Changeset 6
- Timestamp:
- 11/07/06 16:54:16 (2 years ago)
- Files:
-
- maemo-blog/trunk/Makefile (modified) (1 diff)
- maemo-blog/trunk/gui.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
maemo-blog/trunk/Makefile
r2 r6 35 35 CFLAGS += $(WARNINGS) 36 36 37 maemo_blog_CFLAGS += $(shell if pkg-config hildon-fm --exists; then pkg-config hildon-fm --cflags; echo -DHILDON_FM; fi) 38 maemo_blog_LIBS += $(shell if pkg-config hildon-fm --exists; then pkg-config hildon-fm --libs; fi) 37 39 maemo_blog_CFLAGS += $(shell if pkg-config hildon-libs --exists; then pkg-config hildon-libs --cflags; echo -DHILDON; else pkg-config gtk+-2.0 --cflags; fi) 38 40 maemo_blog_LDFLAGS += $(shell if pkg-config hildon-libs --exists; then pkg-config hildon-libs --libs; else pkg-config gtk+-2.0 --libs; fi) 39 41 maemo_blog_CFLAGS += $(shell if pkg-config gtksourceview-1.0 --exists; then pkg-config gtksourceview-1.0 --cflags; echo -DGTKSOURCEVIEW; fi) 40 42 maemo_blog_LDFLAGS += $(shell if pkg-config gtksourceview-1.0 --exists; then pkg-config gtksourceview-1.0 --libs; fi) 43 maemo_blog_CFLAGS += $(shell if pkg-config libgnomevfsutil --exists; then pkg-config libgnomevfsutil --cflags; echo -DHAVE_VFS_UTIL; fi) 44 maemo_blog_LDFLAGS += $(shell if pkg-config libgnomevfsutil --exists; then pkg-config libgnomevfsutil --libs; fi) 45 maemo_blog_CFLAGS += $(shell if pkg-config libgnomeui-2.0 --exists; then pkg-config libgnomeui-2.0 --cflags; echo -DHAVE_VFS_UTIL; fi) 46 maemo_blog_LDFLAGS += $(shell if pkg-config libgnomeui-2.0 --exists; then pkg-config libgnomeui-2.0 --libs; fi) 41 47 42 48 maemo_blog_CFLAGS += `pkg-config gconf-2.0 gtk+-2.0 --cflags` \ maemo-blog/trunk/gui.c
r2 r6 1 1 #include <string.h> 2 #ifdef HILDON_FM 3 #include <hildon-widgets/hildon-file-chooser-dialog.h> 4 #endif 2 5 #ifdef HILDON 3 6 #include <hildon-widgets/hildon-window.h> … … 8 11 #include <gtksourceview/gtksourceview.h> 9 12 #include <gtksourceview/gtksourcelanguagesmanager.h> 13 #endif 14 #ifdef HAVE_VFS_UTIL 15 #include <libgnomeui/gnome-vfs-util.h> 10 16 #endif 11 17 #include "blog-plugin.h" … … 181 187 static void _img(GObject *object, GtkTextBuffer *text) 182 188 { 189 #ifdef HILDON_FM 190 GtkWidget *dialog = hildon_file_chooser_dialog_new("Open file...", 191 GTK_WINDOW(gtk_widget_get_toplevel( 192 GTK_WIDGET(object))), 193 GTK_FILE_CHOOSER_ACTION_OPEN); 194 gtk_dialog_add_buttons(GTK_DIALOG(dialog), 195 "Ok", GTK_RESPONSE_OK, 196 "Cancel", GTK_RESPONSE_CANCEL, 197 NULL); 198 #else 183 199 GtkWidget *dialog = gtk_file_chooser_dialog_new("Open file...", 184 200 GTK_WINDOW(gtk_widget_get_toplevel( … … 188 204 "Cancel", GTK_RESPONSE_CANCEL, 189 205 NULL); 206 #endif 190 207 191 208 gtk_widget_show_all(GTK_WIDGET(dialog)); 192 209 if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) { 210 #ifdef HAVE_VFS_UTIL 211 gchar *file = gtk_file_chooser_get_uri( 212 GTK_FILE_CHOOSER(dialog)); 213 GdkPixbuf *buf = gnome_gdk_pixbuf_new_from_uri(file); 214 #else 193 215 gchar *file = gtk_file_chooser_get_filename( 194 216 GTK_FILE_CHOOSER(dialog)); 195 217 GdkPixbuf *buf = gdk_pixbuf_new_from_file(file, NULL); 218 #endif 196 219 gchar *sep = strrchr(file, '/'); 197 220 GObject *source = g_object_get_data(G_OBJECT(text),
