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

View File

@ -181,7 +181,7 @@ namespace Novell.CASA.GUI
try try
{ {
if (mCasaTray == null) if (mCasaTray == null)
mCasaTray = new CasaTray(); mCasaTray = new CasaTray(this);
} }
catch{} catch{}
} }
@ -672,20 +672,7 @@ namespace Novell.CASA.GUI
{ {
Logger.DbgLog("GUI:CasaMain.on_buttonRefreshYes_clicked() - BEGIN"); Logger.DbgLog("GUI:CasaMain.on_buttonRefreshYes_clicked() - BEGIN");
if( Common.IS_MICASA ) RefreshStores();
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();
dialogConfirmRefresh.Destroy(); dialogConfirmRefresh.Destroy();
@ -713,7 +700,7 @@ namespace Novell.CASA.GUI
{ {
Logger.DbgLog("GUI:CasaMain.QuitApplication() - BEGIN"); Logger.DbgLog("GUI:CasaMain.QuitApplication() - BEGIN");
windowMain.Destroy(); //windowMain.Destroy();
HandleQuit(); HandleQuit();
Logger.DbgLog("GUI:CasaMain.QuitApplication() - END"); Logger.DbgLog("GUI:CasaMain.QuitApplication() - END");
@ -828,6 +815,8 @@ namespace Novell.CASA.GUI
mmiUnlockSecrets.Sensitive = true; mmiUnlockSecrets.Sensitive = true;
mmiDestroySecrets.Sensitive = false; mmiDestroySecrets.Sensitive = false;
notebookStores.Sensitive = false; notebookStores.Sensitive = false;
mmiNew.Sensitive = false; mmiNew.Sensitive = false;
mmiRefresh.Sensitive = false; mmiRefresh.Sensitive = false;
mmiDebug.Sensitive = false; mmiDebug.Sensitive = false;
@ -841,10 +830,15 @@ namespace Novell.CASA.GUI
mmiUnlockSecrets.Sensitive = false; mmiUnlockSecrets.Sensitive = false;
mmiDestroySecrets.Sensitive = true; mmiDestroySecrets.Sensitive = true;
notebookStores.Sensitive = true; notebookStores.Sensitive = true;
mmiRefresh.Sensitive = true; mmiRefresh.Sensitive = true;
mmiDebug.Sensitive = true; mmiDebug.Sensitive = true;
mmiOptions.Sensitive = true; mmiOptions.Sensitive = true;
mmiEdit.Sensitive = true; mmiEdit.Sensitive = true;
//refresh secrets
RefreshStores();
} }
@ -1353,8 +1347,9 @@ namespace Novell.CASA.GUI
{ {
Logger.DbgLog("GUI:CasaMain.OnWindowMainDeleted() - BEGIN"); Logger.DbgLog("GUI:CasaMain.OnWindowMainDeleted() - BEGIN");
windowMain.Destroy(); //windowMain.Destroy();
HandleQuit(); HandleQuit();
//Gtk.Application.Quit (); //Gtk.Application.Quit ();
args.RetVal = true; args.RetVal = true;
@ -1399,6 +1394,41 @@ namespace Novell.CASA.GUI
windowMain.Present(); 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 /// LOGGING WINDOW operations
/// ///

View File

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