diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2007-06-23 05:58:01 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2007-06-23 05:58:01 +0000 |
commit | 1f786cac311e29700baa7d50a4795a91388399e7 (patch) | |
tree | cc395308c9605b3fd052b86056e76fd11d59e52b /gtk | |
parent | 4944cdc8992fdfdf92a5aa02227452a74411fd02 (diff) | |
download | wireshark-1f786cac311e29700baa7d50a4795a91388399e7.tar.gz |
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
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/io_stat.c | 12 | ||||
-rw-r--r-- | gtk/pixmap_save.c | 11 |
2 files changed, 13 insertions, 10 deletions
diff --git a/gtk/io_stat.c b/gtk/io_stat.c index 7bb9f74888..f251e361f4 100644 --- a/gtk/io_stat.c +++ b/gtk/io_stat.c @@ -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); diff --git a/gtk/pixmap_save.c b/gtk/pixmap_save.c index 04518ac534..030ddb266e 100644 --- a/gtk/pixmap_save.c +++ b/gtk/pixmap_save.c @@ -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) */ |