77 |
|
this->vagoSettings->setValue("ConfirmExit", false); |
78 |
|
iniChanged=true; |
79 |
|
} |
80 |
+ |
#ifdef Q_OS_MAC |
81 |
+ |
if(!this->vagoSettings->contains("UseYesButtonClear")){ |
82 |
+ |
this->vagoSettings->setValue("UseYesButtonClear", false); |
83 |
+ |
iniChanged=true; |
84 |
+ |
} |
85 |
+ |
#endif |
86 |
|
|
87 |
|
if(iniChanged){ |
88 |
|
this->vagoSettings->sync(); |
95 |
|
this->outputFolder=this->workspaceLocation; |
96 |
|
this->startedWindowWidth=this->vagoSettings->value("WindowWidth").toInt(); |
97 |
|
this->startedWindowHeight=this->vagoSettings->value("WindowHeight").toInt(); |
98 |
+ |
#ifdef Q_OS_MAC |
99 |
+ |
this->useYesAsDefaultInClearButton=this->vagoSettings->value("UseYesButtonClear").toBool(); |
100 |
+ |
#endif |
101 |
|
|
102 |
|
//Create our workspace if it doesn't exists yet |
103 |
|
if(!QDir(this->workspaceLocation).exists()){ |
135 |
|
|
136 |
|
setConverterButtonsSize(); |
137 |
|
|
138 |
< |
#ifdef Q_WS_MAC |
138 |
> |
#ifdef Q_OS_MAC |
139 |
|
// setUnifiedTitleAndToolBarOnMac(true); // Qt suggests to use it on mac | http://www.slideshare.net/qtbynokia/how-to-make-your-qt-app-look-native // align on left doesn't work if active |
140 |
|
ui->tbOni->setIcon(QIcon(":/new/icons/oni_icon_mac.png")); // Oni executable on mac have a different icon than windows |
141 |
|
// Set mac platform the first one in the menu, and also make it checkable by default |
199 |
|
if(this->vagoSettings->value("OniWindow").toBool()){ // Run in a window? |
200 |
|
arguments << "-noswitch"; |
201 |
|
} |
202 |
< |
#ifdef Q_WS_WIN |
202 |
> |
#ifdef Q_OS_WIN |
203 |
|
else{ |
204 |
|
arguments << "-switch"; // only supported on windows. Was added by daodan dll. |
205 |
|
} |
539 |
|
|
540 |
|
command+=":"+ui->leSpecificFilesLevels->text(); |
541 |
|
} |
542 |
< |
command+=" "+myOutputFolder+" "+file; |
542 |
> |
|
543 |
> |
if(from=="DAT" && to=="ONI FILES"){ // extract files to a subdir with the files name ex: level0_Final |
544 |
> |
command += " " + myOutputFolder.insert(myOutputFolder.size()-2,QString(Util::cutName(file)).replace(".dat","")) + " " + file; |
545 |
> |
} |
546 |
> |
else{ |
547 |
> |
command+=" "+myOutputFolder+" "+file; |
548 |
> |
} |
549 |
|
|
550 |
|
} |
551 |
|
|
1061 |
|
void MainWindow::removeTableContents(DropTableWidget *myTable){ |
1062 |
|
int size = myTable->selectionModel()->selectedRows().size(); |
1063 |
|
|
1064 |
+ |
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton; // default button for clear asking question, only customizable in mac os |
1065 |
+ |
|
1066 |
|
if(size==0){ |
1067 |
|
Util::showPopUp("Select a row first."); |
1068 |
|
return; |
1069 |
|
} |
1070 |
|
|
1071 |
< |
if(Util::showQuestionPopUp(this,"Are you sure you want to delete the selected rows?")){ |
1071 |
> |
#ifdef Q_OS_MAC |
1072 |
> |
if(this->useYesAsDefaultInClearButton){ |
1073 |
> |
defaultButton = QMessageBox::Yes; |
1074 |
> |
} |
1075 |
> |
else{ |
1076 |
> |
defaultButton = QMessageBox::No; |
1077 |
> |
} |
1078 |
> |
#endif |
1079 |
> |
|
1080 |
> |
|
1081 |
> |
if(Util::showQuestionPopUp(this,"Are you sure you want to delete the selected rows?",defaultButton)){ |
1082 |
|
for(int i=0; i<size; i++){ |
1083 |
|
//myTable->removeRow(myTable->selectedItems().at(size-i-1)->row()); |
1084 |
|
myTable->removeRow(myTable->selectionModel()->selectedRows().at(size-i-1).row()); |
1197 |
|
|
1198 |
|
/** |
1199 |
|
Update items loaded |
1200 |
< |
**/ |
1201 |
< |
void MainWindow::on_tabWidget_selected(const QString &arg1) |
1200 |
> |
**/ |
1201 |
> |
void MainWindow::on_tabWidget_currentChanged(int index) |
1202 |
|
{ |
1203 |
< |
if(arg1.compare("General",Qt::CaseSensitive)==0){ //case sentive is faster |
1203 |
> |
QString tabtext = ui->tabWidget->tabText(index); |
1204 |
> |
|
1205 |
> |
if(tabtext.compare("XML",Qt::CaseSensitive)==0){ //case sentive is faster |
1206 |
|
updateItemsLoaded(ui->twSourcesXML); |
1207 |
|
} |
1208 |
< |
else if(arg1.compare("Textures",Qt::CaseSensitive)==0){ |
1208 |
> |
else if(tabtext.compare("Textures",Qt::CaseSensitive)==0){ |
1209 |
|
updateItemsLoaded(ui->twSourcesTextures); |
1210 |
|
} |
1211 |
< |
else if(arg1.compare("Objects",Qt::CaseSensitive)==0){ |
1211 |
> |
else if(tabtext.compare("Characters",Qt::CaseSensitive)==0){ |
1212 |
> |
updateItemsLoaded(ui->twSourcesCharacters); |
1213 |
> |
} |
1214 |
> |
else if(tabtext.compare("Objects",Qt::CaseSensitive)==0){ |
1215 |
|
updateItemsLoaded(ui->twSourcesObjects); |
1216 |
|
} |
1217 |
< |
else if(arg1.compare("Levels",Qt::CaseSensitive)==0){ |
1217 |
> |
else if(tabtext.compare("Levels",Qt::CaseSensitive)==0){ |
1218 |
|
updateItemsLoaded(ui->twSourcesLevels); |
1219 |
|
} |
1220 |
|
else{ |
1564 |
|
Gets application directory. In mac os gets the .app directory |
1565 |
|
**/ |
1566 |
|
QString MainWindow::getOSIndependentAppPath(){ |
1567 |
< |
#ifdef Q_WS_MAC |
1567 |
> |
#ifdef Q_OS_MAC |
1568 |
|
QDir dir = QDir::current(); |
1569 |
|
if(dir.absolutePath().contains(".app")){ // include bundle, but we don't want it |
1570 |
|
dir.cdUp(); |