Esempio n. 1
0
 ///<summary>
 /// Save() force the hashtable's synchro
 ///</summary>
 public void Save()
 {
     foreach (string key in _Preferences.Keys)
     {
         _Set(key, (string)_Preferences[key]);
     }
     _Conf.SuggestSync();
 }
Esempio n. 2
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();
        }
Esempio n. 3
0
        public void Save()
        {
            Trace.Call();

#if LOG4NET
            _Logger.Debug("Saving config");
#endif

            // update values in backend
            foreach (string key in m_Preferences.Keys)
            {
                object obj = m_Preferences[key];
                _Set(key, obj);
            }

#if CONFIG_GCONF
            _GConf.SuggestSync();
#elif CONFIG_NINI
//            StreamWriter sr = File.CreateText(m_IniFilename);
//            m_IniDocument.Save(sr);
            m_IniDocument.Save(m_IniFilename);
#endif
        }
Esempio n. 4
0
 public void SuggestSync()
 {
     gconf.SuggestSync();
 }
Esempio n. 5
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 ();
		}