Updates to initial check-in of pixmap saving feature:

- Bump minimum GTK version from 2.4 to 2.6 in code and users manual
 - Free some strings after we're done with them 
 

svn path=/trunk/; revision=22170
This commit is contained in:
Stephen Fisher 2007-06-23 05:58:01 +00:00
parent 4944cdc899
commit 1f786cac31
3 changed files with 14 additions and 11 deletions

View File

@ -430,7 +430,7 @@
</itemizedlist>
The save button will save the currently displayed portion of
the graph as one of various file formats. The save feature is
only available when using GTK version 2.4 or higher (the
only available when using GTK version 2.6 or higher (the
latest Windows versions comply with this requirement) and
Wireshark version 0.99.7 or higher.

View File

@ -1144,7 +1144,7 @@ configure_event(GtkWidget *widget, GdkEventConfigure *event _U_)
{
int i;
io_stat_t *io;
#if GTK_CHECK_VERSION(2,4,0)
#if GTK_CHECK_VERSION(2,6,0)
GtkWidget *save_bt;
#endif
@ -1165,7 +1165,7 @@ configure_event(GtkWidget *widget, GdkEventConfigure *event _U_)
io->pixmap_width=widget->allocation.width;
io->pixmap_height=widget->allocation.height;
#if GTK_CHECK_VERSION(2,4,0)
#if GTK_CHECK_VERSION(2,6,0)
save_bt = OBJECT_GET_DATA(io->window, "save_bt");
SIGNAL_CONNECT(save_bt, "clicked", pixmap_save_cb, io->pixmap);
gtk_widget_set_sensitive(save_bt, TRUE);
@ -1882,7 +1882,7 @@ init_io_stat_window(io_stat_t *io)
GtkWidget *hbox;
GtkWidget *bbox;
GtkWidget *close_bt, *help_bt;
#if GTK_CHECK_VERSION(2,4,0)
#if GTK_CHECK_VERSION(2,6,0)
GtkWidget *save_bt;
#endif
@ -1907,14 +1907,14 @@ init_io_stat_window(io_stat_t *io)
io_stat_set_title(io);
if(topic_available(HELP_STATS_IO_GRAPH_DIALOG)) {
#if GTK_CHECK_VERSION(2,4,0)
#if GTK_CHECK_VERSION(2,6,0)
bbox = dlg_button_row_new(GTK_STOCK_CLOSE, GTK_STOCK_SAVE,
GTK_STOCK_HELP, NULL);
#else
bbox = dlg_button_row_new(GTK_STOCK_CLOSE, GTK_STOCK_HELP, NULL);
#endif
} else {
#if GTK_CHECK_VERSION(2,4,0)
#if GTK_CHECK_VERSION(2,6,0)
bbox = dlg_button_row_new(GTK_STOCK_CLOSE, GTK_STOCK_SAVE, NULL);
#else
bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL);
@ -1926,7 +1926,7 @@ init_io_stat_window(io_stat_t *io)
close_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE);
window_set_cancel_button(io->window, close_bt, window_cancel_button_cb);
#if GTK_CHECK_VERSION(2,4,0)
#if GTK_CHECK_VERSION(2,6,0)
save_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_SAVE);
gtk_widget_set_sensitive(save_bt, FALSE);
OBJECT_SET_DATA(io->window, "save_bt", save_bt);

View File

@ -32,8 +32,8 @@
#include <gtk/gtk.h>
/* This feature is not available in GTK1 and includes some functions that
* are only available in GTK2.4+ */
#if GTK_CHECK_VERSION(2,4,0)
* are only available in GTK 2.6+ */
#if GTK_CHECK_VERSION(2,6,0)
#include "pixmap_save.h"
#include "simple_dialog.h"
@ -71,13 +71,16 @@ pixbuf_save_button_cb(GtkWidget *save_as_w, GdkPixbuf *pixbuf)
directory, and leave the selection box displayed. */
set_last_open_dir(filename);
g_free(filename);
g_free(file_type);
file_selection_set_current_folder(save_as_w,
get_last_open_dir());
return;
}
ret = gdk_pixbuf_save(pixbuf, filename, file_type, &error, NULL);
g_free(filename);
g_free(file_type);
if(!ret) {
simple_w = simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"%s%s%s",
@ -167,4 +170,4 @@ pixmap_save_cb(GtkWidget *w, gpointer pixmap_ptr)
window_destroy(save_as_w);
}
#endif /* GTK_CHECK_VERSION(2,4,0) */
#endif /* GTK_CHECK_VERSION(2,6,0) */