f-spot r4577 - in branches/FSPOT_0_5_0_STABLE: . src src/UI.Dialog
- From: sdelcroix svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r4577 - in branches/FSPOT_0_5_0_STABLE: . src src/UI.Dialog
- Date: Thu, 6 Nov 2008 10:00:55 +0000 (UTC)
Author: sdelcroix
Date: Thu Nov 6 10:00:55 2008
New Revision: 4577
URL: http://svn.gnome.org/viewvc/f-spot?rev=4577&view=rev
Log:
2008-11-06 Stephane Delcroix <sdelcroix novell com>
* src/main.cs:
* src/UI,Dialog/PreferenceDialog.cs: fix theme loading for gtk+ > 2.12.4
Modified:
branches/FSPOT_0_5_0_STABLE/ChangeLog
branches/FSPOT_0_5_0_STABLE/src/UI.Dialog/PreferenceDialog.cs
branches/FSPOT_0_5_0_STABLE/src/main.cs
Modified: branches/FSPOT_0_5_0_STABLE/src/UI.Dialog/PreferenceDialog.cs
==============================================================================
--- branches/FSPOT_0_5_0_STABLE/src/UI.Dialog/PreferenceDialog.cs (original)
+++ branches/FSPOT_0_5_0_STABLE/src/UI.Dialog/PreferenceDialog.cs Thu Nov 6 10:00:55 2008
@@ -130,8 +130,8 @@
set_saver_button.Clicked += HandleUseFSpot;
screensaverall_radio.Toggled += ToggleTagRadio;
- themenone_radio.Toggled += ToggleThemeRadio;
themelist_combo = ComboBox.NewText ();
+ themenone_radio.Toggled += ToggleThemeRadio;
theme_list = new Dictionary<string, string> ();
string gtkrc = Path.Combine ("gtk-2.0", "gtkrc");
string [] search = {Path.Combine (Global.HomeDirectory, ".themes"), "/usr/share/themes"};
@@ -242,13 +242,19 @@
if (themenone_radio.Active) {
Preferences.Set (Preferences.GTK_RC, String.Empty);
#if GTK_2_12_2
- if (!File.Exists (Path.Combine (Global.BaseDirectory, "gtkrc")))
- (File.Create (Path.Combine (Global.BaseDirectory, "gtkrc"))).Dispose ();
- else
- File.SetLastWriteTime (Path.Combine (Global.BaseDirectory, "gtkrc"), DateTime.Now);
Gtk.Rc.DefaultFiles = Global.DefaultRcFiles;
- Gtk.Rc.ReparseAll ();
+ Gtk.Rc.ReparseAllForSettings (Gtk.Settings.Default, true);
+#endif
+ } else {
+ TreeIter iter;
+ if (themelist_combo.GetActiveIter (out iter)) {
+ Preferences.Set (Preferences.GTK_RC, theme_list [(themelist_combo.Model.GetValue (iter, 0)) as string]);
+#if GTK_2_12_2
+ Gtk.Rc.DefaultFiles = Global.DefaultRcFiles;
+ Gtk.Rc.AddDefaultFile (Preferences.Get<string> (Preferences.GTK_RC));
+ Gtk.Rc.ReparseAllForSettings (Gtk.Settings.Default, true);
#endif
+ }
}
}
@@ -260,15 +266,9 @@
if ((o as ComboBox).GetActiveIter (out iter))
Preferences.Set (Preferences.GTK_RC, theme_list [((o as ComboBox).Model.GetValue (iter, 0)) as string]);
#if GTK_2_12_2
- if (!File.Exists (Path.Combine (Global.BaseDirectory, "gtkrc")))
- (File.Create (Path.Combine (Global.BaseDirectory, "gtkrc"))).Dispose ();
- else
- File.SetLastWriteTime (Path.Combine (Global.BaseDirectory, "gtkrc"), DateTime.Now);
Gtk.Rc.DefaultFiles = Global.DefaultRcFiles;
Gtk.Rc.AddDefaultFile (Preferences.Get<string> (Preferences.GTK_RC));
- foreach (string s in Rc.DefaultFiles)
- Console.WriteLine (s);
- Gtk.Rc.ReparseAll ();
+ Gtk.Rc.ReparseAllForSettings (Gtk.Settings.Default, true);
#endif
}
@@ -277,15 +277,9 @@
if (theme_filechooser.Filename != null && theme_filechooser.Filename != Preferences.Get<string> (Preferences.GTK_RC)) {
Preferences.Set (Preferences.GTK_RC, theme_filechooser.Filename);
#if GTK_2_12_2
- if (!File.Exists (Path.Combine (Global.BaseDirectory, "gtkrc")))
- (File.Create (Path.Combine (Global.BaseDirectory, "gtkrc"))).Dispose ();
- else
- File.SetLastWriteTime (Path.Combine (Global.BaseDirectory, "gtkrc"), DateTime.Now);
Gtk.Rc.DefaultFiles = Global.DefaultRcFiles;
Gtk.Rc.AddDefaultFile (Preferences.Get<string> (Preferences.GTK_RC));
- foreach (string s in Rc.DefaultFiles)
- Console.WriteLine (s);
- Gtk.Rc.ReparseAll ();
+ Gtk.Rc.ReparseAllForSettings (Gtk.Settings.Default, true);
#endif
}
}
@@ -310,7 +304,7 @@
void HandleRefreshTheme (object o, EventArgs e)
{
#if GTK_2_12_2
- Gtk.Rc.ReparseAll ();
+ Gtk.Rc.ReparseAllForSettings (Gtk.Settings.Default, true);
#endif
}
Modified: branches/FSPOT_0_5_0_STABLE/src/main.cs
==============================================================================
--- branches/FSPOT_0_5_0_STABLE/src/main.cs (original)
+++ branches/FSPOT_0_5_0_STABLE/src/main.cs Thu Nov 6 10:00:55 2008
@@ -221,13 +221,14 @@
Gnome.Vfs.Vfs.Initialize ();
if (File.Exists (Preferences.Get<string> (Preferences.GTK_RC))) {
+ if (File.Exists (Path.Combine (Global.BaseDirectory, "gtkrc")))
+ Gtk.Rc.AddDefaultFile (Path.Combine (Global.BaseDirectory, "gtkrc"));
+
#if GTK_2_12_2
- if (!File.Exists (Path.Combine (Global.BaseDirectory, "gtkrc")))
- (File.Create (Path.Combine (Global.BaseDirectory, "gtkrc"))).Dispose ();
- Gtk.Rc.AddDefaultFile (Path.Combine (Global.BaseDirectory, "gtkrc"));
Global.DefaultRcFiles = Gtk.Rc.DefaultFiles;
#endif
Gtk.Rc.AddDefaultFile (Preferences.Get<string> (Preferences.GTK_RC));
+ Gtk.Rc.ReparseAllForSettings (Gtk.Settings.Default, true);
}
try {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]