]> gitweb.hamatoma.de Git - reqt/commitdiff
dayly work
authorhama <hama@siduction.net>
Thu, 14 Jan 2016 23:16:06 +0000 (00:16 +0100)
committerhama <hama@siduction.net>
Thu, 14 Jan 2016 23:16:06 +0000 (00:16 +0100)
appl/recform/CFormatter.cpp
appl/recform/CFormatter.hpp
appl/reimgconvert/converter.cpp
appl/reimgconvert/mainwindow.cpp
appl/reimgconvert/mainwindow.hpp
appl/reimgconvert/mainwindow.ui
appl/reimgconvert/reimgconvert.pro
base/rebase.hpp
gui/ReGuiQueue.hpp

index 96f2158855eda5f4323ebed004823bbec7929520..b495074f64abe646fb53c62a425b6142642e19c0 100644 (file)
@@ -36,17 +36,16 @@ CFormatter::CFormatter(ReProgramArgs& args, ReLogger* logger) :
        m_useTab(true),
        m_lexer(NULL),
        m_parser(NULL),
-       m_countIsTypeList(256),
-       m_isInTypeList(new bool[m_countIsTypeList]),
+       m_isInTypeList(),
        m_countTokenLengths(256),
        m_tokenLengths(new int[m_countTokenLengths])
 {
+       m_isInTypeList.fill(' ', 256);
 }
 /**
  * Destructor.
  */
 CFormatter::~CFormatter(){
-       delete[] m_isInTypeList;
        delete[] m_tokenLengths;
 }
 
@@ -68,6 +67,15 @@ void CFormatter::addToken(ReToken* token)
        m_logicalLine.push_back(FormatToken(token, m_parenthLevel));
 }
 
+/**
+ * Sets the value of <code>m_isInTypeList</code> at a given index to true.
+ * @param ix   index to set
+ */
+void CFormatter::setIsInTypeList(int ix){
+       char cc = '0' + ix % 10;
+       m_isInTypeList.replace(ix, 1, &cc, 1);
+}
+
 /**
  * Find tokens belonging to a type list: cast expressions.
  *
@@ -111,7 +119,7 @@ void CFormatter::findTypeLists()
                                        break;
                        }
                } else {
-                       m_isInTypeList[ix] = true;
+                       m_isInTypeList[ix] = '0' + ix % 10;
                }
        }
        if (endOfTypelist < 0)
@@ -127,7 +135,7 @@ void CFormatter::findTypeLists()
                                 && m_logicalLine.constData()[ix - 2].isOperator(OP_LBRACKET))){
                                // mark all tokens until the previous '(' as "in typelist":
                                while(ix > 0 && ! m_logicalLine.constData()[ix].isOperator(OP_LPARENTH))
-                                       m_isInTypeList[ix--] = true;
+                                       setIsInTypeList(ix--);
                        }
                }
        }
@@ -139,7 +147,7 @@ void CFormatter::findTypeLists()
                        while(++ix < count && ((item2 = &m_logicalLine.constData()[ix])
                                  ->isOperator(OP_LBRACKET, OP_LPARENTH)
                                  || item2->isOperator(OP_SEMICOLON, OP_COMMA)))
-                               m_isInTypeList[ix] = true;
+                               setIsInTypeList(ix);
                }
        }
        // search for template expressions: '<' types '>':
@@ -158,7 +166,7 @@ void CFormatter::findTypeLists()
                                }
                                if (found){
                                        while(++ix < ix2)
-                                               m_isInTypeList[ix] = true;
+                                               setIsInTypeList(ix);
                                        ix++;
                                }
                        }
@@ -199,7 +207,7 @@ void CFormatter::flushLine(int maxIndex, int rawLength)
                for (int ix = 1; ix < maxIx; ix++){
                        FormatToken* item = &m_logicalLine.data()[ix];
                        if (m_outputBuffer.length() > 0
-                                       && needsBlank(lastItem, item, m_isInTypeList[ix]))
+                                       && needsBlank(lastItem, item, m_isInTypeList[ix] != ' '))
                                m_outputBuffer.append(' ');
                        flushToken(item);
                        lastItem = item;
@@ -208,8 +216,7 @@ void CFormatter::flushLine(int maxIndex, int rawLength)
                        flushBuffer();
                }
                m_logicalLine.remove(0, maxIx + 1);
-               memmove(m_isInTypeList, m_isInTypeList + maxIx,
-                               (maxIndex - maxIx + 1) * sizeof m_isInTypeList[0]);
+               m_isInTypeList.remove(0, maxIx + 1);
                memmove(m_tokenLengths, m_tokenLengths + maxIx,
                                (maxIndex - maxIx + 1) * sizeof m_tokenLengths[0]);
                maxIndex -= maxIx;
@@ -244,7 +251,7 @@ int CFormatter::calcLength(int& maxIx){
        m_tokenLengths[0] = length;
        for (int ix = 1; ix < maxIx; ix++){
                FormatToken* item = &m_logicalLine.data()[ix];
-               if (needsBlank(lastItem, item, m_isInTypeList[ix]))
+               if (needsBlank(lastItem, item, m_isInTypeList[ix] != ' '))
                        length += 1;
                length += item->string().length();
                if (item->comment().length() > 0){
@@ -266,7 +273,7 @@ int CFormatter::calcLength(int& maxIx){
  */
 void CFormatter::flush(bool isPart)
 {
-       resetIsTypeList();
+       resetIsInTypeList();
        findTypeLists();
        FormatToken* token;
        if (m_logicalLine.size() > 0 && (token = &m_logicalLine.data()[0])
@@ -496,14 +503,9 @@ bool CFormatter::needsBlank(ReToken* first, ReToken* second, bool isDeclaration)
  *
  * @return
  */
-void CFormatter::resetIsTypeList()
+void CFormatter::resetIsInTypeList()
 {
-       if (m_countIsTypeList < m_logicalLine.size()){
-               delete[] m_isInTypeList;
-               m_countIsTypeList = max(m_logicalLine.size() + 1, m_countIsTypeList + 256);
-               m_isInTypeList = new bool[m_countIsTypeList];
-       }
-       memset(m_isInTypeList, false, sizeof *m_isInTypeList * m_countIsTypeList);
+       m_isInTypeList.fill(' ', m_logicalLine.size());
 }
 
 /**
@@ -647,9 +649,9 @@ void CFormatter::setBlockLevel(int blockLevel)
  */
 void CFormatter::setLastDeclToken(int lastDeclToken)
 {
-       int count = min(lastDeclToken, m_countIsTypeList);
-       if (count > 0)
-               memset(m_isInTypeList, ~false, count * sizeof *m_isInTypeList);
+       int maxIx = min(lastDeclToken, m_isInTypeList.length() - 1);
+       for (int ix = 0; ix <= maxIx; ix++)
+               setIsInTypeList(ix);
 }
 
 /**
index a227ce9b2921de984924b5fd42ed0cd1945f0051..70385a62389f5ffa6b43aaf9ad8f72db22cbdc96 100644 (file)
@@ -66,6 +66,7 @@ public:
        void restoreParenthLevel();
        void saveAndResetParenthLevel();
        void setBlockLevel(int blockLevel);
+       void setIsInTypeList(int ix);
        void setLastDeclToken(int lastDeclToken);
        void setLexer(CppLexer* lexer);
        void setParenthLevel(int parenthLevel);
@@ -83,7 +84,7 @@ protected:
        bool needsPrecedingBlank(CppOperator op);
        bool needsTrailingBlank(CppOperator op);
        bool needsBlank(ReToken* first, ReToken* second, bool isTypeList);
-       void resetIsTypeList();
+       void resetIsInTypeList();
 private:
        ReProgramArgs& m_args;
        int m_blockLevel;
@@ -101,8 +102,9 @@ private:
        CppLexer* m_lexer;
        CppParser* m_parser;
        int m_countIsTypeList;
+       // a string as boolean list: ' ' is false, ('0' + ix%10) is true
        // index: position of a token in m_logicalLine. Value: token is in type list.
-       bool* m_isInTypeList;
+       QByteArray m_isInTypeList;
        QByteArray m_indentBuffer;
        QByteArray m_outputBuffer;
        int m_countTokenLengths;
index f4f511a06ef0204abe345ef32fd6018978a3367b..6e1b4d13eb28f54cd23f6e0576c484156d1d2433 100644 (file)
@@ -379,7 +379,7 @@ void Converter::run(){
                        no++;
                        QString path = m_dir.absoluteFilePath(node);
                        qint64 length = it.fileInfo().size();
-                       QString nodeTarget = ReQStringUtil::replaceExtension(node,
+                       QString nodeTarget = ReFileUtils::replaceExtension(node,
                           "." + m_targetType);
                        QString target = m_targetDir.absoluteFilePath(nodeTarget);
                        convertOneFile(path, target, length);
@@ -393,7 +393,6 @@ void Converter::run(){
    }
    msg = QObject::tr("%1 file(s) converted").arg(no);
    changeState(Converter::STATE_READY, msg);
-   m_mainWindows->switchRun(true);
 }
 
 /**
index 78c123bb64c58b25697ef0f5680fe9760db0cd26..3ba394709c3149aa6b451b8940a3eb93a1dd0def 100644 (file)
@@ -32,31 +32,36 @@ const QString VERSION("2015.05.31");
  * @param parent        NULL or the parent (who destroys the objects at the end)
  */
 MainWindow::MainWindow(const QString& homeDir, QWidget *parent) :
-            QMainWindow(parent),
-            m_homeDir(homeDir),
-            m_storageFile(),
-            ui(new Ui::MainWindow),
-            m_converter(NULL){
+                       QMainWindow(parent),
+                       m_homeDir(homeDir),
+                       m_storageFile(),
+                       ui(new Ui::MainWindow),
+                       m_converter(NULL),
+                       m_logger(),
+                       m_guiQueue(),
+                       m_guiTimer(new QTimer(this)){
 
    ui->setupUi(this);
    initializeHome();
-   switchRun(true);
+   startStop(true);
    m_statusMessage = new QLabel(tr("Welcome at reimgconvert"));
    statusBar()->addWidget(m_statusMessage);
    connect(ui->actionSelectDestination, SIGNAL(triggered()), this,
-      SLOT(selectDestination()));
+         SLOT(selectDestination()));
    connect(ui->pushButtonSelectDest, SIGNAL(clicked()), this,
-      SLOT(selectDestination()));
+         SLOT(selectDestination()));
    connect(ui->actionSelectSource, SIGNAL(triggered()), this,
-      SLOT(selectSource()));
+         SLOT(selectSource()));
    connect(ui->pushButtonSelectDest, SIGNAL(clicked()), this,
-      SLOT(selectDestination()));
+         SLOT(selectDestination()));
    connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(about()));
    restoreState();
    connect(ui->comboBoxTemplate, SIGNAL(currentIndexChanged(const QString&)),
-            this, SLOT(on_templateChangeIndex(const QString&)));
+                       this, SLOT(on_templateChangeIndex(const QString&)));
    connect(ui->pushButtonActivate, SIGNAL(clicked()), this, SLOT(activate()));
+   connect(m_guiTimer, SIGNAL(timeout()), this, SLOT(guiTimerUpdate()));
    restoreState();
+   m_guiTimer->start(100);
 }
 
 /**
@@ -84,17 +89,17 @@ void MainWindow::activate(){
  */
 void MainWindow::setMaxDimensions(int maxWidth, int maxHeight){
    if (maxWidth > maxHeight){
-      ui->comboBoxLandscapeX->setCurrentText(QString::number(maxWidth));
-      ui->comboBoxLandscapeY->setCurrentText("*");
-      ui->comboBoxPortraitX->setCurrentText("*");
-      ui->comboBoxPortraitY->setCurrentText(QString::number(maxHeight));
-      ui->comboBoxSquareX->setCurrentText(QString::number(maxHeight));
+         ui->comboBoxLandscapeX->setCurrentText(QString::number(maxWidth));
+         ui->comboBoxLandscapeY->setCurrentText("*");
+         ui->comboBoxPortraitX->setCurrentText("*");
+         ui->comboBoxPortraitY->setCurrentText(QString::number(maxHeight));
+         ui->comboBoxSquareX->setCurrentText(QString::number(maxHeight));
    }else{
-      ui->comboBoxLandscapeY->setCurrentText(QString::number(maxHeight));
-      ui->comboBoxLandscapeX->setCurrentText("*");
-      ui->comboBoxPortraitY->setCurrentText("*");
-      ui->comboBoxPortraitX->setCurrentText(QString::number(maxWidth));
-      ui->comboBoxSquareX->setCurrentText(QString::number(maxWidth));
+         ui->comboBoxLandscapeY->setCurrentText(QString::number(maxHeight));
+         ui->comboBoxLandscapeX->setCurrentText("*");
+         ui->comboBoxPortraitY->setCurrentText("*");
+         ui->comboBoxPortraitX->setCurrentText(QString::number(maxWidth));
+         ui->comboBoxSquareX->setCurrentText(QString::number(maxWidth));
    }
 }
 
@@ -103,10 +108,10 @@ void MainWindow::setMaxDimensions(int maxWidth, int maxHeight){
  */
 void MainWindow::selectDestination(){
    QString dir = QFileDialog::getExistingDirectory(this,
-      tr("Select Destination Directory"), ui->comboBoxTarget->currentText(),
-      QFileDialog::ShowDirsOnly);
+         tr("Select Destination Directory"), ui->comboBoxTarget->currentText(),
+         QFileDialog::ShowDirsOnly);
    if (!dir.isEmpty())
-      ui->comboBoxTarget->setCurrentText(dir);
+         ui->comboBoxTarget->setCurrentText(dir);
 }
 
 /**
@@ -114,10 +119,10 @@ void MainWindow::selectDestination(){
  */
 void MainWindow::selectSource(){
    QString dir = QFileDialog::getExistingDirectory(this,
-      tr("Select Source Directory"), ui->comboBoxSourceDir->currentText(),
-      QFileDialog::ShowDirsOnly);
+         tr("Select Source Directory"), ui->comboBoxSourceDir->currentText(),
+         QFileDialog::ShowDirsOnly);
    if (!dir.isEmpty())
-      ui->comboBoxSourceDir->setCurrentText(dir);
+         ui->comboBoxSourceDir->setCurrentText(dir);
 }
 
 /**
@@ -128,23 +133,54 @@ void MainWindow::about(){
    dialog.exec();
 }
 
+/**
+ * Callback method of the GUI timer.
+ */
+void MainWindow::guiTimerUpdate()
+{
+       int count = m_guiQueue.count();
+       while(count-- > 0){
+               ReGuiQueueItem item = m_guiQueue.popFront();
+               if (item.m_type == ReGuiQueueItem::Undef)
+                       break;
+               if (! item.apply()){
+                       switch (item.m_type){
+                       case ReGuiQueueItem::ListEnd:
+                               ui->listWidget->addItem(item.m_value);
+                               break;
+                       case ReGuiQueueItem::ReadyMessage:
+                               say(LOG_INFO, item.m_value);
+                               startStop(false);
+                               break;
+                       case ReGuiQueueItem::LogMessage:
+                               say(LOG_INFO, item.m_value);
+                               break;
+                       default:
+                               say(LOG_ERROR, "unknown item type: " + QString::number(item.m_type)
+                                       + " " + item.m_value);
+                               break;
+                       }
+
+               }
+       }
+}
 /**
  * initializeHomeializes the program home directory.
  */
 void MainWindow::initializeHome(){
    if (m_homeDir.isEmpty()){
-      m_homeDir = QDir::home().absoluteFilePath(".reimgconvert");
+         m_homeDir = QDir::home().absoluteFilePath(".reimgconvert");
    }
 
    QDir home(m_homeDir);
    if (!home.exists()){
-      if (!home.mkpath(m_homeDir)){
-         m_homeDir = home.tempPath() + "/.reimgconvert";
-         home.mkpath(m_homeDir);
-      }
+         if (!home.mkpath(m_homeDir)){
+                m_homeDir = home.tempPath() + "/.reimgconvert";
+                home.mkpath(m_homeDir);
+         }
    }
    if (!m_homeDir.endsWith("/"))
-      m_homeDir += "/";
+         m_homeDir += "/";
    m_storageFile = m_homeDir + "state.conf";
    restoreState();
 }
@@ -169,9 +205,9 @@ void MainWindow::on_pushButtonFileSelect_clicked(){
    selection.setFileMode(QFileDialog::DirectoryOnly);
    QString dir = ui->comboBoxSourceDir->currentText();
    if (!dir.isEmpty())
-      selection.setDirectory(dir);
+         selection.setDirectory(dir);
    if (selection.exec())
-      ui->comboBoxSourceDir->setCurrentText(selection.selectedFiles().at(0));
+         ui->comboBoxSourceDir->setCurrentText(selection.selectedFiles().at(0));
 }
 
 /**
@@ -191,7 +227,7 @@ void MainWindow::on_templateChangeIndex(const QString & text){
  * @brief Handles the button click on "convert".
  */
 void MainWindow::on_pushButtonConvert_clicked(){
-   switchRun(false);
+   startStop(true);
    delete m_converter;
    m_errors = 0;
    int landscapeX = comboInt(ui->comboBoxLandscapeX, 0, "*", 0);
@@ -201,13 +237,13 @@ void MainWindow::on_pushButtonConvert_clicked(){
    int squareX = comboInt(ui->comboBoxSquareX, 0);
    int quality = comboInt(ui->comboBoxQuality, 70);
    if (m_errors == 0){
-      m_converter = new Converter(ui->comboBoxSourceDir->currentText(),
-         ui->comboBoxLandscapeX->currentText(),
-         ui->comboBoxSourcePattern->currentText(),
-         ui->comboBoxDestType->currentText(), landscapeX, landscapeY, portraitX,
-         portraitY, squareX, quality, this);
-      // start the thread:
-      m_converter->start();
+         m_converter = new Converter(ui->comboBoxSourceDir->currentText(),
+                ui->comboBoxLandscapeX->currentText(),
+                ui->comboBoxSourcePattern->currentText(),
+                ui->comboBoxDestType->currentText(), landscapeX, landscapeY, portraitX,
+                portraitY, squareX, quality, this);
+         // start the thread:
+         m_converter->start();
    }
 
 }
@@ -215,22 +251,24 @@ void MainWindow::on_pushButtonConvert_clicked(){
 /**
  * @brief Handles the event "thread changed".
  *
+ * Note: this method is called from a non main thread
+ *
  * @param state     the new state of the thread
  * @param info      info about the new state. Not used
  */
-void MainWindow::on_threadStateChanged(Converter::State state, const QString&){
+void MainWindow::on_threadStateChanged(Converter::State state, const QString& info){
    switch (state) {
    case Converter::STATE_READY:
-      ui->pushButtonConvert->show();
-      ui->pushButtonStop->hide();
-      //ui->statusBar->showMessage(info);
-      break;
+         m_guiQueue.pushBack(ReGuiQueueItem(ReGuiQueueItem::ReadyMessage, NULL, info));
+         ui->pushButtonStop->hide();
+         //ui->statusBar->showMessage(info);
+         break;
    case Converter::STATE_SUB_TASK_STOPPED:
-      //ui->statusBar->showMessage(info);
-      break;
+         //ui->statusBar->showMessage(info);
+         break;
    case Converter::STATE_STARTING:
    default:
-      break;
+         break;
    }
 }
 
@@ -248,10 +286,13 @@ bool MainWindow::log(const QString& message){
 /**
  * @brief Logs a message
  *
+ * Note: used by non main threads
+ *
  * @param message   the message to log
  * @return          <code>true</code>
  */
 bool MainWindow::logAppendLast(const QString& message){
+       m_guiQueue.pushBack(ReGuiQueueItem(ReGuiQueueItem::ListEnd, ui->listWidget, message));
    QListWidgetItem* item = ui->listWidget->item(0);
    item->setText(item->text() + " " + message);
    return true;
@@ -261,7 +302,7 @@ bool MainWindow::logAppendLast(const QString& message){
  * Reads the history of the widget values and other parameters and set it.
  */
 void MainWindow::restoreState(){
-   ReStateStorage storage(m_storageFile);
+   ReStateStorage storage(m_storageFile, &m_logger);
    storage.setForm("main");
    storage.restore(ui->comboBoxMaxHeight, "comboBoxMaxHeight", true);
    storage.restore(ui->comboBoxMaxWidth, "comboBoxMaxWidth", true);
@@ -281,7 +322,7 @@ void MainWindow::restoreState(){
  * Stores the history of the widget values and other parameters.
  */
 void MainWindow::saveState(){
-   ReStateStorage storage(m_storageFile);
+   ReStateStorage storage(m_storageFile, &m_logger);
    storage.setForm("main");
    storage.store(ui->comboBoxMaxHeight, "comboBoxMaxHeight");
    storage.store(ui->comboBoxMaxWidth, "comboBoxMaxWidth");
@@ -308,19 +349,30 @@ void MainWindow::setStatusMessage(bool error, const QString& message){
 }
 
 /**
- * Enables/disables the buttons/actions relevant for running.
+ * Starts or stops the search.
  *
- * @param runActive <code>true</code>: the conversion is possible
+ * @param start        <code>true</code>: the search should start
  */
-void MainWindow::switchRun(bool runActive){
-   if (runActive){
-      ui->pushButtonConvert->show();
-      ui->pushButtonStop->hide();
-   }else{
-      ui->pushButtonConvert->hide();
-      ui->pushButtonStop->show();
-   }
-   ui->actionConvert->setEnabled(runActive);
-   ui->actionStop->setEnabled(not runActive);
+void MainWindow::startStop(bool isStart){
+       ui->actionStart->setEnabled(!isStart);
+       ui->actionStop->setEnabled(isStart);
+       ui->pushButtonConvert->setEnabled(! isStart);
+       ui->pushButtonStop->setEnabled(isStart);
+}
+
+/**
+ * Issues a message.
+ *
+ * @param level                type of the message
+ * @param message      message to issue
+ * @return                     <code>level == LOG_ERROR</code>
+ */
+bool MainWindow::say(ReLoggerLevel level, const QString& message)
+{
+       if (level == LOG_ERROR || level == LOG_WARNING)
+               error(message);
+       else
+               log(message);
+       return level == LOG_ERROR;
 }
 
index 86479905927d524f6392742a41db5a68b817fb2f..980694a1a82ef1df07d4bc1c0fa06cc0fc5647d9 100644 (file)
@@ -17,6 +17,7 @@
 #include <QResizeEvent>
 #include <QLabel>
 #include "converter.hpp"
+#include "base/rebase.hpp"
 #include "gui/regui.hpp"
 namespace Ui {
 class MainWindow;
@@ -33,21 +34,25 @@ public:
 
 public:
    bool error(const QString& message){
-      log("+++ " + message);
-      return false;
+         log("+++ " + message);
+         return false;
    }
    bool log(const QString& message);
    bool logAppendLast(const QString& message);
+   void on_threadStateChanged(Converter::State state, const QString& info);
    void setStatusMessage(bool error, const QString& message);
    void switchRun(bool runActive);
+   virtual bool say(ReLoggerLevel level, const QString& message);
 private:
    void initializeHome();
    void restoreState();
    void saveState();
    void setMaxDimensions(int maxWidth, int maxHeight);public slots:
-   void on_threadStateChanged(Converter::State state, const QString& info);private slots:
+   void startStop(bool isStart);
+private slots:
    void activate();
    void about();
+   void guiTimerUpdate();
    void on_pushButtonFileSelect_clicked();
    void on_pushButtonStop_clicked();
    void on_pushButtonConvert_clicked();
@@ -60,6 +65,9 @@ private:
    Ui::MainWindow *ui;
    Converter* m_converter;
    QLabel* m_statusMessage;
+   ReLogger m_logger;
+   ReGuiQueue m_guiQueue;
+   QTimer* m_guiTimer;
 };
 
 #endif // MAINWINDOW_HPP
index 63681a25940d3934abac26168b65dadec30288b9..1d46a60205a7760555f5378df623d87ca98ff3fa 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>799</width>
-    <height>651</height>
+    <width>823</width>
+    <height>783</height>
    </rect>
   </property>
   <property name="minimumSize">
    <string>ReImgConvert</string>
   </property>
   <widget class="QWidget" name="centralWidget">
-   <widget class="QWidget" name="widget" native="true">
-    <property name="geometry">
-     <rect>
-      <x>11</x>
-      <y>11</y>
-      <width>787</width>
-      <height>647</height>
-     </rect>
-    </property>
-    <layout class="QVBoxLayout" name="verticalLayout">
-     <item>
-      <widget class="QTabWidget" name="tabWidget">
-       <property name="minimumSize">
-        <size>
-         <width>0</width>
-         <height>150</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>16777215</width>
-         <height>150</height>
-        </size>
-       </property>
-       <property name="currentIndex">
-        <number>0</number>
-       </property>
-       <widget class="QWidget" name="tab_2">
-        <attribute name="title">
-         <string>Dimensions (quick)</string>
-        </attribute>
-        <layout class="QVBoxLayout" name="verticalLayout_6">
-         <item>
-          <layout class="QHBoxLayout" name="horizontalLayout_4">
-           <item>
-            <widget class="QLabel" name="label_2">
-             <property name="minimumSize">
-              <size>
-               <width>100</width>
-               <height>0</height>
-              </size>
-             </property>
-             <property name="maximumSize">
-              <size>
-               <width>100</width>
-               <height>16777215</height>
-              </size>
-             </property>
-             <property name="text">
-              <string>Template:</string>
-             </property>
-            </widget>
-           </item>
+   <layout class="QVBoxLayout" name="verticalLayout_3">
+    <item>
+     <widget class="QWidget" name="widget" native="true">
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <widget class="QTabWidget" name="tabWidget">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>150</height>
+          </size>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>16777215</width>
+           <height>150</height>
+          </size>
+         </property>
+         <property name="currentIndex">
+          <number>0</number>
+         </property>
+         <widget class="QWidget" name="tab_2">
+          <attribute name="title">
+           <string>Dimensions (quick)</string>
+          </attribute>
+          <layout class="QVBoxLayout" name="verticalLayout_6">
            <item>
-            <widget class="QComboBox" name="comboBoxTemplate">
-             <item>
-              <property name="text">
-               <string>Website: 1024x768</string>
-              </property>
-             </item>
+            <layout class="QHBoxLayout" name="horizontalLayout_4">
              <item>
-              <property name="text">
-               <string>Website II: 800x600</string>
-              </property>
-             </item>
-             <item>
-              <property name="text">
-               <string>Photo: 2048x1536</string>
-              </property>
-             </item>
-             <item>
-              <property name="text">
-               <string>Photo II: 3072x2304</string>
-              </property>
-             </item>
-             <item>
-              <property name="text">
-               <string>Midi: 600x400</string>
-              </property>
-             </item>
-             <item>
-              <property name="text">
-               <string>Mini: 150x100</string>
-              </property>
-             </item>
-            </widget>
-           </item>
-          </layout>
-         </item>
-         <item>
-          <layout class="QHBoxLayout" name="horizontalLayout_5">
-           <item>
-            <layout class="QFormLayout" name="formLayout_7">
-             <item row="0" column="0">
-              <widget class="QLabel" name="label_14">
+              <widget class="QLabel" name="label_2">
                <property name="minimumSize">
                 <size>
                  <width>100</width>
                 </size>
                </property>
                <property name="text">
-                <string>Max. Width:</string>
+                <string>Template:</string>
                </property>
               </widget>
              </item>
-             <item row="0" column="1">
-              <widget class="QComboBox" name="comboBoxMaxWidth">
+             <item>
+              <widget class="QComboBox" name="comboBoxTemplate">
                <property name="minimumSize">
                 <size>
-                 <width>100</width>
+                 <width>315</width>
                  <height>0</height>
                 </size>
                </property>
-               <property name="maximumSize">
+               <item>
+                <property name="text">
+                 <string>Website: 1024x768</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Website II: 800x600</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Photo: 2048x1536</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Photo II: 3072x2304</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Midi: 600x400</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Mini: 150x100</string>
+                </property>
+               </item>
+              </widget>
+             </item>
+             <item>
+              <spacer name="horizontalSpacer_6">
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
                 <size>
-                 <width>100</width>
-                 <height>16777215</height>
+                 <width>40</width>
+                 <height>20</height>
                 </size>
                </property>
-               <property name="editable">
-                <bool>true</bool>
-               </property>
-              </widget>
+              </spacer>
              </item>
             </layout>
            </item>
            <item>
-            <spacer name="horizontalSpacer_6">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <layout class="QFormLayout" name="formLayout_8">
-             <item row="0" column="0">
-              <widget class="QLabel" name="label_15">
-               <property name="minimumSize">
-                <size>
-                 <width>100</width>
-                 <height>0</height>
-                </size>
-               </property>
-               <property name="maximumSize">
-                <size>
-                 <width>100</width>
-                 <height>16777215</height>
-                </size>
-               </property>
+            <layout class="QHBoxLayout" name="horizontalLayout_5">
+             <item>
+              <layout class="QFormLayout" name="formLayout_7">
+               <item row="0" column="0">
+                <widget class="QLabel" name="label_14">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="maximumSize">
+                  <size>
+                   <width>100</width>
+                   <height>16777215</height>
+                  </size>
+                 </property>
+                 <property name="text">
+                  <string>Max. Width:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="0" column="1">
+                <widget class="QComboBox" name="comboBoxMaxWidth">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="maximumSize">
+                  <size>
+                   <width>100</width>
+                   <height>16777215</height>
+                  </size>
+                 </property>
+                 <property name="editable">
+                  <bool>true</bool>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <layout class="QFormLayout" name="formLayout_8">
+               <item row="0" column="0">
+                <widget class="QLabel" name="label_15">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="maximumSize">
+                  <size>
+                   <width>100</width>
+                   <height>16777215</height>
+                  </size>
+                 </property>
+                 <property name="text">
+                  <string>Max. Height:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="0" column="1">
+                <widget class="QComboBox" name="comboBoxMaxHeight">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="maximumSize">
+                  <size>
+                   <width>100</width>
+                   <height>16777215</height>
+                  </size>
+                 </property>
+                 <property name="editable">
+                  <bool>true</bool>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pushButtonActivate">
                <property name="text">
-                <string>Max. Height:</string>
+                <string>&amp;Activate template</string>
                </property>
               </widget>
              </item>
-             <item row="0" column="1">
-              <widget class="QComboBox" name="comboBoxMaxHeight">
-               <property name="minimumSize">
-                <size>
-                 <width>100</width>
-                 <height>0</height>
-                </size>
+             <item>
+              <spacer name="horizontalSpacer_5">
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
                </property>
-               <property name="maximumSize">
+               <property name="sizeHint" stdset="0">
                 <size>
-                 <width>100</width>
-                 <height>16777215</height>
+                 <width>40</width>
+                 <height>20</height>
                 </size>
                </property>
-               <property name="editable">
-                <bool>true</bool>
-               </property>
-              </widget>
+              </spacer>
              </item>
             </layout>
            </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="tab">
+          <attribute name="title">
+           <string>Dimensions (separated)</string>
+          </attribute>
+          <layout class="QHBoxLayout" name="horizontalLayout_3">
            <item>
-            <spacer name="horizontalSpacer_5">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
+            <widget class="QGroupBox" name="groupBox">
+             <property name="minimumSize">
+              <size>
+               <width>230</width>
+               <height>100</height>
+              </size>
              </property>
-             <property name="sizeHint" stdset="0">
+             <property name="maximumSize">
               <size>
-               <width>40</width>
-               <height>20</height>
+               <width>230</width>
+               <height>100</height>
               </size>
              </property>
-            </spacer>
-           </item>
-           <item>
-            <widget class="QPushButton" name="pushButtonActivate">
-             <property name="text">
-              <string>&amp;Activate</string>
+             <property name="title">
+              <string>Portrait:</string>
              </property>
-            </widget>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </widget>
-       <widget class="QWidget" name="tab">
-        <attribute name="title">
-         <string>Dimensions (separated)</string>
-        </attribute>
-        <layout class="QHBoxLayout" name="horizontalLayout_3">
-         <item>
-          <widget class="QGroupBox" name="groupBox">
-           <property name="minimumSize">
-            <size>
-             <width>230</width>
-             <height>100</height>
-            </size>
-           </property>
-           <property name="maximumSize">
-            <size>
-             <width>230</width>
-             <height>100</height>
-            </size>
-           </property>
-           <property name="title">
-            <string>Portrait:</string>
-           </property>
-           <widget class="QWidget" name="layoutWidget1">
-            <property name="geometry">
-             <rect>
-              <x>2</x>
-              <y>30</y>
-              <width>221</width>
-              <height>61</height>
-             </rect>
-            </property>
-            <layout class="QFormLayout" name="formLayout">
-             <item row="0" column="0">
-              <widget class="QLabel" name="label_9">
-               <property name="minimumSize">
-                <size>
-                 <width>100</width>
-                 <height>0</height>
-                </size>
-               </property>
-               <property name="maximumSize">
-                <size>
-                 <width>100</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>Max. Width:</string>
-               </property>
-              </widget>
-             </item>
-             <item row="0" column="1">
-              <widget class="QComboBox" name="comboBoxPortraitX">
-               <property name="minimumSize">
-                <size>
-                 <width>100</width>
-                 <height>0</height>
-                </size>
-               </property>
-               <property name="maximumSize">
-                <size>
-                 <width>100</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="editable">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-             <item row="1" column="0">
-              <widget class="QLabel" name="label">
-               <property name="minimumSize">
-                <size>
-                 <width>100</width>
-                 <height>0</height>
-                </size>
-               </property>
-               <property name="maximumSize">
-                <size>
-                 <width>100</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>Max. Height:</string>
-               </property>
-              </widget>
-             </item>
-             <item row="1" column="1">
-              <widget class="QComboBox" name="comboBoxPortraitY">
-               <property name="minimumSize">
-                <size>
-                 <width>100</width>
-                 <height>0</height>
-                </size>
-               </property>
-               <property name="maximumSize">
-                <size>
-                 <width>100</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="editable">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </widget>
-          </widget>
-         </item>
-         <item>
-          <spacer name="horizontalSpacer">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>48</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QGroupBox" name="groupBox_2">
-           <property name="minimumSize">
-            <size>
-             <width>230</width>
-             <height>100</height>
-            </size>
-           </property>
-           <property name="maximumSize">
-            <size>
-             <width>230</width>
-             <height>100</height>
-            </size>
-           </property>
-           <property name="title">
-            <string>Landscape:</string>
-           </property>
-           <widget class="QWidget" name="layoutWidget2">
-            <property name="geometry">
-             <rect>
-              <x>3</x>
-              <y>31</y>
-              <width>221</width>
-              <height>61</height>
-             </rect>
-            </property>
-            <layout class="QFormLayout" name="formLayout_2">
-             <item row="0" column="0">
-              <widget class="QLabel" name="label_3">
-               <property name="minimumSize">
-                <size>
-                 <width>100</width>
-                 <height>0</height>
-                </size>
-               </property>
-               <property name="maximumSize">
-                <size>
-                 <width>100</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>Max. Width:</string>
-               </property>
-              </widget>
-             </item>
-             <item row="0" column="1">
-              <widget class="QComboBox" name="comboBoxLandscapeX">
-               <property name="minimumSize">
-                <size>
-                 <width>100</width>
-                 <height>0</height>
-                </size>
-               </property>
-               <property name="maximumSize">
-                <size>
-                 <width>100</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="editable">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-             <item row="1" column="0">
-              <widget class="QLabel" name="label_4">
-               <property name="minimumSize">
-                <size>
-                 <width>100</width>
-                 <height>0</height>
-                </size>
-               </property>
-               <property name="maximumSize">
-                <size>
-                 <width>100</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>Max. Height:</string>
-               </property>
-              </widget>
-             </item>
-             <item row="1" column="1">
-              <widget class="QComboBox" name="comboBoxLandscapeY">
-               <property name="minimumSize">
-                <size>
-                 <width>100</width>
-                 <height>0</height>
-                </size>
-               </property>
-               <property name="maximumSize">
-                <size>
-                 <width>100</width>
-                 <height>16777215</height>
-                </size>
-               </property>
-               <property name="editable">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </widget>
-          </widget>
-         </item>
-         <item>
-          <spacer name="horizontalSpacer_2">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>47</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QGroupBox" name="groupBox_3">
-           <property name="minimumSize">
-            <size>
-             <width>150</width>
-             <height>100</height>
-            </size>
-           </property>
-           <property name="maximumSize">
-            <size>
-             <width>150</width>
-             <height>100</height>
-            </size>
-           </property>
-           <property name="title">
-            <string>Square:</string>
-           </property>
-           <widget class="QComboBox" name="comboBoxSquareX">
-            <property name="geometry">
-             <rect>
-              <x>0</x>
-              <y>60</y>
-              <width>100</width>
-              <height>26</height>
-             </rect>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>100</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="maximumSize">
-             <size>
-              <width>100</width>
-              <height>16777215</height>
-             </size>
-            </property>
-            <property name="editable">
-             <bool>true</bool>
-            </property>
-           </widget>
-           <widget class="QLabel" name="label_5">
-            <property name="geometry">
-             <rect>
-              <x>0</x>
-              <y>40</y>
-              <width>141</width>
-              <height>18</height>
-             </rect>
-            </property>
-            <property name="text">
-             <string>Max. Width/Height:</string>
-            </property>
-           </widget>
-          </widget>
-         </item>
-        </layout>
-        <zorder>groupBox_2</zorder>
-        <zorder>groupBox_3</zorder>
-        <zorder>groupBox</zorder>
-        <zorder>horizontalSpacer</zorder>
-       </widget>
-      </widget>
-     </item>
-     <item>
-      <widget class="QGroupBox" name="groupBox_4">
-       <property name="minimumSize">
-        <size>
-         <width>0</width>
-         <height>150</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>16777215</width>
-         <height>150</height>
-        </size>
-       </property>
-       <property name="title">
-        <string>Others:</string>
-       </property>
-       <layout class="QVBoxLayout" name="verticalLayout_3" stretch="1,0">
-        <property name="sizeConstraint">
-         <enum>QLayout::SetFixedSize</enum>
-        </property>
-        <item>
-         <layout class="QHBoxLayout" name="horizontalLayout_7">
-          <item>
-           <layout class="QFormLayout" name="formLayout_3">
-            <item row="0" column="0">
-             <widget class="QLabel" name="label_6">
-              <property name="minimumSize">
-               <size>
-                <width>100</width>
-                <height>0</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>100</width>
-                <height>16777215</height>
-               </size>
-              </property>
-              <property name="text">
-               <string>Quality (%)</string>
+             <widget class="QWidget" name="layoutWidget1">
+              <property name="geometry">
+               <rect>
+                <x>2</x>
+                <y>30</y>
+                <width>221</width>
+                <height>65</height>
+               </rect>
               </property>
+              <layout class="QFormLayout" name="formLayout">
+               <item row="0" column="0">
+                <widget class="QLabel" name="label_9">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="maximumSize">
+                  <size>
+                   <width>100</width>
+                   <height>16777215</height>
+                  </size>
+                 </property>
+                 <property name="text">
+                  <string>Max. Width:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="0" column="1">
+                <widget class="QComboBox" name="comboBoxPortraitX">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="maximumSize">
+                  <size>
+                   <width>100</width>
+                   <height>16777215</height>
+                  </size>
+                 </property>
+                 <property name="editable">
+                  <bool>true</bool>
+                 </property>
+                </widget>
+               </item>
+               <item row="1" column="0">
+                <widget class="QLabel" name="label">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="maximumSize">
+                  <size>
+                   <width>100</width>
+                   <height>16777215</height>
+                  </size>
+                 </property>
+                 <property name="text">
+                  <string>Max. Height:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="1" column="1">
+                <widget class="QComboBox" name="comboBoxPortraitY">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="maximumSize">
+                  <size>
+                   <width>100</width>
+                   <height>16777215</height>
+                  </size>
+                 </property>
+                 <property name="editable">
+                  <bool>true</bool>
+                 </property>
+                </widget>
+               </item>
+              </layout>
              </widget>
-            </item>
-            <item row="0" column="1">
-             <widget class="QComboBox" name="comboBoxQuality">
-              <property name="minimumSize">
-               <size>
-                <width>100</width>
-                <height>0</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>100</width>
-                <height>16777215</height>
-               </size>
-              </property>
-              <property name="editable">
-               <bool>true</bool>
+            </widget>
+           </item>
+           <item>
+            <widget class="QGroupBox" name="groupBox_2">
+             <property name="minimumSize">
+              <size>
+               <width>230</width>
+               <height>100</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>230</width>
+               <height>100</height>
+              </size>
+             </property>
+             <property name="title">
+              <string>Landscape:</string>
+             </property>
+             <widget class="QWidget" name="layoutWidget2">
+              <property name="geometry">
+               <rect>
+                <x>3</x>
+                <y>31</y>
+                <width>221</width>
+                <height>65</height>
+               </rect>
               </property>
+              <layout class="QFormLayout" name="formLayout_2">
+               <item row="0" column="0">
+                <widget class="QLabel" name="label_3">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="maximumSize">
+                  <size>
+                   <width>100</width>
+                   <height>16777215</height>
+                  </size>
+                 </property>
+                 <property name="text">
+                  <string>Max. Width:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="0" column="1">
+                <widget class="QComboBox" name="comboBoxLandscapeX">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="maximumSize">
+                  <size>
+                   <width>100</width>
+                   <height>16777215</height>
+                  </size>
+                 </property>
+                 <property name="editable">
+                  <bool>true</bool>
+                 </property>
+                </widget>
+               </item>
+               <item row="1" column="0">
+                <widget class="QLabel" name="label_4">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="maximumSize">
+                  <size>
+                   <width>100</width>
+                   <height>16777215</height>
+                  </size>
+                 </property>
+                 <property name="text">
+                  <string>Max. Height:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="1" column="1">
+                <widget class="QComboBox" name="comboBoxLandscapeY">
+                 <property name="minimumSize">
+                  <size>
+                   <width>100</width>
+                   <height>0</height>
+                  </size>
+                 </property>
+                 <property name="maximumSize">
+                  <size>
+                   <width>100</width>
+                   <height>16777215</height>
+                  </size>
+                 </property>
+                 <property name="editable">
+                  <bool>true</bool>
+                 </property>
+                </widget>
+               </item>
+              </layout>
              </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer_4">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QFormLayout" name="formLayout_5">
-            <property name="fieldGrowthPolicy">
-             <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
-            </property>
-            <item row="0" column="0">
-             <widget class="QLabel" name="label_10">
-              <property name="minimumSize">
-               <size>
-                <width>100</width>
-                <height>0</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
+            </widget>
+           </item>
+           <item>
+            <widget class="QGroupBox" name="groupBox_3">
+             <property name="minimumSize">
+              <size>
+               <width>150</width>
+               <height>100</height>
+              </size>
+             </property>
+             <property name="maximumSize">
+              <size>
+               <width>150</width>
+               <height>100</height>
+              </size>
+             </property>
+             <property name="title">
+              <string>Square:</string>
+             </property>
+             <widget class="QComboBox" name="comboBoxSquareX">
+              <property name="geometry">
+               <rect>
+                <x>0</x>
+                <y>60</y>
                 <width>100</width>
-                <height>16777215</height>
-               </size>
-              </property>
-              <property name="text">
-               <string>File Pattern:</string>
+                <height>26</height>
+               </rect>
               </property>
-             </widget>
-            </item>
-            <item row="0" column="1">
-             <widget class="QComboBox" name="comboBoxSourcePattern">
               <property name="minimumSize">
                <size>
                 <width>100</width>
                 <height>16777215</height>
                </size>
               </property>
-              <property name="toolTip">
-               <string>A pattern of the source files with wildcards '*' (anything) and '?' (exact one char)</string>
-              </property>
               <property name="editable">
                <bool>true</bool>
               </property>
-              <item>
-               <property name="text">
-                <string notr="true">*.jpg</string>
-               </property>
-              </item>
-              <item>
-               <property name="text">
-                <string notr="true">*.png</string>
-               </property>
-              </item>
-              <item>
-               <property name="text">
-                <string>*.gif</string>
-               </property>
-              </item>
              </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer_3">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <layout class="QFormLayout" name="formLayout_6">
-            <item row="0" column="0">
-             <widget class="QLabel" name="label_11">
-              <property name="minimumSize">
-               <size>
-                <width>100</width>
-                <height>0</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>100</width>
-                <height>16777215</height>
-               </size>
+             <widget class="QLabel" name="label_5">
+              <property name="geometry">
+               <rect>
+                <x>0</x>
+                <y>40</y>
+                <width>141</width>
+                <height>18</height>
+               </rect>
               </property>
               <property name="text">
-               <string>Dest. Type:</string>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="1">
-             <widget class="QComboBox" name="comboBoxDestType">
-              <property name="minimumSize">
-               <size>
-                <width>100</width>
-                <height>0</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>100</width>
-                <height>16777215</height>
-               </size>
+               <string>Max. Width/Height:</string>
               </property>
-              <item>
-               <property name="text">
-                <string notr="true">jpg</string>
-               </property>
-              </item>
-              <item>
-               <property name="text">
-                <string notr="true">png</string>
-               </property>
-              </item>
              </widget>
-            </item>
-           </layout>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="horizontalLayout_6">
-          <item>
-           <widget class="QLabel" name="label_7">
-            <property name="minimumSize">
-             <size>
-              <width>100</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="maximumSize">
-             <size>
-              <width>100</width>
-              <height>16777215</height>
-             </size>
-            </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer_2">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>47</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+          <zorder>groupBox_2</zorder>
+          <zorder>groupBox_3</zorder>
+          <zorder>groupBox</zorder>
+          <zorder>horizontalSpacer_2</zorder>
+         </widget>
+        </widget>
+       </item>
+       <item>
+        <layout class="QGridLayout" name="gridLayout">
+         <item row="0" column="2">
+          <widget class="QLabel" name="label_10">
+           <property name="minimumSize">
+            <size>
+             <width>100</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>100</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>File Pattern:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QComboBox" name="comboBoxQuality">
+           <property name="minimumSize">
+            <size>
+             <width>100</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>100</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="editable">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="4">
+          <widget class="QLabel" name="label_11">
+           <property name="minimumSize">
+            <size>
+             <width>100</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>100</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>Dest. Type:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="5">
+          <widget class="QComboBox" name="comboBoxDestType">
+           <property name="minimumSize">
+            <size>
+             <width>100</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>100</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <item>
             <property name="text">
-             <string>Destination: </string>
+             <string notr="true">jpg</string>
             </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QComboBox" name="comboBoxTarget">
-            <property name="editable">
-             <bool>true</bool>
-            </property>
-            <property name="currentText">
-             <string/>
+           </item>
+           <item>
+            <property name="text">
+             <string notr="true">png</string>
             </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="pushButtonSelectDest">
-            <property name="minimumSize">
-             <size>
-              <width>50</width>
-              <height>0</height>
-             </size>
+           </item>
+          </widget>
+         </item>
+         <item row="0" column="3">
+          <widget class="QComboBox" name="comboBoxSourcePattern">
+           <property name="minimumSize">
+            <size>
+             <width>100</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>100</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>A pattern of the source files with wildcards '*' (anything) and '?' (exact one char)</string>
+           </property>
+           <property name="editable">
+            <bool>true</bool>
+           </property>
+           <item>
+            <property name="text">
+             <string notr="true">*.jpg</string>
             </property>
-            <property name="maximumSize">
-             <size>
-              <width>50</width>
-              <height>16777215</height>
-             </size>
+           </item>
+           <item>
+            <property name="text">
+             <string notr="true">*.png</string>
             </property>
+           </item>
+           <item>
             <property name="text">
-             <string>...</string>
+             <string>*.gif</string>
             </property>
-           </widget>
-          </item>
-         </layout>
-        </item>
-       </layout>
-      </widget>
-     </item>
-     <item>
-      <layout class="QHBoxLayout" name="horizontalLayout_2">
-       <item>
-        <layout class="QVBoxLayout" name="verticalLayout_2">
-         <item>
-          <widget class="QLabel" name="label_8">
+           </item>
+          </widget>
+         </item>
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_6">
+           <property name="minimumSize">
+            <size>
+             <width>100</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>100</width>
+             <height>16777215</height>
+            </size>
+           </property>
            <property name="text">
-            <string>Source Directory (Images):</string>
+            <string>Quality (%)</string>
            </property>
           </widget>
          </item>
+         <item row="0" column="6">
+          <spacer name="horizontalSpacer_3">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
          <item>
-          <layout class="QHBoxLayout" name="horizontalLayout">
+          <layout class="QVBoxLayout" name="verticalLayout_2">
            <item>
-            <widget class="QComboBox" name="comboBoxSourceDir">
-             <property name="editable">
-              <bool>true</bool>
-             </property>
-             <property name="currentText">
-              <string>/tmp/img</string>
+            <widget class="QLabel" name="label_8">
+             <property name="text">
+              <string>Source Directory (Images):</string>
              </property>
             </widget>
            </item>
            <item>
-            <widget class="QPushButton" name="pushButtonSelectSource">
+            <layout class="QHBoxLayout" name="horizontalLayout">
+             <item>
+              <widget class="QComboBox" name="comboBoxSourceDir">
+               <property name="editable">
+                <bool>true</bool>
+               </property>
+               <property name="currentText">
+                <string>/tmp/img</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pushButtonSelectSource">
+               <property name="maximumSize">
+                <size>
+                 <width>30</width>
+                 <height>16777215</height>
+                </size>
+               </property>
+               <property name="toolTip">
+                <string>Auswahldialog</string>
+               </property>
+               <property name="text">
+                <string>...</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_5">
+           <item>
+            <widget class="QLabel" name="label_7">
+             <property name="minimumSize">
+              <size>
+               <width>100</width>
+               <height>0</height>
+              </size>
+             </property>
              <property name="maximumSize">
               <size>
-               <width>30</width>
+               <width>100</width>
                <height>16777215</height>
               </size>
              </property>
-             <property name="toolTip">
-              <string>Auswahldialog</string>
-             </property>
              <property name="text">
-              <string>...</string>
+              <string>Destination: </string>
              </property>
             </widget>
            </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_6">
+             <item>
+              <widget class="QComboBox" name="comboBoxTarget">
+               <property name="editable">
+                <bool>true</bool>
+               </property>
+               <property name="currentText">
+                <string/>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pushButtonSelectDest">
+               <property name="minimumSize">
+                <size>
+                 <width>50</width>
+                 <height>0</height>
+                </size>
+               </property>
+               <property name="maximumSize">
+                <size>
+                 <width>50</width>
+                 <height>16777215</height>
+                </size>
+               </property>
+               <property name="text">
+                <string>...</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
           </layout>
          </item>
         </layout>
        </item>
        <item>
-        <layout class="QVBoxLayout" name="verticalLayout_5">
-         <item>
-          <spacer name="verticalSpacer">
-           <property name="orientation">
-            <enum>Qt::Vertical</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>20</width>
-             <height>40</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
+        <layout class="QHBoxLayout" name="horizontalLayout_7">
          <item>
           <widget class="QPushButton" name="pushButtonConvert">
            <property name="minimumSize">
            </property>
           </widget>
          </item>
+         <item>
+          <spacer name="horizontalSpacer_4">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
          <item>
           <widget class="QPushButton" name="pushButtonStop">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
            <property name="minimumSize">
             <size>
              <width>150</width>
          </item>
         </layout>
        </item>
+       <item>
+        <widget class="QListWidget" name="listWidget"/>
+       </item>
       </layout>
-     </item>
-     <item>
-      <widget class="QListWidget" name="listWidget"/>
-     </item>
-    </layout>
-    <zorder>listWidget</zorder>
-    <zorder>groupBox_4</zorder>
-    <zorder>tabWidget</zorder>
-   </widget>
+      <zorder>listWidget</zorder>
+      <zorder>tabWidget</zorder>
+      <zorder></zorder>
+     </widget>
+    </item>
+   </layout>
   </widget>
   <widget class="QMenuBar" name="menuBar">
    <property name="geometry">
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>799</width>
-     <height>23</height>
+     <width>823</width>
+     <height>26</height>
     </rect>
    </property>
    <widget class="QMenu" name="menu_File">
     <property name="title">
      <string>&amp;File</string>
     </property>
-    <addaction name="actionConvert"/>
+    <addaction name="actionStart"/>
     <addaction name="actionStop"/>
     <addaction name="separator"/>
     <addaction name="actionSelectSource"/>
    <attribute name="toolBarBreak">
     <bool>false</bool>
    </attribute>
-   <addaction name="actionConvert"/>
+   <addaction name="actionStart"/>
    <addaction name="actionStop"/>
   </widget>
   <widget class="QStatusBar" name="statusBar"/>
     <bool>false</bool>
    </attribute>
   </widget>
-  <action name="actionConvert">
+  <action name="actionStart">
    <property name="icon">
     <iconset resource="reimgconvert.qrc">
      <normaloff>:/main/icons/action_go.png</normaloff>:/main/icons/action_go.png</iconset>
    </property>
   </action>
   <action name="actionStop">
+   <property name="enabled">
+    <bool>false</bool>
+   </property>
    <property name="icon">
     <iconset resource="reimgconvert.qrc">
      <normaloff>:/main/icons/cancel.png</normaloff>:/main/icons/cancel.png</iconset>
index 03d87e6f825030231f5e797a98c5ee4969739780..d2d7863da9a490b704058e1cb2250e5ea8de008c 100644 (file)
@@ -15,17 +15,19 @@ INCLUDEPATH = ../.. /usr/include/c++/4.9
 
 SOURCES += main.cpp\
         ../../base/ReException.cpp \
-        ../../base/ReQStringUtil.cpp \
+        ../../base/ReQStringUtils.cpp \
+        ../../base/ReFileUtils.cpp \
         ../../base/ReLogger.cpp \
         ../../gui/ReStateStorage.cpp \
         ../../gui/ReGuiValidator.cpp \
+        ../../gui/ReGuiQueue.cpp \
         mainwindow.cpp \
         converter.cpp \
         aboutdialog.cpp
 
 HEADERS  += mainwindow.hpp \
         ../../base/rebase.hpp \
-        ../../base/ReQStringUtil.hpp \
+        ../../base/ReQStringUtils.hpp \
         ../../gui/ReStateStorage.hpp \
         ../../gui/ReGuiValidator.hpp \
         ../../gui/regui.hpp \
index 464806e73f21ae73c871c9d52491198ba550b410..74f75173b42b17c969eaa4a4eddc91d71f3879e5 100644 (file)
@@ -72,6 +72,7 @@ typedef QString ReString;
 #define _mkdir(path) mkdir(path, -1)
 #define _rmdir rmdir
 #define _unlink unlink
+typedef qint64 uint64_t;
 #else
 #define _strcasecmp _stricmp
 #define OS_SEPARATOR '\\'
index fd76ecd22fc8a9ffeb7ede444e36cb40e6853c1d..9186a17ac68cc3eea2b590bdfd8f41a7a705a691 100644 (file)
@@ -15,7 +15,8 @@
 class ReGuiQueueItem {
 public:
        enum WidgetType {
-               Undef, LabelText, NewTableRow, LogMessage, ReadyMessage,
+               Undef, LabelText, NewTableRow, ListEnd,
+               LogMessage, ReadyMessage,
                UserDefined1, UserDefined2
        };
 
@@ -33,7 +34,7 @@ public:
         * @param widget        NULL or the widget
         * @param value         the value to set
         */
-       ReGuiQueueItem(WidgetType type, QWidget* widget, const QString value) :
+       ReGuiQueueItem(WidgetType type, QWidget* widget, const QString& value) :
                m_type(type),
                m_widget(widget),
                m_value(value){