[gtk+] print to file: fixed lost filename in gui
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] print to file: fixed lost filename in gui
- Date: Thu, 8 Dec 2011 01:05:01 +0000 (UTC)
commit 36effbb307c6a9a8a5d2476b537cd973e8eb282e
Author: Timothy Arceri <t_arceri yahoo com au>
Date: Wed Dec 7 20:03:07 2011 -0500
print to file: fixed lost filename in gui
Stop widget creating an event before updating both directory and
filename values.
https://bugzilla.gnome.org/show_bug.cgi?id=603823
gtk/gtkprinteroptionwidget.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkprinteroptionwidget.c b/gtk/gtkprinteroptionwidget.c
index 840fb26..d3ef046 100644
--- a/gtk/gtkprinteroptionwidget.c
+++ b/gtk/gtkprinteroptionwidget.c
@@ -882,13 +882,22 @@ update_widgets (GtkPrinterOptionWidget *widget)
basename = g_path_get_basename (filename);
dirname = g_path_get_dirname (filename);
+
text = g_filename_to_utf8 (basename, -1, NULL, NULL, NULL);
+
+ /* need to update dirname and basename without triggering function to avoid loosing names */
+ g_signal_handlers_block_by_func (priv->entry, G_CALLBACK (filesave_changed_cb), widget);
+ g_signal_handlers_block_by_func (priv->combo, G_CALLBACK (filesave_changed_cb), widget);
if (text != NULL)
gtk_entry_set_text (GTK_ENTRY (priv->entry), text);
if (g_path_is_absolute (dirname))
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (priv->combo),
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (priv->combo),
dirname);
+
+ g_signal_handlers_unblock_by_func (priv->entry, G_CALLBACK (filesave_changed_cb), widget);
+ g_signal_handlers_unblock_by_func (priv->combo, G_CALLBACK (filesave_changed_cb), widget);
+
g_free (text);
g_free (basename);
g_free (dirname);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]