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
This commit is contained in:
drbob 2008-06-14 13:22:39 +00:00
parent 9e947f26ca
commit c47c751532
3 changed files with 19 additions and 2 deletions

View File

@ -47,7 +47,9 @@ extern RsControl *rsicontrol;
*/ */
RsInit *InitRsConfig(); RsInit *InitRsConfig();
/* extract various options for GUI */
const char *RsConfigDirectory(RsInit *config); const char *RsConfigDirectory(RsInit *config);
bool RsConfigStartMinimised(RsInit *config);
void CleanupRsConfig(RsInit *); void CleanupRsConfig(RsInit *);

View File

@ -137,6 +137,7 @@ RsInit *InitRsConfig()
strcpy(config->logfname, ""); strcpy(config->logfname, "");
config -> autoLogin = true; // Always on now. config -> autoLogin = true; // Always on now.
config -> startMinimised = false;
config -> passwd = ""; config -> passwd = "";
config -> havePasswd = false; config -> havePasswd = false;
config -> haveDebugLevel = false; config -> haveDebugLevel = false;
@ -189,6 +190,11 @@ const char *RsConfigDirectory(RsInit *config)
return (config->basedir).c_str(); return (config->basedir).c_str();
} }
bool RsConfigStartMinimised(RsInit *config)
{
return config->startMinimised;
}
//int InitRetroShare(int argc, char **argv, RsInit *config) //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 /* 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. 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) switch (c)
{ {
case 'a': case 'a':
config->autoLogin = true; 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; std::cerr << std::endl;
break; break;
case 'l': 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 << "-c [basedir] Set the config basdir" << std::endl;
std::cerr << "-s Output to Stderr" << std::endl; std::cerr << "-s Output to Stderr" << std::endl;
std::cerr << "-d [debuglevel] Set the debuglevel" << 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 << "-u Only listen to UDP" << std::endl;
std::cerr << "-e Use a forwarded external Port" << std::endl << std::endl; std::cerr << "-e Use a forwarded external Port" << std::endl << std::endl;
std::cerr << "Example" << std::endl; std::cerr << "Example" << std::endl;

View File

@ -323,6 +323,7 @@ class RsInit
bool havePasswd; /* for Commandline password */ bool havePasswd; /* for Commandline password */
bool autoLogin; /* autoLogin allowed */ bool autoLogin; /* autoLogin allowed */
bool startMinimised; /* Icon or Full Window */
/* Win/Unix Differences */ /* Win/Unix Differences */
char dirSeperator; char dirSeperator;