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

View File

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

View File

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