Commit c459bb17 authored by Niels De Graef's avatar Niels De Graef

Use the conventional path for resources.

This makes Gtk+ automagically set our app menu, and it is more
consistent with other apps. See [automatic resources] in
GtkApplication's documentationfor more info.

[automatic resources]: https://developer.gnome.org/gtk3/stable/GtkApplication.html#automatic-resources
parent c719a960
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/contacts">
<gresource prefix="/org/gnome/Contacts">
<file compressed="true">ui/style.css</file>
<file compressed="true" preprocess="xml-stripblanks">ui/app-menu.ui</file>
<file compressed="true" preprocess="xml-stripblanks">gtk/menus.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/contacts-accounts-list.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/contacts-address-map.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/contacts-avatar-dialog.ui</file>
......
<interface>
<menu id="app-menu">
<section>
<item>
<attribute name="action">app.change-book</attribute>
<attribute name="label" translatable="yes">_Change Address Book…</attribute>
</item>
</section>
<section>
<item>
<attribute name="action">app.help</attribute>
<attribute name="label" translatable="yes">_Help</attribute>
</item>
<item>
<attribute name="action">app.about</attribute>
<attribute name="label" translatable="yes">_About</attribute>
</item>
<item>
<attribute name="action">app.quit</attribute>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="accel">&lt;Primary&gt;q</attribute>
</item>
</section>
</menu>
</interface>
<interface>
<menu id="app-menu">
<section>
<item>
<attribute name="action">app.change-book</attribute>
<attribute name="label" translatable="yes">_Change Address Book…</attribute>
</item>
</section>
<section>
<item>
<attribute name="action">app.help</attribute>
<attribute name="label" translatable="yes">_Help</attribute>
</item>
<item>
<attribute name="action">app.about</attribute>
<attribute name="label" translatable="yes">_About</attribute>
</item>
<item>
<attribute name="action">app.quit</attribute>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="accel">&lt;Primary&gt;q</attribute>
</item>
</section>
</menu>
</interface>
......@@ -2,7 +2,7 @@
# Please keep this file sorted alphabetically.
data/org.gnome.Contacts.appdata.xml.in
data/org.gnome.Contacts.desktop.in
data/ui/app-menu.ui
data/gtk/menus.ui
data/ui/contacts-accounts-list.ui
data/ui/contacts-avatar-dialog.ui
data/ui/contacts-contact-editor.ui
......
......@@ -18,7 +18,7 @@
using Gtk;
using Folks;
[GtkTemplate (ui = "/org/gnome/contacts/ui/contacts-accounts-list.ui")]
[GtkTemplate (ui = "/org/gnome/Contacts/ui/contacts-accounts-list.ui")]
public class Contacts.AccountsList : Box {
[GtkChild]
private ListBox accounts_view;
......
......@@ -24,7 +24,7 @@ using Geocode;
using Gtk;
using GtkClutter;
[GtkTemplate (ui = "/org/gnome/contacts/ui/contacts-address-map.ui")]
[GtkTemplate (ui = "/org/gnome/Contacts/ui/contacts-address-map.ui")]
public class Contacts.AddressMap : Frame {
[GtkChild]
......
......@@ -168,19 +168,11 @@ public class Contacts.App : Gtk.Application {
}
}
private void create_app_menu () {
private void create_actions () {
this.add_action_entries (action_entries, this);
this.set_accels_for_action ("app.help", {"F1"});
this.set_accels_for_action ("app.new-contact", {"<Primary>n"});
var builder = new Gtk.Builder ();
try {
builder.add_from_resource ("/org/gnome/contacts/ui/app-menu.ui");
} catch (GLib.Error e) {
error ("Error loading app menu: %s", e.message);
}
set_app_menu ((MenuModel)builder.get_object ("app-menu"));
}
private void create_window () {
......@@ -196,7 +188,7 @@ public class Contacts.App : Gtk.Application {
contacts_store.disconnect (id);
Source.remove (id2);
create_app_menu ();
create_actions ();
create_window ();
window.show ();
......@@ -208,7 +200,7 @@ public class Contacts.App : Gtk.Application {
id2 = Timeout.add (500, () => {
contacts_store.disconnect (id);
create_app_menu ();
create_actions ();
create_window ();
window.show ();
......@@ -257,7 +249,7 @@ public class Contacts.App : Gtk.Application {
public void load_styling () {
var provider = new Gtk.CssProvider ();
provider.load_from_resource ("/org/gnome/contacts/ui/style.css");
provider.load_from_resource ("/org/gnome/Contacts/ui/style.css");
StyleContext.add_provider_for_screen (Gdk.Screen.get_default(),
provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
......@@ -273,7 +265,7 @@ public class Contacts.App : Gtk.Application {
}
}
create_app_menu ();
create_actions ();
create_window ();
window.show ();
}
......
......@@ -26,7 +26,7 @@ using Folks;
*
* After a user has initially chosen an avatar, we provide a cropping tool.
*/
[GtkTemplate (ui = "/org/gnome/contacts/ui/contacts-avatar-dialog.ui")]
[GtkTemplate (ui = "/org/gnome/Contacts/ui/contacts-avatar-dialog.ui")]
public class Contacts.AvatarDialog : Dialog {
const int MAIN_SIZE = 128;
const int ICONS_SIZE = 64;
......
......@@ -61,7 +61,7 @@ public class Contacts.AddressEditor : Box {
}
}
[GtkTemplate (ui = "/org/gnome/contacts/ui/contacts-contact-editor.ui")]
[GtkTemplate (ui = "/org/gnome/Contacts/ui/contacts-contact-editor.ui")]
public class Contacts.ContactEditor : Grid {
private const string[] DEFAULT_PROPS_NEW_CONTACT = {
......
......@@ -26,7 +26,7 @@ const int PROFILE_SIZE = 96;
* a page if nothing is selected, a ContactSheet to view contact information,
* and a ContactEditor to edit contact information.
*/
[GtkTemplate (ui = "/org/gnome/contacts/ui/contacts-contact-pane.ui")]
[GtkTemplate (ui = "/org/gnome/Contacts/ui/contacts-contact-pane.ui")]
public class Contacts.ContactPane : Stack {
private Window parent_window;
......
......@@ -17,7 +17,7 @@
using Gtk;
[GtkTemplate (ui = "/org/gnome/contacts/ui/contacts-in-app-notification.ui")]
[GtkTemplate (ui = "/org/gnome/Contacts/ui/contacts-in-app-notification.ui")]
public class Contacts.InAppNotification : Revealer {
// Close the in-app notification after 5 seconds by default.
private const uint DEFAULT_KEEPALIVE = 5;
......
......@@ -24,7 +24,7 @@ using Gee;
* It offers the user the sugugestion of linking the currently shown contact
* and another (hopefully) similar contact.
*/
[GtkTemplate (ui = "/org/gnome/contacts/ui/contacts-link-suggestion-grid.ui")]
[GtkTemplate (ui = "/org/gnome/Contacts/ui/contacts-link-suggestion-grid.ui")]
public class Contacts.LinkSuggestionGrid : Grid {
[GtkChild]
......
......@@ -20,7 +20,7 @@ using Gee;
using Gtk;
using Folks;
[GtkTemplate (ui = "/org/gnome/contacts/ui/contacts-list-pane.ui")]
[GtkTemplate (ui = "/org/gnome/Contacts/ui/contacts-list-pane.ui")]
public class Contacts.ListPane : Frame {
private Store store;
......
......@@ -19,7 +19,7 @@ using Gee;
using Gtk;
using Folks;
[GtkTemplate (ui = "/org/gnome/contacts/ui/contacts-window.ui")]
[GtkTemplate (ui = "/org/gnome/Contacts/ui/contacts-window.ui")]
public class Contacts.Window : Gtk.ApplicationWindow {
[GtkChild]
private Grid content_grid;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment