예제 #1
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();
        }
예제 #2
0
        private void _Set(string key, object valueobj)
        {
#if CONFIG_DEBUG
            Trace.Call(key, valueobj);
#endif

#if CONFIG_GCONF
            _GConf.Set(_GConfPrefix + key, valueobj);
#elif CONFIG_NINI
            string     inisection = _IniGetSection(key);
            string     inikey     = _IniGetKey(key);
            IniSection section    = m_IniDocument.Sections[inisection];
            if (section == null)
            {
                m_IniDocument.Sections.Add(new IniSection(inisection));
                section = m_IniDocument.Sections[inisection];
            }

            if (valueobj is string[])
            {
                // Nini does not support native string lists, have to emulate them
                section.Set(inikey, String.Join("|", (string[])valueobj));
            }
            else
            {
                section.Set(inikey, valueobj.ToString());
            }
#endif
        }
 override protected void Installation(CStatusWindow sw)
 {
     //Installieren
     sw.Mainlabel = Catalog.GetString(CConfiguration.txtInstalling);
     client.Set(GConfApplicationKey, ConOutp.ToString().Split('/')[0]);
     sw.Mainlabel = Catalog.GetString(CConfiguration.txtInstallDone);
 }
예제 #4
0
 //All program relevant settings are saved here
 public void SaveProgramSettings()
 {
     try{
         GConfClient.Set(gangGconfPath + "xPosition", Window.X);
         GConfClient.Set(gangGconfPath + "yPosition", Window.Y);
         GConfClient.Set(gangGconfPath + "width", Window.Width);
         GConfClient.Set(gangGconfPath + "height", Window.Height);
         GConfClient.Set(gangGconfPath + "themesDownloadPath", themesDownloadPath);
         GConfClient.Set(gangGconfPath + "xmlRefreshInterval", XmlRefreshInterval);
         GConfClient.Set(gangGconfPath + "proxyKind", (int)ProxyKind);
         GConfClient.Set(gangGconfPath + "proxyPort", gangProxy.Port);
         GConfClient.Set(gangGconfPath + "proxyIp", gangProxy.Ip);
         GConfClient.Set(gangGconfPath + "dontBotherMeForUpdates", DontBotherForUpdates);
     } catch (Exception e) {
         Console.Out.WriteLine(Catalog.GetString("Error") + ":" + Catalog.GetString("Program settings couldn't be saved") + ", " + e.Message);
     }
 }
 override protected void Installation(CStatusWindow sw)
 {
     //Installieren
     sw.Mainlabel = Catalog.GetString(CConfiguration.txtInstalling);
     System.Threading.Thread.Sleep(500);
     client.Set(GConfDecorationKey, ConOutp.ToString().Split('/')[0]);
     sw.Mainlabel = Catalog.GetString(CConfiguration.txtInstallDone);
 }
예제 #6
0
        public bool Set <T> (string key, T val)
        {
            bool success = true;

            try {
                client.Set(AbsolutePathForKey(key), val);
            } catch (Exception e) {
                Log.Error("Encountered error setting GConf key {0}: {1}", key, e.Message);
                Log.Debug(e.StackTrace);
                success = false;
            }
            return(success);
        }
예제 #7
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);
		}
예제 #8
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);
 }
예제 #9
0
 public void Set(string path, string value)
 {
     Init();
     gconf.Set(path, value);
 }
예제 #10
0
 ///<summary>
 /// _Set store in the XML file any data, all is synchronized on the fly
 ///</summary>
 private void _Set(string key, string valueobj)
 {
     _Conf.Set("/apps/medianet/" + key, valueobj);
 }
예제 #11
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 ();
		}
예제 #12
0
 // Methods :: Public :: Set
 /// <summary>
 ///	Set a value in GConf.
 /// </summary>
 /// <param name="key">
 ///	The key.
 /// </param>
 /// <param name="val">
 ///	The value.
 /// </param>
 public static void Set(string key, object val)
 {
     gconf_client.Set(key, val);
 }
예제 #13
0
 override public void Revert()
 {
     client = new GConf.Client();
     client.Set(GConfIconThemeKey, prevIconTheme);
     revertIsAvailable = false;
 }
예제 #14
0
 private void SetConfValue(string key, string val)
 {
     _gconf.Set(_sGCONF_KEY + "/" + key, val);
 }
예제 #15
0
 override protected void Installation(CStatusWindow sw)
 {
     //Installieren
     sw.Mainlabel = Catalog.GetString(CConfiguration.txtInstalling);
     client.Set(GConfIconThemeKey, Folder[0]);
 }
예제 #16
0
 public void on_web_directory_activate(object o, EventArgs args)
 {
     client.Set(GCONF_APP_PATH + "/web_directory", webDirectoryEntry.Text);
 }
예제 #17
0
		public void Set(string key, string val)
		{
			c.Set(path + key, val);
		}
예제 #18
0
 void Set <T> (string key, T val)
 {
     client.Set(ns + key, val);
 }
예제 #19
0
 public override void Revert()
 {
     client = new GConf.Client();
     client.Set(GConfIconThemeKey,prevIconTheme);
     revertIsAvailable=false;
 }