From 216bc753c8a99c578ee8724c11537be1e6082d4e Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Mon, 1 Feb 2010 01:37:17 +0100 Subject: [PATCH] HeAboutDialog now correctly parents with main window --- src/he/he-about-dialog.c | 8 +++++++- src/he/he-about-dialog.h | 3 ++- src/ui/callbacks.c | 5 +++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/he/he-about-dialog.c b/src/he/he-about-dialog.c index d31eb6c..eab055b 100644 --- a/src/he/he-about-dialog.c +++ b/src/he/he-about-dialog.c @@ -256,6 +256,7 @@ he_about_dialog_new () * Shows a new #HeAboutDialog with all settings configured. * * Parameters: + * * parent (The parent window that this dialog will be set transient for) * * app_name (Application name, use NULL to use from g_get_application_name()) * * icon_name (The application's icon name - must be provided) * * version (The version of the application) @@ -266,7 +267,8 @@ he_about_dialog_new () * * donate_url (The application's donations URL, or NULL if not available) **/ void -he_about_dialog_present(const gchar* app_name, +he_about_dialog_present(GtkWindow* parent, + const gchar* app_name, const gchar* icon_name, const gchar* version, const gchar* description, @@ -277,6 +279,10 @@ he_about_dialog_present(const gchar* app_name, { HeAboutDialog* ad = HE_ABOUT_DIALOG(he_about_dialog_new()); + if (parent != NULL) { + gtk_window_set_transient_for(GTK_WINDOW(ad), GTK_WINDOW(parent)); + } + if (app_name != NULL) { he_about_dialog_set_app_name(ad, app_name); } diff --git a/src/he/he-about-dialog.h b/src/he/he-about-dialog.h index db93d92..533cdae 100644 --- a/src/he/he-about-dialog.h +++ b/src/he/he-about-dialog.h @@ -78,7 +78,8 @@ GtkWidget* he_about_dialog_new (void); void -he_about_dialog_present(const gchar* app_name, +he_about_dialog_present(GtkWindow* parent, + const gchar* app_name, const gchar* icon_name, const gchar* version, const gchar* description, diff --git a/src/ui/callbacks.c b/src/ui/callbacks.c index 8503b2a..284c8a1 100644 --- a/src/ui/callbacks.c +++ b/src/ui/callbacks.c @@ -2384,8 +2384,9 @@ void callback_about_link(GtkAboutDialog *about, const gchar *link, gpointer data void callback_about(GtkAction * action, gpointer data) { - /*MainView *mainview=(MainView *)data;*/ - he_about_dialog_present(NULL /* auto-detect app name */, + MainView* mainview = (MainView *)data; + he_about_dialog_present(mainview_get_dialog_parent(mainview), + NULL /* auto-detect app name */, "maepad", VERSION, _("A node-based memory pad for Maemo"), -- 2.11.4.GIT