ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/s10k/Vago/mainwindow.cpp
(Generate patch)

Comparing Vago/trunk/Vago/mainwindow.cpp (file contents):
Revision 771 by s10k, Sun Mar 31 19:02:16 2013 UTC vs.
Revision 790 by s10k, Sat Apr 6 20:54:26 2013 UTC

# Line 9 | Line 9 | MainWindow::MainWindow(QWidget *parent)
9   {
10      ui->setupUi(this);
11  
12 <    this->setWindowTitle("Vago v"+GlobalVars::AppVersion);
12 >    ui->pbConvertGeneral->setMinimumSize(ui->pbConvertGeneral->minimumSizeHint());
13 >    ui->pbConvertGeneral->setMinimumWidth(50);
14 >    ui->pbConvertGeneral->setMinimumHeight(ui->pbConvertGeneral->minimumHeight()*1.4);
15 >
16 >
17  
18 <    // QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale ());
18 >    qDebug() << ui->pbConvertGeneral->minimumHeight() << ui->pbConvertGeneral->minimumHeight();
19  
20 <    if(!QFile::exists(QDir::currentPath()+"/"+GlobalVars::OniSplitExeName)){
20 >    this->setWindowTitle("Vago v"+GlobalVars::AppVersion);
21 >
22 >    if(!QFile::exists(QDir::currentPath()+"/"+GlobalVars::OniSplitString)){
23          Util::showErrorPopUp("OniSplit not found. Please download it at "+GlobalVars::ModsDomain+" and put it in the same folder of Vago. \n\nProgram will now exit.");
24          exit(1);
25      }
26  
27 <    if(!QFile::exists(QDir::currentPath()+"/"+GlobalVars::XmlToolsExeName)){
27 >    if(!QFile::exists(QDir::currentPath()+"/"+GlobalVars::XmlToolsString)){
28          Util::showErrorPopUp("xmlTools not found. Please download it at "+GlobalVars::ModsDomain+" and put it in the same folder of Vago. \n\nProgram will now exit.");
29          exit(1);
30      }
# Line 41 | Line 47 | MainWindow::MainWindow(QWidget *parent)
47          QString aefolder=Util::normalizePath(QFileDialog::getExistingDirectory(this,"Choose Anniversary Edition (AE) folder..."));
48  
49          if(aefolder.isEmpty()){
50 <            Util::showErrorPopUp("AE folder is mandatory. Application will exit.");
50 >            Util::showErrorPopUp("AE folder is mandatory. Application will now exit.");
51              exit(1);
52          }
53  
# Line 98 | Line 104 | MainWindow::MainWindow(QWidget *parent)
104      //Create a thread for do the conversion in background
105      this->myConverter = new Converter(this->myLogger,this->listToProccess);
106  
107 +    // User interface
108      ui->mainToolBar->addWidget(ui->tbAE); //add ae installer launch button
109      ui->mainToolBar->addWidget(ui->emptySpacerLabel); //trick, we can't add directly a space so we add an empty
110      ui->mainToolBar->addWidget(ui->tbOni); //add oni launch buttonlabel
# Line 108 | Line 115 | MainWindow::MainWindow(QWidget *parent)
115  
116      ui->mainToolBar->setLayoutDirection(Qt::RightToLeft);
117  
118 + #ifdef Q_WS_MAC
119 +    // 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
120 +    ui->tbOni->setIcon(QIcon(":/new/icons/oni_icon_mac.png")); // Oni executable on mac have a different icon than windows
121 +    // Set mac platform the first one in the menu, and also make it checkable by default
122 +    ui->menuTarget_Platform->removeAction(ui->actionWindows);
123 +    ui->menuTarget_Platform->addAction(ui->actionWindows);
124 +    ui->actionWindows->setChecked(false);
125 +    ui->actionMac_Windows_demo->setChecked(true);
126 +    // Hide file menu on mac (not needed)
127 +    ui->menuFile->hide();
128 +    ui->menuFile->close();
129 +    //ui->menuBar->macMenu();
130 + #endif
131 +
132      connectSlots();
133  
134      //Commands Mapping
# Line 153 | Line 174 | void MainWindow::on_tbOni_clicked()
174   {
175      QStringList arguments;
176  
177 <    if(this->vagoSettings->value("OniWindow").toBool()){ //Run in a window?
177 >    if(this->vagoSettings->value("OniWindow").toBool()){ // Run in a window?
178          arguments << "-noswitch";
179      }
180 + #ifdef Q_WS_WIN
181      else{
182 <        arguments << "-switch";
182 >        arguments << "-switch"; // only supported on windows. Was added by daodan dll.
183      }
184 + #endif
185  
186 <    arguments << " -debugfiles";
186 >    arguments << "-debugfiles";
187  
188 <    if(!QProcess::startDetached(this->AeLocation+"/Oni.exe",arguments,this->AeLocation)){
188 >    if(!QProcess::startDetached(this->AeLocation+"/"+GlobalVars::OniExe,arguments,this->AeLocation)){
189          showErrStatusMessage("Oni could not be started!");
190      }
191   }
# Line 171 | Line 194 | void MainWindow::on_tbAE_clicked()
194   {
195      // If the app turn out someday to a native app use QProcess::startDetached instead...
196  
197 <    if(!QDesktopServices::openUrl(this->AeLocation+"/AEInstaller/bin/AEInstaller2.jar")){
197 >    if(!QDesktopServices::openUrl("file:///"+this->AeLocation+"/AEInstaller/bin/AEInstaller2.jar")){
198          showErrStatusMessage("Could not start AE Installer!");
199      }
200   }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)