--- Vago/trunk/Vago/preferences.cpp 2014/04/26 12:40:47 999 +++ s10k/Vago/preferences.cpp 2017/12/30 13:57:32 1093 @@ -16,7 +16,8 @@ Preferences::Preferences(QWidget *parent ui->leHeight->setText(this->vagoSettings->value("WindowHeight").toString()); ui->cbOniWindow->setChecked(this->vagoSettings->value("OniWindow").toBool()); ui->cbSeparate->setChecked(this->vagoSettings->value("SeparateInWorkspace").toBool()); - ui->cbVagoExit->setChecked(this->vagoSettings->value("ConfirmExit").toBool()); + ui->cbAskSaveProject->setChecked(this->vagoSettings->value("AskSaveProject").toBool()); + ui->cbAskOpenLastProject->setChecked(this->vagoSettings->value("AskToOpenLastProject").toBool()); #ifdef Q_OS_MAC ui->cbUseYesAsDefaultWhenRemovingItems->setChecked(this->vagoSettings->value("useYesAsDefaultWhenRemovingItems").toBool()); #endif @@ -36,27 +37,27 @@ Preferences::~Preferences() // http://stackoverflow.com/questions/3261676/how-to-make-qdialogbuttonbox-not-close-its-parent-qdialog void Preferences::accept (){ QStringList options; - QRect screenRes = Util::getScreenResolution(); + QRect screenRes = Util::System::getScreenResolution(); options << ui->leAEfolder->text() << ui->leWorkspace->text() << ui->leWidth->text() << ui->leHeight->text(); - if(Util::checkEmptySpaces(options)){ - Util::showErrorPopUp("Setting not saved! There are empty settings."); + if(Util::Validation::checkEmptySpaces(options)){ + Util::Dialogs::showError("Setting not saved! There are empty settings."); return; } - if(Util::checkIfIntegers(QStringList() << ui->leWidth->text() << ui->leHeight->text() )){ - Util::showErrorPopUp("Setting not saved! Width and Height must be numbers."); + if(Util::Validation::checkIfIntegers(QStringList() << ui->leWidth->text() << ui->leHeight->text() )){ + Util::Dialogs::showError("Setting not saved! Width and Height must be numbers."); return; } if(ui->leWidth->text().toInt() > screenRes.width() || ui->leHeight->text().toInt() > screenRes.height()){ - Util::showErrorPopUp("Setting not saved! Width or Height specified are greater than actual screen resolution."); + Util::Dialogs::showError("Setting not saved! Width or Height specified are greater than actual screen resolution."); return; } if(ui->leWidth->text().toInt() <= 0 || ui->leHeight->text().toInt() <= 0 ){ - Util::showErrorPopUp("Settings not saved! Width and Height must be greater than 0."); + Util::Dialogs::showError("Settings not saved! Width and Height must be greater than 0."); return; } @@ -66,13 +67,13 @@ void Preferences::accept (){ this->vagoSettings->setValue("WindowHeight",ui->leHeight->text()); this->vagoSettings->setValue("OniWindow",ui->cbOniWindow->isChecked()); this->vagoSettings->setValue("SeparateInWorkspace",ui->cbSeparate->isChecked()); - this->vagoSettings->setValue("ConfirmExit",ui->cbVagoExit->isChecked()); + this->vagoSettings->setValue("AskSaveProject",ui->cbAskSaveProject->isChecked()); + this->vagoSettings->setValue("AskToOpenLastProject",ui->cbAskOpenLastProject->isChecked()); #ifdef Q_OS_MAC this->vagoSettings->setValue("useYesAsDefaultWhenRemovingItems",ui->cbUseYesAsDefaultWhenRemovingItems->isChecked()); #endif - - Util::showPopUp("You need to restart the application to all changes take effect."); + Util::Dialogs::showInfo("You need to restart the application to all changes take effect."); QDialog::accept(); } @@ -80,7 +81,7 @@ void Preferences::accept (){ void Preferences::on_pbChooseWorkspace_clicked() { QString newDir=QFileDialog::getExistingDirectory(this,"Choose workspace folder..."); - newDir=Util::normalizePath(newDir); + newDir=Util::FileSystem::normalizePath(newDir); if(!newDir.isEmpty()){ ui->leWorkspace->setText(newDir); @@ -90,7 +91,7 @@ void Preferences::on_pbChooseWorkspace_c void Preferences::on_pbChooseAE_clicked() { QString newDir=QFileDialog::getExistingDirectory(this,"Choose AE folder..."); - newDir=Util::normalizePath(newDir); + newDir=Util::FileSystem::normalizePath(newDir); if(!newDir.isEmpty()){ ui->leAEfolder->setText(newDir);