public CConfiguration(ArtType type) { GConfClient = new GConf.Client(); systemProxy = new ProxyAttrStruct(); gangProxy = new ProxyAttrStruct(); systemProxy.Ip = ""; //TODO:Why is it important to initialize it...an error occurs otherwise. gangProxy.Ip = ""; //TODO:Why is it important to initialize it...an error occurs otherwise. artType = type; dirSep = Path.DirectorySeparatorChar.ToString(); homePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + dirSep; settingsPath = Path.Combine(homePath, ".gnome2" + dirSep + "gnome-art-ng"); splashInstallPath = homePath + ".local/share/pixmaps/splash" + dirSep; applicationInstallPath = homePath + "." + themesDir + dirSep; decorationInstallPath = homePath + "." + themesDir + dirSep; iconInstallPath = homePath + iconDir + dirSep; tarIsAvailable = CUtility.TestIfProgIsInstalled("tar", "--version", "gnu tar"); grepIsAvailable = CUtility.TestIfProgIsInstalled("grep", "--version", "gnu grep"); sedIsAvailable = CUtility.TestIfProgIsInstalled("sed", "--version", "gnu sed"); setDistributionDependendSettings(); CreateDownloadDirectories(); //Create GConf listeners GConf.NotifyEventHandler changed_handler = new GConf.NotifyEventHandler(onSettingsChanged); GConfClient.AddNotify(sProxyGconfPath, changed_handler); //Load Configurations settingsLoadOk = LoadProgramSettings(); }
override protected void PreInstallation(CStatusWindow sw) { //Herunterladen sw.Mainlabel = Catalog.GetString(CConfiguration.txtDownloadTheme); GetThemeFile(sw); sw.SetProgress("1/" + installationSteps); //Entpacken sw.Mainlabel = Catalog.GetString(CConfiguration.txtExtracting); System.Collections.ArrayList al = new System.Collections.ArrayList(); al = CUtility.UncompressFile(LocalThemeFile, Path.GetTempPath(), false, null, al); Folder = ((string)(al[0])).Split('/'); //Console.WriteLine(Folder[0]); sw.SetProgress("2/" + installationSteps); //Convertieren sw.Mainlabel = Catalog.GetString(CConfiguration.txtConvertingIcons); sw.SetProgress("3/" + installationSteps); CIconThemeManager iconmanager = new CIconThemeManager(); iconmanager.ThemeName = Folder[0]; iconmanager.StatusWindow = sw; iconmanager.ImportIcons(Path.GetTempPath() + Folder[0]); sw.SetProgress("4/" + installationSteps); iconmanager.SaveAllIcons(config.IconInstallPath + "/", true); //Sichern client = new GConf.Client(); sw.Mainlabel = Catalog.GetString(CConfiguration.txtSavingForRestore); prevIconTheme = (string)client.Get(GConfIconThemeKey); sw.SetProgress("5/" + installationSteps); }
public Session() { gconfClient = new GConf.Client (); gconfClient.AddNotify ("/apps/csboard", new GConf. NotifyEventHandler (SessionChanged)); string dir = ""; string gnomedir = ""; gnomedir = Path.Combine (Environment. GetEnvironmentVariable ("HOME"), ".gnome2"); if (!Directory.Exists (gnomedir)) { Directory.CreateDirectory (gnomedir); } dir = Path.Combine (gnomedir, "csboard"); if (!Directory.Exists (dir)) { Directory.CreateDirectory (dir); } Filename = Path.Combine (dir, "session.pgn"); }
private void gConfInit() { if (gconf == null) { gconf = new GConf.Client (); gconf.AddNotify (getGConfPath (), gConfChanged); } }
private void Init() { if (gconf == null) { gconf = new GConf.Client(); } }
public ConfluenceConfiguration() { _gconf = new GConf.Client(); // Set defaults MaxSearchResults = DefaultMaxSearchResults; }
override protected void PreInstallation(CStatusWindow sw) { string tarParams = ""; client = new GConf.Client(); LocalThemeFile = config.ThemesPath + Path.GetFileName(DownloadUrl); string InstallThemeFile = config.ApplicationInstallPath + Path.GetFileName(DownloadUrl); tarParams = CUtility.GetTarParams(Path.GetExtension(DownloadUrl)); sw.Mainlabel = Catalog.GetString(CConfiguration.txtDownloadTheme); //Herunterladen if (!File.Exists(InstallThemeFile)) { GetThemeFile(sw); } sw.SetProgress("1/" + installationSteps); //Entpacken sw.Mainlabel = Catalog.GetString(CConfiguration.txtExtracting); Console.WriteLine("Command: tar" + tarParams + LocalThemeFile + " -C " + config.ApplicationInstallPath); ConOutp = CUtility.Execute("tar", tarParams + LocalThemeFile + " -C " + config.ApplicationInstallPath); sw.SetProgress("2/" + installationSteps); //Sichern sw.Mainlabel = Catalog.GetString(CConfiguration.txtSavingForRestore); previousApplicationTheme = (string)client.Get(GConfApplicationKey); sw.SetProgress("3/" + installationSteps); }
private void UpdateProxy() { RequestSettings settings = RequestSettings.getInstance(); GConf.Client client = new GConf.Client(); try { bool use = (bool)client.Get("/system/http_proxy/use_http_proxy"); if (!use) { return; } string host = (string)client.Get("/system/http_proxy/host"); if (host == null) { return; } int port = (int)client.Get("/system/http_proxy/port"); if (port <= 0) { return; } Console.WriteLine("Proxy " + host + ":" + port); settings.Proxy = new WebProxy(host, port); } catch (Exception e) {} }
public GConfProxy() { gconf_client = new GConf.Client(); gconf_client.AddNotify(PROXY, OnGConfNotify); gconf_client.AddNotify(HTTP_PROXY, OnGConfNotify); RefreshProxy(); }
public void Dispose() { if (gconf_client != null) { gconf_client.RemoveNotify(PROXY, OnGConfNotify); gconf_client.RemoveNotify(HTTP_PROXY, OnGConfNotify); gconf_client = null; } }
public static void SetBackgroundImage(string path) { GConf.Client client = new GConf.Client(); client.Set("/desktop/gnome/background/color_shading_type", "solid"); client.Set("/desktop/gnome/background/primary_color", "#000000"); client.Set("/desktop/gnome/background/picture_options", "zoom"); client.Set("/desktop/gnome/background/picture_opacity", 100); client.Set("/desktop/gnome/background/picture_filename", path); client.Set("/desktop/gnome/background/draw_background", true); }
public static void SetBackgroundImage (string path) { GConf.Client client = new GConf.Client (); client.Set ("/desktop/gnome/background/color_shading_type", "solid"); client.Set ("/desktop/gnome/background/primary_color", "#000000"); client.Set ("/desktop/gnome/background/picture_options", "stretched"); client.Set ("/desktop/gnome/background/picture_opacity", 100); client.Set ("/desktop/gnome/background/picture_filename", path); client.Set ("/desktop/gnome/background/draw_background", true); }
/// <summary> /// Unsets key /// </summary> /// <param name="client">Client.</param> /// <param name="key">Key.</param> public static void Unset(this GConf.Client client, string key) { using (System.Diagnostics.Process p = new System.Diagnostics.Process()) { p.StartInfo.FileName = "gconftool"; p.StartInfo.Arguments = "-u " + key; p.Start(); p.WaitForExit(); } }
public void SetAsWallpaper() { int width = 0; int height = 0; if (Hit ["fixme:width"] != null && Hit ["fixme:width"] == "") { width = Int32.Parse(Hit ["fixme:width"]); height = Int32.Parse(Hit ["fixme:height"]); } else { if (!System.IO.File.Exists(Hit.FileInfo.FullName)) { return; } Gdk.Pixbuf p = new Gdk.Pixbuf(Hit.FileInfo.FullName); width = p.Width; height = p.Height; } GConf.Client client = new GConf.Client(); client.Set("/desktop/gnome/background/picture_filename", Hit.FileInfo.FullName); if (width <= 640) { if (width == height) { // Tile client.Set("/desktop/gnome/background/picture_options", "wallpaper"); } else { // Center client.Set("/desktop/gnome/background/picture_options", "centered"); } } else if (height >= width) { // Stretch vertically, but not horizontally client.Set("/desktop/gnome/background/picture_options", "scaled"); } else { // Fit to screen client.Set("/desktop/gnome/background/picture_options", "stretched"); } client.SuggestSync(); }
protected override void PluginInitialize() { RegisterConfigurationKey("Username"); RegisterConfigurationKey("Password"); RegisterConfigurationKey("Country"); config = Globals.Configuration; source = new MusicStoreSource(this); SourceManager.AddSource(source); }
public GConfConfig(string baseUrl) { gconf = null; this.baseUrl = baseUrl; if (baseUrl != null) { baseHash = Charp.GetMD5HexHash(baseUrl); } appName = CHARP_APP_NAME; }
static void OnOpenDirClick(object o, EventArgs a) { GConf.Client client = new GConf.Client(); string command = "nautilus"; string args = (string)client.Get(LampManager.SettingsPanel.GCONF_APP_PATH + "/web_directory"); if (args == "") { args = "/var/www/"; } PHPCommands.executeCommand(command, args); }
static void OnLocalhostClick(object o, EventArgs a) { GConf.Client client = new GConf.Client(); string args = "http://localhost/"; string command = (string)client.Get(LampManager.SettingsPanel.GCONF_APP_PATH + "/browser"); if (command == "") { command = args; args = ""; } PHPCommands.executeCommand(command, args); }
public SettingsPanel() { this.Build(); client = new GConf.Client(); client.AddNotify(GCONF_APP_PATH, new GConf.NotifyEventHandler(GConf_Changed)); UpdateFromGConf(); // General webDirectoryEntry.Changed += on_web_directory_activate; // Apache apachectlEntry.Changed += on_apachectl_path_activate; }
static EvoUtils () { try { gc = new GConf.Client (); changed_handler = new GConf.NotifyEventHandler (OnAccountsSettingChanged); gc.AddNotify ("/apps/evolution/mail/accounts", changed_handler); source_url_to_uid = new Dictionary<Uri, string> (); SetupAccountUrlToUidMap (); } catch (Exception e) { Logger.Error ("Evolution: Error reading accounts: {0}", e); } }
static EvoUtils() { try { gc = new GConf.Client(); changed_handler = new GConf.NotifyEventHandler(OnAccountsSettingChanged); gc.AddNotify("/apps/evolution/mail/accounts", changed_handler); source_url_to_uid = new Dictionary <Uri, string> (); SetupAccountUrlToUidMap(); } catch (Exception e) { Logger.Error("Evolution: Error reading accounts: {0}", e); } }
static Metacity.Theme GetTheme() { if (theme == null) { try { GConf.Client client = new GConf.Client(); // client.AddNotify ("/apps/metacity/general", GConfNotify); string themeName = (string)client.Get("/apps/metacity/general/theme"); theme = Metacity.Theme.Load(themeName); } catch { // Don't crash if metacity is not available return(null); } } return(theme); }
static private void GetFontSettings() { GConf.Client client = new GConf.Client(); string font = null; try { font = client.Get("/desktop/gnome/interface/font_name") as string; } catch (GConf.NoSuchKeyException) { } // Sans 10 seems to be the default GNOME fallback if (font == null) { font = "Sans 10"; } Pango.FontDescription font_desc = Pango.FontDescription.FromString(font); preferred_font_family = font_desc.Family; preferred_font_size = font_desc.Size / Pango.Scale.PangoScale; }
protected override void PreInstallation(CStatusWindow sw) { string tarParams=""; client = new GConf.Client(); tarParams=CUtility.GetTarParams(Path.GetExtension(DownloadUrl)); sw.Mainlabel=Catalog.GetString(CConfiguration.txtDownloadTheme); if (!File.Exists(LocalThemeFile)) GetThemeFile(sw); sw.SetProgress("1/"+installationSteps); //Entpacken sw.Mainlabel=Catalog.GetString(CConfiguration.txtExtracting); Console.WriteLine("Command: tar"+tarParams+LocalThemeFile+" -C "+config.DecorationInstallPath); ConOutp = CUtility.Execute("tar",tarParams+LocalThemeFile+" -C "+config.DecorationInstallPath); sw.SetProgress("2/"+installationSteps); //Sichern sw.Mainlabel=Catalog.GetString(CConfiguration.txtSavingForRestore); previousDecorationTheme = (string)client.Get(GConfDecorationKey); sw.SetProgress("3/"+installationSteps); }
public override void Revert() { client = new GConf.Client(); client.Set(GConfIconThemeKey,prevIconTheme); revertIsAvailable=false; }
protected override void PreInstallation(CStatusWindow sw) { //Herunterladen sw.Mainlabel=Catalog.GetString(CConfiguration.txtDownloadTheme); GetThemeFile(sw); sw.SetProgress("1/"+installationSteps); //Entpacken sw.Mainlabel=Catalog.GetString(CConfiguration.txtExtracting); System.Collections.ArrayList al = new System.Collections.ArrayList(); al = CUtility.UncompressFile(LocalThemeFile,Path.GetTempPath(),false, null,al); Folder = ((string)(al[0])).Split('/'); //Console.WriteLine(Folder[0]); sw.SetProgress("2/"+installationSteps); //Convertieren sw.Mainlabel=Catalog.GetString(CConfiguration.txtConvertingIcons); sw.SetProgress("3/"+installationSteps); CIconThemeManager iconmanager = new CIconThemeManager(); iconmanager.ThemeName = Folder[0]; iconmanager.StatusWindow = sw; iconmanager.ImportIcons(Path.GetTempPath()+Folder[0]); sw.SetProgress("4/"+installationSteps); iconmanager.SaveAllIcons(config.IconInstallPath+"/",true); //Sichern client = new GConf.Client(); sw.Mainlabel=Catalog.GetString(CConfiguration.txtSavingForRestore); prevIconTheme=(string)client.Get(GConfIconThemeKey); sw.SetProgress("5/"+installationSteps); }
public void SetAsWallpaper () { int width = 0; int height = 0; if (Hit ["fixme:width"] != null && Hit ["fixme:width"] == "") { width = Int32.Parse (Hit ["fixme:width"]); height = Int32.Parse (Hit ["fixme:height"]); } else { if (! System.IO.File.Exists (Hit.FileInfo.FullName)) return; Gdk.Pixbuf p = new Gdk.Pixbuf (Hit.FileInfo.FullName); width = p.Width; height = p.Height; } GConf.Client client = new GConf.Client (); client.Set ("/desktop/gnome/background/picture_filename", Hit.FileInfo.FullName); if (width <= 640) { if (width == height) { // Tile client.Set ("/desktop/gnome/background/picture_options", "wallpaper"); } else { // Center client.Set ("/desktop/gnome/background/picture_options", "centered"); } } else if (height >= width) { // Stretch vertically, but not horizontally client.Set ("/desktop/gnome/background/picture_options", "scaled"); } else { // Fit to screen client.Set ("/desktop/gnome/background/picture_options", "stretched"); } client.SuggestSync (); }
public GConfPreferencesService(string rootPath) { RootPath = rootPath; client = new GConf.Client(); client.AddNotify(RootPath, new GConf.NotifyEventHandler(HandleGConfChanged)); }
public GConfXKeybinder() { client = new GConf.Client(); bindings = new ArrayList(); }
public GConfPreferencesClient() { client = new GConf.Client(); wrapper_list = new List <NotifyWrapper> (); }
static Metacity.Theme GetTheme() { if (theme == null) { try { GConf.Client client = new GConf.Client (); // client.AddNotify ("/apps/metacity/general", GConfNotify); string themeName = (string)client.Get ("/apps/metacity/general/theme"); theme = Metacity.Theme.Load (themeName); } catch { // Don't crash if metacity is not available return null; } } return theme; }
public CConfiguration(ArtType type) { GConfClient = new GConf.Client(); systemProxy = new ProxyAttrStruct(); gangProxy = new ProxyAttrStruct(); systemProxy.Ip = ""; //TODO:Why is it important to initialize it...an error occurs otherwise. gangProxy.Ip = ""; //TODO:Why is it important to initialize it...an error occurs otherwise. artType=type; dirSep=Path.DirectorySeparatorChar.ToString(); homePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal)+dirSep; settingsPath = Path.Combine(homePath,".gnome2"+dirSep+"gnome-art-ng"); splashInstallPath = homePath+".local/share/pixmaps/splash"+dirSep; applicationInstallPath = homePath+"."+themesDir+dirSep; decorationInstallPath = homePath+"."+themesDir+dirSep; iconInstallPath = homePath+iconDir+dirSep; tarIsAvailable = CUtility.TestIfProgIsInstalled("tar","--version","gnu tar"); grepIsAvailable = CUtility.TestIfProgIsInstalled("grep","--version","gnu grep"); sedIsAvailable = CUtility.TestIfProgIsInstalled("sed","--version","gnu sed"); setDistributionDependendSettings(); CreateDownloadDirectories(); //Create GConf listeners GConf.NotifyEventHandler changed_handler = new GConf.NotifyEventHandler(onSettingsChanged); GConfClient.AddNotify(sProxyGconfPath,changed_handler); //Load Configurations settingsLoadOk = LoadProgramSettings(); }
public JIRAConfiguration() { _gconf= new GConf.Client(); }
public GConfPreferencesClient () { client = new GConf.Client (); wrapper_list = new List<NotifyWrapper> (); }
override public void Revert() { client = new GConf.Client(); client.Set(GConfIconThemeKey, prevIconTheme); revertIsAvailable = false; }
static private void GetFontSettings () { GConf.Client client = new GConf.Client (); string font = null; try { font = client.Get ("/desktop/gnome/interface/font_name") as string; } catch (GConf.NoSuchKeyException) { } // Sans 10 seems to be the default GNOME fallback if (font == null) font = "Sans 10"; Pango.FontDescription font_desc = Pango.FontDescription.FromString (font); preferred_font_family = font_desc.Family; preferred_font_size = font_desc.Size / Pango.Scale.PangoScale; }
// Methods // Methods :: Public // Methods :: Public :: Init /// <summary> /// Initialize the Configuration system. /// </summary> public static void Init() { gconf_client = new GConf.Client(); }
public GConfXKeybinder () { client = new GConf.Client (); bindings = new ArrayList (); }
public JIRAConfiguration() { _gconf = new GConf.Client(); }