| 37 | 
   | 
 // http://stackoverflow.com/questions/3261676/how-to-make-qdialogbuttonbox-not-close-its-parent-qdialog | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 38 | 
   | 
 void Preferences::accept (){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 39 | 
   | 
     QStringList options; | 
 
 
 
 
 
 
 
 
 
 
 
 | 40 | 
 < | 
     QRect screenRes = Util::getScreenResolution(); | 
 
 
 
 
 
 
 
 
 
 | 40 | 
 > | 
     QRect screenRes = Util::System::getScreenResolution(); | 
 
 
 
 
 
 
 
 
 
 
 
 | 41 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 42 | 
   | 
     options << ui->leAEfolder->text() << ui->leWorkspace->text() << ui->leWidth->text() << ui->leHeight->text(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 43 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 44 | 
 < | 
     if(Util::checkEmptySpaces(options)){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 45 | 
 < | 
         Util::showErrorPopUp("Setting not saved! There are empty settings."); | 
 
 
 
 
 
 
 
 
 
 | 44 | 
 > | 
     if(Util::Validation::checkEmptySpaces(options)){ | 
 
 
 
 
 
 | 45 | 
 > | 
         Util::Dialogs::showError("Setting not saved! There are empty settings."); | 
 
 
 
 
 
 
 
 
 
 
 
 | 46 | 
   | 
         return; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 47 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 48 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 49 | 
 < | 
     if(Util::checkIfIntegers(QStringList() << ui->leWidth->text() << ui->leHeight->text() )){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 50 | 
 < | 
         Util::showErrorPopUp("Setting not saved! Width and Height must be numbers."); | 
 
 
 
 
 
 
 
 
 
 | 49 | 
 > | 
     if(Util::Validation::checkIfIntegers(QStringList() << ui->leWidth->text() << ui->leHeight->text() )){ | 
 
 
 
 
 
 | 50 | 
 > | 
         Util::Dialogs::showError("Setting not saved! Width and Height must be numbers."); | 
 
 
 
 
 
 
 
 
 
 
 
 | 51 | 
   | 
         return; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 52 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 53 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 54 | 
   | 
     if(ui->leWidth->text().toInt() > screenRes.width() || ui->leHeight->text().toInt() > screenRes.height()){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 55 | 
 < | 
         Util::showErrorPopUp("Setting not saved! Width or Height specified are greater than actual screen resolution."); | 
 
 
 
 
 
 
 
 
 
 | 55 | 
 > | 
         Util::Dialogs::showError("Setting not saved! Width or Height specified are greater than actual screen resolution."); | 
 
 
 
 
 
 
 
 
 
 
 
 | 56 | 
   | 
         return; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 57 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 58 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 59 | 
   | 
     if(ui->leWidth->text().toInt() <= 0  || ui->leHeight->text().toInt() <= 0 ){ | 
 
 
 
 
 
 
 
 
 
 
 
 | 60 | 
 < | 
         Util::showErrorPopUp("Settings not saved! Width and Height must be greater than 0."); | 
 
 
 
 
 
 
 
 
 
 | 60 | 
 > | 
         Util::Dialogs::showError("Settings not saved! Width and Height must be greater than 0."); | 
 
 
 
 
 
 
 
 
 
 
 
 | 61 | 
   | 
         return; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 62 | 
   | 
     } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 63 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 73 | 
   | 
     this->vagoSettings->setValue("useYesAsDefaultWhenRemovingItems",ui->cbUseYesAsDefaultWhenRemovingItems->isChecked()); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 74 | 
   | 
 #endif | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 75 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 76 | 
 < | 
     Util::showPopUp("You need to restart the application to all changes take effect."); | 
 
 
 
 
 
 
 
 
 
 | 76 | 
 > | 
     Util::Dialogs::showInfo("You need to restart the application to all changes take effect."); | 
 
 
 
 
 
 
 
 
 
 
 
 | 77 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 78 | 
   | 
     QDialog::accept(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 79 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 81 | 
   | 
 void Preferences::on_pbChooseWorkspace_clicked() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 82 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 83 | 
   | 
     QString newDir=QFileDialog::getExistingDirectory(this,"Choose workspace folder..."); | 
 
 
 
 
 
 
 
 
 
 
 
 | 84 | 
 < | 
     newDir=Util::normalizePath(newDir); | 
 
 
 
 
 
 
 
 
 
 | 84 | 
 > | 
     newDir=Util::FileSystem::normalizePath(newDir); | 
 
 
 
 
 
 
 
 
 
 
 
 | 85 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 86 | 
   | 
     if(!newDir.isEmpty()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 87 | 
   | 
         ui->leWorkspace->setText(newDir); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 91 | 
   | 
 void Preferences::on_pbChooseAE_clicked() | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 92 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 93 | 
   | 
     QString newDir=QFileDialog::getExistingDirectory(this,"Choose AE folder..."); | 
 
 
 
 
 
 
 
 
 
 
 
 | 94 | 
 < | 
     newDir=Util::normalizePath(newDir); | 
 
 
 
 
 
 
 
 
 
 | 94 | 
 > | 
     newDir=Util::FileSystem::normalizePath(newDir); | 
 
 
 
 
 
 
 
 
 
 
 
 | 95 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 96 | 
   | 
     if(!newDir.isEmpty()){ | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 97 | 
   | 
         ui->leAEfolder->setText(newDir); |