[alleyoop] Replace GnomeFileEntry with GtkFileChooserButton
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [alleyoop] Replace GnomeFileEntry with GtkFileChooserButton
- Date: Sat, 17 Dec 2011 19:29:39 +0000 (UTC)
commit 8b1ee921b2b943b3fddd12000d07878aae7641ae
Author: Jeffrey Stedfast <fejj gnome org>
Date: Sat Dec 17 14:29:10 2011 -0500
Replace GnomeFileEntry with GtkFileChooserButton
2011-12-17 Jeffrey Stedfast <fejj gnome org>
* src/vggeneralprefs.c: Replace GnomeFileEntry with
GtkFileChooserButton.
ChangeLog | 5 +++++
src/vggeneralprefs.c | 23 +++++++++++------------
src/vggeneralprefs.h | 4 +---
3 files changed, 17 insertions(+), 15 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7edeb0e..2c65acc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2011-12-17 Jeffrey Stedfast <fejj gnome org>
+ * src/vggeneralprefs.c: Replace GnomeFileEntry with
+ GtkFileChooserButton.
+
+2011-12-17 Jeffrey Stedfast <fejj gnome org>
+
* src/main.c: Get rid of glade dependency.
* src/*.c: Replaced references to libgnome/gnome-i18n.h with
diff --git a/src/vggeneralprefs.c b/src/vggeneralprefs.c
index c52f6a8..5f5e116 100644
--- a/src/vggeneralprefs.c
+++ b/src/vggeneralprefs.c
@@ -134,17 +134,14 @@ spin_focus_out (GtkSpinButton *spin, GdkEventFocus *event, const char *key)
}
static void
-file_entry_changed (GtkEntry *entry, const char *key)
+file_entry_changed (GtkFileChooserButton *file_entry, const char *key)
{
- GnomeFileEntry *file_entry;
GConfClient *gconf;
char *str;
gconf = gconf_client_get_default ();
- file_entry = (GnomeFileEntry *) gtk_widget_get_ancestor ((GtkWidget *) entry, GNOME_TYPE_FILE_ENTRY);
-
- str = gnome_file_entry_get_full_path (file_entry, FALSE);
+ str = gtk_file_chooser_get_filename ((GtkFileChooser *) file_entry);
gconf_client_set_string (gconf, key, str ? str : "", NULL);
g_free (str);
@@ -154,7 +151,7 @@ file_entry_changed (GtkEntry *entry, const char *key)
static void
vg_general_prefs_init (VgGeneralPrefs *prefs)
{
- GtkWidget *vbox, *hbox, *label, *w;
+ GtkWidget *vbox, *hbox, *label;
GConfClient *gconf;
GError *err = NULL;
GtkWidget *widget;
@@ -273,13 +270,15 @@ vg_general_prefs_init (VgGeneralPrefs *prefs)
g_clear_error (&err);
}
- widget = gnome_file_entry_new ("suppressions-id", _("Choose Valgrind Suppressions File..."));
- w = gnome_file_entry_gtk_entry ((GnomeFileEntry *) widget);
- g_signal_connect (w, "changed", G_CALLBACK (file_entry_changed), SUPPRESSIONS_KEY);
- gtk_entry_set_text ((GtkEntry *) w, str ? str : "");
- prefs->suppressions = (GnomeFileEntry *) widget;
+ widget = gtk_file_chooser_button_new (_("Choose Valgrind Suppressions File..."), GTK_FILE_CHOOSER_ACTION_OPEN);
+ g_signal_connect (widget, "file-set", G_CALLBACK (file_entry_changed), SUPPRESSIONS_KEY);
+ gtk_file_chooser_set_do_overwrite_confirmation ((GtkFileChooser *) widget, FALSE);
+ gtk_file_chooser_set_show_hidden ((GtkFileChooser *) widget, TRUE);
+ gtk_file_chooser_set_local_only ((GtkFileChooser *) widget, TRUE);
+ gtk_file_chooser_set_filename ((GtkFileChooser *) widget, str);
+ prefs->suppressions = (GtkFileChooserButton *) widget;
gtk_widget_show (widget);
- gtk_box_pack_start ((GtkBox *) hbox, widget, FALSE, FALSE, 0);
+ gtk_box_pack_start ((GtkBox *) hbox, widget, TRUE, TRUE, 0);
g_free (str);
diff --git a/src/vggeneralprefs.h b/src/vggeneralprefs.h
index 66cfb45..c95a949 100644
--- a/src/vggeneralprefs.h
+++ b/src/vggeneralprefs.h
@@ -21,8 +21,6 @@
#ifndef __VG_GENERAL_PREFS_H__
#define __VG_GENERAL_PREFS_H__
-#include <libgnomeui/gnome-file-entry.h>
-
#include "vgtoolprefs.h"
#ifdef __cplusplus
@@ -52,7 +50,7 @@ struct _VgGeneralPrefs {
GtkToggleButton *track_origins;
GtkToggleButton *time_stamp;
GtkToggleButton *run_libc_freeres;
- GnomeFileEntry *suppressions;
+ GtkFileChooserButton *suppressions;
};
struct _VgGeneralPrefsClass {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]