aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-03-13 09:45:20 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-03-13 09:45:20 +0000
commite39fdf7b576e62dbaa43cc820e3a9619f016d301 (patch)
tree22487393d58635da95da87983cc88900f163d7b8
parentd0c61090b1c1d3a0ef6ba1cb6a91e2a879929f30 (diff)
downloadgnunet-gtk-e39fdf7b576e62dbaa43cc820e3a9619f016d301.tar.gz
gnunet-gtk-e39fdf7b576e62dbaa43cc820e3a9619f016d301.zip
- fix for gtk2
-rw-r--r--contrib/gnunet_gns_gtk_zone_open.glade3
-rw-r--r--src/gns/gnunet-gns-gtk.c9
2 files changed, 8 insertions, 4 deletions
diff --git a/contrib/gnunet_gns_gtk_zone_open.glade b/contrib/gnunet_gns_gtk_zone_open.glade
index 392f2738..2d6916b6 100644
--- a/contrib/gnunet_gns_gtk_zone_open.glade
+++ b/contrib/gnunet_gns_gtk_zone_open.glade
@@ -2,9 +2,6 @@
2<interface> 2<interface>
3 <!-- interface-requires gtk+ 3.0 --> 3 <!-- interface-requires gtk+ 3.0 -->
4 <object class="GtkFileFilter" id="GNUNET_GNS_GTK_zone_open_filefilter"> 4 <object class="GtkFileFilter" id="GNUNET_GNS_GTK_zone_open_filefilter">
5 <patterns>
6 <pattern>*.zkey</pattern>
7 </patterns>
8 </object> 5 </object>
9 <object class="GtkFileChooserDialog" id="GNUNET_GNS_GTK_zone_open_filechooserdialog"> 6 <object class="GtkFileChooserDialog" id="GNUNET_GNS_GTK_zone_open_filechooserdialog">
10 <property name="can_focus">False</property> 7 <property name="can_focus">False</property>
diff --git a/src/gns/gnunet-gns-gtk.c b/src/gns/gnunet-gns-gtk.c
index 4751f24a..da5ee2e8 100644
--- a/src/gns/gnunet-gns-gtk.c
+++ b/src/gns/gnunet-gns-gtk.c
@@ -175,6 +175,7 @@ GNUNET_GNS_GTK_open_imagemenuitem_activate_cb (GtkMenuItem *menuitem,
175 GtkWidget *ad; 175 GtkWidget *ad;
176 GtkBuilder *builder; 176 GtkBuilder *builder;
177 GtkWidget *toplevel; 177 GtkWidget *toplevel;
178 GtkFileFilter *ff;
178 179
179 builder = 180 builder =
180 GNUNET_GTK_get_new_builder ("gnunet_gns_gtk_zone_open.glade", NULL); 181 GNUNET_GTK_get_new_builder ("gnunet_gns_gtk_zone_open.glade", NULL);
@@ -183,9 +184,15 @@ GNUNET_GNS_GTK_open_imagemenuitem_activate_cb (GtkMenuItem *menuitem,
183 GNUNET_break (0); 184 GNUNET_break (0);
184 return; 185 return;
185 } 186 }
187 /* This file filter could be set with glade if we use gtk3
188 * With gtk2 we have to set it manually */
189 ff = GTK_FILE_FILTER (gtk_builder_get_object
190 (builder, "GNUNET_GNS_GTK_zone_open_filefilter"));
191 gtk_file_filter_add_pattern (ff, "*.zkey");
192
186 ad = GTK_WIDGET (gtk_builder_get_object 193 ad = GTK_WIDGET (gtk_builder_get_object
187 (builder, "GNUNET_GNS_GTK_zone_open_filechooserdialog")); 194 (builder, "GNUNET_GNS_GTK_zone_open_filechooserdialog"));
188 toplevel = gtk_widget_get_toplevel (menuitem); 195 toplevel = gtk_widget_get_toplevel (GTK_WIDGET (menuitem));
189 if (GTK_IS_WINDOW (toplevel)) 196 if (GTK_IS_WINDOW (toplevel))
190 gtk_window_set_transient_for (GTK_WINDOW (ad), GTK_WINDOW (toplevel)); 197 gtk_window_set_transient_for (GTK_WINDOW (ad), GTK_WINDOW (toplevel));
191 gtk_window_present (GTK_WINDOW (ad)); 198 gtk_window_present (GTK_WINDOW (ad));