示例#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);
        }
		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);
 }
 public override void Revert()
 {
     client = new GConf.Client();
     client.Set(GConfIconThemeKey,prevIconTheme);
     revertIsAvailable=false;
 }