diff --git a/src/dialogs/save/save.c b/src/dialogs/save/save.c index 9dc273d..ab407bc 100644 --- a/src/dialogs/save/save.c +++ b/src/dialogs/save/save.c @@ -440,7 +440,7 @@ static void icon_press(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconPosition icon_ GList * dynamic = NULL; const GList * selection = NULL; - debug("%s",__FUNCTION__); + debug("%s(%d)",__FUNCTION__,dialog->mode); switch(dialog->mode) { @@ -464,6 +464,8 @@ static void icon_press(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconPosition icon_ return; } + debug("Selection=%p",selection); + if(!selection) { *error = g_error_new(g_quark_from_static_string(PACKAGE_NAME),ENOTCONN,"%s",strerror(ENODATA)); @@ -524,7 +526,7 @@ static void icon_press(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconPosition icon_ static void save_as_image(V3270SaveDialog * dialog, const gchar *format, GError **error) { - debug("%s",__FUNCTION__); + debug("%s(%d)",__FUNCTION__,dialog->mode); GdkPixbuf * pixbuf = NULL; @@ -547,6 +549,7 @@ static void icon_press(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconPosition icon_ { debug("%s","LIB3270_CONTENT_SELECTED"); GList * selection = g_list_append_lib3270_selection(NULL, v3270_get_session(dialog->terminal),FALSE); + debug("Selection=%p",selection); pixbuf = v3270_get_selection_as_pixbuf(GTK_V3270(dialog->terminal), selection, FALSE); g_list_free_full(selection,(GDestroyNotify) lib3270_free); } @@ -557,10 +560,13 @@ static void icon_press(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconPosition icon_ return; } + debug("pixbuff=%p",pixbuf); + if(pixbuf) { const gchar * filename = get_filename(dialog); + debug("Filename=%p",filename); if(filename) { gdk_pixbuf_save(pixbuf,filename,format,error,NULL); @@ -568,6 +574,10 @@ static void icon_press(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconPosition icon_ g_object_unref(pixbuf); } + else + { + *error = g_error_new(g_quark_from_static_string(PACKAGE_NAME),-1,_( "Error saving image" )); + } } diff --git a/src/selection/pixbuf.c b/src/selection/pixbuf.c index 17edc63..0f3f8bc 100644 --- a/src/selection/pixbuf.c +++ b/src/selection/pixbuf.c @@ -57,6 +57,7 @@ GdkPixbuf * v3270_get_selection_as_pixbuf(v3270 * terminal, const GList *selecti if(col > cols) cols = col; } + src++; } if(hasSelection) @@ -68,6 +69,8 @@ GdkPixbuf * v3270_get_selection_as_pixbuf(v3270 * terminal, const GList *selecti } + debug("%s: rows=%d cols=%d",__FUNCTION__,rows,cols); + if(!rows) return NULL; @@ -76,6 +79,8 @@ GdkPixbuf * v3270_get_selection_as_pixbuf(v3270 * terminal, const GList *selecti gint width = (cols+1) * terminal->font.width; gint height = (rows+1) * terminal->font.spacing.value; + debug("%s: width=%d height=%d",__FUNCTION__,width,height); + cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height); cairo_t *cr = cairo_create(surface); @@ -131,11 +136,11 @@ GdkPixbuf * v3270_get_selection_as_pixbuf(v3270 * terminal, const GList *selecti } } - cairo_destroy (cr); + cairo_destroy(cr); GdkPixbuf * pixbuf = gdk_pixbuf_get_from_surface(surface,0,0,width,height); - cairo_surface_destroy (surface); + cairo_surface_destroy(surface); return pixbuf; diff --git a/src/terminal/actions/action.c b/src/terminal/actions/action.c index a099407..723a867 100644 --- a/src/terminal/actions/action.c +++ b/src/terminal/actions/action.c @@ -246,7 +246,7 @@ } static gboolean bg_notify_enabled(GObject *action) { - debug("%s(%s,%s,%d)",__FUNCTION__,g_action_get_name(G_ACTION(action)),(g_action_get_enabled(G_ACTION(action)) ? "enabled" : "disabled"),(int) v3270_action_get_group(G_ACTION(action))); +// debug("%s(%s,%s,%d)",__FUNCTION__,g_action_get_name(G_ACTION(action)),(g_action_get_enabled(G_ACTION(action)) ? "enabled" : "disabled"),(int) v3270_action_get_group(G_ACTION(action))); g_object_notify(action, "enabled"); return FALSE; } -- libgit2 0.21.2