This commit is contained in:
@@ -1157,10 +1157,13 @@ namespace Novell.CASA.GUI
|
||||
dialogPreferences.SetPosition(Gtk.WindowPosition.CenterOnParent);
|
||||
dialogPreferences.TransientFor = windowMain;
|
||||
checkbuttonFirefox.Active=Common.IS_FIREFOX;
|
||||
checkbuttonMozilla.Active=Common.IS_MOZILLA;
|
||||
checkbuttonGnomeKeyring.Active=checkbuttonGnomeKeyring.Sensitive=Common.IS_GNOMEKEYRING;
|
||||
checkbuttonKdeWallet.Active=checkbuttonKdeWallet.Sensitive=Common.IS_KDEWALLET;
|
||||
checkbuttonMozilla.Active=Common.IS_MOZILLA;
|
||||
checkbuttonGnomeKeyring.Active=Common.IS_GNOMEKEYRING;
|
||||
checkbuttonKdeWallet.Active=Common.IS_KDEWALLET;
|
||||
|
||||
checkbuttonGnomeKeyring.Sensitive=Common.IS_KDEWALLET_AVAILABLE;
|
||||
checkbuttonKdeWallet.Sensitive=Common.IS_GNOMEKEYRING_AVAILABLE;
|
||||
|
||||
if (Common.IS_WINDOWS)
|
||||
{
|
||||
checkbuttonGnomeKeyring.Sensitive = false;
|
||||
|
||||
110
c_gui/Common.cs
110
c_gui/Common.cs
@@ -36,22 +36,28 @@ public class Common
|
||||
{
|
||||
|
||||
public const int STORE_MICASA = 0,
|
||||
STORE_FIREFOX = 1,
|
||||
STORE_MOZILLA = 2,
|
||||
STORE_KDEWALLET = 3,
|
||||
STORE_GNOMEKEYRING = 4;
|
||||
STORE_FIREFOX = 1,
|
||||
STORE_MOZILLA = 2,
|
||||
STORE_KDEWALLET = 3,
|
||||
STORE_GNOMEKEYRING = 4;
|
||||
|
||||
public static bool IS_MICASA = true,
|
||||
IS_FIREFOX = false,
|
||||
IS_MOZILLA = false,
|
||||
IS_KDEWALLET = false,
|
||||
IS_GNOMEKEYRING = false;
|
||||
public static bool IS_MICASA_AVAILABLE = true,
|
||||
IS_FIREFOX_AVAILABLE = false,
|
||||
IS_MOZILLA_AVAILABLE = false,
|
||||
IS_KDEWALLET_AVAILABLE = false,
|
||||
IS_GNOMEKEYRING_AVAILABLE = false;
|
||||
|
||||
public static bool IS_MICASA = true,
|
||||
IS_FIREFOX = false,
|
||||
IS_MOZILLA = false,
|
||||
IS_KDEWALLET = false,
|
||||
IS_GNOMEKEYRING = false;
|
||||
|
||||
public static bool IS_LINUX = false,
|
||||
IS_WINDOWS = false;
|
||||
public static bool IS_LINUX = false,
|
||||
IS_WINDOWS = false;
|
||||
|
||||
public static string GladeFile = null,
|
||||
DebugLogFile = null;
|
||||
public static string GladeFile = null,
|
||||
DebugLogFile = null;
|
||||
|
||||
|
||||
///##############################################################
|
||||
@@ -108,11 +114,11 @@ public class Common
|
||||
|
||||
///#############################################################
|
||||
///CasaIcons path
|
||||
#if W32
|
||||
public static string CASAICONS = "../images/CASAicons.ico";
|
||||
#endif
|
||||
#if LINUX
|
||||
public static string CASAICONS = "/usr/share/doc/packages/CASA/images/CASAicons.ico";
|
||||
#if W32
|
||||
public static string CASAICONS = "../images/CASAicons.ico";
|
||||
#endif
|
||||
#if LINUX
|
||||
public static string CASAICONS = "/usr/share/doc/packages/CASA/images/CASAicons.ico";
|
||||
#endif
|
||||
|
||||
///##############################################################
|
||||
@@ -308,40 +314,40 @@ public class Common
|
||||
}
|
||||
|
||||
|
||||
public static bool ShowUrl(string url)
|
||||
{
|
||||
|
||||
Process urlShowProcess = new Process();
|
||||
|
||||
if (Common.IS_LINUX)
|
||||
{
|
||||
String sCurrentDesktop = Environment.GetEnvironmentVariable("WINDOWMANAGER");
|
||||
if (sCurrentDesktop != null && (sCurrentDesktop.IndexOf("kde") > 0))
|
||||
urlShowProcess.StartInfo.FileName = "kde-open";
|
||||
else
|
||||
urlShowProcess.StartInfo.FileName = "gnome-open";
|
||||
|
||||
urlShowProcess.StartInfo.Arguments = url;
|
||||
}
|
||||
else
|
||||
urlShowProcess.StartInfo.FileName = url;
|
||||
|
||||
try
|
||||
{
|
||||
urlShowProcess.Start();
|
||||
urlShowProcess.WaitForExit();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.DbgLog(e.Message);
|
||||
Logger.DbgLog(e.StackTrace);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (urlShowProcess.ExitCode == 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
public static bool ShowUrl(string url)
|
||||
{
|
||||
|
||||
Process urlShowProcess = new Process();
|
||||
|
||||
if (Common.IS_LINUX)
|
||||
{
|
||||
String sCurrentDesktop = Environment.GetEnvironmentVariable("WINDOWMANAGER");
|
||||
if (sCurrentDesktop != null && (sCurrentDesktop.IndexOf("kde") > 0))
|
||||
urlShowProcess.StartInfo.FileName = "kde-open";
|
||||
else
|
||||
urlShowProcess.StartInfo.FileName = "gnome-open";
|
||||
|
||||
urlShowProcess.StartInfo.Arguments = url;
|
||||
}
|
||||
else
|
||||
urlShowProcess.StartInfo.FileName = url;
|
||||
|
||||
try
|
||||
{
|
||||
urlShowProcess.Start();
|
||||
urlShowProcess.WaitForExit();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.DbgLog(e.Message);
|
||||
Logger.DbgLog(e.StackTrace);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (urlShowProcess.ExitCode == 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,9 @@ namespace Novell.CASA.GUI {
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Common.IS_KDEWALLET_AVAILABLE = AD.IsStoreAvailable(Common.STORE_KDEWALLET);
|
||||
Common.IS_GNOMEKEYRING_AVAILABLE = AD.IsStoreAvailable(Common.STORE_GNOMEKEYRING);
|
||||
|
||||
aggPol = (AggregationPol) ICASAPol.GetPolicy(CASAPolType.AGGREGATION_POL);
|
||||
if( null == aggPol )
|
||||
@@ -72,20 +75,20 @@ namespace Novell.CASA.GUI {
|
||||
Logger.DbgLog("GUI:StorePolicyInterface.Init() - No Aggregation Policy Found.");
|
||||
return( Common.STATUS_POLICY_POLICYNOTFOUND );
|
||||
}
|
||||
|
||||
|
||||
ArrayList stores = aggPol.StoreList;
|
||||
IEnumerator enumerator = stores.GetEnumerator();
|
||||
|
||||
while( enumerator.MoveNext() )
|
||||
{
|
||||
if( ((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName.Equals(Common.STORENAME_KDEWALLET) && true == AD.IsStoreAvailable(Common.STORE_KDEWALLET))
|
||||
{
|
||||
if( ((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName.Equals(Common.STORENAME_KDEWALLET))
|
||||
{
|
||||
Common.IS_KDEWALLET = true;
|
||||
storeNameKwallet = ((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName;
|
||||
storeIdKwallet[kWalletStoreCounter++] = ((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreId;
|
||||
Logger.DbgLog("GUI:StorePolicyInterface.Init() - miCASA policy = " + Common.IS_MICASA);
|
||||
}
|
||||
else if(((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName.Equals(Common.STORENAME_GNOMEKEYRING) && true == AD.IsStoreAvailable(Common.STORE_GNOMEKEYRING))
|
||||
else if(((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName.Equals(Common.STORENAME_GNOMEKEYRING))
|
||||
{
|
||||
Common.IS_GNOMEKEYRING=true;
|
||||
storeNameGkeyring=((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName;
|
||||
|
||||
Reference in New Issue
Block a user