diff options
author | Niels De Graef <nielsdegraef@gmail.com> | 2020-02-03 21:59:16 +0100 |
---|---|---|
committer | Niels De Graef <nielsdegraef@gmail.com> | 2020-02-03 22:04:59 +0100 |
commit | f83047c9b1228f5ddd97ddc0886d5582c7257ffb (patch) | |
tree | a63f472c1405b7184a3e8d1485186d0b83382806 /src | |
parent | 078d6eb05f941c0b14fa908dda2a80ac9ebb1fce (diff) | |
download | gnome-contacts-f83047c9b1228f5ddd97ddc0886d5582c7257ffb.tar.gz |
Remove ContactForm/ContactEditor UI files
We got rid of the `ContactForm` class with !94, but it was still listed
in `POTFILES.in`, as well as the ContactEditor UI file. The `.vala` file
of `ContactForm` was also not deleted, so do that as well.
Fixes https://gitlab.gnome.org/GNOME/gnome-contacts/issues/161
Diffstat (limited to 'src')
-rw-r--r-- | src/contacts-contact-form.vala | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/src/contacts-contact-form.vala b/src/contacts-contact-form.vala deleted file mode 100644 index 198fa6a..0000000 --- a/src/contacts-contact-form.vala +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2018 Niels De Graef <nielsdegraef@gmail.com> - * - * 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. - * - * This 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. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -using Folks; -using Gee; -using Gtk; - -/** - * A parent class for the {@link ContactEditor} and the {@link ContactSheet}. - * - * This exploits the common structure of both widgets: they both display a - * (possibly empty) contact, starting with a header and subsequently iterating - * over the several {@link Folks.Persona}s, displaying their properties. - */ -[GtkTemplate (ui = "/org/gnome/Contacts/ui/contacts-contact-form.ui")] -public abstract class Contacts.ContactForm : Grid { - - protected const string[] SORTED_PROPERTIES = { - "email-addresses", - "phone-numbers", - "im-addresses", - "urls", - "nickname", - "birthday", - "postal-addresses", - "notes" - }; - - protected Individual? individual; - - protected Store store; - - [GtkChild] - private ScrolledWindow main_sw; - - [GtkChild] - protected Grid container_grid; - protected int last_row = 0; - - construct { - this.container_grid.set_focus_vadjustment (this.main_sw.get_vadjustment ()); - this.main_sw.get_style_context ().add_class ("contacts-contact-form"); - } - - protected string[] sort_persona_properties (string[] props) { - CompareDataFunc<string> compare_properties = (a, b) => { - foreach (var prop in SORTED_PROPERTIES) { - if (a == prop) - return (b == prop)? 0 : -1; - - if (b == prop) - return 1; - } - - return 0; - }; - - var sorted_props = new ArrayList<string> (); - foreach (var s in props) - sorted_props.add (s); - - sorted_props.sort ((owned) compare_properties); - return sorted_props.to_array (); - } - - protected Label create_persona_store_label (Persona p) { - var store_name = new Label(""); - store_name.set_markup (Markup.printf_escaped ("<span font='16px bold'>%s</span>", - Contacts.Utils.format_persona_store_name_for_contact (p))); - store_name.set_halign (Align.START); - store_name.xalign = 0.0f; - store_name.margin_start = 6; - - return store_name; - } -} |