Add 'Do not show again' on 2 dialogs. (Refresh and delete dialogs)
This commit is contained in:
		| @@ -103,7 +103,8 @@ namespace Novell.CASA.GUI | |||||||
| 						checkbuttonKdeWallet, | 						checkbuttonKdeWallet, | ||||||
| 						checkbuttonCloseMessage, | 						checkbuttonCloseMessage, | ||||||
| 						checkbuttonRunInTray, | 						checkbuttonRunInTray, | ||||||
| 						checkbuttonSaveSecrets; | 						checkbuttonSaveSecrets, | ||||||
|  | 						checkbuttonShowRefreshDialog; | ||||||
| 												 | 												 | ||||||
| 						 | 						 | ||||||
| 		[Glade.Widget]  | 		[Glade.Widget]  | ||||||
| @@ -1076,15 +1077,28 @@ namespace Novell.CASA.GUI | |||||||
| 		/// </summary> | 		/// </summary> | ||||||
| 		public void RefreshAllStores(object obj, EventArgs args) | 		public void RefreshAllStores(object obj, EventArgs args) | ||||||
| 		{ | 		{ | ||||||
| 			Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogConfirmRefresh", null); | 			if (config.GetConfigSetting(Common.CONFIG_SHOW_REFRESH_DIALOG, true)) | ||||||
| 			gxmlTemp.Autoconnect (this); | 			{ | ||||||
| 			dialogConfirmRefresh.TransientFor = windowMain;  	         | 				Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogConfirmRefresh", null); | ||||||
|  | 				gxmlTemp.Autoconnect (this); | ||||||
|  | 				dialogConfirmRefresh.TransientFor = windowMain;  	         | ||||||
|  | 			} | ||||||
|  | 			else | ||||||
|  | 			{ | ||||||
|  | 				RefreshStores(); | ||||||
|  | 			} | ||||||
| 		} | 		} | ||||||
|      |      | ||||||
| 		public void on_buttonRefreshYes_clicked(object abj, EventArgs args) | 		public void on_buttonRefreshYes_clicked(object abj, EventArgs args) | ||||||
| 		{ | 		{ | ||||||
| 			Logger.DbgLog("GUI:CasaMain.on_buttonRefreshYes_clicked() - BEGIN"); | 			Logger.DbgLog("GUI:CasaMain.on_buttonRefreshYes_clicked() - BEGIN"); | ||||||
|     	 |     	 | ||||||
|  | 			if ((checkbuttonShowRefreshDialog != null) && (checkbuttonShowRefreshDialog.Active)) | ||||||
|  | 			{ | ||||||
|  | 				config.SetConfigSetting(Common.CONFIG_SHOW_REFRESH_DIALOG, false); | ||||||
|  | 				config.WriteConfig(); | ||||||
|  | 			} | ||||||
|  |  | ||||||
| 			RefreshStores();    	 | 			RefreshStores();    	 | ||||||
| 			dialogConfirmRefresh.Destroy(); | 			dialogConfirmRefresh.Destroy(); | ||||||
|     	 |     	 | ||||||
|   | |||||||
| @@ -144,6 +144,8 @@ public class Common | |||||||
| 	public static string	CONFIG_DISPLAY_CASA_MANAGER			= "DisplayCasaManagerOnClick"; | 	public static string	CONFIG_DISPLAY_CASA_MANAGER			= "DisplayCasaManagerOnClick"; | ||||||
| 	public static string	CONFIG_PERSISTENT_DIRECTORY			= "PersistentDirectory"; | 	public static string	CONFIG_PERSISTENT_DIRECTORY			= "PersistentDirectory"; | ||||||
| 	public static string	CONFIG_PERSIST_SECRETS				= "PersistSecrets";	 | 	public static string	CONFIG_PERSIST_SECRETS				= "PersistSecrets";	 | ||||||
|  | 	public static string	CONFIG_SHOW_REFRESH_DIALOG			= "ShowRefreshDialog"; | ||||||
|  | 	public static string	CONFIG_SHOW_DELETE_DIALOG			= "ShowDeleteDialog"; | ||||||
|  |  | ||||||
|  |  | ||||||
| 	///############################################################# | 	///############################################################# | ||||||
|   | |||||||
| @@ -90,7 +90,8 @@ public class MiCasa : Store | |||||||
| 						entryMasterPassword4; | 						entryMasterPassword4; | ||||||
|   	 |   	 | ||||||
|   	[Glade.Widget]  |   	[Glade.Widget]  | ||||||
|   	Gtk.CheckButton		cbuttonShowPassword; |   	Gtk.CheckButton		cbuttonShowPassword, | ||||||
|  | 						checkbuttonShowDeleteDialog; | ||||||
|   	  	  	 |   	  	  	 | ||||||
|   	[Glade.Widget]  |   	[Glade.Widget]  | ||||||
|   	Gtk.MenuItem 		cmiNewKey, |   	Gtk.MenuItem 		cmiNewKey, | ||||||
| @@ -977,19 +978,39 @@ public class MiCasa : Store | |||||||
| 		 | 		 | ||||||
| 		if( 0 != tvSecretIDMiCasa.Selection.CountSelectedRows() ) | 		if( 0 != tvSecretIDMiCasa.Selection.CountSelectedRows() ) | ||||||
|         { |         { | ||||||
| 			Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogConfirmDelete", null); |  | ||||||
|         	gxmlTemp.Autoconnect (this); | 			TreeModel model; | ||||||
|             dialogConfirmDelete.TransientFor = (Gtk.Window)CasaMain.gxmlMain.GetWidget("windowMain");                 |  | ||||||
| 	    dialogConfirmDelete.Title = "miCASA - Delete Secret"; |  | ||||||
| 	     |  | ||||||
|         	TreeModel model; |  | ||||||
| 			TreeIter  iter; | 			TreeIter  iter; | ||||||
| 			string    selected = null;			 | 			string    selected = null;			 | ||||||
| 			if( tvSecretIDMiCasa.Selection.GetSelected (out model, out iter) ) | 			if( tvSecretIDMiCasa.Selection.GetSelected (out model, out iter) ) | ||||||
| 			{ | 			{ | ||||||
| 				selected = (string) model.GetValue (iter, 0); | 				selected = (string) model.GetValue (iter, 0); | ||||||
|  | 			} | ||||||
|  | 						 | ||||||
|  | 			if (m_config.GetConfigSetting(Common.CONFIG_SHOW_DELETE_DIALOG, true)) | ||||||
|  | 			{ | ||||||
|  | 			 | ||||||
|  | 				Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogConfirmDelete", null); | ||||||
|  | 				gxmlTemp.Autoconnect (this); | ||||||
|  | 				dialogConfirmDelete.TransientFor = (Gtk.Window)CasaMain.gxmlMain.GetWidget("windowMain");                 | ||||||
|  | 				dialogConfirmDelete.Title = "miCASA - Delete Secret"; | ||||||
|  | 				checkbuttonShowDeleteDialog.Visible = true; | ||||||
|  | 	     | ||||||
| 				if( (null != selected) && (selected.Length > 0) ) | 				if( (null != selected) && (selected.Length > 0) ) | ||||||
| 					entryDeleteSecretID.Text = selected; | 					entryDeleteSecretID.Text = selected; | ||||||
|  |  | ||||||
|  | 			} | ||||||
|  | 			else | ||||||
|  | 			{ | ||||||
|  | 				if( (null != selected) && (selected.Length > 0) ) | ||||||
|  | 				{ | ||||||
|  | 					if( Common.STATUS_SUCCESS == StoreDataInterface.UpdateStore(Common.STORE_MICASA, Common.OPERATION_DELETE_SECRET, "", "", ref model, ref iter) ) | ||||||
|  | 					{				 | ||||||
|  | 						tsSecretIDMiCasa.Remove(ref iter); | ||||||
|  | 						tvSecretIDMiCasa.ColumnsAutosize(); | ||||||
|  | 						tsNativeInfoMiCasa.Clear(); | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|          |          | ||||||
| @@ -1025,6 +1046,12 @@ public class MiCasa : Store | |||||||
| 			Logger.DbgLog("GUI:MiCasa.on_buttonYes_clicked() - EXCEPTION:" + exp.ToString()); | 			Logger.DbgLog("GUI:MiCasa.on_buttonYes_clicked() - EXCEPTION:" + exp.ToString()); | ||||||
| 		} | 		} | ||||||
| 		 | 		 | ||||||
|  | 		if ((checkbuttonShowDeleteDialog != null) && (checkbuttonShowDeleteDialog.Active)) | ||||||
|  | 		{ | ||||||
|  | 			m_config.SetConfigSetting(Common.CONFIG_SHOW_DELETE_DIALOG, false); | ||||||
|  | 			m_config.WriteConfig(); | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		Logger.DbgLog("GUI:MiCasa.on_buttonYes_clicked() - END");						 | 		Logger.DbgLog("GUI:MiCasa.on_buttonYes_clicked() - END");						 | ||||||
| 	} | 	} | ||||||
| 	 | 	 | ||||||
|   | |||||||
| @@ -1784,6 +1784,25 @@ their backend stores.</property> | |||||||
| 		  <property name="fill">False</property> | 		  <property name="fill">False</property> | ||||||
| 		</packing> | 		</packing> | ||||||
| 	      </child> | 	      </child> | ||||||
|  |  | ||||||
|  | 	      <child> | ||||||
|  | 		<widget class="GtkCheckButton" id="checkbuttonShowRefreshDialog"> | ||||||
|  | 		  <property name="visible">True</property> | ||||||
|  | 		  <property name="can_focus">True</property> | ||||||
|  | 		  <property name="label" translatable="yes">Do not show this in the future</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> | ||||||
|  | 		</widget> | ||||||
|  | 		<packing> | ||||||
|  | 		  <property name="padding">0</property> | ||||||
|  | 		  <property name="expand">False</property> | ||||||
|  | 		  <property name="fill">False</property> | ||||||
|  | 		</packing> | ||||||
|  | 	      </child> | ||||||
| 	    </widget> | 	    </widget> | ||||||
| 	    <packing> | 	    <packing> | ||||||
| 	      <property name="padding">0</property> | 	      <property name="padding">0</property> | ||||||
| @@ -3787,6 +3806,24 @@ their backend stores.</property> | |||||||
| 		  <property name="fill">False</property> | 		  <property name="fill">False</property> | ||||||
| 		</packing> | 		</packing> | ||||||
| 	      </child> | 	      </child> | ||||||
|  |  | ||||||
|  | 	      <child> | ||||||
|  | 		<widget class="GtkCheckButton" id="checkbuttonShowDeleteDialog"> | ||||||
|  | 		  <property name="can_focus">True</property> | ||||||
|  | 		  <property name="label" translatable="yes">Do not show this in the future</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> | ||||||
|  | 		</widget> | ||||||
|  | 		<packing> | ||||||
|  | 		  <property name="padding">0</property> | ||||||
|  | 		  <property name="expand">False</property> | ||||||
|  | 		  <property name="fill">False</property> | ||||||
|  | 		</packing> | ||||||
|  | 	      </child> | ||||||
| 	    </widget> | 	    </widget> | ||||||
| 	    <packing> | 	    <packing> | ||||||
| 	      <property name="padding">0</property> | 	      <property name="padding">0</property> | ||||||
|   | |||||||
							
								
								
									
										11
									
								
								CASA/micasad/cache/SecretStore.cs
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								CASA/micasad/cache/SecretStore.cs
									
									
									
									
										vendored
									
									
								
							| @@ -797,11 +797,14 @@ namespace sscs.cache | |||||||
| 				// the user might have set a different one | 				// the user might have set a different one | ||||||
| 				// load the policy file and check. | 				// load the policy file and check. | ||||||
| 				UIPol uiPolicy = (UIPol)ICASAPol.GetPolicy(CASAPolType.UI_POL, GetUserHomeDirectory()); | 				UIPol uiPolicy = (UIPol)ICASAPol.GetPolicy(CASAPolType.UI_POL, GetUserHomeDirectory()); | ||||||
| 				string sDir = uiPolicy.GetConfigSetting(ConstStrings.CONFIG_PERSISTENT_DIRECTORY); | 				if (uiPolicy != null) | ||||||
| 				if ((sDir != null) && (sDir.Length > 0)) |  | ||||||
| 				{ | 				{ | ||||||
| 					m_persistenceDirectory = sDir; | 					string sDir = uiPolicy.GetConfigSetting(ConstStrings.CONFIG_PERSISTENT_DIRECTORY); | ||||||
| 					return m_persistenceDirectory; | 					if ((sDir != null) && (sDir.Length > 0)) | ||||||
|  | 					{ | ||||||
|  | 						m_persistenceDirectory = sDir; | ||||||
|  | 						return m_persistenceDirectory; | ||||||
|  | 					} | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user