From 75f83fbeb3a718b1bd6ffc9f806e4d21fc3d5566 Mon Sep 17 00:00:00 2001 From: Luc Pionchon Date: Sun, 21 May 2006 18:56:04 +0000 Subject: [PATCH] Removed hildon-insert-object-dialog NB#8015 * hildon-widgets/hildon-insert-object-dialog.[ch]: removed * doc/tmpl/hildon-insert-object-dialog.sgml: removed * ut/hildon-widgets_tests.c (test27a, test27b, test27c): removed * hildon-widgets/Makefile.am (hildonwidgetsincludeinst_DATA) * hildon-widgets/Makefile.am (libhildonwidgets_la_SOURCES) * doc/hildon-libs-docs.sgml: * po/POTFILES.in: : removed reference * configure.ac: removed check for gnome-vfs * hildon-widgets/Makefile.am: removed gnome-vfs flags * doc/Makefile.am: likewise * ut/Makefile.am: likewise --- ChangeLog | 19 + configure.ac | 5 - debian/changelog | 7 + debian/control | 8 +- doc/Makefile.am | 2 +- doc/hildon-libs-docs.sgml | 1 - doc/tmpl/hildon-insert-object-dialog.sgml | 76 ---- hildon-widgets/Makefile.am | 7 +- hildon-widgets/hildon-insert-object-dialog.c | 500 -------------------------- hildon-widgets/hildon-insert-object-dialog.h | 93 ----- po/POTFILES.in | 1 - ut/Makefile.am | 6 +- ut/hildon-widgets_tests.c | 33 -- 13 files changed, 36 insertions(+), 722 deletions(-) delete mode 100644 doc/tmpl/hildon-insert-object-dialog.sgml delete mode 100644 hildon-widgets/hildon-insert-object-dialog.c delete mode 100644 hildon-widgets/hildon-insert-object-dialog.h diff --git a/ChangeLog b/ChangeLog index fdf88e0..173d866 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,24 @@ 2006-05-21 Luc Pionchon + Removed hildon-insert-object-dialog NB#8015 + + * hildon-widgets/hildon-insert-object-dialog.[ch]: removed + * doc/tmpl/hildon-insert-object-dialog.sgml: removed + * ut/hildon-widgets_tests.c (test27a, test27b, test27c): removed + + * hildon-widgets/Makefile.am (hildonwidgetsincludeinst_DATA) + * hildon-widgets/Makefile.am (libhildonwidgets_la_SOURCES) + * doc/hildon-libs-docs.sgml: + * po/POTFILES.in: : removed reference + + * configure.ac: removed check for gnome-vfs + * hildon-widgets/Makefile.am: removed gnome-vfs flags + * doc/Makefile.am: likewise + * ut/Makefile.am: likewise + + +2006-05-21 Luc Pionchon + * hildon-widgets/gtk-infoprint.c (gtk_confirmation_banner_with_icon_name): added bold markup for backward compatibility. NB#28370 (bis) diff --git a/configure.ac b/configure.ac index c0ddffd..d13d33c 100644 --- a/configure.ac +++ b/configure.ac @@ -34,11 +34,6 @@ PKG_CHECK_MODULES(ESD, esound) AC_SUBST(ESD_LIBS) AC_SUBST(ESD_CFLAGS) -# Needed to demonstrate how mime-types can be handled with gnome-vfs -PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= 2.6 gnome-vfs-module-2.0 >= 2.6) -AC_SUBST(GNOME_VFS_CFLAGS) -AC_SUBST(GNOME_VFS_LIBS) - PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.6) AC_SUBST(GCONF_CFLAGS) AC_SUBST(GCONF_LIBS) diff --git a/debian/changelog b/debian/changelog index a8e1f43..a744157 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +hildon-libs (0.12.15svn-1) unstable; urgency=low + + * debian/control: removed dependency on gnome-vfs (NB#8015) + + + -- Luc Pionchon Sun, 21 May 2006 21:36:44 +0300 + hildon-libs (0.12.15) unstable; urgency=low * fixes NB#28027 - HildonTImeEditor: "Maximum value is %d" infoprint not displayed. diff --git a/debian/control b/debian/control index 4f67b21..4de337a 100644 --- a/debian/control +++ b/debian/control @@ -2,13 +2,13 @@ Source: hildon-libs Section: x11 Priority: optional Maintainer: Luc Pionchon -Build-Depends: debhelper (>= 4.0.0), pkg-config, libosso-gnomevfs2-dev, libgtk2.0-dev (>= 2:2.6.10-1.osso4), osso-esd-dev, libmatchbox-dev (>= 1.3-2), libxi-dev, libxt-dev, libpng12-dev, libgconf2-dev, gtk-doc-tools +Build-Depends: debhelper (>= 4.0.0), pkg-config, libgtk2.0-dev (>= 2:2.6.10-1.osso4), osso-esd-dev, libmatchbox-dev (>= 1.3-2), libxi-dev, libxt-dev, libpng12-dev, libgconf2-dev, gtk-doc-tools Standards-Version: 3.6.0 Package: hildon-libs-dev Section: devel Architecture: any -Depends: hildon-libs0 (= ${Source-Version}), libgtk2.0-dev (>= 2:2.6.10-1.osso4), libosso-gnomevfs2-dev, osso-esd-dev, libmatchbox-dev, libgconf2-dev +Depends: hildon-libs0 (= ${Source-Version}), libgtk2.0-dev (>= 2:2.6.10-1.osso4), osso-esd-dev, libmatchbox-dev, libgconf2-dev Description: Hildon libraries development files Package: hildon-libs0 @@ -16,12 +16,12 @@ Section: libs Architecture: any Conflicts: hildon-lgpl0 (<< 0.12) Replaces: hildon-lgpl0 (<< 0.12) -Depends: ${shlibs:Depends}, ${misc:Depends}, osso-sounds-ui, libosso-gnomevfs2-0, osso-esd, libgconf2-6, hildon-libs-l10n-mr0 | hildon-libs-l10n-mr +Depends: ${shlibs:Depends}, ${misc:Depends}, osso-sounds-ui, osso-esd, libgconf2-6, hildon-libs-l10n-mr0 | hildon-libs-l10n-mr Description: Hildon libraries Package: hildon-libs0-dbg Section: libs Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, osso-sounds-ui, libosso-gnomevfs2-0, osso-esd +Depends: ${shlibs:Depends}, ${misc:Depends}, osso-sounds-ui, osso-esd Description: Hildon libraries (with debug info) diff --git a/doc/Makefile.am b/doc/Makefile.am index 17bb2a3..13e4d06 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -36,7 +36,7 @@ IGNORE_HFILES = \ # CFLAGS and LDFLAGS for compiling scan program. Only needed if # $(DOC_MODULE).types is non-empty. -INCLUDES = $(GTK_CFLAGS) -I$(top_srcdir) $(GNOME_VFS_CFLAGS) +INCLUDES = $(GTK_CFLAGS) -I$(top_srcdir) GTKDOC_LIBS = $(GTK_LIBS) ../hildon-widgets/libhildonwidgets.la diff --git a/doc/hildon-libs-docs.sgml b/doc/hildon-libs-docs.sgml index 1afa6b7..ab3d3bc 100644 --- a/doc/hildon-libs-docs.sgml +++ b/doc/hildon-libs-docs.sgml @@ -76,7 +76,6 @@ Other diff --git a/doc/tmpl/hildon-insert-object-dialog.sgml b/doc/tmpl/hildon-insert-object-dialog.sgml deleted file mode 100644 index c0e0073..0000000 --- a/doc/tmpl/hildon-insert-object-dialog.sgml +++ /dev/null @@ -1,76 +0,0 @@ - -HildonInsertObjectDialog - - - - - - - - - - -Here is an example for using #HildonInsertObjectDialog: - - - - GtkWidget *dialog; - gint result; - gchar *name, *mime_type; - - dialog = hildon_insert_object_dialog_new(parent); - g_signal_connect(G_OBJECT(dialog), "response", - G_CALLBACK(response_cb), NULL); - result = gtk_dialog_run(GTK_DIALOG(dialog)); - - switch (result) - { - case GTK_RESPONSE_OK: - name = hildon_insert_object_dialog_get_name( HILDON_INSERT_OBJECT_DIALOG(dialog) ); - mime_type = hildon_insert_object_dialog_get_mime_type( HILDON_INSERT_OBJECT_DIALOG(dialog) ); - hildon_insert_object_dialog_set_file( HILDON_INSERT_OBJECT_DIALOG(dialog) ); - break; - case HILDON_RESPONSE_INSERT_EXISTING: - break; - default: - break; - } - - gtk_widget_destroy(dialog); - - - - - - - - - - - - - - - - - - - - - - - - -@parent: -@Returns: - - - - - - - -@dialog: -@Returns: - - diff --git a/hildon-widgets/Makefile.am b/hildon-widgets/Makefile.am index 4866065..e399f9b 100644 --- a/hildon-widgets/Makefile.am +++ b/hildon-widgets/Makefile.am @@ -1,4 +1,4 @@ -INCLUDES = $(GTK_CFLAGS) $(GNOME_VFS_CFLAGS) $(GCONF_CFLAGS) \ +INCLUDES = $(GTK_CFLAGS) $(GCONF_CFLAGS) \ $(ESD_CFLAGS) $(LIBMB_CFLAGS) -DLOCALEDIR=\"$(localedir)\" -I$(srcdir)/.. lib_LTLIBRARIES = libhildonwidgets.la @@ -7,7 +7,7 @@ EXTRA_DIST = hildon-marshalers.list libhildonwidgets_la_LDFLAGS = -version-info 5:0:5 -libhildonwidgets_la_LIBADD = $(GTK_LIBS) $(GNOME_VFS_LIBS) $(GCONF_LIBS) \ +libhildonwidgets_la_LIBADD = $(GTK_LIBS) $(GCONF_LIBS) \ $(ESD_LIBS) $(LIBMB_LIBS) libhildonwidgets_la_SOURCES = \ @@ -61,8 +61,6 @@ libhildonwidgets_la_SOURCES = \ hildon-add-home-dialog.h \ hildon-font-selection-dialog.c \ hildon-font-selection-dialog.h \ - hildon-insert-object-dialog.c \ - hildon-insert-object-dialog.h \ hildon-grid.c \ hildon-grid.h \ hildon-grid-item.c \ @@ -141,7 +139,6 @@ hildonwidgetsincludeinst_DATA = \ hildon-sort-dialog.h \ hildon-add-home-dialog.h \ hildon-font-selection-dialog.h \ - hildon-insert-object-dialog.h \ hildon-grid.h \ hildon-grid-item.h \ hildon-file-handling-note.h \ diff --git a/hildon-widgets/hildon-insert-object-dialog.c b/hildon-widgets/hildon-insert-object-dialog.c deleted file mode 100644 index 14c966a..0000000 --- a/hildon-widgets/hildon-insert-object-dialog.c +++ /dev/null @@ -1,500 +0,0 @@ -/* - * This file is part of hildon-libs - * - * Copyright (C) 2005 Nokia Corporation. - * - * Contact: Luc Pionchon - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - * - */ - -/* FIXME: should be moved to hildon-fm (file handling, depends on gnome-vfs) */ - -/** - * SECTION:hildon-insert-object-dialog - * @short_description: A dialog that enables the user to embed an object - * into rich text - * - * #HildonInsertObjectDialog is a dialog that enables the user to insert a - * new or existing object into a Multi-line (Rich Text) Editor as an - * embedded object. - * - * FIXME: deprecated widget. Shall not be used anywhere. - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#define _(String) dgettext(PACKAGE, String) - -#define MAX_ERR_MSG 256 - -#define HILDON_INSERT_OBJECT_DIALOG_WIDTH 300 -#define HILDON_INSERT_OBJECT_DIALOG_HEIGHT 100 - -#define PROJECT_TEMPLATE_DIR "/tmp" -#define RUN_AT_TERMINATION 0 - - -static GtkDialogClass *parent_class; - -struct _HildonInsertObjectDialogPrivate { - GtkButton *insertBtn; - GtkButton *existingBtn; - GtkButton *cancelBtn; - GtkEntry *entry; - GtkLabel *label; - GtkComboBox *combo; - GtkSizeGroup *group; - - HildonCaption *comboCap; - HildonCaption *entryCap; - HildonCaption *locationCap; - - GnomeVFSDirectoryHandle *dir; - char *mimetype; - - guint keysnooper; -}; - -#define HILDON_INSERT_OBJECT_DIALOG_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ - HILDON_TYPE_INSERT_OBJECT_DIALOG, \ - HildonInsertObjectDialogPrivate) ) - -static void -hildon_insert_object_dialog_class_init(HildonInsertObjectDialogClass * - class); -static void hildon_insert_object_dialog_init(HildonInsertObjectDialog * - dialog); -static void hildon_insert_object_dialog_finalize(GObject * obj_self); -static gint hildon_insert_object_dialog_key_snooper(GtkWidget * gadget, - GdkEventKey * event, - GtkWidget * widget); -static void hildon_insert_object_dialog_set_property(GObject * object, - guint prop_id, - const GValue * value, - GParamSpec * pspec); -static void hildon_insert_object_dialog_get_property(GObject * object, - guint prop_id, - GValue * value, GParamSpec * pspec); - -enum { - PROP_0, - PROP_NAME, - PROP_MIME_TYPE -}; - -static gboolean hildon_insert_object_foo(gpointer data) -{ - gnome_vfs_shutdown(); - g_message("GnomeVFS shutdown succeed!\n"); - return FALSE; -} - -/* Private functions */ -static void -hildon_insert_object_dialog_class_init(HildonInsertObjectDialogClass * - class) -{ - - GObjectClass *object_class = G_OBJECT_CLASS(class); - - parent_class = g_type_class_peek_parent(class); - g_type_class_add_private(class, - sizeof(HildonInsertObjectDialogPrivate)); - - object_class->finalize = hildon_insert_object_dialog_finalize; - object_class->set_property = hildon_insert_object_dialog_set_property; - object_class->get_property = hildon_insert_object_dialog_get_property; - - g_object_class_install_property(object_class, PROP_NAME, - g_param_spec_string("name", - "Name", - "The text in name field", - "", G_PARAM_READWRITE)); - - g_object_class_install_property(object_class, PROP_MIME_TYPE, - g_param_spec_string("mime-type", - "Mime-Type", - "The mime type selected in the combobox", - GNOME_VFS_MIME_TYPE_UNKNOWN, - G_PARAM_READABLE)); -} - -static void hildon_insert_object_dialog_finalize(GObject * obj_self) -{ - HildonInsertObjectDialogPrivate *priv; - HildonInsertObjectDialog *dlg; - - g_return_if_fail(HILDON_IS_INSERT_OBJECT_DIALOG(obj_self)); - - dlg = HILDON_INSERT_OBJECT_DIALOG(obj_self); - priv = HILDON_INSERT_OBJECT_DIALOG_GET_PRIVATE(dlg); - - gtk_key_snooper_remove(priv->keysnooper); - - if (G_OBJECT_CLASS(parent_class)->finalize) - G_OBJECT_CLASS(parent_class)->finalize(obj_self); -} - - -static void -hildon_insert_object_dialog_init(HildonInsertObjectDialog * dialog) -{ - - GnomeVFSResult result; - gchar *dir_path = ""; - GnomeVFSFileInfo *file = gnome_vfs_file_info_new(); - GList *mimelist = NULL; - GtkTreeModel *combo_tree = NULL; - GtkTreeIter combo_iter; - gboolean valid = FALSE; - - - dialog->priv = HILDON_INSERT_OBJECT_DIALOG_GET_PRIVATE(dialog); - gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); - - gtk_window_set_title(GTK_WINDOW(dialog), "ckdg_ti_insert_insert_objec"); - - dialog->priv->group = - GTK_SIZE_GROUP(gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL)); - - dialog->priv->insertBtn = - GTK_BUTTON(gtk_dialog_add_button(GTK_DIALOG(dialog), - "ckdg_bd_insert_new", - GTK_RESPONSE_OK)); - - dialog->priv->existingBtn = - GTK_BUTTON(gtk_dialog_add_button - (GTK_DIALOG(dialog), "ckdg_bd_insert_existing", - HILDON_RESPONSE_INSERT_EXISTING)); - - dialog->priv->cancelBtn = - GTK_BUTTON(gtk_dialog_add_button(GTK_DIALOG(dialog), - "ckdg_bd_insert_cancel", - GTK_RESPONSE_CANCEL)); - - dialog->priv->label = GTK_LABEL(gtk_label_new(NULL)); - dialog->priv->locationCap = - HILDON_CAPTION(hildon_caption_new(dialog->priv->group, - "Location", - GTK_WIDGET(dialog->priv->label), - NULL, HILDON_CAPTION_OPTIONAL)); - gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), - GTK_WIDGET(dialog->priv->locationCap), FALSE, FALSE, - 0); - - dialog->priv->entry = GTK_ENTRY(gtk_entry_new()); - dialog->priv->entryCap = - HILDON_CAPTION(hildon_caption_new(dialog->priv->group, - "Name", - GTK_WIDGET(dialog->priv->entry), - NULL, HILDON_CAPTION_OPTIONAL)); - - gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), - GTK_WIDGET(dialog->priv->entryCap), FALSE, FALSE, - 0); - - dialog->priv->combo = GTK_COMBO_BOX(gtk_combo_box_new_text()); - - dialog->priv->comboCap = - HILDON_CAPTION(hildon_caption_new(dialog->priv->group, - "Mime type", - GTK_WIDGET(dialog->priv->combo), - NULL, HILDON_CAPTION_OPTIONAL)); - - gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), - GTK_WIDGET(dialog->priv->comboCap), FALSE, FALSE, - 0); - - dialog->priv->mimetype = (char *) GNOME_VFS_MIME_TYPE_UNKNOWN; - - /* Initialize gnome-vfs */ - if (gnome_vfs_initialized() == FALSE) { - gtk_quit_add(RUN_AT_TERMINATION, hildon_insert_object_foo, NULL); - - if (gnome_vfs_init() == FALSE) { - g_error("GnomeVFS can not be run"); - return; - } else - g_message("GnomeVFS init!"); - } else - g_message("GnomeVFS initialized!"); - - - /* Read registered mime types into combobox */ - mimelist = gnome_vfs_get_registered_mime_types(); - - while (mimelist) { - if (gnome_vfs_mime_get_description((char *) (mimelist->data)) != - NULL) - gtk_combo_box_append_text - (dialog->priv->combo, - gnome_vfs_mime_get_description - ((char *) (mimelist->data))); - else - gtk_combo_box_append_text(dialog->priv->combo, - (char *) (mimelist->data)); - - mimelist = mimelist->next; - } - - gnome_vfs_mime_registered_mime_type_list_free(mimelist); - - /* Read directory path into label and first file into entry */ - /* dir_path = g_strconcat( (const char *)g_get_current_dir(), - PROJECT_TEMPLATE_DIR, NULL); */ - dir_path = g_strconcat(g_getenv((const char *) "PWD"), - PROJECT_TEMPLATE_DIR, NULL); - - result = gnome_vfs_directory_open(&(dialog->priv->dir), dir_path, - GNOME_VFS_FILE_INFO_DEFAULT | - GNOME_VFS_FILE_INFO_GET_MIME_TYPE); - if (result != GNOME_VFS_OK) { - g_warning("Could not read project templates directory\n"); - gtk_label_set_label(dialog->priv->label, - "Could not read project templates directory"); - return; - } else { - gtk_label_set_label(dialog->priv->label, (gchar *) dir_path); - - while (gnome_vfs_directory_read_next(dialog->priv->dir, file) == - GNOME_VFS_OK) { - if (file->name != NULL - && file->type == GNOME_VFS_FILE_TYPE_REGULAR) { - gtk_entry_set_text(dialog->priv->entry, - (gchar *) file->name); - - combo_tree = gtk_combo_box_get_model(dialog->priv->combo); - valid = - gtk_tree_model_get_iter_first(combo_tree, &combo_iter); - - while (valid) { - gchar *str_data; - - gtk_tree_model_get(combo_tree, &combo_iter, 0, - &str_data, -1); - - if (strcmp(str_data, - gnome_vfs_mime_get_description - ((char *) file->mime_type)) == 0) { - dialog->priv->mimetype = (char *) file->mime_type; - gtk_combo_box_set_active_iter(dialog->priv->combo, - &combo_iter); - g_free(str_data); - break; - } - g_free(str_data); - valid = - gtk_tree_model_iter_next(combo_tree, &combo_iter); - } - - break; - } - - } - } - - - if (gnome_vfs_directory_close(dialog->priv->dir) != GNOME_VFS_OK) - g_warning("Could not close the project templates directory\n"); - else - g_message("Gnome VFS dir closed \n"); - - g_free(dir_path); - - dialog->priv->keysnooper = - (guint) (gtk_key_snooper_install - ((GtkKeySnoopFunc) - (hildon_insert_object_dialog_key_snooper), - GTK_WIDGET(dialog))); - - gtk_window_resize(GTK_WINDOW(dialog), - HILDON_INSERT_OBJECT_DIALOG_WIDTH, - HILDON_INSERT_OBJECT_DIALOG_HEIGHT); - - gtk_widget_show_all(GTK_DIALOG(dialog)->vbox); - gtk_widget_show_all(GTK_DIALOG(dialog)->action_area); - - gnome_vfs_file_info_unref(file); - -} - -static gint hildon_insert_object_dialog_key_snooper(GtkWidget * gadget, - GdkEventKey * event, - GtkWidget * widget) -{ - if (event->type == GDK_KEY_RELEASE) { - switch (event->keyval) { - case GDK_I: - case GDK_i: - gtk_dialog_response(GTK_DIALOG(widget), - HILDON_RESPONSE_INSERT_EXISTING); - break; - /* case GDK_C: case GDK_c: gtk_dialog_response( - GTK_DIALOG(widget), GTK_RESPONSE_CANCEL ); break; */ - } - } - return FALSE; -} - - -/* Public functions */ -GType hildon_insert_object_dialog_get_type(void) -{ - static GType dialog_type = 0; - - if (!dialog_type) { - static const GTypeInfo dialog_info = { - sizeof(HildonInsertObjectDialogClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) hildon_insert_object_dialog_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(HildonInsertObjectDialog), - 0, /* n_preallocs */ - (GInstanceInitFunc) hildon_insert_object_dialog_init - }; - - dialog_type = g_type_register_static(GTK_TYPE_DIALOG, - "HildonInsertObjectDialog", - &dialog_info, 0); - } - return dialog_type; - -} - -/** - * hildon_insert_object_dialog_new: - * @parent: the parent window of the dialog - * - * Creates a new #HildonInsertObjectDialog widget. - * - * Returns: the newly created #HildonInsertObjectDialog - */ -GtkWidget *hildon_insert_object_dialog_new(GtkWindow * parent) -{ - GtkWidget *self = g_object_new(HILDON_TYPE_INSERT_OBJECT_DIALOG, NULL); - - if (parent) - gtk_window_set_transient_for(GTK_WINDOW(self), parent); - - return GTK_WIDGET(self); -} - -/** - * hildon_insert_object_dialog_get_name: - * @dialog: the dialog - * - * Gets the text in name field of the file dialog. - * This specifies the object to be inserted. - * - * Returns: a pointer to the name string - */ -const gchar *hildon_insert_object_dialog_get_name(HildonInsertObjectDialog - * dialog) -{ - - g_return_val_if_fail(HILDON_IS_INSERT_OBJECT_DIALOG(dialog), NULL); - - return gtk_entry_get_text(dialog->priv->entry); -} - -/** - * hildon_insert_object_dialog_get_mime_type: - * @dialog: the dialog - * - * Gets the mime type selected in the combobox. - * - * Returns: a pointer to the mime type string, must not be freed - */ -const gchar - *hildon_insert_object_dialog_get_mime_type(HildonInsertObjectDialog * - dialog) -{ - /* GtkTreeIter iter; gchar *return_string; GtkTreeModel *tree_model; - - tree_model = gtk_combo_box_get_model(dialog->priv->combo); - - if(gtk_combo_box_get_active_iter(dialog->priv->combo,&iter)){ - gtk_tree_model_get (tree_model, &iter, 0, &return_string, -1); - return return_string; } else { return NULL; } */ - - - return dialog->priv->mimetype; -} - -static void -hildon_insert_object_dialog_set_property(GObject * object, - guint prop_id, - const GValue * value, GParamSpec * pspec) -{ - HildonInsertObjectDialog *dialog; - - dialog = HILDON_INSERT_OBJECT_DIALOG(object); - - switch (prop_id) { - case PROP_NAME: - gtk_entry_set_text(dialog->priv->entry, g_value_get_string(value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); - break; - } -} - -static void -hildon_insert_object_dialog_get_property(GObject * object, - guint prop_id, GValue * value, GParamSpec * pspec) -{ - HildonInsertObjectDialog *dialog; - - dialog = HILDON_INSERT_OBJECT_DIALOG(object); - - switch (prop_id) { - case PROP_NAME: - g_value_set_string(value, gtk_entry_get_text(dialog->priv->entry)); - break; - case PROP_MIME_TYPE: - g_value_set_string(value, dialog->priv->mimetype); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); - break; - } -} - diff --git a/hildon-widgets/hildon-insert-object-dialog.h b/hildon-widgets/hildon-insert-object-dialog.h deleted file mode 100644 index 5fa5b6d..0000000 --- a/hildon-widgets/hildon-insert-object-dialog.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * This file is part of hildon-libs - * - * Copyright (C) 2005 Nokia Corporation. - * - * Contact: Luc Pionchon - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA - * - */ - -#ifndef __HILDON_INSERT_OBJECT_DIALOG_H__ -#define __HILDON_INSERT_OBJECT_DIALOG_H__ - -#include - -/* - * Headers for GnomeVFS used for mime types - * - */ -#include -#include -#include -#include -#include -#include -#include - -#define HILDON_RESPONSE_INSERT_EXISTING 12345 - - -G_BEGIN_DECLS -#define HILDON_TYPE_INSERT_OBJECT_DIALOG \ - ( hildon_insert_object_dialog_get_type() ) -#define HILDON_INSERT_OBJECT_DIALOG(obj) \ - (GTK_CHECK_CAST (obj, HILDON_TYPE_INSERT_OBJECT_DIALOG,\ - HildonInsertObjectDialog)) -#define HILDON_INSERT_OBJECT_DIALOG_CLASS(klass) \ - (GTK_CHECK_CLASS_CAST ((klass), HILDON_TYPE_INSERT_OBJECT_DIALOG, \ - HildonInsertObjectDialogClass)) -#define HILDON_IS_INSERT_OBJECT_DIALOG(obj) \ - (GTK_CHECK_TYPE (obj, HILDON_TYPE_INSERT_OBJECT_DIALOG)) -#define HILDON_IS_INSERT_OBJECT_DIALOG_CLASS(klass) \ - (GTK_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_INSERT_OBJECT_DIALOG)) -typedef struct _HildonInsertObjectDialog HildonInsertObjectDialog; -typedef struct _HildonInsertObjectDialogClass - HildonInsertObjectDialogClass; - -/** - * HildonInsertObjectDialogPrivate: - * - * This structure contains just private data and should not be - * accessed directly. - */ -typedef struct _HildonInsertObjectDialogPrivate - HildonInsertObjectDialogPrivate; - -struct _HildonInsertObjectDialog { - GtkDialog parent; - HildonInsertObjectDialogPrivate *priv; -}; - -struct _HildonInsertObjectDialogClass { - GtkDialogClass parent_class; -}; - -GType hildon_insert_object_dialog_get_type(void); - -GtkWidget *hildon_insert_object_dialog_new(GtkWindow * parent); - -/* Use return value of gtk_dialog_run to decide - which one of the following to call */ -const gchar *hildon_insert_object_dialog_get_name(HildonInsertObjectDialog - * dialog); -const gchar - *hildon_insert_object_dialog_get_mime_type(HildonInsertObjectDialog * - dialog); - -G_END_DECLS -#endif diff --git a/po/POTFILES.in b/po/POTFILES.in index 1eed9da..ec35650 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -9,7 +9,6 @@ hildon-widgets/hildon-date-editor.c hildon-widgets/hildon-file-details-dialog.c hildon-widgets/hildon-file-handling-note.c hildon-widgets/hildon-font-selection-dialog.c -hildon-widgets/hildon-insert-object-dialog.c hildon-widgets/hildon-note.c hildon-widgets/hildon-number-editor.c hildon-widgets/hildon-range-editor.c diff --git a/ut/Makefile.am b/ut/Makefile.am index e95cb18..6c99559 100644 --- a/ut/Makefile.am +++ b/ut/Makefile.am @@ -2,11 +2,11 @@ outomodule_LTLIBRARIES = \ libhildonwidgets_unittests.la \ libhildonwidgets_clock_unittests.la -INCLUDES = $(GTK_CFLAGS) $(GNOME_VFS_CFLAGS) -I$(top_srcdir)/hildon-widgets $(OUTO_CFLAGS) +INCLUDES = $(GTK_CFLAGS) -I$(top_srcdir)/hildon-widgets $(OUTO_CFLAGS) LDFLAGS = -module -avoid-version libhildonwidgets_unittests_la_SOURCES = hildon-widgets_tests.c -libhildonwidgets_unittests_la_LIBADD = $(GTK_LIBS) $(GNOME_VFS_LIBS) $(top_builddir)/hildon-widgets/libhildonwidgets.la +libhildonwidgets_unittests_la_LIBADD = $(GTK_LIBS) $(top_builddir)/hildon-widgets/libhildonwidgets.la libhildonwidgets_clock_unittests_la_SOURCES = hildon-clock-widgets_tests.c -libhildonwidgets_clock_unittests_la_LIBADD = $(GTK_LIBS) $(GNOME_VFS_LIBS) $(top_builddir)/hildon-widgets/libhildonwidgets.la +libhildonwidgets_clock_unittests_la_LIBADD = $(GTK_LIBS) $(top_builddir)/hildon-widgets/libhildonwidgets.la diff --git a/ut/hildon-widgets_tests.c b/ut/hildon-widgets_tests.c index ae93bd1..cdcf882 100644 --- a/ut/hildon-widgets_tests.c +++ b/ut/hildon-widgets_tests.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -2051,35 +2050,6 @@ int fsd_get_pretext(void) assert( str!=NULL ); return 1; } -/* insert object dialog: new */ -int test27a(void){ - GtkWidget *dialog; - dialog = hildon_insert_object_dialog_new(NULL); - g_assert(dialog); - return 1; -} - -/* insert object dialog: get_name */ -int test27b(void){ - const gchar *string; - GtkWidget *dialog; - - dialog = hildon_insert_object_dialog_new(NULL); - string = hildon_insert_object_dialog_get_name(HILDON_INSERT_OBJECT_DIALOG(dialog)); - g_assert(string); - return 1; -} - -/* insert object dialog: get_mime_type */ -int test27c(void){ - const gchar *string; - GtkWidget *dialog; - - dialog = hildon_insert_object_dialog_new(NULL); - string = hildon_insert_object_dialog_get_mime_type(HILDON_INSERT_OBJECT_DIALOG(dialog)); - g_assert(string); - return 1; -} /* hildon_number_editor_new */ int test28a(void){ @@ -3130,9 +3100,6 @@ testcase tcases[] = #endif {*fsd_set_pretext, "FontSelectionDialog Set preview text", EXPECT_OK}, {*fsd_get_pretext, "FontSelectionDialog Get preview text", EXPECT_OK}, - {*test27a, "hildon_insert_object: new", EXPECT_OK}, - {*test27b, "hildon_insert_object: get_name", EXPECT_OK}, - {*test27c, "hildon_insert_object: get_mime_type", EXPECT_ASSERT}, {*test28a, "hildon_number_editor_new", EXPECT_OK}, {*test28b, "hildon_number_editor_get_value", EXPECT_OK}, {*test28c, "hildon_number_editor_set_range", EXPECT_OK}, -- 1.7.9.5