[nautilus-sendto/gnome-3-6] main: Show the UI in main()



commit 0abe4c125c756add0f8eb2102c6a87ad5f565c7f
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Sep 3 19:59:41 2012 +0100

    main: Show the UI in main()
    
    Instead of when creating the UI. Gives visibility of the UI
    struct to main().

 src/nautilus-sendto-command.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-sendto-command.c b/src/nautilus-sendto-command.c
index f276c57..6dedd2e 100644
--- a/src/nautilus-sendto-command.c
+++ b/src/nautilus-sendto-command.c
@@ -528,7 +528,7 @@ update_button_image (GtkSettings *settings,
 		gtk_widget_show (widget);
 }
 
-static void
+static NS_ui *
 nautilus_sendto_create_ui (void)
 {
 	GtkBuilder *app;
@@ -638,7 +638,7 @@ nautilus_sendto_create_ui (void)
 		gtk_widget_set_sensitive (ui->pack_checkbutton, FALSE);
 	}
 
-	gtk_widget_show (ui->dialog);
+	return ui;
 }
 
 static void
@@ -809,6 +809,7 @@ int main (int argc, char **argv)
 {
 	GOptionContext *context;
 	GError *error = NULL;
+	NS_ui *ui;
 
 	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -846,7 +847,8 @@ int main (int argc, char **argv)
 		gtk_dialog_run (GTK_DIALOG (error_dialog));
 		return 1;
 	}
-	nautilus_sendto_create_ui ();
+	ui = nautilus_sendto_create_ui ();
+	gtk_widget_show (ui->dialog);
 
 	gtk_main ();
 	g_object_unref(settings);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]