From c47c751532ccf0412f5126f03d521c06ede04087 Mon Sep 17 00:00:00 2001 From: drbob Date: Sat, 14 Jun 2008 13:22:39 +0000 Subject: [PATCH] Added StartMinimised Option (-m as distinct from AutoLogin Option -a) The core does nothing with this, but it can be used by the gui. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@600 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/rsiface/rsiface.h | 2 ++ libretroshare/src/rsserver/p3face-startup.cc | 18 ++++++++++++++++-- libretroshare/src/rsserver/p3face.h | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/rsiface/rsiface.h b/libretroshare/src/rsiface/rsiface.h index 333cedeeb..b555e122e 100644 --- a/libretroshare/src/rsiface/rsiface.h +++ b/libretroshare/src/rsiface/rsiface.h @@ -47,7 +47,9 @@ extern RsControl *rsicontrol; */ RsInit *InitRsConfig(); +/* extract various options for GUI */ const char *RsConfigDirectory(RsInit *config); +bool RsConfigStartMinimised(RsInit *config); void CleanupRsConfig(RsInit *); diff --git a/libretroshare/src/rsserver/p3face-startup.cc b/libretroshare/src/rsserver/p3face-startup.cc index f9088f05a..d5ab846e4 100644 --- a/libretroshare/src/rsserver/p3face-startup.cc +++ b/libretroshare/src/rsserver/p3face-startup.cc @@ -137,6 +137,7 @@ RsInit *InitRsConfig() strcpy(config->logfname, ""); config -> autoLogin = true; // Always on now. + config -> startMinimised = false; config -> passwd = ""; config -> havePasswd = false; config -> haveDebugLevel = false; @@ -189,6 +190,11 @@ const char *RsConfigDirectory(RsInit *config) return (config->basedir).c_str(); } +bool RsConfigStartMinimised(RsInit *config) +{ + return config->startMinimised; +} + //int InitRetroShare(int argc, char **argv, RsInit *config) //{ @@ -255,13 +261,19 @@ int InitRetroShare(int argcIgnored, char **argvIgnored, RsInit *config) /* getopt info: every availiable option is listet here. if it is followed by a ':' it needs an argument. If it is followed by a '::' the argument is optional. */ - while((c = getopt(argc, argv,"hesaui:p:c:w:l:d:")) != -1) + while((c = getopt(argc, argv,"hesamui:p:c:w:l:d:")) != -1) { switch (c) { case 'a': config->autoLogin = true; - std::cerr << "AutoLogin Allowed"; + config->startMinimised = true; + std::cerr << "AutoLogin Allowed / Start Minimised On"; + std::cerr << std::endl; + break; + case 'm': + config->startMinimised = true; + std::cerr << "Start Minimised On"; std::cerr << std::endl; break; case 'l': @@ -325,6 +337,8 @@ int InitRetroShare(int argcIgnored, char **argvIgnored, RsInit *config) std::cerr << "-c [basedir] Set the config basdir" << std::endl; std::cerr << "-s Output to Stderr" << std::endl; std::cerr << "-d [debuglevel] Set the debuglevel" << std::endl; + std::cerr << "-a AutoLogin (Windows Only) + StartMinimised" << std::endl; + std::cerr << "-m StartMinimised" << std::endl; std::cerr << "-u Only listen to UDP" << std::endl; std::cerr << "-e Use a forwarded external Port" << std::endl << std::endl; std::cerr << "Example" << std::endl; diff --git a/libretroshare/src/rsserver/p3face.h b/libretroshare/src/rsserver/p3face.h index eb8705ad7..dda4b3ff3 100644 --- a/libretroshare/src/rsserver/p3face.h +++ b/libretroshare/src/rsserver/p3face.h @@ -323,6 +323,7 @@ class RsInit bool havePasswd; /* for Commandline password */ bool autoLogin; /* autoLogin allowed */ + bool startMinimised; /* Icon or Full Window */ /* Win/Unix Differences */ char dirSeperator;