Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 131 → Rev 132

/trunk/DBViewer/mainwindow.cpp
23,6 → 23,10
 
ui->treeWidget->setAlternatingRowColors(true);
ui->treeWidget_2->setAlternatingRowColors(true);
 
 
MainWindow::readSettings();
 
MainWindow::openDataBase();
MainWindow::buildPreviewModel(tr("Ìîÿ ìîäåëü"), tr("1"));
MainWindow::initComboBox();
36,7 → 40,13
ui->pushButton_3->setEnabled(false);
ui->pushButton_4->setEnabled(false);
 
// setFrm.show();
 
connect(ui->getsettingAct, SIGNAL(triggered()), this, SLOT(getSetting())); // âûáîð â ãëàâíîé ôîðìå â ìåíþ "Áàçà äàííûõ" ïóíêòà "Ïàðàìåòðû ñîåäèíåíèÿ"
connect(setFrm.pushButton, SIGNAL(clicked()), this, SLOT(applySetting()));
 
 
 
}
 
MainWindow::~MainWindow()
254,15 → 264,30
sql = QSqlDatabase::addDatabase("QMYSQL");
// sql.setDatabaseName(tr("an_db"));
 
sql.setDatabaseName(tr("inventory"));
sql.setHostName(tr("localhost"));
// // // sql.setDatabaseName(tr("inventory"));
 
sql.setDatabaseName(baseName);
 
 
 
sql.setUserName(tr("an"));
sql.setPassword(tr("393939"));
// // // sql.setHostName(tr("localhost"));
 
sql.setHostName(hostName);
 
 
// // // sql.setUserName(tr("an"));
 
sql.setUserName(userName);
 
 
 
// // // sql.setPassword(tr("393939"));
 
 
sql.setPassword(password);
 
 
 
bool ok;
ok = sql.open();
 
607,6 → 632,9
tmp_stringList << tmp_str;
 
}
// int count = ui->comboBox->count();
 
ui->comboBox->clear();
ui->comboBox->addItems(tmp_stringList);
 
 
617,6 → 645,8
QStringList classesNameList;
QStringList classesID_list;
QString ID_str;
if (index == -1) return;
 
classesID_list = class_list_map.keys();
classesNameList = class_list_map.values();
ID_str = classesID_list[index];
647,7 → 677,7
classesID_list = class_list_map.keys();
classesNameList = class_list_map.values();
index = classesID_list.indexOf(item->child(0)->text(1));
ui->comboBox->setCurrentIndex(index);
if (index != -1) ui->comboBox->setCurrentIndex(index);
 
ui->comboBox->setEnabled(true);