The branch, master has been updated via d553677502781c5f5520ec2c41f067d054df9465 (commit) from 2e0e6e8669e8285046ae3f3c32578a5406fa11e2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d553677502781c5f5520ec2c41f067d054df9465 Author: Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> Date: Thu Oct 25 17:56:18 2012 +0200 add class X2GoClientConfig and init config details ----------------------------------------------------------------------- Summary of changes: x2goapplication.cpp | 4 +- x2goapplication.h | 8 ++ x2goclient2.pro | 4 + x2goclientconfig.cpp | 119 ++++++++++++++++++++ x2goclientconfig.h | 108 ++++++++++++++++++ x2goclientconfigdetail.cpp | 43 +++++++ configuratorkeyboard.h => x2goclientconfigdetail.h | 34 +++--- 7 files changed, 305 insertions(+), 15 deletions(-) create mode 100644 x2goclientconfig.cpp create mode 100644 x2goclientconfig.h create mode 100644 x2goclientconfigdetail.cpp copy configuratorkeyboard.h => x2goclientconfigdetail.h (68%) The diff of changes is: diff --git a/x2goapplication.cpp b/x2goapplication.cpp index f388fd9..7c6efda 100644 --- a/x2goapplication.cpp +++ b/x2goapplication.cpp @@ -27,6 +27,7 @@ #include "workarea.h" #include "messagebox.h" #include <QScrollBar> +#include "x2goclientconfig.h" X2GoApplication::X2GoApplication(int& argc, char** argv, int flags): QApplication(argc, argv, flags) { @@ -46,11 +47,12 @@ X2GoApplication::X2GoApplication(int& argc, char** argv, int flags): QApplicatio addTranslator (appNames, "MAILCLIENT",tr ( "Email client" ) ); addTranslator (appNames, "OFFICE",tr ( "Office" ) ); addTranslator (appNames, "TERMINAL",tr ( "Terminal" ) ); - + clientConfig=new X2GoClientConfig; } X2GoApplication::~X2GoApplication() { + delete clientConfig; qDebug()<<"X2Go Application exited"; } diff --git a/x2goapplication.h b/x2goapplication.h index 7045353..a715154 100644 --- a/x2goapplication.h +++ b/x2goapplication.h @@ -26,6 +26,10 @@ public: void set_##NAME(TYPE val){NAME=val;} \ public: TYPE get_##NAME(){return NAME;} +#define X2GO_RO_PROPERTY(TYPE,NAME) private: TYPE NAME; \ +public: TYPE get_##NAME(){return NAME;} + + #define X2GO_PROPERTY_GETTER(TYPE,NAME) public: TYPE get_##NAME(){return NAME;} #define X2GO_PROPERTY_SETTER(TYP,NAME) public: void set_##NAME(TYPE val){NAME=val;} @@ -37,6 +41,7 @@ class Profile; class ProfileSettingsForm; class MainWindow; class ProfileDetailConfiguratorForm; +class X2GoClientConfig; struct nameTranslator { @@ -53,6 +58,7 @@ class X2GoApplication: public QApplication X2GO_PROPERTY(SessionForm*, sessionForm) X2GO_PROPERTY(MainWindow*, mainWindow) X2GO_PROPERTY(ProfileDetailConfiguratorForm*, profileDetailConfiguratorForm) + X2GO_PROPERTY_GETTER(X2GoClientConfig*, clientConfig) public: ~X2GoApplication(); X2GoApplication(int& argc, char** argv, int = ApplicationFlags); @@ -68,6 +74,8 @@ private: QList<Profile*> profiles; QList<nameTranslator> desktopNames; QList<nameTranslator> appNames; + X2GoClientConfig* clientConfig; +private: const nameTranslator* getTranslator(QList<nameTranslator>& list, int index); QString getInternName(QList<nameTranslator>& list, QString readableName); QString getReadableName(QList<nameTranslator>& list, QString internName); diff --git a/x2goclient2.pro b/x2goclient2.pro index d02c685..cae1795 100755 --- a/x2goclient2.pro +++ b/x2goclient2.pro @@ -50,6 +50,8 @@ SOURCES += main.cpp \ configuratorprinting.cpp \ configuratorsharing.cpp \ messagebox.cpp \ + x2goclientconfig.cpp \ + x2goclientconfigdetail.cpp \ profile.cpp HEADERS += mainwindow.h \ @@ -73,6 +75,8 @@ HEADERS += mainwindow.h \ configuratorprinting.h \ configuratorsharing.h \ messagebox.h \ + x2goclientconfig.h \ + x2goclientconfigdetail.h \ profile.h LIBS += -lssh diff --git a/x2goclientconfig.cpp b/x2goclientconfig.cpp new file mode 100644 index 0000000..d96c871 --- /dev/null +++ b/x2goclientconfig.cpp @@ -0,0 +1,119 @@ +/************************************************************************** +* Copyright (C) 2005-2012 by Oleksandr Shneyder * +* o.shneyder@phoca-gmbh.de * +* * +* 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 "x2goclientconfig.h" +#include <QDir> + +X2GoClientConfig::X2GoClientConfig() +{ + initDetail(&printShowDialog, (bool)true, QString::null, "printing.General.showdialog", tr("Display printing dialog")); + initDetail(&printPDFView, (bool)false, QString::null, "printing.General.pdfview", tr("View PDF instead of printing")); + initDetail(&printCustomCommand, (bool)false, QString::null, "printing.print.startcmd", tr("Use custom printer command")); + initDetail(&printCommand, (QString)"lpr", QString::null, "printing.print.command", tr("Custom printer command")); + initDetail(&printStdin, (bool)false, QString::null, "printing.print.stdin", tr("Redirect output to printer command STDIN")); + initDetail(&printPS, (bool)false, QString::null, "printing.print.ps", tr("Print output in PS format")); + initDetail(&printViewOpen, (bool)false, QString::null, "printing.view.open", tr("Open PDF in viewer application")); + initDetail(&printViewCommand, (QString)"xpdf", QString::null, "printing.view.command", tr("PDF Viewer application")); + initDetail(&printCUPSDefaultPrinter, (QString)QString::null, QString::null, "printing.CUPS.defaultprinter", + tr("Default CUPS printer")); + + initDetail(&showStatusBar, (bool)true, "--show-status-bar", "settings.General.showStatus", tr("Display status bar")); + initDetail(&clientSSHPort, (int)22, "--client-ssh-port", "settings.General.clientport", + tr("Clientside SSH port for file system export usage")); + + initDetail(&trayEnabled, (bool)false, QString::null, "settings.trayicon.enabled", tr("Display icon in system tray")); + initDetail(&trayMinimize, (bool)false, QString::null, "settings.trayicon.mintotray", tr("Hide to system tray when minimized")); + initDetail(&trayHideOnClose, (bool)false, QString::null, "settings.trayicon.noclose", tr("Hide to system tray when closed")); + initDetail(&trayHideOnConnect, (bool)false, QString::null, "settings.trayicon.mincon", + tr("Hide to system tray after connection is established")); + initDetail(&trayShowOnDisconnect, (bool)false, QString::null, "settings.trayicon.maxdiscon", + tr("Restore from system tray after session is disconnected")); + + initDetail(&windowSize, QSize(800,600), QString::null, "sizes.mainwindow.size", tr("Size of main window")); + initDetail(&windowPosition, QPoint(800,600), QString::null, "sizes.mainwindow.pos", tr("Position of main window")); + initDetail(&windowShowMaximized, (bool)false, "--maximize", "sizes.mainwindow.maximized", tr("Maximize main window")); + + initDetail(&showHelp, (bool)false, "--help", QString::null, tr("show help and exit")); + initDetail(&showHelpPack, (bool)false,"--help-pack",QString::null,tr("show available pack methods and exit")); + initDetail(&portableMode, (bool)false, "--portable", QString::null, tr("start in \"portable\" mode")); + initDetail(&cleanFilesOnExit, (bool)false, "--clean-all-files", QString::null, tr("")); + initDetail(&hideMenu, (bool)false, "--no-menu", QString::null, tr("hide menu bar")); + initDetail(&defaultXinerama, (bool)false, "--xinerama", QString::null, tr("use Xinerama by default")); + initDetail(&thinClientMode, (bool)false, "--thinclient", QString::null, tr("run without window manager")); + initDetail(&showHaltButton, (bool)false, "--haltbt", QString::null, tr("show shutdown button")); + initDetail(&startHidden, (bool)false, "--hide", QString::null, tr("start hidden")); + initDetail(&usePGPCard, (bool)false, "--pgp-card", QString::null, tr("use openPGP card authentication")); + initDetail(&autoAddToKnownHosts, (bool)false, "--add-to-known-hosts", QString::null, + tr("add RSA key fingerprint to ~/.ssh/known_hosts")); + initDetail(&disallowSessionEdit, (bool)false, "--no-session-edit", QString::null, + tr("not allow user to edit preconfigured sessions")); + initDetail(&defaultAutoLogin, (bool)false, "--autologin", QString::null, tr("")); + initDetail(&defaultBrockerAutoLogin, (bool)false, "--broker-autologin", QString::null, tr("")); + initDetail(&defaultNoBrockerAuth, (bool)false, "--broker-noauth", QString::null, tr("")); + + initDetail(&defaultDpi, (int)0, "--dpi", QString::null, tr("set dpi of x2goagent, default - not set")); + initDetail(&defaultLink, (QString)"adsl", "--link", QString::null, + tr("<modem|isdn|adsl|wan|lan> set default link type, default 'adsl'")); + initDetail(&defaultPack, (QString)"16m-jpeg-9", "--pack", QString::null, tr("set default pack method, default '16m-jpeg-9'")); + initDetail(&defaultSound, (bool)true, "--sound", QString::null, tr("")); + initDetail(&defaultSessionGeometry, (QString)"1024x768", "--geometry", QString::null, + tr("<W>x<H>|fullscreen set default geometry, default value '800x600'")); + initDetail(&defaultKbdLayout, (QString)tr("us"), "--kbd-layout", QString::null, + tr("set default keyboard layout or layouts comma separated")); + initDetail(&defaultKbdType, (QString)tr("pc105/us"), "--kbd-type", QString::null, tr("set default keyboard type")); + initDetail(&defaultChangeKbd, (bool)true, "--set-kbd", QString::null, tr("overwrite current keyboard settings")); + + initDetail(&sessionConfigFile, (QString)QString::null, "--session-conf", QString::null, tr("path to alternative session config")); + + initDetail(&defaultSessionName, (QString)QString::null, "--session", QString::null, tr("Start specified session")); + initDetail(&defaultSessionId, (QString)QString::null, "--sessionid", QString::null, tr("")); + + initDetail(&defaultUserName, (QString)QString::null, "--user", QString::null, tr("select specified user")); + initDetail(&defaultSessionCommand, (QString)QString::null, "--command", QString::null, tr("Set default command, default value 'KDE'")); + initDetail(&defaultSSHPort, (int)22, "--ssh-port", QString::null, tr("default SSH port, default 22")); + initDetail(&defaultSSHKey, (QString)QString::null, "--ssh-key", QString::null, tr("")); + + initDetail(&brokerUrl, (QString)QString::null, "--broker-url", QString::null, tr("")); + initDetail(&brokerSSHKey, (QString)QString::null, "--broker-ssh-key", QString::null, tr("")); + initDetail(&brokerName, (QString)QString::null, "--broker-name", QString::null, tr("")); + initDetail(&authId, (QString)QString::null, "--auth-id", QString::null, tr("")); + + initDetail(&autoStartApp, (QString)QString::null, "--autostart", QString::null, + tr("launch \"app\" by session start in \"published applications\" mode")); + + initDetail(&homeDirectory, (QString)QDir::homePath(), "--home", QString::null, tr("set users home directory")); + + initDetail(&readExportsFrom, (QString)QString::null, "--read-exports-from", QString::null, tr("")); +} + +void X2GoClientConfig::initDetail(X2GoClientConfigDetail* detail, QVariant value, QString commandLineParameter, + QString configFileParameter, + QString description, bool (*checkSanityFunction)(QVariant value)) +{ + detail->value=value; + detail->commandLineParameter=commandLineParameter; + detail->description=description; + detail->checkSanityFunction=checkSanityFunction; + detail->configFileParameter=configFileParameter; + configDetails<<detail; +} + + diff --git a/x2goclientconfig.h b/x2goclientconfig.h new file mode 100644 index 0000000..38b2a32 --- /dev/null +++ b/x2goclientconfig.h @@ -0,0 +1,108 @@ +/************************************************************************** +* Copyright (C) 2005-2012 by Oleksandr Shneyder * +* o.shneyder@phoca-gmbh.de * +* * +* 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 X2GOCLIENTCONFIG_H +#define X2GOCLIENTCONFIG_H + +#include <QObject> +#include "x2goclientconfigdetail.h" +#include "x2goapplication.h" + +class X2GoClientConfig: public QObject +{ + X2GO_RO_PROPERTY(X2GoClientConfigDetail, printShowDialog) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, printPDFView) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, printCustomCommand) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, printCommand) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, printStdin) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, printPS) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, printViewOpen) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, printViewCommand) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, printCUPSDefaultPrinter) + + X2GO_RO_PROPERTY(X2GoClientConfigDetail, showStatusBar) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, clientSSHPort) + + X2GO_RO_PROPERTY(X2GoClientConfigDetail, trayEnabled) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, trayMinimize) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, trayHideOnClose) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, trayHideOnConnect) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, trayShowOnDisconnect) + + X2GO_RO_PROPERTY(X2GoClientConfigDetail, windowSize) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, windowPosition) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, windowShowMaximized) + + X2GO_RO_PROPERTY(X2GoClientConfigDetail, showHelp) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, showHelpPack) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, portableMode) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, cleanFilesOnExit) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, hideMenu) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultXinerama) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, thinClientMode) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, showHaltButton) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, startHidden) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, usePGPCard) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, autoAddToKnownHosts) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, disallowSessionEdit) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultAutoLogin) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultBrockerAutoLogin) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultNoBrockerAuth) + + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultDpi) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultLink) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultPack) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultSound) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultSessionGeometry) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultKbdLayout) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultKbdType) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultChangeKbd) + + X2GO_RO_PROPERTY(X2GoClientConfigDetail, sessionConfigFile) + + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultSessionName) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultSessionId) + + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultUserName) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultSessionCommand) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultSSHPort) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, defaultSSHKey) + + X2GO_RO_PROPERTY(X2GoClientConfigDetail, brokerUrl) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, brokerSSHKey) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, brokerName) + X2GO_RO_PROPERTY(X2GoClientConfigDetail, authId) + + X2GO_RO_PROPERTY(X2GoClientConfigDetail, autoStartApp) + + X2GO_RO_PROPERTY(X2GoClientConfigDetail, homeDirectory) + + X2GO_RO_PROPERTY(X2GoClientConfigDetail, readExportsFrom) +public: + X2GoClientConfig(); +private: + QList<X2GoClientConfigDetail*> configDetails; +private: + void initDetail(X2GoClientConfigDetail* detail, QVariant value, QString commandLineParameter, QString configFileParameter, + QString description, bool (*checkSanityFunction)(QVariant value)=0); +}; + +#endif // X2GOCLIENTCONFIG_H diff --git a/x2goclientconfigdetail.cpp b/x2goclientconfigdetail.cpp new file mode 100644 index 0000000..cba3b29 --- /dev/null +++ b/x2goclientconfigdetail.cpp @@ -0,0 +1,43 @@ +/* + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 2012 Oleksandr Shneyder <email> + + 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 3 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, see <http://www.gnu.org/licenses/>. +*/ + +#include "x2goclientconfigdetail.h" + +X2GoClientConfigDetail::X2GoClientConfigDetail() +{ +} + +bool X2GoClientConfigDetail::parseCommandLineArgument(QString argument) +{ + /* if(!parseCommandLineArgumentFunction) + return false; + ConfigDetailType val; + bool res=*parseCommandLineArgumentFunction(argument, val); + if(!res) + return false; + if(!checkSanityFunction) + { + value=val; + return true; + } + res=checkSanityFunction(val); + if(!res) + return false; + value=val;*/ + return true; +} diff --git a/configuratorkeyboard.h b/x2goclientconfigdetail.h similarity index 68% copy from configuratorkeyboard.h copy to x2goclientconfigdetail.h index 341a7ef..f54a524 100644 --- a/configuratorkeyboard.h +++ b/x2goclientconfigdetail.h @@ -19,22 +19,28 @@ ***************************************************************************/ -#ifndef CONFIGURATORKEYBOARD_H -#define CONFIGURATORKEYBOARD_H +#ifndef X2GOCLIENTCONFIGDETAIL_H +#define X2GOCLIENTCONFIGDETAIL_H -#include "profiledetailconfigurator.h" -#include "ui_configuratorkeyboard.h" - -class ConfiguratorKeyboard: public ProfileDetailConfigurator, public Ui_ConfiguratorKeyboard +#include <QVariant> +#include "x2goapplication.h" +class X2GoClientConfigDetail { - Q_OBJECT -public: - ConfiguratorKeyboard(Profile* profile, QWidget* parent = 0, Qt::WindowFlags f = 0); - virtual ~ConfiguratorKeyboard(); + friend class X2GoClientConfig; + X2GO_PROPERTY_GETTER( QVariant, value) + X2GO_PROPERTY_GETTER( QString, commandLineParameter) + X2GO_PROPERTY_GETTER( QString, configFileParameter) + X2GO_PROPERTY_GETTER( QString, description) private: - virtual void init(); - virtual void defaults(); - virtual void apply(); + bool (*checkSanityFunction)(QVariant value); + QVariant value; + QString commandLineParameter; + QString configFileParameter; + QString description; +public: + X2GoClientConfigDetail(); + bool parseCommandLineArgument(QString argument); }; -#endif // CONFIGURATORKEYBOARD_H +#endif // X2GOCLIENTCONFIGDETAIL_H + hooks/post-receive -- x2goclient2.git (X2Go Client 2 (rewrite of x2goclient.git)) This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "x2goclient2.git" (X2Go Client 2 (rewrite of x2goclient.git)).