summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2017-12-26 10:03:15 +0100
committerNiels De Graef <nielsdegraef@gmail.com>2017-12-26 10:06:06 +0100
commit5d84bd8f652fb44ffcb7bba46b5adf2cdbf417a1 (patch)
treebcd66125ec97685265def2f2a747887428104510
parent15f1f1d182cee64b4b0d69b8f6b03f0f0a64c336 (diff)
downloadgnome-contacts-5d84bd8f652fb44ffcb7bba46b5adf2cdbf417a1.tar.gz
Rename View to the more obvious ContactList.
-rw-r--r--data/ui/contacts-list-pane.ui2
-rw-r--r--data/ui/style.css4
-rw-r--r--po/POTFILES.in2
-rw-r--r--src/contacts-contact-list.vala (renamed from src/contacts-view.vala)11
-rw-r--r--src/contacts-list-pane.vala28
-rw-r--r--src/meson.build2
6 files changed, 27 insertions, 22 deletions
diff --git a/data/ui/contacts-list-pane.ui b/data/ui/contacts-list-pane.ui
index 34fca1f..9b79537 100644
--- a/data/ui/contacts-list-pane.ui
+++ b/data/ui/contacts-list-pane.ui
@@ -48,7 +48,7 @@
</packing>
</child>
<child>
- <object class="GtkScrolledWindow" id="contacts_view_container">
+ <object class="GtkScrolledWindow" id="contacts_list_container">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
diff --git a/data/ui/style.css b/data/ui/style.css
index bdba0f9..2f12b06 100644
--- a/data/ui/style.css
+++ b/data/ui/style.css
@@ -14,8 +14,8 @@ ContactsListPane.frame:dir(rtl) {
background-color: @theme_bg_color;
}
-/* contatcs view new color */
-.contacts-view {
+/* The contacts in the left pane */
+.contacts-contact-list {
background-color: transparent;
}
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 0ce9a8f..6e34260 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -17,6 +17,7 @@ src/contacts-app.vala
src/contacts-avatar-dialog.vala
src/contacts-contact-editor.vala
src/contacts-contact-frame.vala
+src/contacts-contact-list.vala
src/contacts-contact-pane.vala
src/contacts-contact-sheet.vala
src/contacts-contact.vala
@@ -25,7 +26,6 @@ src/contacts-linked-accounts-dialog.vala
src/contacts-link-suggestion-grid.vala
src/contacts-settings.vala
src/contacts-types.vala
-src/contacts-view.vala
src/contacts-window.vala
src/main.vala
src/org.gnome.Contacts.gschema.xml
diff --git a/src/contacts-view.vala b/src/contacts-contact-list.vala
index 7d8d27c..a08997c 100644
--- a/src/contacts-view.vala
+++ b/src/contacts-contact-list.vala
@@ -19,7 +19,12 @@ using Gtk;
using Folks;
using Gee;
-public class Contacts.View : ListBox {
+/**
+ * The ContactList is the actual list of {@link Contact}s that the user sees on
+ * the left. It is contained by the {@link ListPane}, which also provides other
+ * functionality, such as an action bar.
+ */
+public class Contacts.ContactList : ListBox {
private class ContactDataRow : ListBoxRow {
public Contact contact;
public Label label;
@@ -76,7 +81,7 @@ public class Contacts.View : ListBox {
private Store store;
- public View (Store store) {
+ public ContactList (Store store) {
this.selection_mode = Gtk.SelectionMode.BROWSE;
this.store = store;
@@ -86,7 +91,7 @@ public class Contacts.View : ListBox {
foreach (var c in this.store.get_contacts ())
contact_added_cb (this.store, c);
- get_style_context ().add_class ("contacts-view");
+ get_style_context ().add_class ("contacts-contact-list");
set_sort_func ((a, b) => compare_data (a as ContactDataRow, b as ContactDataRow));
set_filter_func (filter);
diff --git a/src/contacts-list-pane.vala b/src/contacts-list-pane.vala
index e85d74d..4ad9830 100644
--- a/src/contacts-list-pane.vala
+++ b/src/contacts-list-pane.vala
@@ -25,8 +25,8 @@ public class Contacts.ListPane : Frame {
private Store store;
[GtkChild]
- private Gtk.ScrolledWindow contacts_view_container;
- private View contacts_view;
+ private Gtk.ScrolledWindow contacts_list_container;
+ private ContactList contacts_list;
[GtkChild]
public ToolItem search_tool_item;
@@ -48,8 +48,8 @@ public class Contacts.ListPane : Frame {
public signal void selection_changed (Contact? contact);
- public signal void link_contacts (LinkedList<Contact> contacts_list);
- public signal void delete_contacts (LinkedList<Contact> contacts_list);
+ public signal void link_contacts (LinkedList<Contact> contacts);
+ public signal void delete_contacts (LinkedList<Contact> contacts);
public signal void contacts_marked (int contacts_marked);
@@ -64,7 +64,7 @@ public class Contacts.ListPane : Frame {
values = str.split(" ");
}
- this.contacts_view.set_filter_values (values);
+ this.contacts_list.set_filter_values (values);
}
private bool filter_entry_changed_timeout () {
@@ -85,15 +85,15 @@ public class Contacts.ListPane : Frame {
this.store = contacts_store;
// Load the ContactsView and connect the necessary signals
- this.contacts_view = new View (contacts_store);
- this.contacts_view_container.add (this.contacts_view);
+ this.contacts_list = new ContactList (contacts_store);
+ this.contacts_list_container.add (this.contacts_list);
- this.contacts_view.selection_changed.connect( (l, contact) => {
+ this.contacts_list.selection_changed.connect( (l, contact) => {
if (!this.ignore_selection_change)
selection_changed (contact);
});
- this.contacts_view.contacts_marked.connect ((nr_contacts_marked) => {
+ this.contacts_list.contacts_marked.connect ((nr_contacts_marked) => {
this.delete_button.sensitive = (nr_contacts_marked > 0);
this.link_button.sensitive = (nr_contacts_marked > 1);
contacts_marked (nr_contacts_marked);
@@ -103,28 +103,28 @@ public class Contacts.ListPane : Frame {
public void select_contact (Contact? contact, bool ignore_change = false) {
if (ignore_change)
ignore_selection_change = true;
- this.contacts_view.select_contact (contact);
+ this.contacts_list.select_contact (contact);
ignore_selection_change = false;
}
public void show_selection () {
- this.contacts_view.show_selectors ();
+ this.contacts_list.show_selectors ();
actions_bar.show ();
}
public void hide_selection () {
- this.contacts_view.hide_selectors ();
+ this.contacts_list.hide_selectors ();
actions_bar.hide ();
}
[GtkCallback]
private void on_link_button_clicked (Gtk.Button link_button) {
- link_contacts (this.contacts_view.get_marked_contacts ());
+ link_contacts (this.contacts_list.get_marked_contacts ());
}
[GtkCallback]
private void on_delete_button_clicked (Gtk.Button delete_button) {
- var marked_contacts = contacts_view.get_marked_contacts ();
+ var marked_contacts = this.contacts_list.get_marked_contacts ();
foreach (var c in marked_contacts)
c.hide ();
delete_contacts (marked_contacts);
diff --git a/src/meson.build b/src/meson.build
index 708c8d7..c95aca3 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -12,6 +12,7 @@ contacts_vala_sources = [
'contacts-avatar-dialog.vala',
'contacts-contact-editor.vala',
'contacts-contact-frame.vala',
+ 'contacts-contact-list.vala',
'contacts-contact-pane.vala',
'contacts-contact-sheet.vala',
'contacts-contact.vala',
@@ -24,7 +25,6 @@ contacts_vala_sources = [
'contacts-store.vala',
'contacts-types.vala',
'contacts-utils.vala',
- 'contacts-view.vala',
'contacts-window.vala',
'main.vala',
]