Changeset 998 for Vago


Ignore:
Timestamp:
Apr 25, 2014, 11:05:54 PM (11 years ago)
Author:
s10k
Message:

Vago 0.9a

Location:
Vago/trunk/Vago
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • Vago/trunk/Vago/Vago.pro

    r790 r998  
    88QT       += network #network communication
    99QT       += script #for json parse
     10QT       += widgets
    1011
     12INCLUDEPATH += $$[QT_INSTALL_HEADERS]/QtZlib
    1113INCLUDEPATH += ./libs
    1214INCLUDEPATH += ./packageWizard
  • Vago/trunk/Vago/droptablewidget.h

    r811 r998  
    33
    44#include <QTableWidget>
    5 #include <QtGui>
     5#include <QtWidgets>
    66
    77#include "util.h"
  • Vago/trunk/Vago/libs/unzip.cpp

    r771 r998  
    327327        return UnZip::ReadFailed;
    328328
    329     QString filename = QString::fromAscii(buffer2, szName);
     329    QString filename = QString::fromUtf8(buffer2, szName);
    330330    if (filename != path) {
    331331        qDebug() << "Filename in local header mismatches.";
     
    556556        skipEntry = true;
    557557    } else {
    558         filename = QString::fromAscii(buffer2, szName);
     558        filename = QString::fromUtf8(buffer2, szName);
    559559    }
    560560
     
    611611        }
    612612
    613         h->comment = QString::fromAscii(buffer2, szComment);
     613        h->comment = QString::fromUtf8(buffer2, szComment);
    614614    }
    615615
     
    10051005    keys[2] = 878082192L;
    10061006
    1007     QByteArray pwdBytes = pwd.toAscii();
     1007    QByteArray pwdBytes = pwd.toUtf8();
    10081008    int sz = pwdBytes.size();
    10091009    const char* ascii = pwdBytes.data();
  • Vago/trunk/Vago/libs/unzip.h

    r771 r998  
    3535#include <QtCore/QtGlobal>
    3636
    37 #include <zlib/zlib.h>
     37#include <QtZlib/zlib.h>
    3838
    3939class QDir;
  • Vago/trunk/Vago/libs/zip.cpp

    r771 r998  
    822822
    823823        // filename length
    824         QByteArray entryNameBytes = entryName.toAscii();
     824    QByteArray entryNameBytes = entryName.toUtf8();
    825825        int sz = entryNameBytes.size();
    826826
     
    971971        keys[2] = 878082192L;
    972972
    973         QByteArray pwdBytes = password.toAscii();
     973    QByteArray pwdBytes = password.toUtf8();
    974974        int sz = pwdBytes.size();
    975975        const char* ascii = pwdBytes.data();
     
    11921192
    11931193        // filename
    1194         QByteArray fileNameBytes = fileName.toAscii();
     1194    QByteArray fileNameBytes = fileName.toUtf8();
    11951195        sz = fileNameBytes.size();
    11961196        buffer1[ZIP_CD_OFF_NAMELEN] = sz & 0xFF;
     
    12671267
    12681268        // ZIP file comment length
    1269         QByteArray commentBytes = comment.toAscii();
     1269    QByteArray commentBytes = comment.toUtf8();
    12701270        quint16 commentLength = commentBytes.size();
    12711271
  • Vago/trunk/Vago/libs/zip.h

    r771 r998  
    3434#include <QtCore/QtGlobal>
    3535
    36 #include <zlib/zlib.h>
     36#include <QtZlib/zlib.h>
    3737
    3838class QIODevice;
  • Vago/trunk/Vago/main.cpp

    r792 r998  
    66#endif
    77
    8 #include <QtGui/QApplication>
     8#include <QtWidgets/QApplication>
    99#include "mainwindow.h"
    1010
  • Vago/trunk/Vago/mainwindow.cpp

    r897 r998  
    7878        iniChanged=true;
    7979    }
     80#ifdef Q_OS_MAC
     81    if(!this->vagoSettings->contains("UseYesButtonClear")){
     82        this->vagoSettings->setValue("UseYesButtonClear", false);
     83        iniChanged=true;
     84    }
     85#endif
    8086
    8187    if(iniChanged){
     
    9096    this->startedWindowWidth=this->vagoSettings->value("WindowWidth").toInt();
    9197    this->startedWindowHeight=this->vagoSettings->value("WindowHeight").toInt();
     98#ifdef Q_OS_MAC
     99    this->useYesAsDefaultInClearButton=this->vagoSettings->value("UseYesButtonClear").toBool();
     100#endif
    92101
    93102    //Create our workspace if it doesn't exists yet
     
    127136    setConverterButtonsSize();
    128137
    129 #ifdef Q_WS_MAC
     138#ifdef Q_OS_MAC
    130139    // 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
    131140    ui->tbOni->setIcon(QIcon(":/new/icons/oni_icon_mac.png")); // Oni executable on mac have a different icon than windows
     
    191200        arguments << "-noswitch";
    192201    }
    193 #ifdef Q_WS_WIN
     202#ifdef Q_OS_WIN
    194203    else{
    195204        arguments << "-switch"; // only supported on windows. Was added by daodan dll.
     
    531540            command+=":"+ui->leSpecificFilesLevels->text();
    532541        }
    533         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        }
    534549
    535550    }
     
    10471062    int size = myTable->selectionModel()->selectedRows().size();
    10481063
     1064    QMessageBox::StandardButton defaultButton = QMessageBox::NoButton; // default button for clear asking question, only customizable in mac os
     1065
    10491066    if(size==0){
    10501067        Util::showPopUp("Select a row first.");
     
    10521069    }
    10531070
    1054     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)){
    10551082        for(int i=0; i<size; i++){
    10561083            //myTable->removeRow(myTable->selectedItems().at(size-i-1)->row());
     
    11711198/**
    11721199  Update items loaded
    1173   **/
    1174 void MainWindow::on_tabWidget_selected(const QString &arg1)
    1175 {
    1176     if(arg1.compare("General",Qt::CaseSensitive)==0){ //case sentive is faster
     1200**/
     1201void MainWindow::on_tabWidget_currentChanged(int index)
     1202{
     1203    QString tabtext = ui->tabWidget->tabText(index);
     1204
     1205    if(tabtext.compare("XML",Qt::CaseSensitive)==0){ //case sentive is faster
    11771206        updateItemsLoaded(ui->twSourcesXML);
    11781207    }
    1179     else if(arg1.compare("Textures",Qt::CaseSensitive)==0){
     1208    else if(tabtext.compare("Textures",Qt::CaseSensitive)==0){
    11801209        updateItemsLoaded(ui->twSourcesTextures);
    11811210    }
    1182     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){
    11831215        updateItemsLoaded(ui->twSourcesObjects);
    11841216    }
    1185     else if(arg1.compare("Levels",Qt::CaseSensitive)==0){
     1217    else if(tabtext.compare("Levels",Qt::CaseSensitive)==0){
    11861218        updateItemsLoaded(ui->twSourcesLevels);
    11871219    }
     
    15331565  **/
    15341566QString MainWindow::getOSIndependentAppPath(){
    1535 #ifdef Q_WS_MAC
     1567#ifdef Q_OS_MAC
    15361568    QDir dir = QDir::current();
    15371569    if(dir.absolutePath().contains(".app")){ // include bundle, but we don't want it
  • Vago/trunk/Vago/mainwindow.h

    r897 r998  
    137137    void dtContextMenu(DropTableWidget* myTable, QContextMenuEvent *event); //Context menu options for table widgets
    138138
    139     void on_tabWidget_selected(const QString &arg1);
    140 
    141139    void checkVagoLastVersion(QNetworkReply *result); //check vago last version
    142140
     
    180178
    181179    void on_tbAbortConversion_clicked();
     180
     181    void on_tabWidget_currentChanged(int index);
    182182
    183183private:
     
    191191    int startedWindowWidth;
    192192    int startedWindowHeight;
     193#ifdef Q_OS_MAC
     194    bool useYesAsDefaultInClearButton;
     195#endif
    193196    QLabel *itemsLoaded;
    194197    QProgressBar *myBar; //Progress Bar
  • Vago/trunk/Vago/packageWizard/packagewizard.cpp

    r793 r998  
    1515
    1616    //Center and resize QWizard (http://www.thedazzlersinc.com/source/2012/06/04/qt-center-window-in-screen/)
    17 #ifdef Q_WS_WIN
     17#ifdef Q_OS_WIN
    1818    myWizard.resize(640,480);
    1919#else
  • Vago/trunk/Vago/preferences.cpp

    r897 r998  
    1818    ui->cbSeparate->setChecked(this->vagoSettings->value("SeparateInWorkspace").toBool());
    1919    ui->cbVagoExit->setChecked(this->vagoSettings->value("ConfirmExit").toBool());
     20
     21#ifdef Q_OS_WIN
     22    ui->cbClearButtonYes->hide(); // don't display this mac os only option in windows
     23#endif
    2024
    2125}
     
    6165    this->vagoSettings->setValue("SeparateInWorkspace",ui->cbSeparate->isChecked());
    6266    this->vagoSettings->setValue("ConfirmExit",ui->cbVagoExit->isChecked());
     67#ifdef Q_OS_MAC
     68    this->vagoSettings->setValue("UseYesButtonClear",ui->cbClearButtonYes->isChecked());
     69#endif
     70
    6371
    6472    Util::showPopUp("You need to restart the application to all changes take effect.");
  • Vago/trunk/Vago/preferences.ui

    r897 r998  
    139139       </widget>
    140140      </item>
     141      <item>
     142       <widget class="QCheckBox" name="cbClearButtonYes">
     143        <property name="text">
     144         <string>Use Yes button as default for Clear items</string>
     145        </property>
     146       </widget>
     147      </item>
    141148     </layout>
    142149    </widget>
  • Vago/trunk/Vago/readme.txt

    r899 r998  
    11Readme.txt
    22~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3 Vago GUI v0.9
     3Vago GUI v0.9a
    44~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    55
     
    3737----------------------------------
    3838Change Log:
     39----------------------------------
     400.9a, 25-04-2014
     41-Upgraded Qt libraries to version 5
     42-Updated OniSplit to 0.9.96.0 version
     43-Fixed the bug where the items loaded counter in status bar wasn't updated
     44when changing tabs
     45-Now levels->dat - oni files get extracted to a subfolder with the level's
     46extracted name (requested by paradox)
     47-Now in Mac OS is possible to choose Yes button by default when clearing the
     48files contents (requested by edt)
    3949----------------------------------
    40500.9, 08-01-2014
  • Vago/trunk/Vago/soundWizard/soundwizard.cpp

    r815 r998  
    2323
    2424    //Center and resize QWizard (http://www.thedazzlersinc.com/source/2012/06/04/qt-center-window-in-screen/)
    25 #ifdef Q_WS_WIN
     25#ifdef Q_OS_WIN
    2626    this->myWizard->resize(640,480);
    2727#else
  • Vago/trunk/Vago/util.cpp

    r897 r998  
    6868}
    6969
    70 bool showQuestionPopUp(QWidget * parent, QString message){
    71     return QMessageBox::question (parent, "Are you sure?", message, QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes;
     70bool showQuestionPopUp(QWidget * parent, QString message, QMessageBox::StandardButton standardButton){
     71    return QMessageBox::question (parent, "Are you sure?", message, QMessageBox::Yes | QMessageBox::No, standardButton)==QMessageBox::Yes;
    7272}
    7373
     
    162162            }
    163163        } else {
    164             qDebug("Unhandled item" + info.filePath().toAscii() + "in cpDir");
     164            qDebug("Unhandled item" + info.filePath().toUtf8() + "in cpDir");
    165165        }
    166166    }
  • Vago/trunk/Vago/util.h

    r900 r998  
    1313
    1414namespace GlobalVars{
    15 const QString AppVersion="0.9";
     15const QString AppVersion="0.9a";
    1616const QString OniSplitString="OniSplit.exe";
    1717const QString XmlToolsString="xmlTools.exe";
    1818
    19 #ifdef Q_WS_WIN
     19#ifdef Q_OS_WIN
    2020const QString OniExe="Oni.exe";
    2121const QString OniSplitExeName=OniSplitString;
     
    2828
    2929const QString AppLogName="logVago.txt";
    30 const QString BuiltOniSplitVersion="0.9.94.0";
     30const QString BuiltOniSplitVersion="0.9.96.0";
    3131const QString BuiltXmlToolsVersion="0.8d";
    3232const QString ModsDomain="mods.oni2.net";
    33 #ifdef Q_WS_WIN
     33#ifdef Q_OS_WIN
    3434const QString VagoNode = "247";
    3535#else
     
    5959QStringList substring(QString myString,QString separator,Qt::CaseSensitivity cs = Qt::CaseSensitive);
    6060int indexOfBackward(QString myString, QString toSearch, int from = -1);
    61 bool showQuestionPopUp(QWidget * parent, QString message);
     61bool showQuestionPopUp(QWidget * parent, QString message, QMessageBox::StandardButton standardButton=QMessageBox::NoButton);
    6262bool checkEmptySpaces(QStringList toCheck);
    6363bool checkIfIntegers(QStringList toCheck);
Note: See TracChangeset for help on using the changeset viewer.