… | |
… | |
16 | |
16 | |
17 | static GObject *(*old_constructor) (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties); |
17 | static GObject *(*old_constructor) (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties); |
18 | |
18 | |
19 | static gchar *last_path; |
19 | static gchar *last_path; |
20 | |
20 | |
|
|
21 | #define DEBUG(stmt) stmt; |
|
|
22 | |
21 | ///////////////////////////////////////////////////////////////////////////// |
23 | ///////////////////////////////////////////////////////////////////////////// |
22 | |
24 | |
23 | gchar *gtk_file_chooser_get_filename (GtkFileChooser *chooser) |
25 | gchar *gtk_file_chooser_get_filename (GtkFileChooser *chooser) |
24 | { |
26 | { |
|
|
27 | DEBUG ((printf ("gtk_file_chooser_get_filename %s\n", last_path))) |
25 | return g_strdup (last_path ? last_path : "/nonex1st4nt"); |
28 | return g_strdup (last_path ? last_path : "/nonex1st4nt"); |
26 | } |
29 | } |
27 | |
30 | |
28 | gboolean gtk_file_chooser_select_filename (GtkFileChooser *chooser, const char *filename) |
31 | gboolean gtk_file_chooser_select_filename (GtkFileChooser *chooser, const char *filename) |
29 | { |
32 | { |
… | |
… | |
55 | return 1; |
58 | return 1; |
56 | } |
59 | } |
57 | |
60 | |
58 | gchar * gtk_file_chooser_get_current_folder (GtkFileChooser *chooser) |
61 | gchar * gtk_file_chooser_get_current_folder (GtkFileChooser *chooser) |
59 | { |
62 | { |
|
|
63 | DEBUG ((printf ("gtk_file_chooser_get_current_folder\n"))) |
60 | return g_strdup ("/nonex1st4nt/"); |
64 | return g_strdup ("/nonex1st4nt/"); |
61 | } |
65 | } |
62 | |
66 | |
63 | ///////////////////////////////////////////////////////////////////////////// |
67 | ///////////////////////////////////////////////////////////////////////////// |
64 | |
68 | |
… | |
… | |
109 | return files; |
113 | return files; |
110 | } |
114 | } |
111 | |
115 | |
112 | gchar *gtk_file_chooser_get_uri (GtkFileChooser *chooser) |
116 | gchar *gtk_file_chooser_get_uri (GtkFileChooser *chooser) |
113 | { |
117 | { |
114 | return to_uri(gtk_file_chooser_get_filename (chooser)); |
118 | gchar *uri = to_uri(gtk_file_chooser_get_filename (chooser)); |
|
|
119 | DEBUG ((printf ("gtk_file_chooser_get_uri %s\n", uri))); |
|
|
120 | return uri; |
115 | } |
121 | } |
116 | |
122 | |
117 | gboolean gtk_file_chooser_set_uri (GtkFileChooser *chooser, const char *uri) |
123 | gboolean gtk_file_chooser_set_uri (GtkFileChooser *chooser, const char *uri) |
118 | { |
124 | { |
119 | return gtk_file_chooser_set_filename (chooser, from_uri (uri)); |
125 | return gtk_file_chooser_set_filename (chooser, from_uri (uri)); |
… | |
… | |
159 | } |
165 | } |
160 | |
166 | |
161 | g_io_channel_read_to_end (source, &last_path, 0, 0); |
167 | g_io_channel_read_to_end (source, &last_path, 0, 0); |
162 | g_io_channel_unref (source); |
168 | g_io_channel_unref (source); |
163 | activate_cb (data); |
169 | activate_cb (data); |
|
|
170 | |
|
|
171 | DEBUG ((printf ("read_result<%s>\n", last_path))); |
|
|
172 | |
164 | return FALSE; |
173 | return FALSE; |
165 | } |
174 | } |
166 | |
175 | |
167 | static gboolean show_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) |
176 | static gboolean show_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) |
168 | { |
177 | { |