Changeset 1058


Ignore:
Timestamp:
Oct 30, 2016, 3:42:39 PM (8 years ago)
Author:
s10k
Message:

Vago 1.2

Location:
Vago/trunk/Vago
Files:
15 added
15 edited

Legend:

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

    r1054 r1058  
    1717INCLUDEPATH += ./soundWizard
    1818INCLUDEPATH += ./bgImageWizard
     19INCLUDEPATH += ./xmlToolsInterface
    1920
    2021# Used this great tutorial to build zlib and quazip:
     
    7071    bgImageWizard/bgimagepage3.cpp \
    7172    bgImageWizard/bgimagepagefinal.cpp \
     73    xmlToolsInterface/xmltoolsinterface.cpp \
     74    libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.cpp \
     75    xmlToolsInterface/xmltoolsinterfacecommandpreview.cpp \
     76    libs/LineNumberDisplay/LineNumberDisplay.cpp
    7277
    7378HEADERS  += \
     
    97102    bgImageWizard/bgimagewizard.h \
    98103    bgImageWizard/bgimagepage3.h \
    99     bgImageWizard/bgimagepagefinal.h
     104    bgImageWizard/bgimagepagefinal.h \
     105    xmlToolsInterface/xmltoolsinterface.h \
     106    libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.h \
     107    xmlToolsInterface/xmltoolsinterfacecommandpreview.h \
     108    libs/LineNumberDisplay/LineNumberDisplay.h
    100109
    101110FORMS    += \
     
    116125    bgImageWizard/bgimagepage3.ui \
    117126    bgImageWizard/bgimagepagefinal.ui \
     127    xmlToolsInterface/xmltoolsinterface.ui \
     128    xmlToolsInterface/xmltoolsinterfacecommandpreview.ui
    118129
    119130RESOURCES += \
  • Vago/trunk/Vago/about.cpp

    r1054 r1058  
    3333                         "smashingmagazine for the folder icon :)<br />"
    3434                         "Freepik and Flaticon by the background image wizard icon<br />"
     35                         "qtiplot authors for line numbers in QTextEdit<br />"
     36                         "d1vanov for basic-xml-syntax-highlighter class <br />"
    3537                         "<center>"
    3638                         "Visit us at:<br />"
  • Vago/trunk/Vago/bgImageWizard/bgimagepage2.cpp

    r1054 r1058  
    106106
    107107    // Update image information
    108     ui->lbImageName->setText(myImageFileInfo.baseName().replace("." + myImageFileInfo.suffix(), ""));
     108    QString imageName = myImageFileInfo.baseName().replace("." + myImageFileInfo.suffix(), "");
     109
     110    ui->lbImageName->setToolTip(imageName);
     111
     112    if(imageName.length() > 30){
     113        imageName = imageName.mid(0,27) + "...";
     114    }
     115
     116    ui->lbImageName->setText(imageName);
    109117    ui->lbImageWidth->setText(QString::number(image.width()));
    110118    ui->lbImageHeight->setText(QString::number(image.height()));
  • Vago/trunk/Vago/bgImageWizard/bgimagepage2.ui

    r1054 r1058  
    77    <x>0</x>
    88    <y>0</y>
    9     <width>404</width>
    10     <height>286</height>
     9    <width>558</width>
     10    <height>323</height>
    1111   </rect>
    1212  </property>
     
    5050     <property name="minimumSize">
    5151      <size>
    52        <width>380</width>
     52       <width>500</width>
    5353       <height>230</height>
    5454      </size>
     
    6060      <item>
    6161       <widget class="QGroupBox" name="groupBox_2">
     62        <property name="sizePolicy">
     63         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
     64          <horstretch>0</horstretch>
     65          <verstretch>0</verstretch>
     66         </sizepolicy>
     67        </property>
     68        <property name="minimumSize">
     69         <size>
     70          <width>250</width>
     71          <height>128</height>
     72         </size>
     73        </property>
    6274        <property name="title">
    6375         <string>Preview</string>
     
    7688      <item>
    7789       <widget class="QGroupBox" name="groupBox_3">
     90        <property name="sizePolicy">
     91         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
     92          <horstretch>0</horstretch>
     93          <verstretch>0</verstretch>
     94         </sizepolicy>
     95        </property>
     96        <property name="minimumSize">
     97         <size>
     98          <width>250</width>
     99          <height>128</height>
     100         </size>
     101        </property>
    78102        <property name="title">
    79103         <string>Details</string>
  • Vago/trunk/Vago/bgImageWizard/bgimagepage3.cpp

    r1054 r1058  
    8585        backgroundName = "TXMPother";
    8686        txmbName = "TXMBother";
     87        ui->leLevelId->clear();
     88        ui->leLevelId->setEnabled(false);
    8789    }
    8890    else if(type == "Intro Screen"){
    8991        backgroundName = "TXMPlevel" + levelNumber + "_intro_";
    9092        txmbName = "TXMBintro_splash_screen";
     93        ui->leLevelId->setEnabled(true);
    9194    }
    9295    else if(type == "Win Screen"){
    9396        backgroundName = "TXMPlevel" + levelNumber + "_win_";
    9497        txmbName = "TXMBwin_splash_screen";
     98        ui->leLevelId->setEnabled(true);
    9599    }
    96100    else if(type == "Loose Screen"){
    97101        backgroundName = "TXMPfail01_";
    98102        txmbName = "TXMBfail_splash_screen";
     103        ui->leLevelId->clear();
     104        ui->leLevelId->setEnabled(false);
    99105    }
    100106    else if(type == "Main Menu Screen"){
    101107        backgroundName = "TXMPOni_startup_";
    102108        txmbName = "TXMBpict_mainmenu";
     109        ui->leLevelId->clear();
     110        ui->leLevelId->setEnabled(false);
    103111    }
    104112    else if(type == "Options Menu Screen"){
    105113        backgroundName = "TXMPoptions_";
    106114        txmbName = "TXMBpict_options_background";
     115        ui->leLevelId->clear();
     116        ui->leLevelId->setEnabled(false);
    107117    }
    108118    else if(type == "Load Level Screen"){
    109119        backgroundName = "TXMPoni_kanji_";
    110120        txmbName = "TXMBpict_loadgame_background";
     121        ui->leLevelId->clear();
     122        ui->leLevelId->setEnabled(false);
    111123    }
    112124
  • Vago/trunk/Vago/bgImageWizard/bgimagepagefinal.cpp

    r1054 r1058  
    164164}
    165165
    166 /*
    167 QVector<int> BGImagePageFinal::getSplitSizes(int imageSideSize)
    168 {
    169     int currNumber = 256;
    170     int remainingSideSize = imageSideSize;
    171 
    172     QVector<int> splitSizes;
    173 
    174     while(currNumber > 8){
    175         if(remainingSideSize-currNumber >= 0){
    176             splitSizes.append(currNumber);
    177             remainingSideSize -= currNumber;
    178         }
    179         else{
    180             currNumber /= 2;
    181         }
    182     }
    183 
    184     if(remainingSideSize != 0)
    185     {
    186         splitSizes.clear();
    187     }
    188 
    189     return splitSizes;
    190 }
    191 */
    192 
    193166QVector<int> BGImagePageFinal::getSplitSizes(int imageSideSize)
    194167{
  • Vago/trunk/Vago/main.cpp

    r1047 r1058  
    1111    a.setStyleSheet("QStatusBar::item { border: 0px; }"); //hide QLabels border in status bar //http://qt-project.org/forums/viewthread/18743
    1212
     13//    XmlToolsInterface *xmlToolsWindow = new XmlToolsInterface(new Logger(UtilVago::getAppPath(), GlobalVars::AppLogName));
     14//    xmlToolsWindow->show(); //it destroys itself when finished.
     15
    1316    return a.exec();
    1417}
  • Vago/trunk/Vago/mainwindow.cpp

    r1054 r1058  
    129129    ui->statusBar->addPermanentWidget(ui->tbAbortConversion);
    130130
    131     //Initialize list pointers
    132     this->listToProccess = new QStringList;
    133 
    134131    // User interface
    135132    ui->mainToolBar->addWidget(ui->tbAE); //add ae installer launch button
     
    139136    ui->mainToolBar->addWidget(ui->tbCommand); //add option to manual onisplit commands
    140137    ui->mainToolBar->addWidget(ui->emptySpacerLabel3); //same as before
     138    ui->mainToolBar->addWidget(ui->tbXmlToolsInterface); //add option to manual onisplit commands
     139    ui->mainToolBar->addWidget(ui->emptySpacerLabel4); //same as before
    141140    ui->mainToolBar->addWidget(ui->tbOpenFolder); //add option to open folder with files converted etc
    142141
     
    208207
    209208    //Create a thread for do the conversion in background
    210     this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, this->listToProccess, this->win7TaskBarProgress);
     209    this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, &this->listToProccess, this->win7TaskBarProgress);
    211210#else
    212     this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, this->listToProccess);
     211    this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, &this->listToProccess);
    213212#endif
    214213
     
    291290{
    292291    QDesktopServices::openUrl(QUrl("file:///"+this->outputFolder));
     292}
     293
     294
     295void MainWindow::on_tbXmlToolsInterface_clicked()
     296{
     297    //We pass no parent because we want to have an independent window for XmlToolsInterface,
     298    //so we can minimize it or maximize indepently from the MainWindow
     299    XmlToolsInterface *xmlToolsWindow = new XmlToolsInterface(this->myLogger);
     300    xmlToolsWindow->show(); //it destroys itself when finished.
    293301}
    294302
     
    742750        //Only process enabled items
    743751        if(currTable->item(i,2)->background()!=currTable->disabledBackStyle){
    744             this->listToProccess->append(currTable->item(i,2)->text());
     752            this->listToProccess.append(currTable->item(i,2)->text());
    745753        }
    746754    }
     
    11871195        if(result == QMessageBox::StandardButton::Cancel){
    11881196            event->ignore();
    1189         }
    1190     }
     1197            return;
     1198        }
     1199    }
     1200
     1201    // Exit application (this will also close all other windows which don't have parent, for instance ManualCommands)
     1202    QApplication::quit();
    11911203}
    11921204
     
    12251237    ui->cbGridsLevels->setEnabled(checked);
    12261238    ui->cbGridsLevels->setChecked(checked);
    1227     if(checked){
     1239    if(checked && !projectIsLoading){
    12281240        QString file=QFileDialog::getOpenFileName(this,"Choose the BNV.dae file...","./" , "All Files (*.*)");
    12291241        if(!file.isEmpty()){
     
    12371249    ui->leAdditSourcesLevels->setEnabled(checked);
    12381250
    1239     if(checked){
     1251    if(checked && !projectIsLoading){
    12401252        QStringList filesSelected=QFileDialog::getOpenFileNames(this,"Choose the additional .dae files...","./" , "All Files (*.*)");
    12411253        QString filesJoined;
     
    13061318void MainWindow::on_tbCommand_clicked()
    13071319{
    1308     //Show preferences
    1309     ManualCommands *commandsWindow = new ManualCommands(this);
     1320    //We pass no parent because we want to have an independent window for ManualCommands,
     1321    //so we can minimize it or maximize indepently from the MainWindow
     1322    ManualCommands *commandsWindow = new ManualCommands();
    13101323    commandsWindow->show(); //it destroys itself when finished.
    13111324}
     
    20022015{
    20032016
     2017    this->projectIsLoading = true;
     2018
    20042019    if(this->vagoSettings->value("AskSaveProject").toBool() && this->unsavedChangesExist){
    20052020        QMessageBox::StandardButton result = askToSaveCurrentProject();
    20062021        if(result == QMessageBox::StandardButton::Cancel){
     2022            this->projectIsLoading = false;
    20072023            return;
    20082024        }
     
    20182034        UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "An error ocurred while loading project file.\n" + QString(result.description()));
    20192035        showErrStatusMessage(statusError);
     2036        this->projectIsLoading = false;
    20202037        return;
    20212038    }
     
    20252042        UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, QString(doc.root().name()) + "The file opened is not a valid VagoProject file. Load aborted.");
    20262043        showErrStatusMessage(statusError);
     2044        this->projectIsLoading = false;
    20272045        return;
    20282046    }
     
    20372055        UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't find the vagoVersion of the current project. Load aborted.\n" + QString(e.what()));
    20382056        showErrStatusMessage(statusError);
     2057        this->projectIsLoading = false;
    20392058        return;
    20402059    }
     
    20432062        UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "The project that you are trying to load seems it is not compatible with your Vago Version. Please update Vago and try again.");
    20442063        showErrStatusMessage(statusError);
     2064        this->projectIsLoading = false;
    20452065        return;
    20462066    }
     
    20582078        UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't load the vago project. Error: " + QString(e.what()));
    20592079        showErrStatusMessage(statusError);
     2080        this->projectIsLoading = false;
    20602081        return;
    20612082    }
     
    20692090
    20702091    setVagoWindowTitle();
     2092
     2093    this->projectIsLoading = false;
    20712094
    20722095    showSuccessStatusMessage("Project loaded sucessfully.");
     
    21322155        ui->cbGridsLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@generateGrids")).attribute().as_bool());
    21332156        ui->cbAdditionalSourcesLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@additionalSources")).attribute().as_bool());
    2134         ui->leAdditSourcesLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@bnvSource")).attribute().value()));
     2157        ui->leAdditSourcesLevels->setText(QString(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@additionalSourcesValue")).attribute().value()));
    21352158    }
    21362159    else{
  • Vago/trunk/Vago/mainwindow.h

    r1054 r1058  
    1111#include "converter.h"
    1212#include "droptablewidget.h"
     13#include "xmltoolsinterface.h"
    1314
    1415#include <QMainWindow>
     
    3637
    3738#include "libs/pugixml/pugixml.hpp"
    38 //#include <QDebug>
    3939
    4040namespace Ui {
     
    198198
    199199    void on_actionNew_Project_triggered();
     200
     201    void on_tbXmlToolsInterface_clicked();
    200202
    201203private:
     
    215217    QProgressBar *myBar; //Progress Bar
    216218    QHash<QString, QString> commandMap; //Map the commands for fast retreive
    217     QStringList *listToProccess; //items to proccess
     219    QStringList listToProccess; //items to proccess
    218220    Converter *myConverter = nullptr;
    219221    QSettings *vagoSettings;
     
    229231    // Indicates that the application is fully loaded which includes painting the main window
    230232    bool applicationIsFullyLoaded = false;
     233    // This variable indicates that we have a project being loaded. It should only be set by MainWindow thread.
     234    // It allow us to ignore certain gui slots like when checking checkbox that ask the user for input
     235    bool projectIsLoading = false;
    231236
    232237    // anonymous enum
  • Vago/trunk/Vago/mainwindow.ui

    r1054 r1058  
    2121   <layout class="QVBoxLayout" name="verticalLayout">
    2222    <item>
    23      <layout class="QHBoxLayout" name="horizontalLayout_10">
     23     <layout class="QHBoxLayout" name="horizontalLayout_5">
    2424      <item>
    2525       <widget class="QToolButton" name="tbAbortConversion">
     
    5050         <iconset resource="resources.qrc">
    5151          <normaloff>:/new/icons/folder_icon.png</normaloff>:/new/icons/folder_icon.png</iconset>
     52        </property>
     53       </widget>
     54      </item>
     55      <item>
     56       <widget class="QLabel" name="emptySpacerLabel2">
     57        <property name="sizePolicy">
     58         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
     59          <horstretch>0</horstretch>
     60          <verstretch>0</verstretch>
     61         </sizepolicy>
     62        </property>
     63        <property name="minimumSize">
     64         <size>
     65          <width>20</width>
     66          <height>0</height>
     67         </size>
     68        </property>
     69        <property name="baseSize">
     70         <size>
     71          <width>0</width>
     72          <height>0</height>
     73         </size>
     74        </property>
     75        <property name="text">
     76         <string/>
     77        </property>
     78       </widget>
     79      </item>
     80      <item>
     81       <widget class="QToolButton" name="tbXmlToolsInterface">
     82        <property name="toolTip">
     83         <string>XmlTools Interface</string>
     84        </property>
     85        <property name="text">
     86         <string>...</string>
     87        </property>
     88        <property name="icon">
     89         <iconset resource="resources.qrc">
     90          <normaloff>:/new/icons/xmltoolsinterface.png</normaloff>:/new/icons/xmltoolsinterface.png</iconset>
    5291        </property>
    5392       </widget>
     
    75114       <widget class="QToolButton" name="tbCommand">
    76115        <property name="toolTip">
    77          <string>Manual OniSplit Commands</string>
     116         <string>Manual Tools Commands</string>
    78117        </property>
    79118        <property name="text">
     
    87126      </item>
    88127      <item>
    89        <widget class="QLabel" name="emptySpacerLabel2">
     128       <widget class="QLabel" name="emptySpacerLabel4">
    90129        <property name="sizePolicy">
    91130         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
     
    97136         <size>
    98137          <width>20</width>
    99           <height>0</height>
    100          </size>
    101         </property>
    102         <property name="baseSize">
    103          <size>
    104           <width>0</width>
    105138          <height>0</height>
    106139         </size>
     
    14311464    <addaction name="actionSound_Wizard"/>
    14321465    <addaction name="actionBackground_Image_Wizard"/>
     1466    <addaction name="separator"/>
    14331467   </widget>
    14341468   <addaction name="menuFile"/>
     
    16361670   </property>
    16371671  </action>
     1672  <action name="actionXmlTools_Interface">
     1673   <property name="icon">
     1674    <iconset resource="resources.qrc">
     1675     <normaloff>:/new/icons/xmltoolsinterface.png</normaloff>:/new/icons/xmltoolsinterface.png</iconset>
     1676   </property>
     1677   <property name="text">
     1678    <string>XmlTools Interface</string>
     1679   </property>
     1680  </action>
    16381681 </widget>
    16391682 <layoutdefault spacing="6" margin="11"/>
  • Vago/trunk/Vago/manualcommands.cpp

    r1052 r1058  
    11#include "manualcommands.h"
    22#include "ui_manualcommands.h"
    3 #include <QDebug>
    43
    54ManualCommands::ManualCommands(QWidget *parent) :
     
    87{
    98    ui->setupUi(this);
    10     this->setAttribute(Qt::WA_DeleteOnClose,true); //destroy itself once finished.
     9    this->setAttribute(Qt::WA_DeleteOnClose, true); //destroy itself once finished.
    1110    this->myProcess = new QProcess();
    1211    this->myProcess->setProcessChannelMode(QProcess::MergedChannels);
     
    3332
    3433void ManualCommands::executeCommand(){
     34
     35    QString toolExecutable;
     36
     37    if(ui->cbTargetTool->currentText() == "OniSplit"){
     38        toolExecutable = UtilVago::getOniSplitExecutable();
     39    }
     40    else{
     41        toolExecutable = UtilVago::getXmlToolsExecutable();
     42    }
    3543
    3644    QString command=ui->leManualCommand->text().trimmed();
     
    6270    }
    6371
    64     QString var = UtilVago::getOniSplitExecutable() +" "+ui->leManualCommand->text();
    65 
    66     this->myProcess->start(UtilVago::getOniSplitExecutable()+" "+ui->leManualCommand->text());
     72    this->myProcess->start(toolExecutable+" "+ui->leManualCommand->text());
    6773    this->myProcess->waitForFinished(120000); //wait 2 minutes at maximum
    68     ui->ptOutput->appendPlainText("> "+command);
     74    ui->ptOutput->appendPlainText("> " + ui->cbTargetTool->currentText() + " " + command);
    6975    ui->ptOutput->appendPlainText(this->myProcess->readAll());
    7076    ui->ptOutput->ensureCursorVisible();
  • Vago/trunk/Vago/manualcommands.ui

    r771 r1058  
    77    <x>0</x>
    88    <y>0</y>
    9     <width>460</width>
    10     <height>300</height>
     9    <width>640</width>
     10    <height>480</height>
    1111   </rect>
    1212  </property>
    1313  <property name="windowTitle">
    14    <string>Manual OniSplit Commands</string>
     14   <string>Manual Tools Commands</string>
     15  </property>
     16  <property name="windowIcon">
     17   <iconset resource="resources.qrc">
     18    <normaloff>:/new/icons/command_icon.png</normaloff>:/new/icons/command_icon.png</iconset>
    1519  </property>
    1620  <widget class="QWidget" name="centralwidget">
     
    2226      </property>
    2327      <layout class="QHBoxLayout" name="horizontalLayout_2">
     28       <item>
     29        <widget class="QLabel" name="label_2">
     30         <property name="text">
     31          <string>Target Tool:</string>
     32         </property>
     33        </widget>
     34       </item>
     35       <item>
     36        <widget class="QComboBox" name="cbTargetTool">
     37         <item>
     38          <property name="text">
     39           <string>OniSplit</string>
     40          </property>
     41         </item>
     42         <item>
     43          <property name="text">
     44           <string>XmlTools</string>
     45          </property>
     46         </item>
     47        </widget>
     48       </item>
    2449       <item>
    2550        <layout class="QHBoxLayout" name="horizontalLayout">
     
    134159  </widget>
    135160 </widget>
    136  <resources/>
     161 <resources>
     162  <include location="resources.qrc"/>
     163 </resources>
    137164 <connections>
    138165  <connection>
  • Vago/trunk/Vago/readme.txt

    r1054 r1058  
    11Readme.txt
    22~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3 Vago GUI v1.1
     3Vago GUI v1.2
    44~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    55
     
    3737----------------------------------
    3838Change Log:
     39----------------------------------
     401.2, 30-10-2016
     41- Upgraded to XmlTools 2.0c
     42- Added a XmlTools interface. Click in the XML icon in the main window.
     43- Now in manual commands you can choose if you want to call OniSplit or XmlTools
     44- Now manual commands behaves likes an independent window
     45- Fixed additional sources in levels tab when loading project
     46- Interface was asking user for additional sources and bnv source files when this
     47options were checked in levels tab when a project was loading. This was fixed.
     48- Fixed background image page 2 layout when the image name is large
    3949----------------------------------
    40501.1, 12-10-2016
  • Vago/trunk/Vago/resources.qrc

    r1054 r1058  
    1616        <file>abort.png</file>
    1717        <file>background_image.png</file>
     18        <file>xmltoolsinterface.png</file>
    1819    </qresource>
    1920    <qresource prefix="/new/about">
  • Vago/trunk/Vago/utilvago.h

    r1054 r1058  
    77namespace GlobalVars{
    88
    9 const QString AppVersion="1.1";
     9const QString AppVersion="1.2";
    1010const QString LastCompatibleVersion = "1.0";
    1111const QString ToolsFolder = "tools";
     
    2525const QString AppLogName="logVago.txt";
    2626const QString BuiltOniSplitVersion="0.9.96.0";
    27 const QString BuiltXmlToolsVersion="2.0b";
     27const QString BuiltXmlToolsVersion="2.0c";
    2828const QString ModsDomain="mods.oni2.net";
    2929#ifdef Q_OS_WIN
Note: See TracChangeset for help on using the changeset viewer.