summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2017-12-30 15:10:38 +0100
committerNiels De Graef <nielsdegraef@gmail.com>2017-12-30 15:14:46 +0100
commit489f6d3c01f4ea0bdfa3a9cca0dae727517706ee (patch)
tree084a017d1074faf5204e9faf4303b12e02b7f024 /data
parent819edbdddaca2df37c3aa15c14f8226f1f1b5d86 (diff)
downloadgnome-contacts-489f6d3c01f4ea0bdfa3a9cca0dae727517706ee.tar.gz
Extract setup window into a separate class.
This simplifies the code in ContactsWindow by a bit and also prevents unnecessary loading of the setup UI.
Diffstat (limited to 'data')
-rw-r--r--data/contacts.gresource.xml1
-rw-r--r--data/ui/contacts-setup-window.ui93
-rw-r--r--data/ui/contacts-window.ui359
3 files changed, 230 insertions, 223 deletions
diff --git a/data/contacts.gresource.xml b/data/contacts.gresource.xml
index ba45a0c..2e4f79c 100644
--- a/data/contacts.gresource.xml
+++ b/data/contacts.gresource.xml
@@ -12,6 +12,7 @@
<file compressed="true" preprocess="xml-stripblanks">ui/contacts-in-app-notification.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/contacts-link-suggestion-grid.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/contacts-list-pane.ui</file>
+ <file compressed="true" preprocess="xml-stripblanks">ui/contacts-setup-window.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/contacts-window.ui</file>
</gresource>
</gresources>
diff --git a/data/ui/contacts-setup-window.ui b/data/ui/contacts-setup-window.ui
new file mode 100644
index 0000000..41fffdd
--- /dev/null
+++ b/data/ui/contacts-setup-window.ui
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.22 -->
+ <template class="ContactsSetupWindow" parent="GtkApplicationWindow">
+ <property name="visible">True</property>
+ <property name="default_width">800</property>
+ <property name="default_height">600</property>
+ <property name="icon_name">gnome-contacts</property>
+ <child type="titlebar">
+ <object class="GtkHeaderBar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Contacts Setup</property>
+ <property name="show_close_button">False</property>
+ <style>
+ <class name="titlebar"/>
+ </style>
+ <child>
+ <object class="GtkButton" id="setup_quit_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Quit</property>
+ <property name="action_name">app.quit</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="setup_quit_button_atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes">Cancel setup and quit</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="pack_type">start</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="setup_done_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="focus_on_click">False</property>
+ <property name="label" translatable="yes">Done</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="setup_done_button_atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes">Setup complete</property>
+ </object>
+ </child>
+ <style>
+ <class name="text-button"/>
+ <class name="suggested-action"/>
+ </style>
+ </object>
+ <packing>
+ <property name="pack_type">end</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkGrid" id="content">
+ <property name="visible">True</property>
+ <property name="valign">center</property>
+ <property name="halign">center</property>
+ <property name="border_width">12</property>
+ <property name="row_spacing">24</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="halign">center</property>
+ <property name="label" translatable="yes">Welcome</property>
+ <attributes>
+ <attribute name="scale" value="3.5"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="halign">center</property>
+ <property name="wrap">True</property>
+ <property name="max_width_chars">55</property>
+ <property name="label" translatable="yes">Please select your main address book: this is where new contacts will be added. If you keep your contacts in an online account, you can add them using the online accounts settings.</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkListBox" id="providers_list">
+ <property name="visible">True</property>
+ <property name="halign">center</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
diff --git a/data/ui/contacts-window.ui b/data/ui/contacts-window.ui
index d9d48d2..c5858bc 100644
--- a/data/ui/contacts-window.ui
+++ b/data/ui/contacts-window.ui
@@ -11,7 +11,142 @@
<signal name="key-press-event" handler="key_press_event_cb" object="ContactsWindow" after="yes" swapped="no"/>
<signal name="delete-event" handler="delete_event_cb" object="ContactsWindow" after="no" swapped="no"/>
<child type="titlebar">
- <placeholder />
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkHeaderBar" id="left_header">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">All Contacts</property>
+ <property name="show_close_button">True</property>
+ <style>
+ <class name="contacts-left-header-bar"/>
+ <class name="titlebar"/>
+ </style>
+ <child>
+ <object class="GtkButton" id="add_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <signal name="clicked" handler="new_contact" object="ContactsWindow" after="no" swapped="no"/>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="add_button_atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes">Add contact</property>
+ </object>
+ </child>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">list-add-symbolic</property>
+ <property name="icon_size">1</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="pack_type">start</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="select_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="focus_on_click">False</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="select_button_atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes">Selection mode</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">object-select-symbolic</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="pack_type">end</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="select_cancel_button">
+ <property name="visible">False</property>
+ <property name="can_focus">True</property>
+ <property name="focus_on_click">False</property>
+ <property name="label" translatable="yes">Cancel</property>
+ </object>
+ <packing>
+ <property name="pack_type">end</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkHeaderBar" id="right_header">
+ <property name="visible">True</property>
+ <property name="hexpand">True</property>
+ <property name="show_close_button">True</property>
+ <style>
+ <class name="contacts-right-header-bar"/>
+ <class name="titlebar"/>
+ </style>
+ <child>
+ <object class="GtkButton" id="cancel_button">
+ <property name="visible">False</property>
+ <property name="can_focus">True</property>
+ <property name="focus_on_click">False</property>
+ <property name="label" translatable="yes">Cancel</property>
+ <property name="width_request">70</property>
+ <property name="valign">center</property>
+ <style>
+ <class name="text-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="pack_type">start</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="edit_button">
+ <property name="visible">False</property>
+ <property name="can_focus">True</property>
+ <property name="focus_on_click">False</property>
+ <property name="label" translatable="yes">Edit</property>
+ <property name="width_request">70</property>
+ <property name="valign">center</property>
+ <style>
+ <class name="text-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="pack_type">end</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="done_button">
+ <property name="visible">False</property>
+ <property name="can_focus">True</property>
+ <property name="focus_on_click">False</property>
+ <property name="label" translatable="yes">Done</property>
+ <property name="width_request">70</property>
+ <property name="valign">center</property>
+ <style>
+ <class name="text-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="pack_type">end</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
</child>
<child>
<object class="GtkStack" id="view_switcher">
@@ -97,46 +232,6 @@
<property name="name">content-view</property>
</packing>
</child>
- <child>
- <object class="GtkGrid" id="setup_view">
- <property name="visible">True</property>
- <property name="valign">center</property>
- <property name="border_width">12</property>
- <property name="row_spacing">24</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="halign">center</property>
- <property name="label" translatable="yes">Welcome</property>
- <attributes>
- <attribute name="scale" value="3.5"/>
- <!-- <attribute name="weight" value="bold"/> -->
- </attributes>
- </object>
- <packing>
- <property name="top_attach">0</property>
- <property name="left_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="setup_explanation_label">
- <property name="visible">True</property>
- <property name="halign">center</property>
- <property name="wrap">True</property>
- <property name="max_width_chars">50</property>
- <property name="label" translatable="yes">Please select your main address book: this is where new contacts will be added. If you keep your contacts in an online account, you can add them using the online accounts settings.</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="left_attach">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="name">setup-view</property>
- </packing>
- </child>
</object>
</child>
</template>
@@ -148,188 +243,6 @@
<widget name="done_button"/>
</widgets>
</object>
- <object class="GtkGrid" id="content_header_bar">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkHeaderBar" id="left_header">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="title" translatable="yes">All Contacts</property>
- <property name="show_close_button">True</property>
- <style>
- <class name="contacts-left-header-bar"/>
- <class name="titlebar"/>
- </style>
- <child>
- <object class="GtkButton" id="add_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <signal name="clicked" handler="new_contact" object="ContactsWindow" after="no" swapped="no"/>
- <child internal-child="accessible">
- <object class="AtkObject" id="add_button_atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">Add contact</property>
- </object>
- </child>
- <style>
- <class name="image-button"/>
- </style>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">list-add-symbolic</property>
- <property name="icon_size">1</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="pack_type">start</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="select_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="focus_on_click">False</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="select_button_atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">Selection mode</property>
- </object>
- </child>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">object-select-symbolic</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="pack_type">end</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="select_cancel_button">
- <property name="visible">False</property>
- <property name="can_focus">True</property>
- <property name="focus_on_click">False</property>
- <property name="label" translatable="yes">Cancel</property>
- </object>
- <packing>
- <property name="pack_type">end</property>
- </packing>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkHeaderBar" id="right_header">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="show_close_button">True</property>
- <style>
- <class name="contacts-right-header-bar"/>
- <class name="titlebar"/>
- </style>
- <child>
- <object class="GtkButton" id="cancel_button">
- <property name="visible">False</property>
- <property name="can_focus">True</property>
- <property name="focus_on_click">False</property>
- <property name="label" translatable="yes">Cancel</property>
- <property name="width_request">70</property>
- <property name="valign">center</property>
- <style>
- <class name="text-button"/>
- </style>
- </object>
- <packing>
- <property name="pack_type">start</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="edit_button">
- <property name="visible">False</property>
- <property name="can_focus">True</property>
- <property name="focus_on_click">False</property>
- <property name="label" translatable="yes">Edit</property>
- <property name="width_request">70</property>
- <property name="valign">center</property>
- <style>
- <class name="text-button"/>
- </style>
- </object>
- <packing>
- <property name="pack_type">end</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="done_button">
- <property name="visible">False</property>
- <property name="can_focus">True</property>
- <property name="focus_on_click">False</property>
- <property name="label" translatable="yes">Done</property>
- <property name="width_request">70</property>
- <property name="valign">center</property>
- <style>
- <class name="text-button"/>
- </style>
- </object>
- <packing>
- <property name="pack_type">end</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <object class="GtkHeaderBar" id="setup_header_bar">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="title" translatable="yes">Contacts Setup</property>
- <property name="show_close_button">False</property>
- <style>
- <class name="titlebar"/>
- </style>
- <child>
- <object class="GtkButton" id="setup_quit_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Quit</property>
- <property name="action_name">app.quit</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="setup_quit_button_atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">Cancel setup and quit</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="pack_type">start</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="setup_done_button">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="focus_on_click">False</property>
- <property name="label" translatable="yes">Done</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="setup_done_button_atkobject">
- <property name="AtkObject::accessible-name" translatable="yes">Setup complete</property>
- </object>
- </child>
- <style>
- <class name="text-button"/>
- <class name="suggested-action"/>
- </style>
- </object>
- <packing>
- <property name="pack_type">end</property>
- </packing>
- </child>
- </object>
<object class="GtkSizeGroup" id="left_pane_size_group">
<property name="mode">horizontal</property>
<widgets>