From 43fa2efaf3d9bedc85dc8d9e4af64d3e194d9785 Mon Sep 17 00:00:00 2001 From: Jim Norman Date: Mon, 5 Jun 2006 21:33:03 +0000 Subject: [PATCH] Bug 175455. Prevent crash when entering MP that is too short and during an upgrade. --- CASA.changes | 5 ++++ c_gui/CasaMain.cs | 62 ++++++++++++++++++++++++++--------------------- c_gui/Common.cs | 19 +++++++++++++++ 3 files changed, 58 insertions(+), 28 deletions(-) diff --git a/CASA.changes b/CASA.changes index 7b1b2f92..13bed172 100644 --- a/CASA.changes +++ b/CASA.changes @@ -1,3 +1,8 @@ +-------------------------------------------------------------------- +Mon Jun 05 15:30:53 MST 2006 - jnorman@novell.com +- Bug 175455. Prevent crash when entering MP that is too short and + during an upgrade. + -------------------------------------------------------------------- Thursday May 25 16:15:53 MST 2006 - jnorman@novell.com - Bug 178796: change the way we generate the new salt so that diff --git a/c_gui/CasaMain.cs b/c_gui/CasaMain.cs index 2aa8ade5..80a1d824 100644 --- a/c_gui/CasaMain.cs +++ b/c_gui/CasaMain.cs @@ -133,7 +133,8 @@ namespace Novell.CASA.GUI [Glade.Widget] - Gtk.DrawingArea drawingarea1; + Gtk.DrawingArea drawingarea1, + drawingarea2; #endregion @@ -226,8 +227,11 @@ namespace Novell.CASA.GUI { try { - if (mCasaTray == null) - mCasaTray = new CasaTray(this); + if (!Common.IsArgSet(args, Common.ARG_NO_TRAY_ICON)) + { + if (mCasaTray == null) + mCasaTray = new CasaTray(this); + } } catch (Exception e) { @@ -505,7 +509,7 @@ namespace Novell.CASA.GUI private bool DeleteMiCasaFiles() { - string[] faFiles = Directory.GetFiles(GetUserHomeDir(), ".miCASA*"); + string[] faFiles = Directory.GetFiles(Common.GetUserHomeDir(), ".miCASA*"); bool bDeletedFiles = true; for (int i=0; i' }; @@ -69,6 +74,8 @@ public class Common '{', '}', '[', ']', ':', ';', '\"', '\'', '<', '>', ',', '.', '?', '/', '!'}; + + */ ///############################################################## @@ -120,8 +127,11 @@ public class Common ///############################################################## /// ARG CONSTANTS + /// + public static string ARG_NO_TRAY_ICON = "-notray"; public static string ARG_SHOW_TRAY_ICON = "-tray"; public static string ARG_DEBUG = "-debug"; + ///############################################################# ///CasaIcons path @@ -407,6 +417,15 @@ public class Common else return false; } + + internal static string GetUserHomeDir() + { + if (Common.IS_LINUX) + return Environment.GetEnvironmentVariable("HOME"); + else + return Environment.GetEnvironmentVariable("USERPROFILE"); + } + } }