summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2022-09-07 11:00:41 +0200
committerNiels De Graef <nielsdegraef@gmail.com>2022-09-08 07:16:50 +0200
commitbe028d98b29795c3e6846ba12374274ea2ff4751 (patch)
tree1863e5019d5f5993f67a2c480b8deb2aeda36d6c /src
parentca63c4912bd5f161b5bfc8067f40f3715fc97b88 (diff)
downloadgnome-contacts-be028d98b29795c3e6846ba12374274ea2ff4751.tar.gz
Remove AddressbookDialog
This is no longer used now that we have ported this to be part of the preferences window
Diffstat (limited to 'src')
-rw-r--r--src/contacts-addressbook-dialog.vala80
-rw-r--r--src/contacts-app.vala6
-rw-r--r--src/meson.build1
3 files changed, 0 insertions, 87 deletions
diff --git a/src/contacts-addressbook-dialog.vala b/src/contacts-addressbook-dialog.vala
deleted file mode 100644
index 14d7153..0000000
--- a/src/contacts-addressbook-dialog.vala
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2020 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;
-
-public class Contacts.AddressbookDialog : Gtk.Dialog {
-
- private AccountsList accounts_list;
-
- public AddressbookDialog (Store contacts_store, Gtk.Window? window) {
- Object(
- modal: true,
- transient_for: window,
- title: _("Change Address Book"),
- use_header_bar: 1
- );
-
- add_buttons (_("Change"), Gtk.ResponseType.OK,
- _("Cancel"), Gtk.ResponseType.CANCEL);
-
- var ok_button = get_widget_for_response (Gtk.ResponseType.OK);
- ok_button.sensitive = false;
- ok_button.get_style_context ().add_class ("suggested-action");
-
- var scrolled_window = new Gtk.ScrolledWindow ();
- scrolled_window.hexpand = true;
- scrolled_window.vexpand = true;
- scrolled_window.height_request = 300;
- scrolled_window.hscrollbar_policy = Gtk.PolicyType.NEVER;
- scrolled_window.propagate_natural_height = true;
- ((Gtk.Box) this.get_content_area ()).append (scrolled_window);
-
- var clamp = new Adw.Clamp ();
- clamp.margin_top = 32;
- clamp.margin_bottom = 32;
- clamp.margin_start = 12;
- clamp.margin_end = 12;
- clamp.maximum_size = 400;
- scrolled_window.set_child (clamp);
-
- var box = new Gtk.Box (Gtk.Orientation.VERTICAL, 12);
- box.valign = Gtk.Align.START;
- clamp.set_child (box);
-
- var explanation_label = new Gtk.Label (_("New contacts will be added to the selected address book.\nYou are able to view and edit contacts from other address books."));
- explanation_label.xalign = 0;
- explanation_label.wrap = true;
- box.append (explanation_label);
-
- this.accounts_list = new AccountsList (contacts_store);
- this.accounts_list.notify["selected-store"].connect ((obj, pspec) => {
- ok_button.sensitive = (this.accounts_list.selected_store != null);
- });
-
- box.append (this.accounts_list);
- }
-
- public override void response (int response) {
- if (response != Gtk.ResponseType.OK)
- return;
-
- unowned var e_store = (Edsf.PersonaStore) this.accounts_list.selected_store;
- if (e_store != null)
- Utils.set_primary_store (e_store);
- }
-}
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index 25613a2..6f15733 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -115,12 +115,6 @@ public class Contacts.App : Adw.Application {
}
}
- public void change_address_book () {
- var dialog = new AddressbookDialog (this.contacts_store, this.window);
- dialog.response.connect ((_) => dialog.close ());
- dialog.show ();
- }
-
public void show_preferences () {
var prefs_window = new PreferencesWindow (this.contacts_store, this.window);
prefs_window.show ();
diff --git a/src/meson.build b/src/meson.build
index b29028e..346aae7 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -97,7 +97,6 @@ libcontacts_dep = declare_dependency(
# The gnome-contacts binary
contacts_vala_sources = files(
- 'contacts-addressbook-dialog.vala',
'contacts-accounts-list.vala',
'contacts-app.vala',
'contacts-avatar.vala',