GUI enhancements.
This commit is contained in:
		| @@ -100,7 +100,8 @@ namespace Novell.CASA.GUI | |||||||
| 						checkbuttonMozilla,  | 						checkbuttonMozilla,  | ||||||
| 						checkbuttonGnomeKeyring,  | 						checkbuttonGnomeKeyring,  | ||||||
| 						checkbuttonKdeWallet, | 						checkbuttonKdeWallet, | ||||||
| 						checkbuttonCloseMessage; | 						checkbuttonCloseMessage, | ||||||
|  | 						checkbuttonRunInTray;						 | ||||||
| 						 | 						 | ||||||
| 		[Glade.Widget]  | 		[Glade.Widget]  | ||||||
| 		Gtk.Label		label88, | 		Gtk.Label		label88, | ||||||
| @@ -131,6 +132,10 @@ namespace Novell.CASA.GUI | |||||||
| 						mmiNetworkManager, | 						mmiNetworkManager, | ||||||
| 						mmiGaim; | 						mmiGaim; | ||||||
| 		 | 		 | ||||||
|  | 		[Glade.Widget]  | ||||||
|  | 		Gtk.RadioButton radiobutton1, | ||||||
|  | 						radiobutton2; | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| 		[Glade.Widget] | 		[Glade.Widget] | ||||||
| @@ -235,9 +240,12 @@ namespace Novell.CASA.GUI | |||||||
| 					try  | 					try  | ||||||
| 					{ | 					{ | ||||||
| 						if (!Common.IsArgSet(args, Common.ARG_NO_TRAY_ICON)) | 						if (!Common.IsArgSet(args, Common.ARG_NO_TRAY_ICON)) | ||||||
|  | 						{ | ||||||
|  | 							if (config.GetConfigSetting(Common.CONFIG_RUN_IN_TRAY, true))							 | ||||||
| 							{ | 							{ | ||||||
| 								if (mCasaTray == null) | 								if (mCasaTray == null) | ||||||
| 								mCasaTray = new CasaTray(this); | 									mCasaTray = new CasaTray(this, config); | ||||||
|  | 							} | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 					catch (Exception e) | 					catch (Exception e) | ||||||
| @@ -1614,15 +1622,74 @@ namespace Novell.CASA.GUI | |||||||
| 			checkbuttonKdeWallet.Sensitive = Common.IS_KDEWALLET_AVAILABLE; | 			checkbuttonKdeWallet.Sensitive = Common.IS_KDEWALLET_AVAILABLE; | ||||||
| 			checkbuttonGnomeKeyring.Sensitive = Common.IS_GNOMEKEYRING_AVAILABLE;	 | 			checkbuttonGnomeKeyring.Sensitive = Common.IS_GNOMEKEYRING_AVAILABLE;	 | ||||||
| 			 | 			 | ||||||
|  | 			// options | ||||||
|  | 			checkbuttonRunInTray.Sensitive = true; | ||||||
|  | 			checkbuttonRunInTray.Active = config.GetConfigSetting(Common.CONFIG_RUN_IN_TRAY, true); | ||||||
|  | 			checkbuttonRunInTray.Visible = true; | ||||||
|  |  | ||||||
|  | 			radiobutton1.Visible = true;			 | ||||||
|  | 			radiobutton2.Visible = true; | ||||||
|  | 			 | ||||||
|  | 			radiobutton1.Sensitive = checkbuttonRunInTray.Active; | ||||||
|  | 			radiobutton2.Sensitive = checkbuttonRunInTray.Active; | ||||||
|  |  | ||||||
|  | 			radiobutton1.Active = config.GetConfigSetting(Common.DISPLAY_CASA_MANAGER, true); | ||||||
|  | 			radiobutton2.Active = !config.GetConfigSetting(Common.DISPLAY_CASA_MANAGER, true); | ||||||
|  |  | ||||||
|  | 			 | ||||||
| 			if (Common.IS_WINDOWS) | 			if (Common.IS_WINDOWS) | ||||||
| 			{ | 			{ | ||||||
| 				checkbuttonGnomeKeyring.Sensitive = false; | 				checkbuttonGnomeKeyring.Sensitive = false; | ||||||
|  | 				checkbuttonGnomeKeyring.Visible = false; | ||||||
|  |  | ||||||
| 				checkbuttonKdeWallet.Sensitive = false; | 				checkbuttonKdeWallet.Sensitive = false; | ||||||
|  | 				checkbuttonKdeWallet.Visible = false; | ||||||
| 			} | 			} | ||||||
|          |          | ||||||
| 			Logger.DbgLog("GUI:CasaMain.Preferences() - END");  	          	         | 			Logger.DbgLog("GUI:CasaMain.Preferences() - END");  	          	         | ||||||
| 		} | 		} | ||||||
|      |      | ||||||
|  | 		public void on_checkbuttonRunInTray_clicked(object obj, EventArgs args) | ||||||
|  | 		{ | ||||||
|  | 			 | ||||||
|  | 			Gtk.CheckButton button = (Gtk.CheckButton)obj; | ||||||
|  | 			if (button.Active) | ||||||
|  | 			{ | ||||||
|  | #if W32 | ||||||
|  | 				// start tray icon | ||||||
|  | 				if (mCasaTray == null) | ||||||
|  | 					mCasaTray = new CasaTray(this, config); | ||||||
|  | #endif | ||||||
|  | 				radiobutton1.Sensitive = radiobutton2.Sensitive = true; | ||||||
|  | 				config.SetConfigSetting(Common.CONFIG_RUN_IN_TRAY, true); | ||||||
|  | 				config.WriteConfig(); | ||||||
|  | 			} | ||||||
|  | 			else | ||||||
|  | 			{ | ||||||
|  | #if W32 | ||||||
|  | 				// stop tray icon | ||||||
|  | 				if (mCasaTray != null) | ||||||
|  | 				{ | ||||||
|  | 					mCasaTray.StopRunningInTray(); | ||||||
|  | 					mCasaTray = null; | ||||||
|  | 				} | ||||||
|  | #endif | ||||||
|  | 				radiobutton1.Sensitive = radiobutton2.Sensitive = false; | ||||||
|  | 				config.SetConfigSetting(Common.CONFIG_RUN_IN_TRAY, false); | ||||||
|  | 				config.WriteConfig(); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		public void on_radiobutton1_clicked(object obj, EventArgs e) | ||||||
|  | 		{ | ||||||
|  | 			if (radiobutton1.Active) | ||||||
|  | 				config.SetConfigSetting(Common.DISPLAY_CASA_MANAGER, true); | ||||||
|  | 			else | ||||||
|  | 				config.SetConfigSetting(Common.DISPLAY_CASA_MANAGER, false); | ||||||
|  |  | ||||||
|  | 			config.WriteConfig(); | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		public void okbuttonPreferences_clicked(object abj, EventArgs args) | 		public void okbuttonPreferences_clicked(object abj, EventArgs args) | ||||||
| 		{    	 | 		{    	 | ||||||
| 			Logger.DbgLog("GUI:CasaMain.okbuttonPreferences_clicked() - BEGIN"); | 			Logger.DbgLog("GUI:CasaMain.okbuttonPreferences_clicked() - BEGIN"); | ||||||
|   | |||||||
| @@ -46,17 +46,23 @@ namespace Novell.CASA.GUI | |||||||
| 		Egg.TrayIcon icon; | 		Egg.TrayIcon icon; | ||||||
| 		EventBox eb; | 		EventBox eb; | ||||||
| 		private Gtk.Image m_imageLocked = new Image("images/CASA_16.png", IconSize.Menu); | 		private Gtk.Image m_imageLocked = new Image("images/CASA_16.png", IconSize.Menu); | ||||||
| 		private static string iconfile = "/usr/share/doc/packages/CASA/images/CASAicons.ico"; |  | ||||||
|  | 		private static string iconfile = "/usr/share/doc/packages/CASA/images/CASA_22.png"; | ||||||
| 		private static Gtk.IconSet iconset = new IconSet(new Gdk.Pixbuf(iconfile)); | 		private static Gtk.IconSet iconset = new IconSet(new Gdk.Pixbuf(iconfile)); | ||||||
| 		private static Gtk.Image m_imageUnlocked = new Gtk.Image(iconset, IconSize.Menu);	 | 		private static Gtk.Image m_imageUnlocked = new Gtk.Image(iconset, IconSize.Menu);	 | ||||||
|  | 		private static string iconfileLocked = "/usr/share/doc/packages/CASA/images/CASA_22_Locked.png"; | ||||||
|  | 		private static Gtk.IconSet iconLocked = new IconSet(new Gdk.Pixbuf(iconfileLocked)); | ||||||
|  | 		private static Gtk.Image m_imageLocked = new Gtk.Image(iconLocked, IconSize.Menu);	 | ||||||
| #endif | #endif | ||||||
| 		 | 		 | ||||||
| 		private static CasaMain mCasaMain = null; | 		private static CasaMain mCasaMain = null; | ||||||
|  | 		private static Config m_config = null; | ||||||
| 		private Menu popupMenu = null; | 		private Menu popupMenu = null; | ||||||
| 			 | 			 | ||||||
| 		public CasaTray(CasaMain casaInstance) | 		public CasaTray(CasaMain casaInstance, Config config) | ||||||
| 		{ | 		{ | ||||||
| 			mCasaMain = casaInstance; | 			mCasaMain = casaInstance; | ||||||
|  | 			m_config = config; | ||||||
| 			Setup(); | 			Setup(); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| @@ -308,9 +314,11 @@ namespace Novell.CASA.GUI | |||||||
|  |  | ||||||
| 		private void notifyIcon_DoubleClick(object sender, EventArgs e) | 		private void notifyIcon_DoubleClick(object sender, EventArgs e) | ||||||
| 		{						 | 		{						 | ||||||
|  |  | ||||||
| 			//menuLockMiCasa_Activated(sender, e);		 | 			//menuLockMiCasa_Activated(sender, e);		 | ||||||
|  | 			if (m_config.GetConfigSetting(Common.DISPLAY_CASA_MANAGER, true)) | ||||||
| 				menuLaunchGUI_Activated(sender, e); | 				menuLaunchGUI_Activated(sender, e); | ||||||
|  | 			else | ||||||
|  | 				menuLockMiCasa_Activated(sender, e); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		private void menuDestroyMiCasa_Activated(object sender, EventArgs e) | 		private void menuDestroyMiCasa_Activated(object sender, EventArgs e) | ||||||
| @@ -333,9 +341,20 @@ namespace Novell.CASA.GUI | |||||||
| 				notifyIcon.Icon = m_iconNormal; | 				notifyIcon.Icon = m_iconNormal; | ||||||
| 			} | 			} | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | 		internal void StopRunningInTray() | ||||||
|  | 		{ | ||||||
|  | #if W32 | ||||||
|  | 			notifyIcon.Dispose(); | ||||||
|  | #endif | ||||||
|  | #if LINUX | ||||||
|  | 			eb.Remove(m_imageUnlocked); | ||||||
|  | 			//icon.Dispose(); | ||||||
|  | #endif | ||||||
|  | 		} | ||||||
|  | 		 | ||||||
|  |  | ||||||
| 		internal void Destroy() | 		internal void Destroy() | ||||||
| 		{ | 		{ | ||||||
|  |  | ||||||
| @@ -346,8 +365,7 @@ namespace Novell.CASA.GUI | |||||||
| 			notifyIcon.Dispose(); | 			notifyIcon.Dispose(); | ||||||
| #endif | #endif | ||||||
| #if LINUX | #if LINUX | ||||||
| 			// Does not work | 			eb.Remove(m_imageUnlocked); | ||||||
| 			icon.Dispose(); |  | ||||||
| #endif | #endif | ||||||
| 			Application.Quit(); | 			Application.Quit(); | ||||||
| 			 | 			 | ||||||
|   | |||||||
| @@ -132,6 +132,8 @@ public class Common | |||||||
| 	public static string	ARG_SHOW_TRAY_ICON			= "-tray"; | 	public static string	ARG_SHOW_TRAY_ICON			= "-tray"; | ||||||
| 	public static string	ARG_DEBUG					= "-debug"; | 	public static string	ARG_DEBUG					= "-debug"; | ||||||
|  |  | ||||||
|  | 	public static string	CONFIG_RUN_IN_TRAY			= "RunInTray"; | ||||||
|  | 	 | ||||||
|  |  | ||||||
| 	///############################################################# | 	///############################################################# | ||||||
| 	///CasaIcons path | 	///CasaIcons path | ||||||
|   | |||||||
| @@ -4298,7 +4298,7 @@ prompted for the Master Password at startup.</property> | |||||||
|   <property name="type">GTK_WINDOW_TOPLEVEL</property> |   <property name="type">GTK_WINDOW_TOPLEVEL</property> | ||||||
|   <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> |   <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> | ||||||
|   <property name="modal">True</property> |   <property name="modal">True</property> | ||||||
|   <property name="resizable">False</property> |   <property name="resizable">True</property> | ||||||
|   <property name="destroy_with_parent">True</property> |   <property name="destroy_with_parent">True</property> | ||||||
|   <property name="icon">CASAicons.ico</property> |   <property name="icon">CASAicons.ico</property> | ||||||
|   <property name="decorated">True</property> |   <property name="decorated">True</property> | ||||||
| @@ -4513,6 +4513,179 @@ prompted for the Master Password at startup.</property> | |||||||
| 	    </packing> | 	    </packing> | ||||||
| 	  </child> | 	  </child> | ||||||
|  |  | ||||||
|  | 	  <child> | ||||||
|  | 	    <widget class="GtkFrame" id="frame29"> | ||||||
|  | 	      <property name="border_width">6</property> | ||||||
|  | 	      <property name="visible">True</property> | ||||||
|  | 	      <property name="label_xalign">0</property> | ||||||
|  | 	      <property name="label_yalign">0.5</property> | ||||||
|  | 	      <property name="shadow_type">GTK_SHADOW_IN</property> | ||||||
|  |  | ||||||
|  | 	      <child> | ||||||
|  | 		<widget class="GtkAlignment" id="alignment44"> | ||||||
|  | 		  <property name="visible">True</property> | ||||||
|  | 		  <property name="xalign">0.5</property> | ||||||
|  | 		  <property name="yalign">0.5</property> | ||||||
|  | 		  <property name="xscale">1</property> | ||||||
|  | 		  <property name="yscale">1</property> | ||||||
|  | 		  <property name="top_padding">0</property> | ||||||
|  | 		  <property name="bottom_padding">0</property> | ||||||
|  | 		  <property name="left_padding">12</property> | ||||||
|  | 		  <property name="right_padding">0</property> | ||||||
|  |  | ||||||
|  | 		  <child> | ||||||
|  | 		    <widget class="GtkVBox" id="vbox146"> | ||||||
|  | 		      <property name="border_width">4</property> | ||||||
|  | 		      <property name="visible">True</property> | ||||||
|  | 		      <property name="homogeneous">False</property> | ||||||
|  | 		      <property name="spacing">0</property> | ||||||
|  |  | ||||||
|  | 		      <child> | ||||||
|  | 			<widget class="GtkCheckButton" id="checkbuttonRunInTray"> | ||||||
|  | 			  <property name="visible">True</property> | ||||||
|  | 			  <property name="can_focus">True</property> | ||||||
|  | 			  <property name="label" translatable="yes">Show CASA Manager in notify area</property> | ||||||
|  | 			  <property name="use_underline">True</property> | ||||||
|  | 			  <property name="relief">GTK_RELIEF_NORMAL</property> | ||||||
|  | 			  <property name="focus_on_click">True</property> | ||||||
|  | 			  <property name="active">False</property> | ||||||
|  | 			  <property name="inconsistent">False</property> | ||||||
|  | 			  <property name="draw_indicator">True</property> | ||||||
|  | 			  <signal name="clicked" handler="on_checkbuttonRunInTray_clicked" last_modification_time="Thu, 13 Jul 2006 19:51:18 GMT"/> | ||||||
|  | 			</widget> | ||||||
|  | 			<packing> | ||||||
|  | 			  <property name="padding">0</property> | ||||||
|  | 			  <property name="expand">False</property> | ||||||
|  | 			  <property name="fill">False</property> | ||||||
|  | 			</packing> | ||||||
|  | 		      </child> | ||||||
|  |  | ||||||
|  | 		      <child> | ||||||
|  | 			<widget class="GtkHBox" id="hbox86"> | ||||||
|  | 			  <property name="visible">True</property> | ||||||
|  | 			  <property name="homogeneous">False</property> | ||||||
|  | 			  <property name="spacing">0</property> | ||||||
|  |  | ||||||
|  | 			  <child> | ||||||
|  | 			    <widget class="GtkLabel" id="label262"> | ||||||
|  | 			      <property name="visible">True</property> | ||||||
|  | 			      <property name="label" translatable="yes">      </property> | ||||||
|  | 			      <property name="use_underline">False</property> | ||||||
|  | 			      <property name="use_markup">False</property> | ||||||
|  | 			      <property name="justify">GTK_JUSTIFY_LEFT</property> | ||||||
|  | 			      <property name="wrap">False</property> | ||||||
|  | 			      <property name="selectable">False</property> | ||||||
|  | 			      <property name="xalign">0.5</property> | ||||||
|  | 			      <property name="yalign">0.5</property> | ||||||
|  | 			      <property name="xpad">0</property> | ||||||
|  | 			      <property name="ypad">0</property> | ||||||
|  | 			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> | ||||||
|  | 			      <property name="width_chars">-1</property> | ||||||
|  | 			      <property name="single_line_mode">False</property> | ||||||
|  | 			      <property name="angle">0</property> | ||||||
|  | 			    </widget> | ||||||
|  | 			    <packing> | ||||||
|  | 			      <property name="padding">0</property> | ||||||
|  | 			      <property name="expand">False</property> | ||||||
|  | 			      <property name="fill">False</property> | ||||||
|  | 			    </packing> | ||||||
|  | 			  </child> | ||||||
|  |  | ||||||
|  | 			  <child> | ||||||
|  | 			    <widget class="GtkVBox" id="vbox147"> | ||||||
|  | 			      <property name="visible">True</property> | ||||||
|  | 			      <property name="homogeneous">False</property> | ||||||
|  | 			      <property name="spacing">0</property> | ||||||
|  |  | ||||||
|  | 			      <child> | ||||||
|  | 				<widget class="GtkRadioButton" id="radiobutton1"> | ||||||
|  | 				  <property name="visible">True</property> | ||||||
|  | 				  <property name="can_focus">True</property> | ||||||
|  | 				  <property name="label" translatable="yes">Display CASA Manager when icon is clicked</property> | ||||||
|  | 				  <property name="use_underline">True</property> | ||||||
|  | 				  <property name="relief">GTK_RELIEF_NORMAL</property> | ||||||
|  | 				  <property name="focus_on_click">True</property> | ||||||
|  | 				  <property name="active">False</property> | ||||||
|  | 				  <property name="inconsistent">False</property> | ||||||
|  | 				  <property name="draw_indicator">True</property> | ||||||
|  | 				  <signal name="toggled" handler="on_radiobutton1_clicked" last_modification_time="Thu, 13 Jul 2006 21:36:16 GMT"/> | ||||||
|  | 				</widget> | ||||||
|  | 				<packing> | ||||||
|  | 				  <property name="padding">0</property> | ||||||
|  | 				  <property name="expand">False</property> | ||||||
|  | 				  <property name="fill">False</property> | ||||||
|  | 				</packing> | ||||||
|  | 			      </child> | ||||||
|  |  | ||||||
|  | 			      <child> | ||||||
|  | 				<widget class="GtkRadioButton" id="radiobutton2"> | ||||||
|  | 				  <property name="visible">True</property> | ||||||
|  | 				  <property name="can_focus">True</property> | ||||||
|  | 				  <property name="label" translatable="yes">Lock/Unlock secrets when icon is clicked</property> | ||||||
|  | 				  <property name="use_underline">True</property> | ||||||
|  | 				  <property name="relief">GTK_RELIEF_NORMAL</property> | ||||||
|  | 				  <property name="focus_on_click">True</property> | ||||||
|  | 				  <property name="active">False</property> | ||||||
|  | 				  <property name="inconsistent">False</property> | ||||||
|  | 				  <property name="draw_indicator">True</property> | ||||||
|  | 				  <property name="group">radiobutton1</property> | ||||||
|  | 				  <signal name="toggled" handler="on_radiobutton1_clicked" last_modification_time="Thu, 13 Jul 2006 21:36:25 GMT"/> | ||||||
|  | 				</widget> | ||||||
|  | 				<packing> | ||||||
|  | 				  <property name="padding">0</property> | ||||||
|  | 				  <property name="expand">False</property> | ||||||
|  | 				  <property name="fill">False</property> | ||||||
|  | 				</packing> | ||||||
|  | 			      </child> | ||||||
|  | 			    </widget> | ||||||
|  | 			    <packing> | ||||||
|  | 			      <property name="padding">0</property> | ||||||
|  | 			      <property name="expand">True</property> | ||||||
|  | 			      <property name="fill">True</property> | ||||||
|  | 			    </packing> | ||||||
|  | 			  </child> | ||||||
|  | 			</widget> | ||||||
|  | 			<packing> | ||||||
|  | 			  <property name="padding">0</property> | ||||||
|  | 			  <property name="expand">True</property> | ||||||
|  | 			  <property name="fill">True</property> | ||||||
|  | 			</packing> | ||||||
|  | 		      </child> | ||||||
|  | 		    </widget> | ||||||
|  | 		  </child> | ||||||
|  | 		</widget> | ||||||
|  | 	      </child> | ||||||
|  |  | ||||||
|  | 	      <child> | ||||||
|  | 		<widget class="GtkLabel" id="label261"> | ||||||
|  | 		  <property name="visible">True</property> | ||||||
|  | 		  <property name="label" translatable="yes"><b> Options </b></property> | ||||||
|  | 		  <property name="use_underline">False</property> | ||||||
|  | 		  <property name="use_markup">True</property> | ||||||
|  | 		  <property name="justify">GTK_JUSTIFY_LEFT</property> | ||||||
|  | 		  <property name="wrap">False</property> | ||||||
|  | 		  <property name="selectable">False</property> | ||||||
|  | 		  <property name="xalign">0.5</property> | ||||||
|  | 		  <property name="yalign">0.5</property> | ||||||
|  | 		  <property name="xpad">0</property> | ||||||
|  | 		  <property name="ypad">0</property> | ||||||
|  | 		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> | ||||||
|  | 		  <property name="width_chars">-1</property> | ||||||
|  | 		  <property name="single_line_mode">False</property> | ||||||
|  | 		  <property name="angle">0</property> | ||||||
|  | 		</widget> | ||||||
|  | 		<packing> | ||||||
|  | 		  <property name="type">label_item</property> | ||||||
|  | 		</packing> | ||||||
|  | 	      </child> | ||||||
|  | 	    </widget> | ||||||
|  | 	    <packing> | ||||||
|  | 	      <property name="padding">0</property> | ||||||
|  | 	      <property name="expand">True</property> | ||||||
|  | 	      <property name="fill">True</property> | ||||||
|  | 	    </packing> | ||||||
|  | 	  </child> | ||||||
|  |  | ||||||
| 	  <child> | 	  <child> | ||||||
| 	    <widget class="GtkFrame" id="frame16"> | 	    <widget class="GtkFrame" id="frame16"> | ||||||
| 	      <property name="border_width">6</property> | 	      <property name="border_width">6</property> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user