Remove Debug Menu from CASAManager. CASAManager.exe -debug enables it

This commit is contained in:
Jim Norman 2005-10-20 23:57:26 +00:00
parent 3fb493d23d
commit 61ef84a1ef
3 changed files with 34 additions and 7 deletions

View File

@ -95,6 +95,7 @@ public class CasaMain
public static CasaTray mCasaTray = null;
public static bool m_bShowDebug = false;
///#######################################################################
@ -114,6 +115,10 @@ public class CasaMain
if (args.Length > 0)
{
if (Common.IsArgSet(args, Common.ARG_DEBUG))
m_bShowDebug = true;
if (Common.IsTrayAvailable() && Common.IsArgSet(args, Common.ARG_SHOW_TRAY_ICON))
{
mCasaTray = new CasaTray();
@ -131,6 +136,8 @@ public class CasaMain
new CasaMain(args);
}
Application.Run();
Logger.DbgLog("GUI:CasaMain.Main() - END");
@ -174,6 +181,12 @@ public class CasaMain
gxml = new Glade.XML(Common.GladeFile, "windowMain", null);
gxml.Autoconnect(this);
if (!m_bShowDebug)
mmiDebug.Hide();
windowMain.DeleteEvent += new DeleteEventHandler(OnWindowMainDeleted);
/// PLATFORM SPECIFIC GUI CHANGES
@ -1091,7 +1104,7 @@ public class CasaMain
#if LINUX
// TODO check startup script for the user.
return false;
return true;
#endif
}

View File

@ -85,6 +85,7 @@ public class Common
///##############################################################
/// ARG CONSTANTS
public static string ARG_SHOW_TRAY_ICON = "-tray";
public static string ARG_DEBUG = "-debug";
///#############################################################
///CasaIcons path

View File

@ -246,8 +246,8 @@ namespace sscs.verbs
else
{
secret = keyChain.GetSecret(secretID);
secret.RemoveKeyValue(keyID);
wo.SetError(constants.RetCodes.SUCCESS, null);
secret.RemoveKeyValue(keyID);
wo.SetError(constants.RetCodes.SUCCESS, null);
}
}
catch (Exception e)
@ -257,6 +257,7 @@ namespace sscs.verbs
return wo;
}
private WrappedObject DoReadKey(SecretStore ssStore, WrappedObject wo)
{
try
@ -505,7 +506,7 @@ namespace sscs.verbs
ssStore.AddKeyChain(keyChain);
}
Secret secret1 = new Secret(GW);
Secret secret1 = GetOrCreateSecret(keyChain, GW);
secret1.SetKeyValue("CN", "User1");
secret1.SetKeyValue("Password", "GWPass");
try
@ -515,7 +516,7 @@ namespace sscs.verbs
catch (Exception)
{}
Secret secret2 = new Secret(IFOLDER);
Secret secret2 = GetOrCreateSecret(keyChain, IFOLDER);
secret2.SetKeyValue("CN", "User2");
secret2.SetKeyValue("Password", "IfolderPass");
secret2.SetKeyValue("EmployeeID", "123456");
@ -526,7 +527,7 @@ namespace sscs.verbs
catch (Exception)
{}
Secret secret3 = new Secret(GWIM);
Secret secret3 = GetOrCreateSecret(keyChain,GWIM);
secret3.SetKeyValue("CN", "User3");
secret3.SetKeyValue("Password", "GwimPass");
try
@ -562,6 +563,18 @@ namespace sscs.verbs
return wo;
}
private Secret GetOrCreateSecret(KeyChain kc, string sID)
{
try
{
return kc.GetSecret(sID);
}
catch (Exception)
{
return new Secret(sID);
}
}
private WrappedObject DoGetLinkedKeys(SecretStore ssStore, WrappedObject wo)
{