[geary/wip/720794-modal] Initial set of patches
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/720794-modal] Initial set of patches
- Date: Sat, 21 Dec 2013 00:34:12 +0000 (UTC)
commit a32bbc45a3a7e4985d841640135a807edc0af335
Author: William Jon McCann <william jon mccann gmail com>
Date: Fri Dec 20 15:31:38 2013 -0800
Initial set of patches
This achieves the basic goal of the ticket (make the dialog boxes
modal and transient), but need to rip out the now-extraneous logic
dealing with modeless-ness.
src/client/accounts/account-dialog.vala | 4 +++-
src/client/application/geary-controller.vala | 4 ++--
src/client/dialogs/preferences-dialog.vala | 6 ++++--
3 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/client/accounts/account-dialog.vala b/src/client/accounts/account-dialog.vala
index f6a4eae..eb78ee6 100644
--- a/src/client/accounts/account-dialog.vala
+++ b/src/client/accounts/account-dialog.vala
@@ -57,10 +57,12 @@ public class AccountDialog : Gtk.Dialog {
notebook.show_all(); // Required due to longstanding Gtk.Notebook bug
}
- public static void show_instance() {
+ public static void show_instance(Gtk.Window parent) {
if (account_dialog == null) {
account_dialog = new AccountDialog();
}
+ account_dialog.set_transient_for(parent);
+ account_dialog.set_modal(true);
account_dialog.show_all();
account_dialog.present();
}
diff --git a/src/client/application/geary-controller.vala b/src/client/application/geary-controller.vala
index 5b49fd4..0f1b5c6 100644
--- a/src/client/application/geary-controller.vala
+++ b/src/client/application/geary-controller.vala
@@ -1298,11 +1298,11 @@ public class GearyController : Geary.BaseObject {
}
private void on_accounts() {
- AccountDialog.show_instance();
+ AccountDialog.show_instance(main_window);
}
private void on_preferences() {
- PreferencesDialog.show_instance();
+ PreferencesDialog.show_instance(main_window);
}
private Gee.ArrayList<Geary.EmailIdentifier> get_conversation_email_ids(
diff --git a/src/client/dialogs/preferences-dialog.vala b/src/client/dialogs/preferences-dialog.vala
index d253fc9..91d48f8 100644
--- a/src/client/dialogs/preferences-dialog.vala
+++ b/src/client/dialogs/preferences-dialog.vala
@@ -50,10 +50,12 @@ public class PreferencesDialog : Object {
show_notifications.active = config.show_notifications;
}
- public static void show_instance() {
+ public static void show_instance(Gtk.Window parent) {
if (preferences_dialog == null)
preferences_dialog = new PreferencesDialog(GearyApplication.instance.config);
-
+
+ preferences_dialog.dialog.set_transient_for(parent);
+ preferences_dialog.dialog.set_modal(true);
preferences_dialog.populate_preference_options();
preferences_dialog.dialog.show_all();
preferences_dialog.dialog.present();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]