[rhythmbox] widgets: Add test program for URI dialog



commit 33bfef3d8dcc23a8178c6047a45b3424ea7d9631
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Feb 24 17:22:47 2011 +0000

    widgets: Add test program for URI dialog

 widgets/Makefile.am       |    4 +++-
 widgets/test-uri-dialog.c |   29 +++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletions(-)
---
diff --git a/widgets/Makefile.am b/widgets/Makefile.am
index be08d21..9e49969 100644
--- a/widgets/Makefile.am
+++ b/widgets/Makefile.am
@@ -60,6 +60,8 @@ INCLUDES =						\
 librbwidgets_la_LDFLAGS = -export-dynamic
 librbwidgets_la_LIBADD = $(NOTIFY_LIBS)
 
-noinst_PROGRAMS = test-rb-segmented-bar
+noinst_PROGRAMS = test-rb-segmented-bar test-uri-dialog
 test_rb_segmented_bar_SOURCES = test-rb-segmented-bar.c
 test_rb_segmented_bar_LDADD = librbwidgets.la $(RHYTHMBOX_LIBS)
+test_uri_dialog_SOURCES = test-uri-dialog.c
+test_uri_dialog_LDADD = librbwidgets.la $(top_builddir)/lib/librb.la $(RHYTHMBOX_LIBS)
diff --git a/widgets/test-uri-dialog.c b/widgets/test-uri-dialog.c
new file mode 100644
index 0000000..fe27f68
--- /dev/null
+++ b/widgets/test-uri-dialog.c
@@ -0,0 +1,29 @@
+
+#include "rb-uri-dialog.h"
+#include "rb-file-helpers.h"
+
+static void
+location_added (RBURIDialog *dialog,
+		const char  *uri,
+		gpointer     user_data)
+{
+	g_message ("URI selected was: %s", uri);
+}
+
+int main (int argc, char **argv)
+{
+	GtkWidget *dialog;
+
+	gtk_init (&argc, &argv);
+	rb_file_helpers_init (TRUE);
+
+	dialog = rb_uri_dialog_new ("Dialog title", "dialog label");
+	g_signal_connect (G_OBJECT (dialog), "location-added",
+			  G_CALLBACK (location_added), NULL);
+
+	gtk_dialog_run (GTK_DIALOG (dialog));
+
+	gtk_widget_destroy (dialog);
+
+	return 0;
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]