[Goodies-commits] r5289 - in xfce4-screenshooter-plugin/trunk: . src
Jerome Guelfucci
jeromeg at xfce.org
Sat Aug 23 12:28:51 CEST 2008
Author: jeromeg
Date: 2008-08-23 10:28:50 +0000 (Sat, 23 Aug 2008)
New Revision: 5289
Modified:
xfce4-screenshooter-plugin/trunk/ChangeLog
xfce4-screenshooter-plugin/trunk/NEWS
xfce4-screenshooter-plugin/trunk/configure.ac.in
xfce4-screenshooter-plugin/trunk/src/screenshooter-utils.c
Log:
=== 1.3.2 ===
* src/screenshooter-utils.c:
- (cb_current_folder_changed): new function to update the filename.
- (save_screenshot): updated to use cb_current_folder_changed.
* NEWS: updated.
* configure.ac.in: get ready for new release.
Modified: xfce4-screenshooter-plugin/trunk/ChangeLog
===================================================================
--- xfce4-screenshooter-plugin/trunk/ChangeLog 2008-08-23 01:10:23 UTC (rev 5288)
+++ xfce4-screenshooter-plugin/trunk/ChangeLog 2008-08-23 10:28:50 UTC (rev 5289)
@@ -1,3 +1,13 @@
+2008-08-23 jeromeg
+
+ === 1.3.2 ===
+
+ * src/screenshooter-utils.c:
+ - (cb_current_folder_changed): new function to update the filename.
+ - (save_screenshot): updated to use cb_current_folder_changed.
+ * NEWS: updated.
+ * configure.ac.in: get ready for new release.
+
2008-08-19 jeromeg
* src/*: use a #define to set the default save directory.
Modified: xfce4-screenshooter-plugin/trunk/NEWS
===================================================================
--- xfce4-screenshooter-plugin/trunk/NEWS 2008-08-23 01:10:23 UTC (rev 5288)
+++ xfce4-screenshooter-plugin/trunk/NEWS 2008-08-23 10:28:50 UTC (rev 5289)
@@ -6,6 +6,8 @@
* Use tooltips for panel plugin when compiled with gtk >= 2.12.
* Fix all compiler warnings.
* Comment the code and make it more readable.
+ * IMPROVEMENT: now, the name of the screenshot is updated while browsing in
+ the file chooser to set its save location.
=== Version 1.3.1 ===
* BUGFIX: Fix -s switch with relative path.
Modified: xfce4-screenshooter-plugin/trunk/configure.ac.in
===================================================================
--- xfce4-screenshooter-plugin/trunk/configure.ac.in 2008-08-23 01:10:23 UTC (rev 5288)
+++ xfce4-screenshooter-plugin/trunk/configure.ac.in 2008-08-23 10:28:50 UTC (rev 5289)
@@ -8,7 +8,7 @@
m4_define([xfce4_screenshooter_plugin_version_micro], [2])
m4_define([xfce4_screenshooter_plugin_version_nano], []) dnl leave this empty to have no nano version
m4_define([xfce4_screenshooter_plugin_version_build], [r at REVISION@])
-m4_define([xfce4_screenshooter_plugin_version_tag], [svn])
+m4_define([xfce4_screenshooter_plugin_version_tag], [])
m4_define([xfce4_screenshooter_plugin_version], [xfce4_screenshooter_plugin_version_major().xfce4_screenshooter_plugin_version_minor().xfce4_screenshooter_plugin_version_micro()ifelse(xfce4_screenshooter_plugin_version_nano(), [], [], [.xfce4_screenshooter_plugin_version_nano()])ifelse(xfce4_screenshooter_plugin_version_tag(), [svn], [xfce4_screenshooter_plugin_version_tag()-xfce4_screenshooter_plugin_version_build()], [xfce4_screenshooter_plugin_version_tag()])])
AC_INIT([xfce4-screenshooter-plugin], [xfce4_screenshooter_plugin_version], [http://bugzilla.xfce.org/], [xfce4-screenshooter-plugin])
Modified: xfce4-screenshooter-plugin/trunk/src/screenshooter-utils.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/src/screenshooter-utils.c 2008-08-23 01:10:23 UTC (rev 5288)
+++ xfce4-screenshooter-plugin/trunk/src/screenshooter-utils.c 2008-08-23 10:28:50 UTC (rev 5289)
@@ -22,9 +22,9 @@
/* Prototypes */
static gchar *generate_filename_for_uri(char *uri);
static Window find_toplevel_window (Window xid);
+static void cb_current_folder_changed (GtkFileChooser *chooser, gpointer user_data);
-
/* Borrowed from gnome-screenshot */
/* This function returns the toplevel window containing Window, for most window
managers this will enable you to get the decorations around Window. Does not
@@ -93,6 +93,30 @@
+/* Generate a correct file name when setting a folder in chooser
+GtkFileChooser *chooser: the file chooser we are using.
+gpointer user_data: not used here.
+*/
+static void
+cb_current_folder_changed (GtkFileChooser *chooser, gpointer user_data)
+{
+ gchar *current_folder =
+ gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (chooser));
+
+ if (current_folder)
+ {
+ gchar *new_filename = generate_filename_for_uri (current_folder);
+
+ gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (chooser),
+ new_filename);
+ g_free (new_filename);
+ }
+
+ g_free (current_folder);
+}
+
+
+
/* Public */
@@ -203,6 +227,11 @@
GDK_INTERP_BILINEAR);
gtk_image_set_from_pixbuf (GTK_IMAGE (preview), thumbnail);
g_object_unref (thumbnail);
+
+ /* We the user opens a folder in the fine_chooser, we set a valid
+ filename */
+ g_signal_connect (G_OBJECT (chooser), "current-folder-changed",
+ G_CALLBACK(cb_current_folder_changed), NULL);
dialog_response = gtk_dialog_run (GTK_DIALOG (chooser));
More information about the Goodies-commits
mailing list