Пример #1
0
        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();
        }
Пример #2
0
        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);
        }
Пример #3
0
        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");
        }
Пример #4
0
 private void gConfInit()
 {
     if (gconf == null) {
         gconf = new GConf.Client ();
         gconf.AddNotify (getGConfPath (), gConfChanged);
     }
 }
Пример #5
0
 private void Init()
 {
     if (gconf == null)
     {
         gconf = new GConf.Client();
     }
 }
Пример #6
0
        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);
        }
Пример #8
0
        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) {}
        }
Пример #9
0
        public GConfProxy()
        {
            gconf_client = new GConf.Client();
            gconf_client.AddNotify(PROXY, OnGConfNotify);
            gconf_client.AddNotify(HTTP_PROXY, OnGConfNotify);

            RefreshProxy();
        }
Пример #10
0
 public void Dispose()
 {
     if (gconf_client != null)
     {
         gconf_client.RemoveNotify(PROXY, OnGConfNotify);
         gconf_client.RemoveNotify(HTTP_PROXY, OnGConfNotify);
         gconf_client = null;
     }
 }
Пример #11
0
 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);
 }
Пример #12
0
		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);
		}
Пример #13
0
 /// <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();
     }
 }
Пример #14
0
        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();
        }
Пример #15
0
        protected override void PluginInitialize()
        {
            RegisterConfigurationKey("Username");
            RegisterConfigurationKey("Password");
            RegisterConfigurationKey("Country");
            config = Globals.Configuration;

            source = new MusicStoreSource(this);

            SourceManager.AddSource(source);
        }
Пример #16
0
            public GConfConfig(string baseUrl)
            {
                gconf        = null;
                this.baseUrl = baseUrl;
                if (baseUrl != null)
                {
                    baseHash = Charp.GetMD5HexHash(baseUrl);
                }

                appName = CHARP_APP_NAME;
            }
Пример #17
0
        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);
        }
Пример #18
0
        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);
        }
Пример #19
0
        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;
        }
Пример #20
0
		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);
			}
		}
Пример #21
0
        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);
            }
        }
Пример #22
0
 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);
 }
Пример #23
0
        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);
        }
Пример #25
0
 public override void Revert()
 {
     client = new GConf.Client();
     client.Set(GConfIconThemeKey,prevIconTheme);
     revertIsAvailable=false;
 }
Пример #26
0
        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);
        }
Пример #27
0
		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 ();
		}
Пример #28
0
 public GConfPreferencesService(string rootPath)
 {
     RootPath = rootPath;
     client   = new GConf.Client();
     client.AddNotify(RootPath, new GConf.NotifyEventHandler(HandleGConfChanged));
 }
Пример #29
0
 public GConfXKeybinder()
 {
     client   = new GConf.Client();
     bindings = new ArrayList();
 }
        protected override void PluginInitialize()
        {
            RegisterConfigurationKey("Username");
            RegisterConfigurationKey("Password");
            RegisterConfigurationKey("Country");
            config = Globals.Configuration;

            source = new MusicStoreSource(this);

            SourceManager.AddSource(source);
        }
Пример #31
0
 public GConfPreferencesClient()
 {
     client       = new GConf.Client();
     wrapper_list = new List <NotifyWrapper> ();
 }
Пример #32
0
 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();
        }
Пример #34
0
 public JIRAConfiguration()
 {
     _gconf= new GConf.Client();
 }
		public GConfPreferencesClient ()
		{
			client = new GConf.Client ();
			wrapper_list = new List<NotifyWrapper> ();
		}
Пример #36
0
 override public void Revert()
 {
     client = new GConf.Client();
     client.Set(GConfIconThemeKey, prevIconTheme);
     revertIsAvailable = false;
 }
Пример #37
0
		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;
		}
Пример #38
0
 // Methods
 // Methods :: Public
 // Methods :: Public :: Init
 /// <summary>
 ///	Initialize the Configuration system.
 /// </summary>
 public static void Init()
 {
     gconf_client = new GConf.Client();
 }
Пример #39
0
		public GConfXKeybinder ()
		{
			client = new GConf.Client ();
			bindings = new ArrayList ();
		}
Пример #40
0
 public JIRAConfiguration()
 {
     _gconf = new GConf.Client();
 }