[nautilus] application: cleanup creation of connect server dialog
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] application: cleanup creation of connect server dialog
- Date: Sat, 6 Dec 2014 23:45:54 +0000 (UTC)
commit 9958c9bfba6598600777338cd505541bd000d7c3
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sat Dec 6 15:40:25 2014 -0800
application: cleanup creation of connect server dialog
src/nautilus-application.c | 4 +---
src/nautilus-connect-server-dialog.c | 16 ++++------------
2 files changed, 5 insertions(+), 15 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 89d0c7e..8c3488c 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -556,14 +556,12 @@ nautilus_application_connect_server (NautilusApplication *application,
if (dialog == NULL) {
dialog = nautilus_connect_server_dialog_new (window);
g_signal_connect (dialog, "response", G_CALLBACK (on_connect_server_response), application);
- application->priv->connect_server_window = GTK_WIDGET (dialog);
+ application->priv->connect_server_window = dialog;
g_object_add_weak_pointer (G_OBJECT (dialog),
(gpointer *) &application->priv->connect_server_window);
}
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
- gtk_window_set_screen (GTK_WINDOW (dialog), gtk_window_get_screen (GTK_WINDOW (window)));
gtk_window_present (GTK_WINDOW (dialog));
return dialog;
diff --git a/src/nautilus-connect-server-dialog.c b/src/nautilus-connect-server-dialog.c
index b285541..459a1d0 100644
--- a/src/nautilus-connect-server-dialog.c
+++ b/src/nautilus-connect-server-dialog.c
@@ -697,18 +697,10 @@ nautilus_connect_server_dialog_class_init (NautilusConnectServerDialogClass *cla
GtkWidget *
nautilus_connect_server_dialog_new (NautilusWindow *window)
{
- GtkWidget *dialog;
-
- dialog = gtk_widget_new (NAUTILUS_TYPE_CONNECT_SERVER_DIALOG,
- "use-header-bar", TRUE,
- NULL);
-
- if (window) {
- gtk_window_set_screen (GTK_WINDOW (dialog),
- gtk_window_get_screen (GTK_WINDOW (window)));
- }
-
- return dialog;
+ return g_object_new (NAUTILUS_TYPE_CONNECT_SERVER_DIALOG,
+ "transient-for", window,
+ "use-header-bar", TRUE,
+ NULL);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]