[Goodies-commits] r5942 - in xfce4-screenshooter-plugin/trunk: . lib panel-plugin src
Jerome Guelfucci
jeromeg at xfce.org
Mon Nov 3 21:20:51 CET 2008
Author: jeromeg
Date: 2008-11-03 20:20:51 +0000 (Mon, 03 Nov 2008)
New Revision: 5942
Modified:
xfce4-screenshooter-plugin/trunk/ChangeLog
xfce4-screenshooter-plugin/trunk/TODO
xfce4-screenshooter-plugin/trunk/configure.ac.in
xfce4-screenshooter-plugin/trunk/lib/screenshooter-dialogs.c
xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c
xfce4-screenshooter-plugin/trunk/panel-plugin/screenshooter-plugin.c
xfce4-screenshooter-plugin/trunk/src/main.c
Log:
* configure.ac.in: Display build options.
* lib/screenshooter-dialog.c:
- (cb_combo_active_item_changed) Fix prototype and do not free sd->app as it
makes the plugin segfault.
* lib/screenshooter-utils.c:
- (screenshooter_open_screenshot) Display the error with xfce_err if any.
* TODO: updated.
Modified: xfce4-screenshooter-plugin/trunk/ChangeLog
===================================================================
--- xfce4-screenshooter-plugin/trunk/ChangeLog 2008-11-03 19:45:48 UTC (rev 5941)
+++ xfce4-screenshooter-plugin/trunk/ChangeLog 2008-11-03 20:20:51 UTC (rev 5942)
@@ -1,6 +1,16 @@
2008-11-03 jeromeg
+ * configure.ac.in: Display build options.
+ * lib/screenshooter-dialog.c:
+ - (cb_combo_active_item_changed) Fix prototype and do not free sd->app as it
+ makes the plugin segfault.
+ * lib/screenshooter-utils.c:
+ - (screenshooter_open_screenshot) Display the error with xfce_err if any.
* TODO: updated.
+
+2008-11-03 jeromeg
+
+ * TODO: updated.
* lib/screenshooter-utils.h: add define for default application.
* lib/screenshooter-utils.c:
- (screenshooter_read_rc_file) read the default application.
Modified: xfce4-screenshooter-plugin/trunk/TODO
===================================================================
--- xfce4-screenshooter-plugin/trunk/TODO 2008-11-03 19:45:48 UTC (rev 5941)
+++ xfce4-screenshooter-plugin/trunk/TODO 2008-11-03 20:20:51 UTC (rev 5942)
@@ -1,8 +1,6 @@
-* Add open with support to the plugin.
* Write some documentation.
* Update the code comments.
* Update the website.
-* Correctly free the stuff in the GLists in screenshooter-dialogs.c
Low priority:
* Try to get borders captured with compiz.
Modified: xfce4-screenshooter-plugin/trunk/configure.ac.in
===================================================================
--- xfce4-screenshooter-plugin/trunk/configure.ac.in 2008-11-03 19:45:48 UTC (rev 5941)
+++ xfce4-screenshooter-plugin/trunk/configure.ac.in 2008-11-03 20:20:51 UTC (rev 5942)
@@ -70,3 +70,15 @@
po/Makefile.in
])
+dnl ***************************
+dnl *** Print configuration ***
+dnl ***************************
+
+echo "Build Configuration:"
+
+if test x"$GIO_FOUND" = x"yes"; then
+echo "* Open with support: yes"
+else
+echo "* Open with support: no"
+fi
+
Modified: xfce4-screenshooter-plugin/trunk/lib/screenshooter-dialogs.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/lib/screenshooter-dialogs.c 2008-11-03 19:45:48 UTC (rev 5941)
+++ xfce4-screenshooter-plugin/trunk/lib/screenshooter-dialogs.c 2008-11-03 20:20:51 UTC (rev 5942)
@@ -34,7 +34,7 @@
static void cb_delay_spinner_changed (GtkWidget *spinner,
ScreenshotData *sd);
#ifdef HAVE_GIO
-static void cb_combo_active_item_changed (GtkComboBox *box,
+static void cb_combo_active_item_changed (GtkWidget *box,
ScreenshotData *sd);
static void add_item (GAppInfo *app_info,
GtkWidget *liststore);
@@ -106,7 +106,7 @@
-static void cb_combo_active_item_changed (GtkComboBox *box, ScreenshotData *sd)
+static void cb_combo_active_item_changed (GtkWidget *box, ScreenshotData *sd)
{
GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX (box));
GtkTreeIter iter;
@@ -116,10 +116,7 @@
gtk_tree_model_get (model, &iter, 2, &active_command, -1);
- if (sd->app != NULL)
- g_free (sd->app);
-
- sd->app = active_command;
+ sd->app = active_command;
}
Modified: xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c 2008-11-03 19:45:48 UTC (rev 5941)
+++ xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c 2008-11-03 20:20:51 UTC (rev 5942)
@@ -360,7 +360,15 @@
gchar *command =
g_strconcat (application, " ", screenshot_path, NULL);
- xfce_exec (command, FALSE, TRUE, NULL);
+ GError *error = NULL;
+
+ if (!xfce_exec_on_screen (gdk_screen_get_default (), command, FALSE, TRUE, &error))
+ {
+ xfce_err (error->message);
+ g_error_free (error);
+ }
+
+ g_free (command);
}
}
}
Modified: xfce4-screenshooter-plugin/trunk/panel-plugin/screenshooter-plugin.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/panel-plugin/screenshooter-plugin.c 2008-11-03 19:45:48 UTC (rev 5941)
+++ xfce4-screenshooter-plugin/trunk/panel-plugin/screenshooter-plugin.c 2008-11-03 20:20:51 UTC (rev 5942)
@@ -138,6 +138,7 @@
pd->style_id = 0;
g_free (pd->sd->screenshot_dir);
+ g_free (pd->sd->app);
g_free (pd->sd);
g_free (pd);
}
@@ -152,6 +153,7 @@
cb_button_clicked (GtkWidget *button, PluginData *pd)
{
GdkPixbuf *screenshot;
+ gchar *screenshot_path = NULL;
/* Make the button unclickable so that the user does not press it while
another screenshot is in progress */
@@ -160,12 +162,19 @@
/* Get the screenshot */
screenshot = screenshooter_take_screenshot (pd->sd->mode, pd->sd->delay);
- screenshooter_save_screenshot (screenshot, pd->sd->show_save_dialog,
- pd->sd->screenshot_dir);
+ screenshot_path =
+ screenshooter_save_screenshot (screenshot, pd->sd->show_save_dialog,
+ pd->sd->screenshot_dir);
+ g_object_unref (screenshot);
+
+ if (screenshot_path != NULL)
+ {
+ screenshooter_open_screenshot (screenshot_path, pd->sd->app);
+ g_free (screenshot_path);
+ }
+
gtk_widget_set_sensitive (GTK_WIDGET (pd->button), TRUE);
-
- g_object_unref (screenshot);
}
Modified: xfce4-screenshooter-plugin/trunk/src/main.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/src/main.c 2008-11-03 19:45:48 UTC (rev 5941)
+++ xfce4-screenshooter-plugin/trunk/src/main.c 2008-11-03 20:20:51 UTC (rev 5942)
@@ -214,6 +214,7 @@
}
g_free (sd->screenshot_dir);
+ g_free (sd->app);
g_free (sd);
g_free (rc_file);
More information about the Goodies-commits
mailing list