]> gitweb.hamatoma.de Git - reqt/commitdiff
dayly work
authorhama <hama@siduction.net>
Sat, 19 Dec 2015 21:07:44 +0000 (22:07 +0100)
committerhama <hama@siduction.net>
Sat, 19 Dec 2015 21:07:44 +0000 (22:07 +0100)
appl/prime/.gitignore [new file with mode: 0644]
appl/reidos/maincmdline.cpp
appl/reidos/reidoscmdline.pro
gui/regui.hpp

diff --git a/appl/prime/.gitignore b/appl/prime/.gitignore
new file mode 100644 (file)
index 0000000..3df573f
--- /dev/null
@@ -0,0 +1 @@
+/Debug/
index ec98aad385d7502cbed889ffb0c3374e259b6052..e38fa701519ff78f5ec71564e3cfee1dcfb163dc 100644 (file)
@@ -26,33 +26,38 @@ SyncHandler::SyncHandler(ReProgramArgs* globalArgs) :
        m_globalArgs(globalArgs),
        m_syncArgs(NULL){
        m_syncArgs = new ReProgramArgs(
-               I18N::s2b(QObject::tr(
-                       "usage: $0 <global_opts> sy(nchronize) <options> <source> <target>\n"
-                       "Copies newer and missing files from <source> to <target>\n"
-                       "<source>: the source directory. This directory is never changed\n"
-                       "If <source> ends with the path separator the files of <source> will be copied directly to <target>\n"
-                       "Otherwise the node of <source> will be a subdirectory of <target>\n"
-                       "Examples:\n"
-                       "<source>: /home/ <target>: /trg /home/abc.txt will be copied to /trg/abc.txt\n"
-                       "<source>: /home <target>: /trg /home/abc.txt will be copied to /trg/home/abc.txt"
-                       "<target>: the target directory"
-                       )),
+               I18N::s2b(
+                       QObject::tr("usage:") + "$0 <global_opts> sy(nchronize) <options> <source> <target>\n"
+                       + QObject::tr("Copies newer and missing files from <source> to <target>") + "\n"
+                       + QObject::tr("<source>: the source directory. This directory is never changed") + "\n"
+                       + QObject::tr("If <source> ends with the path separator the files of <source> will be copied directly to <target>") + "\n"
+                       + QObject::tr("Otherwise the node of <source> will be a subdirectory of <target>") + "\n"
+                       + QObject::tr("Examples:") + "\n"
+                       + "<source>: /home/ <target>: "
+                       + QObject::tr("/trg /home/abc.txt will be copied to /trg/abc.txt") + "\n"
+                       + "<source>: /home <target>:"
+                       + QObject::tr("/trg /home/abc.txt will be copied to /trg/home/abc.txt") + "\n"
+                       + "<target>: "
+                       + QObject::tr("the target directory")
+                       ),
                        "$0 sy -p *,*.txt,*.odt --dir-patterns=*,.git,.* /home /backup\n"
                        "$0 sync --file-pattern=*,-*.bak,-*~ -P *,-*cache* /work crypt:/media/nas"
                );
-       m_syncArgs->addString("filePattern", I18N::s2b(QObject::tr(
-                       "a comma separated list of file patterns to include/exclude files to copy.\n"
-                       "An exclude pattern begins with '-'. Placeholder is '*' (for any string)\n"
-                       "Examples:\n"
+       m_syncArgs->addString("filePattern", I18N::s2b(
+                       QObject::tr("a comma separated list of file patterns to include/exclude files to copy.") + "\n"
+                       + QObject::tr("An exclude pattern begins with '-'. Placeholder is '*' (for any string)") + "\n"
+                       + QObject::tr("Examples:")
+                       ) + "\n"
                        "--file-pattern=*,-*.bak\n"
-                       "-p *.txt,*.doc,*.odt")),
+                       "-p *.txt,*.doc,*.odt",
                'p', "file-pattern", false, "*");
-       m_syncArgs->addString("dirPattern", I18N::s2b(QObject::tr(
-                       "a comma separated list of directory patterns to include/exclude directories from processing.\n"
-                       "An exclude pattern begins with '-'. Placeholder is '*' (for any string)\n"
-                       "Examples:\n"
-                       "--dir-pattern=;*;-.cache\n"
-                       "-P *,-.git,.*")),
+       m_syncArgs->addString("dirPattern", I18N::s2b(
+                       QObject::tr("a comma separated list of directory patterns to include/exclude directories from processing.")
+                                                         + "\n"
+                       + QObject::tr("An exclude pattern begins with '-'. Placeholder is '*' (for any string)") + "\n"
+                       + QObject::tr("Examples:") + "\n"
+                       + "--dir-pattern=;*;-.cache\n"
+                       + "-P *,-.git,.*"),
                'P', "dir-pattern", false, "*");
 }
 
@@ -60,21 +65,19 @@ int main(int argc, char *argv[])
 {
        QApplication a(argc, argv);
        ReProgramArgs args(
-               QObject::tr(
-               "Usage: $0 <opts> <mode> <mode_opts> <mode_params>\n"
-               "<mode>:\n"
-               "co(mpare)     compares two directories\n"
-               "sm(ooth)      superflous files on target will be removed\n"
-               "sy(nchronize) newer or missing files will be copied from source to target"
-               ),
-               QObject::tr(
-       "reidoscmdline help sync\n"
-       "reidoscmdline -v sync --dir-pattern=;*;-cache --file-pattern=;*.txt;*.doc /x /y"
-               ));
-
-
-       QString startDir = argc > 1 ? argv[1] : "";
-       QString homeDir = argc > 2 ? argv[2] : "";
-
+               QObject::tr("Usage:") + " $0 <opts> <mode> <mode_opts> <mode_params>\n"
+               + "<mode>:\n"
+               + "co(mpare)     " + QObject::tr("compares two directories") + "\n"
+               + "sm(ooth)      " + QObject::tr("superflous files on target will be removed") + "\n"
+               + "sy(nchronize) " + QObject::tr("newer or missing files will be copied from source to target"),
+       "$0 help sync\n"
+       "$0 -v sync --dir-pattern=;*;-cache --file-pattern=;*.txt;*.doc /x /y"
+               );
+       try {
+               args.init(argc, argv);
+               args.help(NULL, false, stdout);
+       } catch( ReOptionException e){
+               args.help(NULL, true, stdout);
+       }
        return a.exec();
 }
index b134310779422b7bc00fc3e75f28a9b2fd1a8c00..f6959522ca4444c70dfc2e69c4f10698f0338ada 100644 (file)
@@ -8,7 +8,10 @@ QT       += core gui
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 
-TARGET = reidos
+TARGET = reidoscmdline
+CONFIG   += console
+CONFIG   -= app_bundle
+
 TEMPLATE = app
 
 INCLUDEPATH += . ../..
index 9d32a31333612ab4a428103d371293f94e3d9ce8..134bd06026054b0bd68e26e6a2b15d1256757de8 100644 (file)
@@ -12,6 +12,7 @@
 #ifndef REGUI_HPP
 #define REGUI_HPP
 
+#include <QPushButton>
 #include "gui/ReStateStorage.hpp"
 #include "gui/ReGuiValidator.hpp"
 #include "gui/ReEdit.hpp"
  * @return      <code>true</code>: the point lays inside the rectangle
  */
 inline bool rectContains(const QRect& rect, const QPoint& point,
-    const char* what = "") {
+       const char* what = "") {
 #if 1
        ReUseParameter(what);
        return point.x() >= rect.x() && point.y() >= rect.y()
-           && point.x() < rect.x() + rect.width()
-           && point.y() < rect.y() + rect.height();
+               && point.x() < rect.x() + rect.width()
+               && point.y() < rect.y() + rect.height();
 #else
        bool rc = point.x() >= rect.x();
        char reason = ' ';