Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 131 → Rev 132

/trunk/DBViewer/database.cpp
650,3 → 650,73
return result_map;
}
 
 
 
 
 
 
// Ñ÷èòûâàåì íàñòðîéêè
 
void MainWindow::readSettings()
{
QSettings settings("Trolltech", "Application Example");
baseName = settings.value("baseName", "an_db").toString();
userName = settings.value("userName", "an").toString();
password = settings.value("password", "393939").toString();
tableName = settings.value("tableName", "inventar").toString();
hostName = settings.value("hostName", "server").toString();
// resize(size);
// move(pos);tableName
}
 
 
void MainWindow::writeSettings()
{
QSettings settings("Trolltech", "Application Example");
settings.setValue("baseName", baseName);
settings.setValue("userName", userName);
settings.setValue("password", password);
settings.setValue("tableName", tableName);
settings.setValue("hostName", hostName);
}
 
 
 
void MainWindow::applySetting()
{
bool ok;
baseName = setFrm.lineEdit->text();
userName = setFrm.lineEdit_2->text();
password = setFrm.lineEdit_3->text();
// tableName = setFrm->lineEdit_4->text();
hostName = setFrm.lineEdit_5->text();
writeSettings();
 
 
ok=openDataBase();
if (!ok) return;
// // // ui->treeWidget->clear(); // î÷èùàåì äåðåâî ñ ìîäåëüþ
 
// // // buildPreviewModel(tr("Ìîÿ ìîäåëü"), tr("1"));
class_list_map.clear(); // î÷èùàåì ñïèñîê êëàññîâ
initComboBox();
// // // getDatabaseData();
// delete setFrm;
setFrm.close();
}
 
 
void MainWindow::getSetting()
{
// setFrm = new settingForm;
// // // connect(setFrm.pushButton, SIGNAL(clicked()), this, SLOT(applySetting()));
setFrm.lineEdit->setText(baseName);
setFrm.lineEdit_2->setText(userName);
setFrm.lineEdit_3->setText(password);
// setFrm->lineEdit_4->setText(tableName);
setFrm.lineEdit_5->setText(hostName);
setFrm.show();
 
 
 
}