[X2Go-Commits] [x2goclient] 01/01: help.{cpp, h}: add skeleton for new help system.

git-admin at x2go.org git-admin at x2go.org
Wed Apr 22 07:00:12 CEST 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch bugfix/help-cmd
in repository x2goclient.

commit c6539db85a86d6fad9100b3d42022473665970a2
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Wed Apr 22 06:59:59 2015 +0200

    help.{cpp,h}: add skeleton for new help system.
---
 debian/changelog |    1 +
 src/help.cpp     |   65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/help.h       |   47 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 113 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6c25c06..1002103 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -258,6 +258,7 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low
     - onmainwindow.cpp: quote commands for generating pulse-client.conf
       correctly, add more quotes and use absolute file path for pulse cookie.
     - version.h: add include guard.
+    - help.{cpp,h}: add skeleton for new help system.
 
   [ Fernando Pedemonte ]
   * New upstream release (4.0.4.0):
diff --git a/src/help.cpp b/src/help.cpp
new file mode 100644
index 0000000..d42c881
--- /dev/null
+++ b/src/help.cpp
@@ -0,0 +1,65 @@
+/***************************************************************************
+ *  Copyright (C) 2015 by Mihai Moldovan <ionic at ionic.de> +49 721 14595728 *
+ *                                                                         *
+ *  This program is free software; you can redistribute it and/or modify   *
+ *  it under the terms of the GNU General Public License as published by   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the                          *
+ *  Free Software Foundation, Inc.,                                        *
+ *  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.              *
+ ***************************************************************************/
+
+#include "help.h"
+#include <QCoreApplication>
+#include "version.h"
+
+help::prelude_t build_prelude () {
+  help::prelude_t ret ();
+
+  QStringList args = QCoreApplication::arguments ();
+
+  QString ver ("X2Go Client " << VERSION);
+
+  if (QFile::exists (":/txt/git-info")) {
+    QFile file (":/txt/git-info");
+
+    if (file.open (QIODevice::ReadOnly | QIODevice::Text)) {
+      QTextStream stream (&file);
+
+      QString git_info (stream.readAll ().trimmed ());
+
+      if (!(git_info.isEmpty ())) {
+        ver << " (Git information: " << git_info << ")";
+      }
+    }
+  }
+
+  ret.append (ver);
+  ret.append ("Usage: " << args.at (0) << " [OPTION]...");
+  ret.append ("Options:");
+  ret.append ("");
+
+  return (ret);
+}
+
+help::params_t help::build_params () {
+
+}
+
+help::data_t help::build_data () {
+  return (help::data_t (help::build_prelude (), help::build_params ()));
+}
+
+help::pretty_print (help::data_t data) {
+  help::data_t data = help::build_data ();
+
+
+}
diff --git a/src/help.h b/src/help.h
new file mode 100644
index 0000000..87cd5a7
--- /dev/null
+++ b/src/help.h
@@ -0,0 +1,47 @@
+/***************************************************************************
+ *  Copyright (C) 2015 by Mihai Moldovan <ionic at ionic.de> +49 721 14595728 *
+ *                                                                         *
+ *  This program is free software; you can redistribute it and/or modify   *
+ *  it under the terms of the GNU General Public License as published by   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the                          *
+ *  Free Software Foundation, Inc.,                                        *
+ *  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.              *
+ ***************************************************************************/
+
+#ifndef HELP_H
+#define HELP_H
+
+#include <QPair>
+#include <QStringList>
+#include <vector>
+#include <algorithm>
+
+namespace help {
+  typedef QStringList prelude_t;
+  typedef QPair<QString, QString> params_elem_t;
+  typedef QList<params_elem_t> params_t;
+  typedef QPair<prelude_t, params_t> data_t;
+
+  /* Builds a prelude_t object. Values are hardcoded here. */
+  prelude_t build_prelude ();
+
+  /* Builds a params_t object. Values are hardcoded here. */
+  params_t build_params ();
+
+  /* Merges prelude_t and params_t into a data_t object. */
+  data_t build_data ();
+
+  /* Prints a help_data_t structure. */
+  void pretty_print (data_t data);
+}
+
+#endif /* !defined (HELP_H) */

--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list