mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 797091 - About window misbehaves.
Caching it is silly. Don't.
This commit is contained in:
parent
715a079be0
commit
b0d0ee1a40
@ -205,11 +205,6 @@ typedef struct GncMainWindowPrivate
|
|||||||
* window that is contained in the status bar. This pointer
|
* window that is contained in the status bar. This pointer
|
||||||
* provides easy access for updating the progressbar. */
|
* provides easy access for updating the progressbar. */
|
||||||
GtkWidget *progressbar;
|
GtkWidget *progressbar;
|
||||||
/** Pointer to the about dialog. We need this so that we create
|
|
||||||
* only one, can attach to its activate-link signal, and can
|
|
||||||
* destroy it with the main window.
|
|
||||||
*/
|
|
||||||
GtkWidget *about_dialog;
|
|
||||||
|
|
||||||
/** The group of all actions provided by the main window
|
/** The group of all actions provided by the main window
|
||||||
* itself. This does not include any action provided by menu
|
* itself. This does not include any action provided by menu
|
||||||
@ -2610,7 +2605,6 @@ gnc_main_window_init (GncMainWindow *window,
|
|||||||
|
|
||||||
/* Get the show_color_tabs value preference */
|
/* Get the show_color_tabs value preference */
|
||||||
priv->show_color_tabs = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_COLOR);
|
priv->show_color_tabs = gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_COLOR);
|
||||||
priv->about_dialog = NULL;
|
|
||||||
|
|
||||||
gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL,
|
gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL,
|
||||||
GNC_PREF_TAB_COLOR,
|
GNC_PREF_TAB_COLOR,
|
||||||
@ -2697,8 +2691,6 @@ gnc_main_window_destroy (GtkWidget *widget)
|
|||||||
g_list_foreach (plugins, gnc_main_window_remove_plugin, window);
|
g_list_foreach (plugins, gnc_main_window_remove_plugin, window);
|
||||||
g_list_free (plugins);
|
g_list_free (plugins);
|
||||||
}
|
}
|
||||||
if (priv->about_dialog)
|
|
||||||
g_object_unref (priv->about_dialog);
|
|
||||||
GTK_WIDGET_CLASS (parent_class)->destroy (widget);
|
GTK_WIDGET_CLASS (parent_class)->destroy (widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4504,32 +4496,26 @@ url_signal_cb (GtkAboutDialog *dialog, gchar *uri, gpointer data)
|
|||||||
static void
|
static void
|
||||||
gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window)
|
gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window)
|
||||||
{
|
{
|
||||||
GncMainWindowPrivate *priv;
|
/* Translators: %s will be replaced with the current year */
|
||||||
|
gchar *copyright = g_strdup_printf(_("Copyright © 1997-%s The GnuCash contributors."),
|
||||||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
GNC_VCS_REV_YEAR);
|
||||||
|
gchar **authors = get_file_strsplit("AUTHORS");
|
||||||
if (priv->about_dialog == NULL)
|
gchar **documenters = get_file_strsplit("DOCUMENTERS");
|
||||||
{
|
gchar *license = get_file("LICENSE");
|
||||||
/* Translators: %s will be replaced with the current year */
|
GtkIconTheme *icon_theme = gtk_icon_theme_get_default ();
|
||||||
gchar *copyright = g_strdup_printf(_("Copyright © 1997-%s The GnuCash contributors."),
|
GdkPixbuf *logo = gtk_icon_theme_load_icon (icon_theme,
|
||||||
GNC_VCS_REV_YEAR);
|
GNC_ICON_APP,
|
||||||
gchar **authors = get_file_strsplit("AUTHORS");
|
128,
|
||||||
gchar **documenters = get_file_strsplit("DOCUMENTERS");
|
GTK_ICON_LOOKUP_USE_BUILTIN,
|
||||||
gchar *license = get_file("LICENSE");
|
NULL);
|
||||||
GtkIconTheme *icon_theme = gtk_icon_theme_get_default ();
|
gchar *version = g_strdup_printf ("%s: %s\n%s: %s\nFinance::Quote: %s",
|
||||||
GdkPixbuf *logo = gtk_icon_theme_load_icon (icon_theme,
|
_("Version"), gnc_version(),
|
||||||
GNC_ICON_APP,
|
_("Build ID"), gnc_build_id(),
|
||||||
128,
|
gnc_quote_source_fq_version ()
|
||||||
GTK_ICON_LOOKUP_USE_BUILTIN,
|
? gnc_quote_source_fq_version ()
|
||||||
NULL);
|
: "-");
|
||||||
gchar *version = g_strdup_printf ("%s: %s\n%s: %s\nFinance::Quote: %s",
|
GtkDialog *dialog = GTK_DIALOG (gtk_about_dialog_new ());
|
||||||
_("Version"), gnc_version(),
|
g_object_set (G_OBJECT (dialog),
|
||||||
_("Build ID"), gnc_build_id(),
|
|
||||||
gnc_quote_source_fq_version ()
|
|
||||||
? gnc_quote_source_fq_version ()
|
|
||||||
: "-");
|
|
||||||
priv->about_dialog = gtk_about_dialog_new ();
|
|
||||||
g_object_set (priv->about_dialog,
|
|
||||||
"authors", authors,
|
"authors", authors,
|
||||||
"documenters", documenters,
|
"documenters", documenters,
|
||||||
"comments", _("Accounting for personal and small business finance."),
|
"comments", _("Accounting for personal and small business finance."),
|
||||||
@ -4537,37 +4523,34 @@ gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window)
|
|||||||
"license", license,
|
"license", license,
|
||||||
"logo", logo,
|
"logo", logo,
|
||||||
"name", "GnuCash",
|
"name", "GnuCash",
|
||||||
/* Translators: the following string will be shown in Help->About->Credits
|
/* Translators: the following string will be shown in Help->About->Credits
|
||||||
* Enter your name or that of your team and an email contact for feedback.
|
* Enter your name or that of your team and an email contact for feedback.
|
||||||
* The string can have multiple rows, so you can also add a list of
|
* The string can have multiple rows, so you can also add a list of
|
||||||
* contributors. */
|
* contributors. */
|
||||||
"translator-credits", _("translator-credits"),
|
"translator-credits", _("translator-credits"),
|
||||||
"version", version,
|
"version", version,
|
||||||
"website", PACKAGE_URL,
|
"website", PACKAGE_URL,
|
||||||
"website-label", _("Visit the GnuCash website."),
|
"website-label", _("Visit the GnuCash website."),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
g_free(version);
|
g_free(version);
|
||||||
g_free(copyright);
|
g_free(copyright);
|
||||||
if (license)
|
if (license)
|
||||||
g_free(license);
|
g_free(license);
|
||||||
if (documenters)
|
if (documenters)
|
||||||
g_strfreev(documenters);
|
g_strfreev(documenters);
|
||||||
if (authors)
|
if (authors)
|
||||||
g_strfreev(authors);
|
g_strfreev(authors);
|
||||||
g_object_unref (logo);
|
g_object_unref (logo);
|
||||||
g_signal_connect (priv->about_dialog, "activate-link",
|
g_signal_connect (dialog, "activate-link",
|
||||||
G_CALLBACK (url_signal_cb), NULL);
|
G_CALLBACK (url_signal_cb), NULL);
|
||||||
g_signal_connect (priv->about_dialog, "response",
|
/* Set dialog to resize. */
|
||||||
G_CALLBACK (gtk_widget_hide), NULL);
|
gtk_window_set_resizable(GTK_WINDOW (dialog), TRUE);
|
||||||
|
|
||||||
/* Set dialog to resize. */
|
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
||||||
gtk_window_set_resizable(GTK_WINDOW(priv->about_dialog), TRUE);
|
GTK_WINDOW (window));
|
||||||
|
gtk_dialog_run (dialog);
|
||||||
gtk_window_set_transient_for (GTK_WINDOW (priv->about_dialog),
|
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||||
GTK_WINDOW (window));
|
|
||||||
}
|
|
||||||
gtk_dialog_run (GTK_DIALOG (priv->about_dialog));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user