[dconf-editor] Use GResource facilities.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Use GResource facilities.
- Date: Sat, 18 Apr 2015 04:55:39 +0000 (UTC)
commit cebd80643e26a56a945c79f3a93a3dd626b8f259
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sat Apr 18 00:18:29 2015 +0200
Use GResource facilities.
editor/dconf-editor.gresource.xml | 6 ++++--
editor/dconf-editor.vala | 22 +---------------------
2 files changed, 5 insertions(+), 23 deletions(-)
---
diff --git a/editor/dconf-editor.gresource.xml b/editor/dconf-editor.gresource.xml
index d2d9b87..8f91396 100644
--- a/editor/dconf-editor.gresource.xml
+++ b/editor/dconf-editor.gresource.xml
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
- <gresource prefix="/ca/desrt/dconf-editor">
+ <gresource prefix="/ca/desrt/dconf-editor/ui">
<file preprocess="xml-stripblanks">dconf-editor.ui</file>
- <file preprocess="xml-stripblanks">dconf-editor-menu.ui</file>
+ </gresource>
+ <gresource prefix="/ca/desrt/dconf-editor/gtk">
+ <file preprocess="xml-stripblanks" alias="menus.ui">dconf-editor-menu.ui</file>
</gresource>
</gresources>
diff --git a/editor/dconf-editor.vala b/editor/dconf-editor.vala
index 36f8ea1..17404d8 100644
--- a/editor/dconf-editor.vala
+++ b/editor/dconf-editor.vala
@@ -68,17 +68,9 @@ class ConfigurationEditor : Gtk.Application
model = new SettingsModel();
- Gtk.Builder ui = new Gtk.Builder();
+ Gtk.Builder ui = new Gtk.Builder.from_resource ("/ca/desrt/dconf-editor/ui/dconf-editor.ui");
/* window */
- try
- {
- ui.add_from_resource("/ca/desrt/dconf-editor/dconf-editor.ui");
- }
- catch (Error e)
- {
- error("Failed to load UI: %s", e.message);
- }
window = (Gtk.ApplicationWindow) ui.get_object ("window");
window.set_default_size (settings.get_int ("window-width"), settings.get_int ("window-height"));
@@ -92,18 +84,6 @@ class ConfigurationEditor : Gtk.Application
add_window (window);
- /* app-menu */
- var menu_ui = new Gtk.Builder();
- try
- {
- menu_ui.add_from_resource("/ca/desrt/dconf-editor/dconf-editor-menu.ui");
- }
- catch (Error e)
- {
- error("Failed to load menu UI: %s", e.message);
- }
- set_app_menu((MenuModel)menu_ui.get_object("menu"));
-
/* named objects apart search box */
key_info_grid = (Gtk.Grid) ui.get_object("key_info_grid");
schema_label = (Gtk.Label) ui.get_object("schema_label");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]