]> gitweb.hamatoma.de Git - reqt/commitdiff
rebackgui + reimgconvert
authorHamatoma <hamatoma@gmx.de>
Tue, 4 Oct 2016 21:26:36 +0000 (23:26 +0200)
committerHamatoma <hamatoma@gmx.de>
Tue, 4 Oct 2016 21:26:36 +0000 (23:26 +0200)
* rebackgui:
** Button "Make first"
* reimgconvert:
** check of the input fields
** target dir is ignored in source tree
** translations completed

appl/rebackgui/mainwindow.cpp
appl/rebackgui/mainwindow.hpp
appl/rebackgui/mainwindow.ui
appl/reimgconvert/converter.cpp
appl/reimgconvert/converter.hpp
appl/reimgconvert/mainwindow.cpp
appl/reimgconvert/mainwindow.hpp
appl/reimgconvert/mainwindow.ui
appl/reimgconvert/reimgconvert.de.qm
appl/reimgconvert/reimgconvert.de.ts
base/ReFileUtils.cpp

index a172085033c3428f66f5579164aed2d70f80e0ad..da6b02f9309e697b9dc6afa8afec9a527e1f481f 100644 (file)
@@ -223,6 +223,8 @@ void MainWindow::initializeGui(){
        connect(ui->pushButtonStop, SIGNAL(clicked()), this, SLOT(onStop()));
        connect(ui->pushButtonAddItem, SIGNAL(clicked()), this, SLOT(onAddItem()));
        connect(ui->pushButtonDeleteItem, SIGNAL(clicked()), this, SLOT(onDeleteItem()));
+       connect(ui->pushButtonMakeFirst, SIGNAL(clicked()), this, SLOT(onMakeFirst()));
+
        connect(ui->pushButtonAddSource, SIGNAL(clicked()), this, SLOT(onAddSource()));
        connect(ui->pushButtonDeleteSource, SIGNAL(clicked()), this, SLOT(onDeleteSource()));
        connect(ui->pushButtonSelectTarget, SIGNAL(clicked()), this, SLOT(onSelectTarget()));
@@ -617,6 +619,31 @@ void MainWindow::onLoadConfig(){
        m_configuration.load("");
        updateTable();
 }
+
+/**
+ * Swaps the current item with the first item.
+ */
+void MainWindow::onMakeFirst()
+{
+       int row = ui->tableWidgetConfiguration->selectionModel()->currentIndex().row();
+       if (row == 0){
+               say(LOG_WARNING, "That's already the first entry. I do nothing");
+       } else if (row > 0){
+               BackupItem current = m_configuration.items()[row];
+               BackupItem currentFirst = m_configuration.items()[0];
+               currentFirst.m_no = row + 1;
+               current.m_no = 1;
+               m_configuration.items()[0] = current;
+               m_configuration.items()[row] = currentFirst;
+               m_configuration.check();
+               updateTable();
+               updateItem(0);
+               updateItem(row);
+               if (ui->checkBoxAutoSave->isChecked())
+                       onSaveConfig();
+       }
+}
+
 /**
  * Loads the configuration file.
  */
index ffc2893eed49edfecf8d4a10ea58c6ba6b02b464..e86a9a07b78bc7c0300021604021dcd2e2c094a6 100644 (file)
@@ -73,6 +73,7 @@ private slots:
    void onGerman();
    virtual void onGuiTimerUpdate();
    virtual void onLanguageChange();
+   void onMakeFirst();
    void onSaveConfig();
    void onStart();
    void onSelectionChanged(const QItemSelection& prior, const QItemSelection& later);
index 5bbe0794c061f8efb00a0b7423c81467ed47b319..f70c23777c235cbc766ab1f8afc54cd09208fdcf 100644 (file)
                 </property>
                </widget>
               </item>
+              <item>
+               <widget class="QPushButton" name="pushButtonMakeFirst">
+                <property name="minimumSize">
+                 <size>
+                  <width>125</width>
+                  <height>0</height>
+                 </size>
+                </property>
+                <property name="text">
+                 <string>Make first</string>
+                </property>
+               </widget>
+              </item>
               <item>
                <spacer name="horizontalSpacer_9">
                 <property name="orientation">
index 0f391a0ba3d813252f5cc043299d758fe85b6f45..03a25dac82c23917ec337f3084420140af72f0b7 100644 (file)
@@ -489,7 +489,10 @@ void TaskConverter::run(){
                        + exc.message());
    }
    preSize = max(1LL, preSize);
-   msg = QObject::tr("%1 of %2 file(s) converted, %3 -> %4 (%5 %), duration: %6")
+   if (m_totalFiles == 0)
+       msg = QObject::tr("0 files converted");
+   else
+       msg = QObject::tr("%1 of %2 file(s) converted, %3 -> %4 (%5 %), duration: %6")
                   .arg(no).arg(m_totalFiles)
                   .arg(ReQStringUtils::readableSize(preSize))
                        .arg(ReQStringUtils::readableSize(postSize))
@@ -501,16 +504,21 @@ void TaskConverter::run(){
 /**
  * Constructor.
  *
+ * @param target        the target directory which must be ignored as source
  * @param directory            the base directory to inspect
  * @param sourcePattern        the pattern of the image files to convert
  * @param mainWindow   the parent
  */
-TaskSearch::TaskSearch(const QString& directory,
+TaskSearch::TaskSearch(const QString& target, const QString& directory,
    const QString& sourcePattern, bool recursive, MainWindow* mainWindow) :
        Converter(directory, mainWindow),
        m_sourcePattern(sourcePattern),
-       m_recursive(recursive)
+    m_target(),
+    m_recursive(recursive),
+    m_mainWindow(mainWindow)
 {
+    QFileInfo info(target);
+    m_target = info.canonicalFilePath();
 }
 
 /**
@@ -521,41 +529,47 @@ TaskSearch::TaskSearch(const QString& directory,
  * @param dir  the directory to inspect
  */
 void TaskSearch::processOneDirectory(const QString& dir){
-       QDirIterator it(dir);
-       QRegExp regExpr(m_sourcePattern, Qt::CaseInsensitive, QRegExp::Wildcard);
-       QString relPath;
-       QString info;
-       if (dir.length() > m_sourceDir.length()){
-               relPath = dir.mid(m_sourceDir.length() + 1) + OS_SEPARATOR_STR;
-       }
-       while (it.hasNext()){
-          if (m_shouldStop){
-                 break;
-          }
-          it.next();
-          if (! it.fileInfo().isDir() && regExpr.indexIn(it.fileName()) >= 0){
-                  info = relPath + "\t" + it.fileName();
-                  m_mutex.lock();
-                  m_files.append(info);
-                  m_totalFiles++;
-                  m_totalBytes += it.fileInfo().size();
-                  m_mutex.unlock();
-          }
-       }
-       if (m_recursive && ! m_shouldStop){
-               QDirIterator it2(dir);
-               QString node;
-               while (it2.hasNext()){
-                       if (m_shouldStop){
-                          break;
-                       }
-                  it2.next();
+    QFileInfo info(dir);
+    if (info.canonicalFilePath() == m_target){
+        m_mainWindow->log(QObject::tr("target directory ignored as source:")
+                          + " " + info.canonicalFilePath());
+    } else {
+        QDirIterator it(dir);
+        QRegExp regExpr(m_sourcePattern, Qt::CaseInsensitive, QRegExp::Wildcard);
+        QString relPath;
+        QString info;
+        if (dir.length() > m_sourceDir.length()){
+            relPath = dir.mid(m_sourceDir.length() + 1) + OS_SEPARATOR_STR;
+        }
+        while (it.hasNext()){
+           if (m_shouldStop){
+              break;
+           }
+           it.next();
+           if (! it.fileInfo().isDir() && regExpr.indexIn(it.fileName()) >= 0){
+               info = relPath + "\t" + it.fileName();
+               m_mutex.lock();
+               m_files.append(info);
+               m_totalFiles++;
+               m_totalBytes += it.fileInfo().size();
+               m_mutex.unlock();
+           }
+        }
+        if (m_recursive && ! m_shouldStop){
+            QDirIterator it2(dir);
+            QString node;
+            while (it2.hasNext()){
+                if (m_shouldStop){
+                   break;
+                }
+               it2.next();
 
-                  if (it2.fileInfo().isDir() && (node = it2.fileName()) != "." && node != ".."){
-                          processOneDirectory(it2.filePath());
-                  }
-               }
-       }
+               if (it2.fileInfo().isDir() && (node = it2.fileName()) != "." && node != ".."){
+                   processOneDirectory(it2.filePath());
+               }
+            }
+        }
+    }
 }
 
 /**
index 733c001537f491eb1349c4333a73c85efe5498d4..a2e3224aefb0b6636a2ead368f4305eb6aa0f996 100644 (file)
@@ -104,15 +104,18 @@ private:
 
 class TaskSearch : public Converter {
 public:
-       TaskSearch(const QString& dir, const QString& sourcePattern,
-                          bool recursive, MainWindow* mainWindows);
+    TaskSearch(const QString& target, const QString& dir,
+               const QString& sourcePattern,
+               bool recursive, MainWindow* mainWindow);
 protected:
        virtual void run();
 protected:
    void processOneDirectory(const QString& dir);
 private:
    QString m_sourcePattern;
+   QString m_target;
    bool m_recursive;
+   MainWindow* m_mainWindow;
 };
 
 class TaskShowOther : public Converter {
index a42dd264962b4396cbae1f2e05287c4ef6618784..40409cc409a1873a855e7b666070efb5d71ebb48 100644 (file)
@@ -15,7 +15,7 @@
 #include "ui_mainwindow.h"
 #include "aboutdialog.hpp"
 
-const QString VERSION("2016.06.26");
+const QString VERSION("2016.10.04");
 
 /** @class MainWindow mainwindow.hpp "mainwindow.hpp"
  *
@@ -93,6 +93,63 @@ void MainWindow::onAboutToQuit(){
        saveState();
 }
 
+/**
+ * Tests whether the parameter for execution are complete.
+ *
+ * @return <code>true</code>no error
+ */
+bool MainWindow::checkArguments()
+{
+    bool rc = false;
+    if (ui->tabWidget->currentIndex() == TAB_QUICK){
+        if (ui->comboBoxMaxHeight->currentText().isEmpty())
+            error(tr("missing maximal height"));
+        else if (ui->comboBoxMaxWidth->currentText().isEmpty())
+            error(tr("missing maximal width"));
+        else
+            rc = true;
+    } else {
+        if (ui->comboBoxLandscapeX->currentText().isEmpty()
+                && ui->comboBoxLandscapeY->currentText().isEmpty())
+            error(tr("missing data of landscape format: define maximal width or maximal height"));
+        else if (ui->comboBoxPortraitX->currentText().isEmpty()
+                 && ui->comboBoxPortraitY->currentText().isEmpty())
+            error(tr("missing data of portrait format: define maximal width or maximal height"));
+        else if (ui->comboBoxSquareX->currentText().isEmpty())
+            error(tr("missing data of square format: define maximal width/height"));
+        else
+            rc = true;
+    }
+    if (rc){
+        rc = false;
+        QString source = ui->comboBoxSourceDir->currentText();
+        QFileInfo info(source);
+        QString canonicalSource = info.canonicalFilePath();
+        QString target = ui->comboBoxTargetDir->currentText();
+        QFileInfo infoTarget(target);
+        QString canonicalTarget = infoTarget.canonicalFilePath();
+        if (source.isEmpty())
+            error (tr("missing source directory"));
+        else if (! ReFileUtils::isAbsolutPath(source))
+            error (tr("source is not an absolute directory name:") + " " + source);
+        else if (! QFileInfo::exists(canonicalSource))
+            error(tr("source directory does not exist:") + " " + canonicalSource);
+        else if (! info.isDir())
+            error(tr("source is not a directory:") + " " + source);
+        else if (target.isEmpty())
+            error (tr("missing target directory"));
+        else if (! ReFileUtils::isAbsolutPath(target))
+            error (tr("target is not an absolute directory name:") + " " + target);
+        else if (QFileInfo::exists(canonicalTarget) && ! infoTarget.isDir())
+            error(tr("target is not a directory:") + " " + target);
+        else if (canonicalSource == canonicalTarget)
+            error(tr("target is the same as the source:") + " " + canonicalSource);
+        else
+            rc = true;
+    }
+    return rc;
+}
+
 /**
  * Clears the table.
  */
@@ -173,38 +230,50 @@ bool MainWindow::log(const QString& message){
  * @brief Handles the button click on "convert".
  */
 void MainWindow::onConvert(){
-       Converter::m_shouldStop = false;
-       startStop(true);
-   m_errors = 0;
-   int landscapeX = comboInt(ui->comboBoxLandscapeX, 0, "*", 0);
-   int landscapeY = comboInt(ui->comboBoxLandscapeY, 0, "*", 0);
-   int portraitX = comboInt(ui->comboBoxPortraitX, 0, "*", 0);
-   int portraitY = comboInt(ui->comboBoxPortraitY, 0, "*", 0);
-   int squareX = comboInt(ui->comboBoxSquareX, 0);
-   int quality = comboInt(ui->comboBoxQuality, 75);
-   int maxWidth = comboInt(ui->comboBoxMaxWidth, 0);
-   int maxHeight = comboInt(ui->comboBoxMaxHeight, 0);
-   QRegularExpressionMatch match = QRegularExpression("\\dx\\d").match(
-                          ui->comboBoxTemplate->currentText());
-   bool simpleConversion = match.hasMatch();
-   if (m_errors == 0){
-          saveState();
-          delete m_taskSearch;
-          m_taskSearch = new TaskSearch(ui->comboBoxSourceDir->currentText(),
-                               ui->comboBoxSourcePattern->currentText(),
-                               ui->checkBoxRecursive->isChecked(), this);
-          m_taskSearch->start();
+    if (checkArguments()){
+        Converter::m_shouldStop = false;
+        startStop(true);
+       m_errors = 0;
+       int landscapeX, landscapeY, portraitX, portraitY, squareX;
+       int quality, maxWidth, maxHeight;
+       bool simpleConversion = ui->tabWidget->currentIndex() == TAB_QUICK;
+       if (simpleConversion){
+           portraitX = landscapeX = 0;
+           portraitY = landscapeY = 0;
+           squareX = 0;
+           quality = comboInt(ui->comboBoxQuality, 75);
+           maxWidth = comboInt(ui->comboBoxMaxWidth, 0);
+           maxHeight = comboInt(ui->comboBoxMaxHeight, 0);
+       } else {
+           landscapeX = comboInt(ui->comboBoxLandscapeX, 0, "*", 0);
+           landscapeY = comboInt(ui->comboBoxLandscapeY, 0, "*", 0);
+           portraitX = comboInt(ui->comboBoxPortraitX, 0, "*", 0);
+           portraitY = comboInt(ui->comboBoxPortraitY, 0, "*", 0);
+           squareX = comboInt(ui->comboBoxSquareX, 0);
+           quality = comboInt(ui->comboBoxQuality, 75);
+           maxWidth = 0;
+           maxHeight = 0;
+       }
+       if (m_errors == 0){
+           saveState();
+           delete m_taskSearch;
+           m_taskSearch = new TaskSearch(ui->comboBoxTargetDir->currentText(),
+                    ui->comboBoxSourceDir->currentText(),
+                    ui->comboBoxSourcePattern->currentText(),
+                    ui->checkBoxRecursive->isChecked(), this);
+           m_taskSearch->start();
 
-          delete m_taskConvert;
-         m_taskConvert = new TaskConverter(ui->comboBoxSourceDir->currentText(),
-                ui->comboBoxTargetDir->currentText(),
-                ui->comboBoxSourcePattern->currentText(),
-                ui->comboBoxDestType->currentText(),
-               simpleConversion, maxWidth, maxHeight,
-               landscapeX, landscapeY, portraitX,
-                portraitY, squareX, quality, this);
-          m_taskConvert->start();
-   }
+           delete m_taskConvert;
+          m_taskConvert = new TaskConverter(ui->comboBoxSourceDir->currentText(),
+             ui->comboBoxTargetDir->currentText(),
+             ui->comboBoxSourcePattern->currentText(),
+             ui->comboBoxDestType->currentText(),
+            simpleConversion, maxWidth, maxHeight,
+            landscapeX, landscapeY, portraitX,
+             portraitY, squareX, quality, this);
+           m_taskConvert->start();
+       }
+    }
 }
 
 /**
index 4e1cfaece0253862eb450f4f1ab0195f5e30502f..b58a23d180b70cf71bd9355b738f1c98f595bd9b 100644 (file)
@@ -27,7 +27,8 @@ class MainWindow: public ReGuiApplication,
    public ReGuiValidator,
    public ConvertLogger {
    Q_OBJECT
-
+public:
+    enum { TAB_QUICK, TAB_DETAIL };
 public:
    explicit MainWindow(QApplication& application, const QString& homeDir, QWidget *parent = 0);
    ~MainWindow();
@@ -39,6 +40,7 @@ public:
 public:
    virtual bool say(ReLoggerLevel level, const QString& message);
 private:
+   bool checkArguments();
    void restoreState();
    void saveState();
    void setMaxDimensions(int maxWidth, int maxHeight);public slots:
index 0e7cc7512e8360ebddbe2c6db9adfc4cbb967774..c8087bcae0577149ba12f97ec020646524c786a2 100644 (file)
@@ -48,7 +48,7 @@
           <x>11</x>
           <y>11</y>
           <width>561</width>
-          <height>30</height>
+          <height>38</height>
          </rect>
         </property>
         <layout class="QHBoxLayout" name="horizontalLayout_4">
           <x>13</x>
           <y>62</y>
           <width>560</width>
-          <height>30</height>
+          <height>38</height>
          </rect>
         </property>
         <layout class="QHBoxLayout" name="horizontalLayout_9">
            <property name="editable">
             <bool>true</bool>
            </property>
+           <property name="currentText">
+            <string notr="true">1024</string>
+           </property>
           </widget>
          </item>
          <item>
            <property name="editable">
             <bool>true</bool>
            </property>
+           <property name="currentText">
+            <string notr="true">768</string>
+           </property>
           </widget>
          </item>
          <item>
              <x>2</x>
              <y>30</y>
              <width>234</width>
-             <height>65</height>
+             <height>81</height>
             </rect>
            </property>
            <layout class="QFormLayout" name="formLayout">
               <property name="editable">
                <bool>true</bool>
               </property>
+              <property name="currentText">
+               <string notr="true"/>
+              </property>
              </widget>
             </item>
             <item row="1" column="0">
               <property name="editable">
                <bool>true</bool>
               </property>
+              <property name="currentText">
+               <string notr="true"/>
+              </property>
              </widget>
             </item>
            </layout>
              <x>3</x>
              <y>31</y>
              <width>234</width>
-             <height>65</height>
+             <height>81</height>
             </rect>
            </property>
            <layout class="QFormLayout" name="formLayout_2">
               <property name="editable">
                <bool>true</bool>
               </property>
+              <property name="currentText">
+               <string notr="true"/>
+              </property>
              </widget>
             </item>
             <item row="1" column="0">
               <property name="editable">
                <bool>true</bool>
               </property>
+              <property name="currentText">
+               <string notr="true"/>
+              </property>
              </widget>
             </item>
            </layout>
            <property name="editable">
             <bool>true</bool>
            </property>
+           <property name="currentText">
+            <string notr="true"/>
+           </property>
           </widget>
           <widget class="QLabel" name="label_5">
            <property name="geometry">
         <property name="editable">
          <bool>true</bool>
         </property>
+        <property name="currentText">
+         <string notr="true">80</string>
+        </property>
        </widget>
       </item>
       <item>
         <property name="editable">
          <bool>true</bool>
         </property>
+        <property name="currentText">
+         <string notr="true">*.jpg</string>
+        </property>
         <item>
          <property name="text">
           <string notr="true">*.jpg</string>
              <bool>true</bool>
             </property>
             <property name="currentText">
-             <string/>
+             <string notr="true"/>
             </property>
            </widget>
           </item>
      <x>0</x>
      <y>0</y>
      <width>958</width>
-     <height>26</height>
+     <height>30</height>
     </rect>
    </property>
    <widget class="QMenu" name="menu_File">
index 864e62c08339c1d9980e8f855fd7bb62fc0d740e..7601e7779f141479fff9fcea47c161d71b7f67dc 100644 (file)
Binary files a/appl/reimgconvert/reimgconvert.de.qm and b/appl/reimgconvert/reimgconvert.de.qm differ
index 48e02793559fc138d33cb9b7ffe42890a1948f2d..240cdb06c17e80a31737cbe451417c71b42ac2e4 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS version="2.1" language="de_DE">
+<TS version="2.0" language="de_DE">
 <context>
     <name>AboutDialog</name>
     <message>
@@ -98,240 +98,310 @@ p, li { white-space: pre-wrap; }
     </message>
     <message>
         <location filename="mainwindow.ui" line="159"/>
-        <location filename="mainwindow.ui" line="283"/>
-        <location filename="mainwindow.ui" line="390"/>
+        <location filename="mainwindow.ui" line="289"/>
+        <location filename="mainwindow.ui" line="402"/>
         <source>Max. Width:</source>
         <translation>Max. Breite:</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="197"/>
-        <location filename="mainwindow.ui" line="321"/>
-        <location filename="mainwindow.ui" line="428"/>
+        <location filename="mainwindow.ui" line="200"/>
+        <location filename="mainwindow.ui" line="330"/>
+        <location filename="mainwindow.ui" line="443"/>
         <source>Max. Height:</source>
         <translation>Max. Höhe:</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="238"/>
+        <location filename="mainwindow.ui" line="244"/>
         <source>Dimensions (separated)</source>
         <translation>Auflösung (getrennt)</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="256"/>
+        <location filename="mainwindow.ui" line="262"/>
         <source>Portrait:</source>
         <translation>Hochformat:</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="363"/>
+        <location filename="mainwindow.ui" line="375"/>
         <source>Landscape:</source>
         <translation>Breitformat:</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="470"/>
+        <location filename="mainwindow.ui" line="488"/>
         <source>Square:</source>
         <translation>Quadrat:</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="507"/>
+        <location filename="mainwindow.ui" line="528"/>
         <source>Max. Width/Height:</source>
         <translation>Max. Breite/Höhe:</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="550"/>
+        <location filename="mainwindow.ui" line="571"/>
         <source>Quality (%):</source>
         <translation>Qualität (%):</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="569"/>
+        <location filename="mainwindow.ui" line="590"/>
         <source>Quality of the image. Only relevant for *.jpg</source>
         <translation>Qualität des Bildes. Nur relevant für *.jpg</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="591"/>
+        <location filename="mainwindow.ui" line="615"/>
         <source>File Pattern:</source>
         <translation>Dateimuster:</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="610"/>
+        <location filename="mainwindow.ui" line="634"/>
         <source>A pattern of the source files with wildcards &apos;*&apos; (anything) and &apos;?&apos; (exact one char)</source>
         <translation>Ein Muster der Quelldateien mit Joker &apos;*&apos; (beliebiger String) und &apos;?&apos; (genau ein Zeichen)</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="647"/>
+        <location filename="mainwindow.ui" line="674"/>
         <source>Dest. Type:</source>
         <translation>Zieldateityp:</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="702"/>
+        <location filename="mainwindow.ui" line="729"/>
         <source>Source Directory (Images):</source>
         <translation>Quellverzeichnis (der Bilddateien):</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="761"/>
+        <location filename="mainwindow.ui" line="788"/>
         <source>Destination: </source>
         <translation>Ziel:</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="770"/>
+        <location filename="mainwindow.ui" line="797"/>
         <source>The converted files will built here</source>
         <translation>Die konvertierten Dateien werden hier erstellt</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="822"/>
+        <location filename="mainwindow.ui" line="849"/>
         <source>Process the subdirectories too</source>
         <translation>Auch Unterverzeichnisse werden behandelt</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="825"/>
+        <location filename="mainwindow.ui" line="852"/>
         <source>Recursive</source>
         <translation>Rekursiv</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="841"/>
+        <location filename="mainwindow.ui" line="868"/>
         <source>Files not matching the file pattern will be copied too (and not ignored)</source>
         <translation>Dateien, die nicht auf das Dateimuster passen werden auch kopiert (und nicht ignoriert)</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="844"/>
+        <location filename="mainwindow.ui" line="871"/>
         <source>Copy other files</source>
         <translation>Kopiere andere Dateien</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="870"/>
+        <location filename="mainwindow.ui" line="897"/>
         <source>Show other files</source>
         <translation>Zeige andere Dateien</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="896"/>
+        <location filename="mainwindow.ui" line="923"/>
         <source>Converts the images</source>
         <translation>Konvertiere die Bilder</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="899"/>
+        <location filename="mainwindow.ui" line="926"/>
         <source>&amp;Convert</source>
         <translation>Konvertiere</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="932"/>
-        <location filename="mainwindow.ui" line="1167"/>
+        <location filename="mainwindow.ui" line="959"/>
+        <location filename="mainwindow.ui" line="1194"/>
         <source>Clears the list</source>
         <translation>Löscht die Liste</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="935"/>
-        <location filename="mainwindow.ui" line="1164"/>
+        <location filename="mainwindow.ui" line="962"/>
+        <location filename="mainwindow.ui" line="1191"/>
         <source>C&amp;lear</source>
         <translation>&amp;Löschen</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="973"/>
+        <location filename="mainwindow.ui" line="1000"/>
         <source>Stops the conversion</source>
         <translation>Hält die Konversion an</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="976"/>
+        <location filename="mainwindow.ui" line="1003"/>
         <source>&amp;Stop</source>
         <translation>Halt</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="1005"/>
+        <location filename="mainwindow.ui" line="1032"/>
         <source>&amp;File</source>
         <translation>Datei</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="1020"/>
+        <location filename="mainwindow.ui" line="1047"/>
         <source>&amp;Help</source>
         <translation>&amp;Hilfe</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="1060"/>
+        <location filename="mainwindow.ui" line="1087"/>
         <source>toolBar_2</source>
         <translation></translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="1075"/>
+        <location filename="mainwindow.ui" line="1102"/>
         <source>Convert</source>
         <translation>Konvertiere</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="1078"/>
+        <location filename="mainwindow.ui" line="1105"/>
         <source>Converts all images from the source directory into the target directory</source>
         <translation>Konvertiert alle Bilder vom Quellverzeichnis ins Zielverzeichnis</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="730"/>
-        <location filename="mainwindow.ui" line="1093"/>
+        <location filename="mainwindow.ui" line="757"/>
+        <location filename="mainwindow.ui" line="1120"/>
         <source>Select the source directory</source>
         <translation>Wahl eines Quellverzeichnis</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="1105"/>
+        <location filename="mainwindow.ui" line="1132"/>
         <source>Select Destination</source>
         <translation>Wahl des Zielverzeichnisses</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="795"/>
-        <location filename="mainwindow.ui" line="1108"/>
+        <location filename="mainwindow.ui" line="822"/>
+        <location filename="mainwindow.ui" line="1135"/>
         <source>Select the destination directory</source>
         <translation>Wahl des Zielverzeichnisses</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="666"/>
+        <location filename="mainwindow.ui" line="693"/>
         <source>The target images will have this format (and file extension)</source>
         <translation>Die Zielbilder werden in diesem Format (und mit dieser Dateiendung) gespeichert</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="711"/>
+        <location filename="mainwindow.ui" line="738"/>
         <source>The files will fetched from here</source>
         <translation>Die Bilder werden von hier geholt</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="1123"/>
+        <location filename="mainwindow.ui" line="1117"/>
+        <source>Select Source</source>
+        <translation>Wähle Quelle</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.ui" line="1150"/>
         <source>Sto&amp;p</source>
         <translation>Halt</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="1126"/>
+        <location filename="mainwindow.ui" line="1153"/>
         <source>Stopps the conversion</source>
         <translation>Hält die Konversion an</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="1138"/>
+        <location filename="mainwindow.ui" line="1165"/>
         <source>&amp;Exit</source>
         <translation>B&amp;enden</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="1141"/>
+        <location filename="mainwindow.ui" line="1168"/>
         <source>Terminates the program</source>
         <translation>Beendet das Program</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="1153"/>
+        <location filename="mainwindow.ui" line="1180"/>
         <source>&amp;About</source>
         <translation>Über</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="1156"/>
+        <location filename="mainwindow.ui" line="1183"/>
         <source>Info about the program</source>
         <translation>Information über das Program</translation>
     </message>
     <message>
-        <location filename="mainwindow.ui" line="1144"/>
+        <location filename="mainwindow.ui" line="1171"/>
         <source>Ctrl+Shift+X</source>
         <oldsource>Ctrl+Shift+A</oldsource>
-        <translation type="unfinished"></translation>
+        <translation>Ctrl+Shift+X</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="106"/>
+        <source>missing maximal height</source>
+        <translation>Maximale Höhe nicht eingetragen</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="108"/>
+        <source>missing maximal width</source>
+        <translation>Maximale Breite nicht eingetragen</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="114"/>
+        <source>missing data of landscape format: define maximal width or maximal height</source>
+        <translation>Vermisse Angabe im Breitformat: definiere maximale Breite oder maximale Höhe</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="117"/>
+        <source>missing data of portrait format: define maximal width or maximal height</source>
+        <translation>Vermisse Angabe im Hochformat: definiere maximale Breite oder maximale Höhe</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="119"/>
+        <source>missing data of square format: define maximal width/height</source>
+        <translation>Vermisse Angabe im Quadratformat: definiere maximale Breite / Höhe</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="132"/>
+        <source>missing source directory</source>
+        <translation>Quellverzeichnis nicht angegeben</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="134"/>
+        <source>source is not an absolute directory name:</source>
+        <translation>Die Quelle hat keinen absoluten Verzeichnisnamen:</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="136"/>
+        <source>source directory does not exist:</source>
+        <translation>Das Quellverzeichnis existiert nicht:</translation>
     </message>
     <message>
-        <location filename="mainwindow.cpp" line="223"/>
+        <location filename="mainwindow.cpp" line="138"/>
+        <source>source is not a directory:</source>
+        <translation>Die Quelle ist kein Verzeichnis:</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="140"/>
+        <source>missing target directory</source>
+        <translation>Zielverzeichnis nicht angegeben</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="142"/>
+        <source>target is not an absolute directory name:</source>
+        <translation>Das Ziel hat keinen absoluten Verzeichnisnamen:</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="144"/>
+        <source>target is not a directory:</source>
+        <translation>Das Ziel ist kein Verzeichnis:</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="146"/>
+        <source>target is the same as the source:</source>
+        <translation>Das Ziel ist das gleiche Verzeichnis wie die Quelle:</translation>
+    </message>
+    <message>
+        <location filename="mainwindow.cpp" line="293"/>
         <source>Select Source Directory</source>
         <translation>Wahl des Quellverzeichnisses</translation>
     </message>
     <message>
-        <location filename="mainwindow.cpp" line="280"/>
+        <location filename="mainwindow.cpp" line="350"/>
         <source>Reading data from </source>
         <translation>Daten werden gelesen von </translation>
     </message>
     <message>
-        <location filename="mainwindow.cpp" line="367"/>
+        <location filename="mainwindow.cpp" line="437"/>
         <source>Select Destination Directory</source>
         <translation>Wahl des Zielverzeichnisses</translation>
     </message>
@@ -353,48 +423,75 @@ Erwartet: %2</translation>
         <translation>Ausführung wegen Fehler angehalten</translation>
     </message>
     <message>
-        <location filename="converter.cpp" line="492"/>
+        <location filename="converter.cpp" line="493"/>
+        <source>0 files converted</source>
+        <translation>0 Dateien konvertiert</translation>
+    </message>
+    <message>
+        <location filename="converter.cpp" line="495"/>
         <source>%1 of %2 file(s) converted, %3 -&gt; %4 (%5 %), duration: %6</source>
         <translation>%1 von %2 Datei(en) konvertiert, %3 -&gt; %4 (%5 %), Dauer: %6</translation>
     </message>
     <message>
-        <location filename="../../base/ReFileUtils.cpp" line="177"/>
+        <location filename="converter.cpp" line="534"/>
+        <source>target directory ignored as source:</source>
+        <oldsource>target directory ignored as source: </oldsource>
+        <translation>Das Zielverzeichnis wurde als Quelle ignoriert:</translation>
+    </message>
+    <message>
+        <location filename="../../base/ReFileUtils.cpp" line="185"/>
+        <source>copy file failed (%1): %2</source>
+        <translation>Kopieren missglückt (%1): %2</translation>
+    </message>
+    <message>
+        <location filename="../../base/ReFileUtils.cpp" line="196"/>
         <source>not found: %1</source>
         <translation>Nicht gefunden: %1</translation>
     </message>
     <message>
-        <location filename="../../base/ReFileUtils.cpp" line="181"/>
-        <location filename="../../base/ReFileUtils.cpp" line="185"/>
+        <location filename="../../base/ReFileUtils.cpp" line="210"/>
+        <source>not a regular file: %1</source>
+        <translation>Keine normale Datei: %1</translation>
+    </message>
+    <message>
+        <location filename="../../base/ReFileUtils.cpp" line="214"/>
+        <location filename="../../base/ReFileUtils.cpp" line="218"/>
         <source>cannot open (%1): %2</source>
         <translation>Kann nicht öffnen (%1): %2</translation>
     </message>
     <message>
-        <location filename="../../base/ReFileUtils.cpp" line="202"/>
+        <location filename="../../base/ReFileUtils.cpp" line="235"/>
         <source>cannot write (%1): %2 [%3/%4]</source>
         <translation>Kann nicht schreiben (%1): %2 [%3/%4]</translation>
     </message>
     <message>
-        <location filename="../../base/ReFileUtils.cpp" line="209"/>
+        <location filename="../../base/ReFileUtils.cpp" line="242"/>
         <source>file can be read only partitionally: %1 [%2/%3]</source>
         <translation>Datei kann nur teilweise gelesen werden: %1 [%2/%3]</translation>
     </message>
     <message>
-        <location filename="../../base/ReFileUtils.cpp" line="214"/>
+        <location filename="../../base/ReFileUtils.cpp" line="247"/>
         <source>cannot set date/time (%1): %2</source>
         <translation>Kann Datum/Zeit nicht setzen  (%1): %2</translation>
     </message>
     <message>
-        <location filename="../../base/ReFileUtils.cpp" line="217"/>
+        <location filename="../../base/ReFileUtils.cpp" line="250"/>
         <source>cannot set permissions (%1): %2</source>
         <translation>Kann Dateirechte nicht setzen (%1): %2 [%3/%4]</translation>
     </message>
     <message>
-        <location filename="../../base/ReFileUtils.cpp" line="491"/>
+        <location filename="../../base/ReFileUtils.cpp" line="260"/>
+        <source>cannot set user/gid [%1/%2] (%3): %4</source>
+        <translation>Kann Benutzer/Gruppe nicht setzen:[%1/%2] (%3): %4 </translation>
+    </message>
+    <message>
+        <location filename="../../base/ReFileUtils.cpp" line="604"/>
+        <location filename="../../base/ReFileUtils.cpp" line="673"/>
         <source>can&apos;t create directory (%1): %2</source>
         <translation>Kann Verzeichnis nicht erzeugen (%1): %2 [%3/%4]</translation>
     </message>
     <message>
-        <location filename="../../base/ReFileUtils.cpp" line="497"/>
+        <location filename="../../base/ReFileUtils.cpp" line="610"/>
         <source>can&apos;t create directory (is a file): </source>
         <translation>Kann Verzeichnis nicht erstellen (ist eine Datei): </translation>
     </message>
@@ -498,7 +595,7 @@ Erwartet: %2</translation>
 <context>
     <name>TaskShowOther</name>
     <message>
-        <location filename="converter.cpp" line="637"/>
+        <location filename="converter.cpp" line="651"/>
         <source>Found: %1 file(s)</source>
         <translation>Gefunden: %1 Datei(en)</translation>
     </message>
index 5815b74602e05f2cb16db565bb7a30f799a0c628..0bfafe8b6bd48189444ae9866e6f2785460e03ef 100644 (file)
@@ -20,6 +20,7 @@ enum {
        LOC_MAKE_DIR_1,                 // 12505
        LOC_MAKE_DIR_2,                 // 12506
        LOC_SET_TIMES_2,        // 12507
+       LOC_MAKE_DIR_WITH_PARENT_1,                     // 12508
 };
 int ReFileUtils::m_maxCharSet = 128;
 bool ReFileUtils::m_ignoreSetUidError = false;
@@ -638,7 +639,7 @@ ReSuccess_t ReFileUtils::makeDirWithParents(const char* path, ReLogger* logger)
                QByteArray dir = parentOf(path);
                ReStringUtils::chomp(dir, OS_SEPARATOR);
                if (stat(dir.constData(), &info) == 0 && S_ISDIR(info.st_mode))
-                       rc = makeDir(path, logger);
+                       rc = makeDir(path, NULL);
                else {
                        const char* end;
                        const char* start = path;
@@ -657,16 +658,20 @@ ReSuccess_t ReFileUtils::makeDirWithParents(const char* path, ReLogger* logger)
                                                continue;
                                        }
 #endif
-                                       rc = makeDir(dir.constData(), logger);
+                                       rc = makeDir(dir.constData(), NULL);
                                        dir += OS_SEPARATOR;
                                }
                        }
                        if (rc && start[0] != '\0') {
                                dir.append(start);
-                               rc = makeDir(dir.constData(), logger);
+                               rc = makeDir(dir.constData(), NULL);
                        }
                }
        }
+       if (! rc)
+               logger->log(LOG_ERROR, LOC_MAKE_DIR_WITH_PARENT_1,
+                                       QObject::tr("can't create directory (%1): %2").arg(errno)
+                                       .arg(path));
        return rc;
 }
 
@@ -1244,6 +1249,8 @@ void ReMountInfo::load()
        QRegularExpression regExpr("^(.*?) on (.*) type ");
        QString line;
        QString directory;
+       m_deviceOfMountPoint.clear();
+       m_mountPointOfDevice.clear();
        for (int ix = 0; ix < lines.size(); ix++){
                if (lines[ix][0] != OS_SEPARATOR)
                        continue;
@@ -1293,7 +1300,7 @@ ReMountInfo& ReMountInfo::instance(bool forceLoad){
        else if (forceLoad)
                m_instance->load();
 
-                       return *m_instance;
+       return *m_instance;
 }
 
 /**
@@ -1311,7 +1318,7 @@ ReSuccess_t ReMountInfo::mount(const QString& device, const QString& path,
        args << "/bin/mount" << device << path;
        QByteArray error;
        ReSuccess_t rc =  ReProcess::executeSilent("/usr/bin/sudo", args, 30, &error);
-       if (! rc &&& announcer != NULL)
+       if (! rc && announcer != NULL)
                announcer->say(LOG_ERROR, QString(error));
        return rc;
 }
@@ -1411,6 +1418,7 @@ void ReBlockDevices::load(){
                                                                " UUID=\"([^\"]+)\""
                                                                " TYPE=\"([^\"]+)\"");
        QString line;
+       m_devices.clear();
        for (int ix = 0; ix < lines.size(); ix++){
                line = I18N::b2s(lines.at(ix));
                QRegularExpressionMatch match = regExpr2.match(line);