Add 'Do not show again' on 2 dialogs. (Refresh and delete dialogs)

This commit is contained in:
Jim Norman 2006-09-20 22:58:27 +00:00
parent 03ca6a4a03
commit 466357aa0e
5 changed files with 98 additions and 15 deletions

View File

@ -103,7 +103,8 @@ namespace Novell.CASA.GUI
checkbuttonKdeWallet,
checkbuttonCloseMessage,
checkbuttonRunInTray,
checkbuttonSaveSecrets;
checkbuttonSaveSecrets,
checkbuttonShowRefreshDialog;
[Glade.Widget]
@ -1076,15 +1077,28 @@ namespace Novell.CASA.GUI
/// </summary>
public void RefreshAllStores(object obj, EventArgs args)
{
Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogConfirmRefresh", null);
gxmlTemp.Autoconnect (this);
dialogConfirmRefresh.TransientFor = windowMain;
if (config.GetConfigSetting(Common.CONFIG_SHOW_REFRESH_DIALOG, true))
{
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)
{
Logger.DbgLog("GUI:CasaMain.on_buttonRefreshYes_clicked() - BEGIN");
if ((checkbuttonShowRefreshDialog != null) && (checkbuttonShowRefreshDialog.Active))
{
config.SetConfigSetting(Common.CONFIG_SHOW_REFRESH_DIALOG, false);
config.WriteConfig();
}
RefreshStores();
dialogConfirmRefresh.Destroy();

View File

@ -144,6 +144,8 @@ public class Common
public static string CONFIG_DISPLAY_CASA_MANAGER = "DisplayCasaManagerOnClick";
public static string CONFIG_PERSISTENT_DIRECTORY = "PersistentDirectory";
public static string CONFIG_PERSIST_SECRETS = "PersistSecrets";
public static string CONFIG_SHOW_REFRESH_DIALOG = "ShowRefreshDialog";
public static string CONFIG_SHOW_DELETE_DIALOG = "ShowDeleteDialog";
///#############################################################

View File

@ -90,7 +90,8 @@ public class MiCasa : Store
entryMasterPassword4;
[Glade.Widget]
Gtk.CheckButton cbuttonShowPassword;
Gtk.CheckButton cbuttonShowPassword,
checkbuttonShowDeleteDialog;
[Glade.Widget]
Gtk.MenuItem cmiNewKey,
@ -977,19 +978,39 @@ public class MiCasa : Store
if( 0 != tvSecretIDMiCasa.Selection.CountSelectedRows() )
{
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";
TreeModel model;
TreeModel model;
TreeIter iter;
string selected = null;
if( tvSecretIDMiCasa.Selection.GetSelected (out model, out iter) )
{
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) )
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());
}
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");
}

View File

@ -1784,6 +1784,25 @@ their backend stores.</property>
<property name="fill">False</property>
</packing>
</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>
<packing>
<property name="padding">0</property>
@ -3787,6 +3806,24 @@ their backend stores.</property>
<property name="fill">False</property>
</packing>
</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>
<packing>
<property name="padding">0</property>

View File

@ -797,11 +797,14 @@ namespace sscs.cache
// the user might have set a different one
// load the policy file and check.
UIPol uiPolicy = (UIPol)ICASAPol.GetPolicy(CASAPolType.UI_POL, GetUserHomeDirectory());
string sDir = uiPolicy.GetConfigSetting(ConstStrings.CONFIG_PERSISTENT_DIRECTORY);
if ((sDir != null) && (sDir.Length > 0))
if (uiPolicy != null)
{
m_persistenceDirectory = sDir;
return m_persistenceDirectory;
string sDir = uiPolicy.GetConfigSetting(ConstStrings.CONFIG_PERSISTENT_DIRECTORY);
if ((sDir != null) && (sDir.Length > 0))
{
m_persistenceDirectory = sDir;
return m_persistenceDirectory;
}
}
}