Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 4
0
 private void gConfInit()
 {
     if (gconf == null) {
         gconf = new GConf.Client ();
         gconf.AddNotify (getGConfPath (), gConfChanged);
     }
 }
Ejemplo n.º 5
0
 private void Init()
 {
     if (gconf == null)
     {
         gconf = new GConf.Client();
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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) {}
        }
Ejemplo n.º 9
0
        public GConfProxy()
        {
            gconf_client = new GConf.Client();
            gconf_client.AddNotify(PROXY, OnGConfNotify);
            gconf_client.AddNotify(HTTP_PROXY, OnGConfNotify);

            RefreshProxy();
        }
Ejemplo n.º 10
0
 public void Dispose()
 {
     if (gconf_client != null)
     {
         gconf_client.RemoveNotify(PROXY, OnGConfNotify);
         gconf_client.RemoveNotify(HTTP_PROXY, OnGConfNotify);
         gconf_client = null;
     }
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
		}
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 15
0
        protected override void PluginInitialize()
        {
            RegisterConfigurationKey("Username");
            RegisterConfigurationKey("Password");
            RegisterConfigurationKey("Country");
            config = Globals.Configuration;

            source = new MusicStoreSource(this);

            SourceManager.AddSource(source);
        }
Ejemplo n.º 16
0
            public GConfConfig(string baseUrl)
            {
                gconf        = null;
                this.baseUrl = baseUrl;
                if (baseUrl != null)
                {
                    baseHash = Charp.GetMD5HexHash(baseUrl);
                }

                appName = CHARP_APP_NAME;
            }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
			}
		}
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 25
0
 public override void Revert()
 {
     client = new GConf.Client();
     client.Set(GConfIconThemeKey,prevIconTheme);
     revertIsAvailable=false;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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 ();
		}
Ejemplo n.º 28
0
 public GConfPreferencesService(string rootPath)
 {
     RootPath = rootPath;
     client   = new GConf.Client();
     client.AddNotify(RootPath, new GConf.NotifyEventHandler(HandleGConfChanged));
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 31
0
 public GConfPreferencesClient()
 {
     client       = new GConf.Client();
     wrapper_list = new List <NotifyWrapper> ();
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 34
0
 public JIRAConfiguration()
 {
     _gconf= new GConf.Client();
 }
		public GConfPreferencesClient ()
		{
			client = new GConf.Client ();
			wrapper_list = new List<NotifyWrapper> ();
		}
Ejemplo n.º 36
0
 override public void Revert()
 {
     client = new GConf.Client();
     client.Set(GConfIconThemeKey, prevIconTheme);
     revertIsAvailable = false;
 }
Ejemplo n.º 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;
		}
Ejemplo n.º 38
0
 // Methods
 // Methods :: Public
 // Methods :: Public :: Init
 /// <summary>
 ///	Initialize the Configuration system.
 /// </summary>
 public static void Init()
 {
     gconf_client = new GConf.Client();
 }
Ejemplo n.º 39
0
		public GConfXKeybinder ()
		{
			client = new GConf.Client ();
			bindings = new ArrayList ();
		}
Ejemplo n.º 40
0
 public JIRAConfiguration()
 {
     _gconf = new GConf.Client();
 }