summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS10
-rw-r--r--configure.ac2
-rw-r--r--dconf.doap2
-rw-r--r--editor/Makefile.am12
-rw-r--r--editor/dconf-editor-menu.ui20
-rw-r--r--editor/dconf-editor.ui473
-rw-r--r--editor/dconf-editor.vala180
-rw-r--r--editor/dconf-schema.vala3
8 files changed, 485 insertions, 217 deletions
diff --git a/NEWS b/NEWS
index 98a2286..ed6bee3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,13 @@
+Changes in dconf 0.13.0
+=======================
+
+ - now requiring Vala 0.18 (ie: at least 0.17.0)
+
+ - editor: use GtkApplication and GMenu
+ - editor: support searching for keys
+
+ - dconf cli: call setlocale() on startup
+
Changes in dconf 0.11.7
=======================
diff --git a/configure.ac b/configure.ac
index 93680cf..d580d75 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,8 +18,8 @@ fi
# Check for programs
AC_PROG_CC
+AM_PROG_VALAC([0.17.0])
AC_PROG_RANLIB
-AM_PROG_VALAC([0.15.1])
# Use GSettings
GLIB_GSETTINGS
diff --git a/dconf.doap b/dconf.doap
index 69a2178..66f12a6 100644
--- a/dconf.doap
+++ b/dconf.doap
@@ -6,7 +6,7 @@
xmlns:gnome='http://api.gnome.org/doap-extensions#'>
<name xml:lang='en'>dconf</name>
- <shortdesc xml:lang='en'>configuation database system</shortdesc>
+ <shortdesc xml:lang='en'>Configuation database system</shortdesc>
<maintainer>
<foaf:Person>
diff --git a/editor/Makefile.am b/editor/Makefile.am
index eb668e7..3fa76f6 100644
--- a/editor/Makefile.am
+++ b/editor/Makefile.am
@@ -14,10 +14,12 @@ dconf_editor_LDADD = \
$(libxml_LIBS)
dconf_editor_CFLAGS = \
- $(gtk_CFLAGS) \
- $(gee_CFLAGS) \
- $(libxml_CFLAGS) \
- -DPKGDATADIR=\"$(pkgdatadir)\" \
+ $(gtk_CFLAGS) \
+ $(gee_CFLAGS) \
+ $(libxml_CFLAGS) \
+ -DPKGDATADIR=\"$(pkgdatadir)\" \
+ -DVERSION=\"$(VERSION)\" \
+ -DGETTEXT_PACKAGE=\"dconf-editor\" \
-w
dconf_editor_SOURCES = \
@@ -50,6 +52,6 @@ update-icon-cache:
fi
pkgdatadir = $(datadir)/dconf-editor
-dist_pkgdata_DATA = dconf-editor.ui
+dist_pkgdata_DATA = dconf-editor.ui dconf-editor-menu.ui
EXTRA_DIST = $(gsettings_SCHEMAS) $(icons)
diff --git a/editor/dconf-editor-menu.ui b/editor/dconf-editor-menu.ui
new file mode 100644
index 0000000..5443796
--- /dev/null
+++ b/editor/dconf-editor-menu.ui
@@ -0,0 +1,20 @@
+<interface>
+ <menu id="menu">
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Find</attribute>
+ <attribute name="action">app.find</attribute>
+ <attribute name="accel">&lt;Primary&gt;f</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_About</attribute>
+ <attribute name="action">app.about</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Quit</attribute>
+ <attribute name="action">app.quit</attribute>
+ <attribute name="accel">&lt;Primary&gt;q</attribute>
+ </item>
+ </section>
+ </menu>
+</interface>
diff --git a/editor/dconf-editor.ui b/editor/dconf-editor.ui
index 72f040d..1082b40 100644
--- a/editor/dconf-editor.ui
+++ b/editor/dconf-editor.ui
@@ -1,196 +1,175 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <requires lib="gtk+" version="2.24"/>
+ <!-- interface-requires gtk+ 3.0 -->
<object class="GtkAction" id="set_default_action">
<property name="label" translatable="yes">Set to Default</property>
<property name="sensitive">False</property>
- <signal name="activate" handler="set_default_cb" swapped="no"/>
</object>
<object class="GtkWindow" id="main_window">
<property name="can_focus">False</property>
<property name="border_width">6</property>
- <property name="title" translatable="yes">Configuration Editor</property>
- <property name="default_width">600</property>
- <property name="default_height">300</property>
- <signal name="window-state-event" handler="main_window_window_state_event_cb" swapped="no"/>
- <signal name="configure-event" handler="main_window_configure_event_cb" swapped="no"/>
<child>
- <object class="GtkHPaned" id="hpaned1">
+ <object class="GtkBox" id="box1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="position">100</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <object class="GtkScrolledWindow" id="directory_scrolledwindow">
+ <object class="GtkHPaned" id="hpaned1">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">never</property>
- <property name="shadow_type">in</property>
+ <property name="position">100</property>
<child>
- <placeholder/>
+ <object class="GtkScrolledWindow" id="directory_scrolledwindow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">False</property>
+ </packing>
</child>
- </object>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
<child>
- <object class="GtkGrid" id="key_info_grid">
+ <object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
- <property name="sensitive">False</property>
<property name="can_focus">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="label" translatable="yes">Schema:</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="label" translatable="yes">Summary:</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="label" translatable="yes">Description:</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="label" translatable="yes">Type:</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="label" translatable="yes">Default:</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="schema_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="wrap">True</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="description_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="wrap">True</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="type_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
+ <property name="spacing">6</property>
<child>
- <object class="GtkHBox" id="hbox2">
+ <object class="GtkGrid" id="key_info_grid">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Schema:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Summary:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Description:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Type:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Default:</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="schema_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="summary_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="wrap">True</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
<child>
- <object class="GtkLabel" id="default_label">
+ <object class="GtkLabel" id="description_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
<property name="wrap">True</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="type_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
@@ -198,59 +177,173 @@
<property name="selectable">True</property>
</object>
<packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="button1">
+ <object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="related_action">set_default_action</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="default_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="wrap">True</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="related_action">set_default_action</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="related_action">set_default_action</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="left_attach">1</property>
+ <property name="top_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
+ <child>
+ <object class="GtkScrolledWindow" id="key_scrolledwindow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="search_box">
+ <property name="can_focus">False</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkButton" id="search_box_close_button">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-close</property>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkScrolledWindow" id="key_scrolledwindow">
+ <object class="GtkEntry" id="search_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="shadow_type">in</property>
+ <property name="invisible_char">•</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <property name="homogeneous">True</property>
<child>
- <placeholder/>
+ <object class="GtkButton" id="search_next_button">
+ <property name="label" translatable="yes">Next</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="search_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">3</property>
</packing>
</child>
</object>
<packing>
- <property name="resize">True</property>
- <property name="shrink">False</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
diff --git a/editor/dconf-editor.vala b/editor/dconf-editor.vala
index 9daf3c0..22fcff4 100644
--- a/editor/dconf-editor.vala
+++ b/editor/dconf-editor.vala
@@ -1,10 +1,10 @@
-class ConfigurationEditor
+class ConfigurationEditor : Gtk.Application
{
private SettingsModel model;
private Settings settings;
private Gtk.Builder ui;
- private Gtk.Window window;
+ private Gtk.ApplicationWindow window;
private Gtk.TreeView dir_tree_view;
private Gtk.TreeView key_tree_view;
private Gtk.Grid key_info_grid;
@@ -14,11 +14,32 @@ class ConfigurationEditor
private Gtk.Label type_label;
private Gtk.Label default_label;
private Gtk.Action set_default_action;
+ private Gtk.Box search_box;
+ private Gtk.Entry search_entry;
+ private Gtk.Label search_label;
private Key? selected_key;
+ private const GLib.ActionEntry[] action_entries =
+ {
+ { "find", find_cb },
+ { "about", about_cb },
+ { "quit", quit_cb }
+ };
+
public ConfigurationEditor()
{
+ Object(application_id: "ca.desrt.dconf-editor", flags: ApplicationFlags.FLAGS_NONE);
+ }
+
+ protected override void startup()
+ {
+ base.startup();
+
+ Environment.set_application_name (_("DConf Editor"));
+
+ add_action_entries (action_entries, this);
+
settings = new Settings ("ca.desrt.dconf-editor.Settings");
model = new SettingsModel();
@@ -26,15 +47,30 @@ class ConfigurationEditor
ui = new Gtk.Builder();
try
{
- ui.add_from_file(Path.build_filename(Config.PKGDATADIR, "dconf-editor.ui"));
+ string[] objects = { "set_default_action", "box1", "menu" };
+ ui.add_objects_from_file(Path.build_filename(Config.PKGDATADIR, "dconf-editor.ui"), objects);
}
catch (Error e)
{
critical("Failed to load UI: %s", e.message);
}
- ui.connect_signals(this);
- window = (Gtk.Window)ui.get_object("main_window");
- window.destroy.connect(Gtk.main_quit);
+ window = new Gtk.ApplicationWindow(this);
+ window.set_default_size(600, 300);
+ window.title = _("Configuration Editor");
+ window.window_state_event.connect(main_window_window_state_event_cb);
+ window.configure_event.connect(main_window_configure_event_cb);
+ window.add((Gtk.Box)ui.get_object("box1"));
+
+ var menu_ui = new Gtk.Builder();
+ try
+ {
+ menu_ui.add_from_file(Path.build_filename(Config.PKGDATADIR, "dconf-editor-menu.ui"));
+ }
+ catch (Error e)
+ {
+ critical("Failed to load menu UI: %s", e.message);
+ }
+ set_app_menu((MenuModel)menu_ui.get_object("menu"));
window.set_default_size (settings.get_int ("width"), settings.get_int ("height"));
if (settings.get_boolean ("maximized"))
@@ -60,16 +96,32 @@ class ConfigurationEditor
type_label = (Gtk.Label)ui.get_object("type_label");
default_label = (Gtk.Label)ui.get_object("default_label");
set_default_action = (Gtk.Action)ui.get_object("set_default_action");
+ set_default_action.activate.connect(set_default_cb);
+
+ search_box = (Gtk.Box)ui.get_object("search_box");
+ search_entry = (Gtk.Entry)ui.get_object("search_entry");
+ search_label = (Gtk.Label)ui.get_object("search_label");
+ search_entry.activate.connect(find_next_cb);
+ var search_box_close_button = (Gtk.Button)ui.get_object("search_box_close_button");
+ search_box_close_button.clicked.connect(close_search_cb);
+
+ var search_next_button = (Gtk.Button)ui.get_object("search_next_button");
+ search_next_button.clicked.connect(find_next_cb);
/* Always select something */
Gtk.TreeIter iter;
if (model.get_iter_first(out iter))
dir_tree_view.get_selection().select_iter(iter);
}
+
+ private void close_search_cb ()
+ {
+ search_box.hide();
+ }
- public void show()
+ protected override void activate()
{
- window.show();
+ window.present();
}
private void dir_selected_cb()
@@ -175,16 +227,14 @@ class ConfigurationEditor
set_default_action.sensitive = selected_key != null && !selected_key.is_default;
}
- [CCode (cname = "G_MODULE_EXPORT set_default_cb", instance_pos = -1)]
- public void set_default_cb (Gtk.Action action)
+ private void set_default_cb (Gtk.Action action)
{
if (selected_key == null)
return;
selected_key.set_to_default();
}
- [CCode (cname = "G_MODULE_EXPORT main_window_configure_event_cb", instance_pos = -1)]
- public bool main_window_configure_event_cb (Gtk.Widget widget, Gdk.EventConfigure event)
+ private bool main_window_configure_event_cb (Gtk.Widget widget, Gdk.EventConfigure event)
{
if (!settings.get_boolean ("maximized"))
{
@@ -195,8 +245,7 @@ class ConfigurationEditor
return false;
}
- [CCode (cname = "G_MODULE_EXPORT main_window_window_state_event_cb", instance_pos = -1)]
- public bool main_window_window_state_event_cb (Gtk.Widget widget, Gdk.EventWindowState event)
+ private bool main_window_window_state_event_cb (Gtk.Widget widget, Gdk.EventWindowState event)
{
if ((event.changed_mask & Gdk.WindowState.MAXIMIZED) != 0)
{
@@ -207,15 +256,106 @@ class ConfigurationEditor
return false;
}
- public static int main(string[] args)
+ private void find_cb()
{
- Gtk.init(ref args);
+ search_box.show();
+ search_entry.grab_focus();
+ }
- var editor = new ConfigurationEditor();
- editor.show ();
+ private void find_next_cb()
+ {
+ search_label.set_text("");
- Gtk.main();
+ Gtk.TreeIter iter;
+ var key_iter = Gtk.TreeIter();
+ var have_key_iter = false;
+ if (dir_tree_view.get_selection().get_selected(null, out iter))
+ {
+ if (key_tree_view.get_selection().get_selected(null, out key_iter))
+ {
+ var dir = model.get_directory(iter);
+ if (dir.key_model.iter_next(ref key_iter))
+ have_key_iter = true;
+ else
+ get_next_iter(ref iter);
+ }
+ }
+ else if (!model.get_iter_first(out iter))
+ return;
- return 0;
+ do
+ {
+ var dir = model.get_directory(iter);
+ if (!have_key_iter)
+ have_key_iter = dir.key_model.get_iter_first(out key_iter);
+ if (have_key_iter)
+ {
+ do
+ {
+ var key = dir.key_model.get_key(key_iter);
+ if (key.name.index_of (search_entry.text) >= 0)
+ {
+ dir_tree_view.expand_to_path(model.get_path(iter));
+ dir_tree_view.get_selection().select_iter(iter);
+ dir_tree_view.scroll_to_cell(model.get_path(iter), null, false, 0, 0);
+ key_tree_view.get_selection().select_iter(key_iter);
+ key_tree_view.scroll_to_cell(dir.key_model.get_path(key_iter), null, false, 0, 0);
+ return;
+ }
+ } while(dir.key_model.iter_next(ref key_iter));
+ }
+ have_key_iter = false;
+ } while(get_next_iter(ref iter));
+
+ search_label.set_text(_("Not found"));
+ }
+
+ private bool get_next_iter(ref Gtk.TreeIter iter)
+ {
+ /* Search children next */
+ if (model.iter_has_child(iter))
+ {
+ model.iter_nth_child(out iter, iter, 0);
+ return true;
+ }
+
+ /* Move to the next branch */
+ while (!model.iter_next(ref iter))
+ {
+ /* Otherwise move to the parent and onto the next iter */
+ if (!model.iter_parent(out iter, iter))
+ return false;
+ }
+
+ return true;
+ }
+
+ private void about_cb()
+ {
+ string[] authors = { "Robert Ancell", null };
+ string license = _("This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA");
+ Gtk.show_about_dialog (window,
+ "program-name", _("DConf Editor"),
+ "version", Config.VERSION,
+ "comments",
+ _("Directly edit your entire configuration database"),
+ "copyright", "Copyright \xc2\xa9 Canonical Ltd",
+ "license", license,
+ "wrap-license", true,
+ "authors", authors,
+ "translator-credits", _("translator-credits"),
+ "logo-icon-name", "dconf-editor",
+ null);
+ }
+
+ private void quit_cb()
+ {
+ window.destroy();
+ }
+
+ public static int main(string[] args)
+ {
+ var app = new ConfigurationEditor();
+ return app.run(args);
}
}
diff --git a/editor/dconf-schema.vala b/editor/dconf-schema.vala
index dc8e60a..e1e8691 100644
--- a/editor/dconf-schema.vala
+++ b/editor/dconf-schema.vala
@@ -397,6 +397,9 @@ public class SchemaList
var f = new SchemaFlags.from_xml(this, node);
flags.insert(f.id, f);
}
+ else if (node->type == Xml.ElementType.COMMENT_NODE)
+ {
+ }
else if (node->type != Xml.ElementType.TEXT_NODE)
warning ("Unknown tag <%s>", node->name);
}