[PATCH] applet: position some more dialogs to the center of the screen
- From: Mathieu Trudel-Lapierre <mathieu-tl ubuntu com>
- To: networkmanager-list gnome org
- Cc: Mathieu Trudel-Lapierre <mathieu-tl ubuntu com>
- Subject: [PATCH] applet: position some more dialogs to the center of the screen
- Date: Wed, 6 Mar 2013 12:40:57 -0500
---
src/applet-dialogs.c | 4 ++++
src/utils/utils.c | 2 ++
2 files changed, 6 insertions(+)
diff --git a/src/applet-dialogs.c b/src/applet-dialogs.c
index 53167b7..1e7359e 100644
--- a/src/applet-dialogs.c
+++ b/src/applet-dialogs.c
@@ -55,6 +55,7 @@ info_dialog_show_error (const char *err)
dialog = gtk_message_dialog_new_with_markup (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
"<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s", _("Error displaying
connection information:"), err);
+ gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ALWAYS);
gtk_window_present (GTK_WINDOW (dialog));
g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog);
}
@@ -902,6 +903,7 @@ applet_info_dialog_show (NMApplet *applet)
g_signal_connect (dialog, "delete-event", G_CALLBACK (gtk_widget_hide_on_delete), dialog);
g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_hide), dialog);
gtk_widget_realize (dialog);
+ gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ALWAYS);
gtk_window_present_with_time (GTK_WINDOW (dialog),
gdk_x11_get_server_time (gtk_widget_get_window (dialog)));
}
@@ -981,6 +983,7 @@ applet_mobile_password_dialog_new (NMConnection *connection,
dialog = GTK_DIALOG (gtk_dialog_new ());
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+ gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ALWAYS);
gtk_window_set_title (GTK_WINDOW (dialog), _("Mobile broadband network password"));
w = gtk_dialog_add_button (dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
@@ -1338,6 +1341,7 @@ applet_mobile_pin_dialog_new (const char *unlock_required,
} else
g_assert_not_reached ();
+ gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ALWAYS);
gtk_window_set_title (GTK_WINDOW (dialog), title);
widget = GTK_WIDGET (gtk_builder_get_object (builder, "header_label"));
diff --git a/src/utils/utils.c b/src/utils/utils.c
index 00f8596..3260c5b 100644
--- a/src/utils/utils.c
+++ b/src/utils/utils.c
@@ -192,6 +192,8 @@ utils_show_error_dialog (const char *title,
"%s",
text1);
+ gtk_window_set_position (GTK_WINDOW (err_dialog), GTK_WIN_POS_CENTER_ALWAYS);
+
if (text2)
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (err_dialog), "%s", text2);
if (title)
--
1.8.1.2
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]