Bug 141924. Refresh secrets after unlock. Additional GUI behavior fixes.

This commit is contained in:
Jim Norman 2006-01-09 18:55:50 +00:00
parent 95544542e0
commit 22c4b384b8
3 changed files with 87 additions and 35 deletions

View File

@ -27,8 +27,10 @@ namespace Novell.CASA.DataEngines
{
// Always Aggregate miCASA.
micasaengine = new miCASAEngine();
#if LINUX
kwEngine = new KWalletEngine();
gkEngine = new GKEngine();
#endif
/*
// Reading Policy to see what else needs to be Aggregated.
@ -191,10 +193,12 @@ namespace Novell.CASA.DataEngines
{
if (StoreID == ConstStrings.CASA_STORE_MICASA)
return micasaengine.SetSecret(secret, opnType);
#if LINUX
if (StoreID == ConstStrings.CASA_STORE_KWALLET)
return kwEngine.SetSecret(secret, opnType);
if (StoreID == ConstStrings.CASA_STORE_GK)
return gkEngine.SetSecret(secret, opnType);
#endif
else
{
#if LINUX
@ -238,10 +242,12 @@ namespace Novell.CASA.DataEngines
{
if (StoreID == ConstStrings.CASA_STORE_MICASA)
return micasaengine.SetSecret(secret);
#if LINUX
if (StoreID == ConstStrings.CASA_STORE_KWALLET)
return kwEngine.SetSecret(secret);
if (StoreID == ConstStrings.CASA_STORE_GK)
return gkEngine.SetSecret(secret);
#endif
else
{
#if LINUX
@ -297,10 +303,12 @@ namespace Novell.CASA.DataEngines
if (StoreID == ConstStrings.CASA_STORE_MICASA)
return micasaengine.Remove(secret);
#if LINUX
if (StoreID == ConstStrings.CASA_STORE_KWALLET)
return kwEngine.Remove(secret);
if (StoreID == ConstStrings.CASA_STORE_GK)
return gkEngine.Remove(secret);
#endif
return -1;
}

View File

@ -49,24 +49,24 @@ namespace Novell.CASA.GUI
[Glade.Widget]
Gtk.Dialog dialogPersistentStorage,
dialogPreferences,
dialogAbout,
dialogLogin,
dialogLoginContinue,
dialogConfirmRefresh,
dialogSingleInstance,
dialogLoginReprompt,
dialogShortPassword,
dialogResetMP;
dialogPreferences,
dialogAbout,
dialogLogin,
dialogLoginContinue,
dialogConfirmRefresh,
dialogSingleInstance,
dialogLoginReprompt,
dialogShortPassword,
dialogResetMP;
[Glade.Widget]
Gtk.Entry entryMasterPassword1,
entryMasterPassword2,
entryMasterPassword3,
entryMasterPassword4,
entryOldMP,
entryNewMP1,
entryNewMP2;
entryMasterPassword2,
entryMasterPassword3,
entryMasterPassword4,
entryOldMP,
entryNewMP1,
entryNewMP2;
[Glade.Widget]
Gtk.CheckButton checkbuttonFirefox,
@ -99,7 +99,7 @@ namespace Novell.CASA.GUI
[Glade.Widget]
#endregion
#endregion
public static CasaTray mCasaTray = null;
@ -181,7 +181,7 @@ namespace Novell.CASA.GUI
try
{
if (mCasaTray == null)
mCasaTray = new CasaTray();
mCasaTray = new CasaTray(this);
}
catch{}
}
@ -672,20 +672,7 @@ namespace Novell.CASA.GUI
{
Logger.DbgLog("GUI:CasaMain.on_buttonRefreshYes_clicked() - BEGIN");
if( Common.IS_MICASA )
objMiCasa.AggregateStore();
if( Common.IS_FIREFOX )
objFirefox.AggregateStore();
if( Common.IS_MOZILLA )
objMozilla.AggregateStore();
if( Common.IS_KDEWALLET )
objKdeWallet.AggregateStore();
if( Common.IS_GNOMEKEYRING )
objGnomeKeyring.AggregateStore();
RefreshStores();
dialogConfirmRefresh.Destroy();
@ -713,7 +700,7 @@ namespace Novell.CASA.GUI
{
Logger.DbgLog("GUI:CasaMain.QuitApplication() - BEGIN");
windowMain.Destroy();
//windowMain.Destroy();
HandleQuit();
Logger.DbgLog("GUI:CasaMain.QuitApplication() - END");
@ -828,6 +815,8 @@ namespace Novell.CASA.GUI
mmiUnlockSecrets.Sensitive = true;
mmiDestroySecrets.Sensitive = false;
notebookStores.Sensitive = false;
mmiNew.Sensitive = false;
mmiRefresh.Sensitive = false;
mmiDebug.Sensitive = false;
@ -840,11 +829,16 @@ namespace Novell.CASA.GUI
mmiLockSecrets.Sensitive = true;
mmiUnlockSecrets.Sensitive = false;
mmiDestroySecrets.Sensitive = true;
notebookStores.Sensitive = true;
notebookStores.Sensitive = true;
mmiRefresh.Sensitive = true;
mmiDebug.Sensitive = true;
mmiOptions.Sensitive = true;
mmiEdit.Sensitive = true;
//refresh secrets
RefreshStores();
}
@ -1353,8 +1347,9 @@ namespace Novell.CASA.GUI
{
Logger.DbgLog("GUI:CasaMain.OnWindowMainDeleted() - BEGIN");
windowMain.Destroy();
//windowMain.Destroy();
HandleQuit();
//Gtk.Application.Quit ();
args.RetVal = true;
@ -1399,6 +1394,41 @@ namespace Novell.CASA.GUI
windowMain.Present();
}
internal void Hide()
{
windowMain.Visible = false;
}
internal void Show()
{
RefreshStores();
windowMain.Visible = true;
}
internal void Dispose()
{
windowMain.Destroy();
}
internal void RefreshStores()
{
if( Common.IS_MICASA )
objMiCasa.AggregateStore();
if( Common.IS_FIREFOX )
objFirefox.AggregateStore();
if( Common.IS_MOZILLA )
objMozilla.AggregateStore();
if( Common.IS_KDEWALLET )
objKdeWallet.AggregateStore();
if( Common.IS_GNOMEKEYRING )
objGnomeKeyring.AggregateStore();
}
///#######################################################################
/// LOGGING WINDOW operations
///

View File

@ -201,6 +201,10 @@ namespace Novell.CASA.GUI
{
ShowContextMenu();
}
if (args.Event.Button == 1)
{
menuLaunchGUI_Activated(null, null);
}
}
private void OnPopupClick(object o, EventArgs args)
{
@ -221,7 +225,9 @@ namespace Novell.CASA.GUI
public void CasaManagerQuit()
{
mCasaMain = null;
//mCasaMain = null;
if (mCasaMain != null)
mCasaMain.Hide();
}
private void menuLaunchGUI_Activated(object sender, EventArgs e)
@ -230,7 +236,10 @@ namespace Novell.CASA.GUI
if (mCasaMain == null)
mCasaMain = new CasaMain(null);
else
{
mCasaMain.Show();
mCasaMain.Focus();
}
}
private void menuLockMiCasa_Activated(object sender, EventArgs e)
@ -297,6 +306,10 @@ namespace Novell.CASA.GUI
internal void Destroy()
{
if (mCasaMain != null)
mCasaMain.Dispose();
#if W32
notifyIcon.Dispose();
#endif
@ -304,6 +317,7 @@ namespace Novell.CASA.GUI
// Does not work
icon.Dispose();
#endif
Application.Quit();
}
}