Changeset 801 for Vago


Ignore:
Timestamp:
Apr 7, 2013, 5:36:17 PM (12 years ago)
Author:
s10k
Message:

Vago: tried to fix the main directory in mac. I don't want to get the
bundle one.

Location:
Vago/trunk/Vago
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Vago/trunk/Vago/mainwindow.cpp

    r797 r801  
    1010    ui->setupUi(this);
    1111
     12    this->AppDir=getOSIndependentAppPath();
     13
    1214    this->setWindowTitle("Vago v"+GlobalVars::AppVersion);
    1315
    14     if(!QFile::exists(QDir::currentPath()+"/"+GlobalVars::OniSplitString)){
     16    if(!QFile::exists(this->AppDir+"/"+GlobalVars::OniSplitString)){
    1517        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.");
    1618        exit(1);
    1719    }
    1820
    19     if(!QFile::exists(QDir::currentPath()+"/"+GlobalVars::XmlToolsString)){
     21    if(!QFile::exists(this->AppDir+"/"+GlobalVars::XmlToolsString)){
    2022        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.");
    2123        exit(1);
    2224    }
    2325
    24     this->vagoSettings = new QSettings(QDir::currentPath() + "/" + this->VagoSettingsName, QSettings::IniFormat);
     26    this->vagoSettings = new QSettings(this->AppDir + "/" + this->VagoSettingsName, QSettings::IniFormat);
    2527
    2628    //First Execution? Old configuration? Settings missed?
     
    3133    }
    3234    if(!this->vagoSettings->contains("Workspace")){
    33         this->vagoSettings->setValue("Workspace", QDir::currentPath()+"/VagoWorkspace");
     35        this->vagoSettings->setValue("Workspace", this->AppDir+"/VagoWorkspace");
    3436        iniChanged=true;
    3537    }
     
    161163void MainWindow::on_actionSound_Wizard_triggered()
    162164{
    163     SoundWizard myWizard (this->workspaceWizardsLocation, this->myLogger, &this->commandMap);
     165    SoundWizard myWizard (this->AppDir, this->workspaceWizardsLocation, this->myLogger, &this->commandMap);
    164166    myWizard.exec();
    165167}
     
    15001502}
    15011503
     1504/**
     1505  Gets application directory. In mac os gets the .app directory
     1506  **/
     1507QString MainWindow::getOSIndependentAppPath(){
     1508#ifdef Q_WS_MAC
     1509    QDir dir = QDir::current();
     1510    if(dir.absolutePath().contains(".app")){ // include bundle, but we don't want it
     1511        dir.cdUp();
     1512        dir.cdUp();
     1513    }
     1514    return dir.absolutePath();
     1515#else
     1516    return  QDir::currentPath();
     1517#endif
     1518}
     1519
    15021520void MainWindow::connectSlots(){
    15031521
  • Vago/trunk/Vago/mainwindow.h

    r792 r801  
    4646
    4747protected:
    48      void closeEvent(QCloseEvent *event);
     48    void closeEvent(QCloseEvent *event);
    4949   
    5050private slots:
     
    186186    Ui::MainWindow *ui;
    187187    Logger *myLogger;
     188    QString AppDir;
    188189    QString workspaceLocation; //Workspace location
    189190    QString workspaceWizardsLocation; //Workspace wizard location
     
    220221    QString getCommand(DropTableWidget* myTable, QString myOutputFolder, QString from, QString to , QString file);
    221222    QString getTypeConversion(DropTableWidget *myTable); //get the current type for a table
     223    QString getOSIndependentAppPath();
    222224};
    223225
  • Vago/trunk/Vago/soundWizard/soundpage2.cpp

    r797 r801  
    33
    44const QStringList SoundPage2::allowedFiles = QStringList() << "*.wav" <<  "*.aif" <<  "*.aifc" << "*.afc";
    5 const QString SoundPage2::codecLocalHelpFile=GlobalVars::HelpLocation + "/XMLSNDD.html#Source_file_creation";
    65
    7 SoundPage2::SoundPage2(QWidget *parent) :
     6SoundPage2::SoundPage2(QString appLocation, QWidget *parent) :
    87    QWizardPage(parent),
    98    ui(new Ui::soundpage2)
     
    1110    ui->setupUi(this);
    1211    this->soundTable=ui->twSoundFiles;
     12    this->codecLocalHelpFile=appLocation+"/"+GlobalVars::HelpDir + "/XMLSNDD.html#Source_file_creation";
    1313    ui->twSoundFiles->removeColumn(2); // Only two columns
    1414
  • Vago/trunk/Vago/soundWizard/soundpage2.h

    r771 r801  
    1818    DropTableWidget *soundTable;
    1919
    20     explicit SoundPage2(QWidget *parent = 0);
     20    explicit SoundPage2(QString appLocation, QWidget *parent = 0);
    2121    ~SoundPage2();
    2222   
     
    3737    Ui::soundpage2 *ui;
    3838    static const QStringList allowedFiles;
    39     static const QString codecLocalHelpFile;
     39    QString codecLocalHelpFile;
    4040
    4141    bool validatePage();
  • Vago/trunk/Vago/soundWizard/soundwizard.cpp

    r793 r801  
    11#include "soundwizard.h"
    22
    3 SoundWizard::SoundWizard(QString workspaceWizardLocation, Logger *myLogger, QHash<QString, QString> *commandMap)
     3SoundWizard::SoundWizard(QString appLocation, QString workspaceWizardLocation, Logger *myLogger, QHash<QString, QString> *commandMap)
    44{
     5    this->appLocation=appLocation;
    56    this->workspaceWizardLocation=workspaceWizardLocation;
    67    this->myLogger=myLogger;
     
    3334    //
    3435
    35     SoundPage2 *page2 = new SoundPage2();
     36    SoundPage2 *page2 = new SoundPage2(this->appLocation);
    3637    SoundPage3 *page3 = new SoundPage3();
    3738    SoundPage4 *page4 = new SoundPage4();
  • Vago/trunk/Vago/soundWizard/soundwizard.h

    r771 r801  
    2323    Q_OBJECT // for signals and slots
    2424public:
    25     SoundWizard(QString workspaceWizardLocation, Logger *myLogger, QHash<QString, QString> *commandMap);
     25    SoundWizard(QString appLocation, QString workspaceWizardLocation, Logger *myLogger, QHash<QString, QString> *commandMap);
    2626    int exec();
    2727private:
     
    3030    QString workspaceWizardLocation;
    3131    QString soundsLocation;
     32    QString appLocation;
    3233    Logger *myLogger;
    3334    QWizard *myWizard;
  • Vago/trunk/Vago/util.h

    r798 r801  
    99#include <QDesktopServices>
    1010#include <QUrl>
    11 
     11#include <QCoreApplication>
    1212
    1313namespace GlobalVars{
     
    3434const QString VagoWebUrl="http://"+ModsDomain+"/node/"+VagoNode;
    3535const QString VagoTemporaryDir=QDir::tempPath()+"/VagoTemp";
    36 const QString HelpLocation=QDir::currentPath() + "/help";
     36const QString HelpDir="help";
    3737const char OniSplitProcSeparator=';';
    3838}
     
    4848QString fullTrim(QString str);
    4949QString normalizeDecimalSeparator(QString value);
     50
    5051QStringList multipleDirDialog(QString title);
    5152QStringList substring(QString myString,QString separator,Qt::CaseSensitivity cs = Qt::CaseSensitive);
     
    6667void showRichErrorPopUp(QString message);
    6768void openLogFile();
    68 
    6969}
    7070
Note: See TracChangeset for help on using the changeset viewer.