--- Vago/trunk/Vago/mainwindow.cpp 2014/04/25 21:05:54 998 +++ Vago/trunk/Vago/mainwindow.cpp 2016/03/13 16:11:45 1031 @@ -78,8 +78,8 @@ MainWindow::MainWindow(QWidget *parent) iniChanged=true; } #ifdef Q_OS_MAC - if(!this->vagoSettings->contains("UseYesButtonClear")){ - this->vagoSettings->setValue("UseYesButtonClear", false); + if(!this->vagoSettings->contains("useYesAsDefaultWhenRemovingItems")){ + this->vagoSettings->setValue("useYesAsDefaultWhenRemovingItems", false); iniChanged=true; } #endif @@ -96,7 +96,7 @@ MainWindow::MainWindow(QWidget *parent) this->startedWindowWidth=this->vagoSettings->value("WindowWidth").toInt(); this->startedWindowHeight=this->vagoSettings->value("WindowHeight").toInt(); #ifdef Q_OS_MAC - this->useYesAsDefaultInClearButton=this->vagoSettings->value("UseYesButtonClear").toBool(); + this->useYesAsDefaultWhenRemovingItems=this->vagoSettings->value("useYesAsDefaultWhenRemovingItems").toBool(); #endif //Create our workspace if it doesn't exists yet @@ -1069,7 +1069,7 @@ void MainWindow::removeTableContents(Dro } #ifdef Q_OS_MAC - if(this->useYesAsDefaultInClearButton){ + if(this->useYesAsDefaultWhenRemovingItems){ defaultButton = QMessageBox::Yes; } else{ @@ -1088,12 +1088,24 @@ void MainWindow::removeTableContents(Dro } void MainWindow::clearTableContents(DropTableWidget *myTable){ + + QMessageBox::StandardButton defaultButton = QMessageBox::NoButton; // default button for clear asking question, only customizable in mac os + if(myTable->rowCount()==0){ Util::showPopUp("Nothing to clear."); return; } - if(Util::showQuestionPopUp(this,"Are you sure you want to clear the content?")){ +#ifdef Q_OS_MAC + if(this->useYesAsDefaultWhenRemovingItems){ + defaultButton = QMessageBox::Yes; + } + else{ + defaultButton = QMessageBox::No; + } +#endif + + if(Util::showQuestionPopUp(this,"Are you sure you want to clear the content?",defaultButton)){ myTable->clearContents(); myTable->setRowCount(0); } @@ -1565,7 +1577,7 @@ void MainWindow::setConverterButtonsSize **/ QString MainWindow::getOSIndependentAppPath(){ #ifdef Q_OS_MAC - QDir dir = QDir::current(); + QDir dir = QDir(QCoreApplication::applicationDirPath()); if(dir.absolutePath().contains(".app")){ // include bundle, but we don't want it dir.cdUp(); dir.cdUp();