[maemo-commits] [maemo-commits] r13032 - projects/haf/trunk/hildon-fm/hildon-fm
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Mon Aug 6 18:00:52 EEST 2007
- Previous message: [maemo-commits] r13031 - in projects/haf/trunk/hildon-desktop: . libhildondesktop
- Next message: [maemo-commits] r13033 - in projects/haf/trunk/hildon-fm: . debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: marivoll
Date: 2007-08-06 18:00:46 +0300 (Mon, 06 Aug 2007)
New Revision: 13032
Modified:
projects/haf/trunk/hildon-fm/hildon-fm/t.c
Log:
Test gtk_file_system_create_folder.
Modified: projects/haf/trunk/hildon-fm/hildon-fm/t.c
===================================================================
--- projects/haf/trunk/hildon-fm/hildon-fm/t.c 2007-08-06 13:57:30 UTC (rev 13031)
+++ projects/haf/trunk/hildon-fm/hildon-fm/t.c 2007-08-06 15:00:46 UTC (rev 13032)
@@ -1,71 +1,45 @@
#include <gtk/gtk.h>
-GtkWidget *scrolled (GtkWidget *);
-void clicked (GtkWidget *w, gpointer d);
+#define GTK_FILE_SYSTEM_ENABLE_UNSUPPORTED
+#include <gtk/gtkfilesystem.h>
-int cur;
-GtkWidget *labels[3];
-GtkWidget *hbox;
-
-GtkWidget *
-scrolled (GtkWidget *w)
+static void
+create_folder_callback (GtkFileSystemHandle *handle,
+ const GtkFilePath *path,
+ const GError *error, gpointer data)
{
- GtkWidget *scroller = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroller),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroller),
- w);
- return scroller;
-}
+ if (error)
+ fprintf (stderr, "%s: %s\n",
+ gtk_file_path_get_string (path),
+ error->message);
+ else
+ fprintf (stderr, "%s: success\n",
+ gtk_file_path_get_string (path));
-void
-clicked (GtkWidget *w, gpointer d)
-{
- gtk_widget_hide (labels[cur]);
- cur = (cur + 1) % 3;
- gtk_widget_show (labels[cur]);
+ gtk_main_quit ();
}
int
main(int argc, char **argv)
{
- int i;
+ GtkFileSystem *fs;
+ GtkFilePath *p;
+ GtkFileSystemHandle *h;
- GtkWidget *window, *hpaned, *button;
-
+ g_thread_init (NULL);
gtk_init (NULL, NULL);
- labels[0] = scrolled (gtk_label_new ("Label 1 - Arrrrrrrrrrrrrrrrrrrr"));
- labels[1] = gtk_label_new ("Label 2 - Arrrrrrrrrrrrrrr");
- labels[2] = scrolled (gtk_label_new ("Label 3 - Arrrrrrrrrrrrrrrrrrrrrrrrrrrrr"));
+ if (argc > 1)
+ {
+ fs = gtk_file_system_create ("gnome-vfs");
+ p = gtk_file_system_filename_to_path (fs, argv[1]);
+ h = gtk_file_system_create_folder (fs, p,
+ create_folder_callback,
+ NULL);
+
+ if (h)
+ gtk_main ();
+ }
- hbox = gtk_hbox_new (FALSE, 0);
- for (i = 0; i < 3; i++)
- gtk_box_pack_start (GTK_BOX (hbox), labels[i], TRUE, TRUE, 0);
-
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
- button = gtk_button_new_with_label ("Foooooooooooooooooooooooooooooooooooo");
- g_signal_connect (button, "clicked",
- G_CALLBACK (clicked), NULL);
-
- hpaned = gtk_hpaned_new ();
- gtk_paned_pack1 (GTK_PANED (hpaned),
- scrolled (button),
- TRUE, FALSE);
- gtk_paned_pack2 (GTK_PANED (hpaned),
- hbox,
- TRUE, FALSE);
-
- gtk_container_add (GTK_CONTAINER (window), hpaned);
-
- gtk_widget_show_all (window);
- cur = 0;
- gtk_widget_hide (labels[1]);
- gtk_widget_hide (labels[2]);
-
- gtk_main ();
-
return 0;
}
- Previous message: [maemo-commits] r13031 - in projects/haf/trunk/hildon-desktop: . libhildondesktop
- Next message: [maemo-commits] r13033 - in projects/haf/trunk/hildon-fm: . debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
