f-spot r3875 - in trunk: . src src/Core src/UI.Dialog
- From: sdelcroix svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r3875 - in trunk: . src src/Core src/UI.Dialog
- Date: Wed, 7 May 2008 10:20:46 +0100 (BST)
Author: sdelcroix
Date: Wed May 7 09:20:46 2008
New Revision: 3875
URL: http://svn.gnome.org/viewvc/f-spot?rev=3875&view=rev
Log:
2008-05-07 Stephane Delcroix <sdelcroix novell com>
* configure.in: detect gtk-sharp 2.12.2
* src/Core/Global.cs:
* src/main.cs:
* src/UI.Dialog/PreferenceDialog.cs: apply theme changes on the fly.
Require (unreleased, but svn works) gtk-sharp 2.12.2
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/src/Core/Global.cs
trunk/src/UI.Dialog/PreferenceDialog.cs
trunk/src/main.cs
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Wed May 7 09:20:46 2008
@@ -91,10 +91,12 @@
if pkg-config --atleast-version=2.11 gtk-sharp-2.0; then
CSC_DEFINES="$CSC_DEFINES -d:GTK_2_11"
fi
+if pkg-config --atleast-version=2.12.2 gtk-sharp-2.0; then
+ CSC_DEFINES="$CSC_DEFINES -d:GTK_2_12_2"
+fi
if pkg-config --atleast-version=2.0 mono; then
CSC_DEFINES="$CSC_DEFINES -d:MONO_2_0"
fi
-
if pkg-config --atleast-version=1.2.5 mono-cairo; then
CSC_DEFINES="$CSC_DEFINES -d:CAIRO_1_2_5"
fi
Modified: trunk/src/Core/Global.cs
==============================================================================
--- trunk/src/Core/Global.cs (original)
+++ trunk/src/Core/Global.cs Wed May 7 09:20:46 2008
@@ -52,5 +52,17 @@
return icon_theme;
}
}
+
+#if GTK_2_12_2
+ private static string [] default_rc_files = null;
+ public static string [] DefaultRcFiles {
+ get {
+ if (default_rc_files == null)
+ default_rc_files = Gtk.Rc.DefaultFiles;
+ return default_rc_files;
+ }
+ set { default_rc_files = value; }
+ }
+#endif
}
}
Modified: trunk/src/UI.Dialog/PreferenceDialog.cs
==============================================================================
--- trunk/src/UI.Dialog/PreferenceDialog.cs (original)
+++ trunk/src/UI.Dialog/PreferenceDialog.cs Wed May 7 09:20:46 2008
@@ -176,8 +176,14 @@
themelist_combo.Sensitive = theme_filechooser.Sensitive = themecustom_radio.Active;
if (themenone_radio.Active) {
Preferences.Set (Preferences.GTK_RC, String.Empty);
- //Gtk.Rc.DefaultFiles = String.Empty;
- //Gtk.Rc.ReparseAll ();
+#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 ();
+#endif
}
}
@@ -188,12 +194,35 @@
TreeIter iter;
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 (Preferences.GTK_RC) as string);
+ foreach (string s in Rc.DefaultFiles)
+ Console.WriteLine (s);
+ Gtk.Rc.ReparseAll ();
+#endif
}
void HandleThemeFileActivated (object o, EventArgs e)
{
- if (theme_filechooser.Filename != null && theme_filechooser.Filename != Preferences.Get (Preferences.GTK_RC))
+ if (theme_filechooser.Filename != null && theme_filechooser.Filename != Preferences.Get (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 (Preferences.GTK_RC) as string);
+ foreach (string s in Rc.DefaultFiles)
+ Console.WriteLine (s);
+ Gtk.Rc.ReparseAll ();
+#endif
+ }
}
void OnPreferencesChanged (object sender, NotifyEventArgs args)
Modified: trunk/src/main.cs
==============================================================================
--- trunk/src/main.cs (original)
+++ trunk/src/main.cs Wed May 7 09:20:46 2008
@@ -212,8 +212,15 @@
create = false;
Gnome.Vfs.Vfs.Initialize ();
- if (File.Exists (Preferences.Get (Preferences.GTK_RC) as string))
+ if (File.Exists (Preferences.Get (Preferences.GTK_RC) as string)) {
+#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 (Preferences.GTK_RC) as string);
+ }
Catalog.Init ("f-spot", Defines.LOCALE_DIR);
try {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]