Changeset 1058
- Timestamp:
- Oct 30, 2016, 3:42:39 PM (8 years ago)
- Location:
- Vago/trunk/Vago
- Files:
-
- 15 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
Vago/trunk/Vago/Vago.pro
r1054 r1058 17 17 INCLUDEPATH += ./soundWizard 18 18 INCLUDEPATH += ./bgImageWizard 19 INCLUDEPATH += ./xmlToolsInterface 19 20 20 21 # Used this great tutorial to build zlib and quazip: … … 70 71 bgImageWizard/bgimagepage3.cpp \ 71 72 bgImageWizard/bgimagepagefinal.cpp \ 73 xmlToolsInterface/xmltoolsinterface.cpp \ 74 libs/BasicXMLSyntaxHighlighter/BasicXMLSyntaxHighlighter.cpp \ 75 xmlToolsInterface/xmltoolsinterfacecommandpreview.cpp \ 76 libs/LineNumberDisplay/LineNumberDisplay.cpp 72 77 73 78 HEADERS += \ … … 97 102 bgImageWizard/bgimagewizard.h \ 98 103 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 100 109 101 110 FORMS += \ … … 116 125 bgImageWizard/bgimagepage3.ui \ 117 126 bgImageWizard/bgimagepagefinal.ui \ 127 xmlToolsInterface/xmltoolsinterface.ui \ 128 xmlToolsInterface/xmltoolsinterfacecommandpreview.ui 118 129 119 130 RESOURCES += \ -
Vago/trunk/Vago/about.cpp
r1054 r1058 33 33 "smashingmagazine for the folder icon :)<br />" 34 34 "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 />" 35 37 "<center>" 36 38 "Visit us at:<br />" -
Vago/trunk/Vago/bgImageWizard/bgimagepage2.cpp
r1054 r1058 106 106 107 107 // 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); 109 117 ui->lbImageWidth->setText(QString::number(image.width())); 110 118 ui->lbImageHeight->setText(QString::number(image.height())); -
Vago/trunk/Vago/bgImageWizard/bgimagepage2.ui
r1054 r1058 7 7 <x>0</x> 8 8 <y>0</y> 9 <width> 404</width>10 <height> 286</height>9 <width>558</width> 10 <height>323</height> 11 11 </rect> 12 12 </property> … … 50 50 <property name="minimumSize"> 51 51 <size> 52 <width> 380</width>52 <width>500</width> 53 53 <height>230</height> 54 54 </size> … … 60 60 <item> 61 61 <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> 62 74 <property name="title"> 63 75 <string>Preview</string> … … 76 88 <item> 77 89 <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> 78 102 <property name="title"> 79 103 <string>Details</string> -
Vago/trunk/Vago/bgImageWizard/bgimagepage3.cpp
r1054 r1058 85 85 backgroundName = "TXMPother"; 86 86 txmbName = "TXMBother"; 87 ui->leLevelId->clear(); 88 ui->leLevelId->setEnabled(false); 87 89 } 88 90 else if(type == "Intro Screen"){ 89 91 backgroundName = "TXMPlevel" + levelNumber + "_intro_"; 90 92 txmbName = "TXMBintro_splash_screen"; 93 ui->leLevelId->setEnabled(true); 91 94 } 92 95 else if(type == "Win Screen"){ 93 96 backgroundName = "TXMPlevel" + levelNumber + "_win_"; 94 97 txmbName = "TXMBwin_splash_screen"; 98 ui->leLevelId->setEnabled(true); 95 99 } 96 100 else if(type == "Loose Screen"){ 97 101 backgroundName = "TXMPfail01_"; 98 102 txmbName = "TXMBfail_splash_screen"; 103 ui->leLevelId->clear(); 104 ui->leLevelId->setEnabled(false); 99 105 } 100 106 else if(type == "Main Menu Screen"){ 101 107 backgroundName = "TXMPOni_startup_"; 102 108 txmbName = "TXMBpict_mainmenu"; 109 ui->leLevelId->clear(); 110 ui->leLevelId->setEnabled(false); 103 111 } 104 112 else if(type == "Options Menu Screen"){ 105 113 backgroundName = "TXMPoptions_"; 106 114 txmbName = "TXMBpict_options_background"; 115 ui->leLevelId->clear(); 116 ui->leLevelId->setEnabled(false); 107 117 } 108 118 else if(type == "Load Level Screen"){ 109 119 backgroundName = "TXMPoni_kanji_"; 110 120 txmbName = "TXMBpict_loadgame_background"; 121 ui->leLevelId->clear(); 122 ui->leLevelId->setEnabled(false); 111 123 } 112 124 -
Vago/trunk/Vago/bgImageWizard/bgimagepagefinal.cpp
r1054 r1058 164 164 } 165 165 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 193 166 QVector<int> BGImagePageFinal::getSplitSizes(int imageSideSize) 194 167 { -
Vago/trunk/Vago/main.cpp
r1047 r1058 11 11 a.setStyleSheet("QStatusBar::item { border: 0px; }"); //hide QLabels border in status bar //http://qt-project.org/forums/viewthread/18743 12 12 13 // XmlToolsInterface *xmlToolsWindow = new XmlToolsInterface(new Logger(UtilVago::getAppPath(), GlobalVars::AppLogName)); 14 // xmlToolsWindow->show(); //it destroys itself when finished. 15 13 16 return a.exec(); 14 17 } -
Vago/trunk/Vago/mainwindow.cpp
r1054 r1058 129 129 ui->statusBar->addPermanentWidget(ui->tbAbortConversion); 130 130 131 //Initialize list pointers132 this->listToProccess = new QStringList;133 134 131 // User interface 135 132 ui->mainToolBar->addWidget(ui->tbAE); //add ae installer launch button … … 139 136 ui->mainToolBar->addWidget(ui->tbCommand); //add option to manual onisplit commands 140 137 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 141 140 ui->mainToolBar->addWidget(ui->tbOpenFolder); //add option to open folder with files converted etc 142 141 … … 208 207 209 208 //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); 211 210 #else 212 this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, this->listToProccess);211 this->myConverter = new Converter(UtilVago::getAppPath(), this->myLogger, &this->listToProccess); 213 212 #endif 214 213 … … 291 290 { 292 291 QDesktopServices::openUrl(QUrl("file:///"+this->outputFolder)); 292 } 293 294 295 void 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. 293 301 } 294 302 … … 742 750 //Only process enabled items 743 751 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()); 745 753 } 746 754 } … … 1187 1195 if(result == QMessageBox::StandardButton::Cancel){ 1188 1196 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(); 1191 1203 } 1192 1204 … … 1225 1237 ui->cbGridsLevels->setEnabled(checked); 1226 1238 ui->cbGridsLevels->setChecked(checked); 1227 if(checked ){1239 if(checked && !projectIsLoading){ 1228 1240 QString file=QFileDialog::getOpenFileName(this,"Choose the BNV.dae file...","./" , "All Files (*.*)"); 1229 1241 if(!file.isEmpty()){ … … 1237 1249 ui->leAdditSourcesLevels->setEnabled(checked); 1238 1250 1239 if(checked ){1251 if(checked && !projectIsLoading){ 1240 1252 QStringList filesSelected=QFileDialog::getOpenFileNames(this,"Choose the additional .dae files...","./" , "All Files (*.*)"); 1241 1253 QString filesJoined; … … 1306 1318 void MainWindow::on_tbCommand_clicked() 1307 1319 { 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(); 1310 1323 commandsWindow->show(); //it destroys itself when finished. 1311 1324 } … … 2002 2015 { 2003 2016 2017 this->projectIsLoading = true; 2018 2004 2019 if(this->vagoSettings->value("AskSaveProject").toBool() && this->unsavedChangesExist){ 2005 2020 QMessageBox::StandardButton result = askToSaveCurrentProject(); 2006 2021 if(result == QMessageBox::StandardButton::Cancel){ 2022 this->projectIsLoading = false; 2007 2023 return; 2008 2024 } … … 2018 2034 UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "An error ocurred while loading project file.\n" + QString(result.description())); 2019 2035 showErrStatusMessage(statusError); 2036 this->projectIsLoading = false; 2020 2037 return; 2021 2038 } … … 2025 2042 UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, QString(doc.root().name()) + "The file opened is not a valid VagoProject file. Load aborted."); 2026 2043 showErrStatusMessage(statusError); 2044 this->projectIsLoading = false; 2027 2045 return; 2028 2046 } … … 2037 2055 UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't find the vagoVersion of the current project. Load aborted.\n" + QString(e.what())); 2038 2056 showErrStatusMessage(statusError); 2057 this->projectIsLoading = false; 2039 2058 return; 2040 2059 } … … 2043 2062 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."); 2044 2063 showErrStatusMessage(statusError); 2064 this->projectIsLoading = false; 2045 2065 return; 2046 2066 } … … 2058 2078 UtilVago::showAndLogErrorPopUpLogButton(this->myLogger, "Couldn't load the vago project. Error: " + QString(e.what())); 2059 2079 showErrStatusMessage(statusError); 2080 this->projectIsLoading = false; 2060 2081 return; 2061 2082 } … … 2069 2090 2070 2091 setVagoWindowTitle(); 2092 2093 this->projectIsLoading = false; 2071 2094 2072 2095 showSuccessStatusMessage("Project loaded sucessfully."); … … 2132 2155 ui->cbGridsLevels->setChecked(doc.select_node(Util::qStrToCstr("/VagoProject/"+tabName+"/Options/@generateGrids")).attribute().as_bool()); 2133 2156 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())); 2135 2158 } 2136 2159 else{ -
Vago/trunk/Vago/mainwindow.h
r1054 r1058 11 11 #include "converter.h" 12 12 #include "droptablewidget.h" 13 #include "xmltoolsinterface.h" 13 14 14 15 #include <QMainWindow> … … 36 37 37 38 #include "libs/pugixml/pugixml.hpp" 38 //#include <QDebug>39 39 40 40 namespace Ui { … … 198 198 199 199 void on_actionNew_Project_triggered(); 200 201 void on_tbXmlToolsInterface_clicked(); 200 202 201 203 private: … … 215 217 QProgressBar *myBar; //Progress Bar 216 218 QHash<QString, QString> commandMap; //Map the commands for fast retreive 217 QStringList *listToProccess; //items to proccess219 QStringList listToProccess; //items to proccess 218 220 Converter *myConverter = nullptr; 219 221 QSettings *vagoSettings; … … 229 231 // Indicates that the application is fully loaded which includes painting the main window 230 232 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; 231 236 232 237 // anonymous enum -
Vago/trunk/Vago/mainwindow.ui
r1054 r1058 21 21 <layout class="QVBoxLayout" name="verticalLayout"> 22 22 <item> 23 <layout class="QHBoxLayout" name="horizontalLayout_ 10">23 <layout class="QHBoxLayout" name="horizontalLayout_5"> 24 24 <item> 25 25 <widget class="QToolButton" name="tbAbortConversion"> … … 50 50 <iconset resource="resources.qrc"> 51 51 <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> 52 91 </property> 53 92 </widget> … … 75 114 <widget class="QToolButton" name="tbCommand"> 76 115 <property name="toolTip"> 77 <string>Manual OniSplitCommands</string>116 <string>Manual Tools Commands</string> 78 117 </property> 79 118 <property name="text"> … … 87 126 </item> 88 127 <item> 89 <widget class="QLabel" name="emptySpacerLabel 2">128 <widget class="QLabel" name="emptySpacerLabel4"> 90 129 <property name="sizePolicy"> 91 130 <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> … … 97 136 <size> 98 137 <width>20</width> 99 <height>0</height>100 </size>101 </property>102 <property name="baseSize">103 <size>104 <width>0</width>105 138 <height>0</height> 106 139 </size> … … 1431 1464 <addaction name="actionSound_Wizard"/> 1432 1465 <addaction name="actionBackground_Image_Wizard"/> 1466 <addaction name="separator"/> 1433 1467 </widget> 1434 1468 <addaction name="menuFile"/> … … 1636 1670 </property> 1637 1671 </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> 1638 1681 </widget> 1639 1682 <layoutdefault spacing="6" margin="11"/> -
Vago/trunk/Vago/manualcommands.cpp
r1052 r1058 1 1 #include "manualcommands.h" 2 2 #include "ui_manualcommands.h" 3 #include <QDebug>4 3 5 4 ManualCommands::ManualCommands(QWidget *parent) : … … 8 7 { 9 8 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. 11 10 this->myProcess = new QProcess(); 12 11 this->myProcess->setProcessChannelMode(QProcess::MergedChannels); … … 33 32 34 33 void 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 } 35 43 36 44 QString command=ui->leManualCommand->text().trimmed(); … … 62 70 } 63 71 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()); 67 73 this->myProcess->waitForFinished(120000); //wait 2 minutes at maximum 68 ui->ptOutput->appendPlainText("> " +command);74 ui->ptOutput->appendPlainText("> " + ui->cbTargetTool->currentText() + " " + command); 69 75 ui->ptOutput->appendPlainText(this->myProcess->readAll()); 70 76 ui->ptOutput->ensureCursorVisible(); -
Vago/trunk/Vago/manualcommands.ui
r771 r1058 7 7 <x>0</x> 8 8 <y>0</y> 9 <width> 460</width>10 <height> 300</height>9 <width>640</width> 10 <height>480</height> 11 11 </rect> 12 12 </property> 13 13 <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> 15 19 </property> 16 20 <widget class="QWidget" name="centralwidget"> … … 22 26 </property> 23 27 <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> 24 49 <item> 25 50 <layout class="QHBoxLayout" name="horizontalLayout"> … … 134 159 </widget> 135 160 </widget> 136 <resources/> 161 <resources> 162 <include location="resources.qrc"/> 163 </resources> 137 164 <connections> 138 165 <connection> -
Vago/trunk/Vago/readme.txt
r1054 r1058 1 1 Readme.txt 2 2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 Vago GUI v1. 13 Vago GUI v1.2 4 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 5 … … 37 37 ---------------------------------- 38 38 Change Log: 39 ---------------------------------- 40 1.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 47 options 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 39 49 ---------------------------------- 40 50 1.1, 12-10-2016 -
Vago/trunk/Vago/resources.qrc
r1054 r1058 16 16 <file>abort.png</file> 17 17 <file>background_image.png</file> 18 <file>xmltoolsinterface.png</file> 18 19 </qresource> 19 20 <qresource prefix="/new/about"> -
Vago/trunk/Vago/utilvago.h
r1054 r1058 7 7 namespace GlobalVars{ 8 8 9 const QString AppVersion="1. 1";9 const QString AppVersion="1.2"; 10 10 const QString LastCompatibleVersion = "1.0"; 11 11 const QString ToolsFolder = "tools"; … … 25 25 const QString AppLogName="logVago.txt"; 26 26 const QString BuiltOniSplitVersion="0.9.96.0"; 27 const QString BuiltXmlToolsVersion="2.0 b";27 const QString BuiltXmlToolsVersion="2.0c"; 28 28 const QString ModsDomain="mods.oni2.net"; 29 29 #ifdef Q_OS_WIN
Note:
See TracChangeset
for help on using the changeset viewer.