[maemo-commits] [maemo-commits] r12083 - in projects/haf/trunk/hildon-fm: . hildon-fm
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Mon Jun 4 11:08:42 EEST 2007
- Previous message: [maemo-commits] r12082 - projects/haf/trunk/libosso/debian
- Next message: [maemo-commits] r12084 - in projects/haf/trunk/libosso: debian src
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: marivoll Date: 2007-06-04 11:08:36 +0300 (Mon, 04 Jun 2007) New Revision: 12083 Modified: projects/haf/trunk/hildon-fm/ChangeLog projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-chooser-dialog.c projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-chooser-dialog.h Log: * hildon-fm/hildon-file-chooser-dialog.h, hildon-fm/hildon-file-chooser-dialog.c (hildon_file_chooser_dialog_get_extension, hildon_file_chooser_dialog_set_extension): New. Modified: projects/haf/trunk/hildon-fm/ChangeLog =================================================================== --- projects/haf/trunk/hildon-fm/ChangeLog 2007-06-04 07:54:09 UTC (rev 12082) +++ projects/haf/trunk/hildon-fm/ChangeLog 2007-06-04 08:08:36 UTC (rev 12083) @@ -1,5 +1,10 @@ 2007-06-04 Marius Vollmer <marius.vollmer at nokia.com> + * hildon-fm/hildon-file-chooser-dialog.h, + hildon-fm/hildon-file-chooser-dialog.c + (hildon_file_chooser_dialog_get_extension, + hildon_file_chooser_dialog_set_extension): New. + Released 1.9.27 * hildon-fm/hildon-file-chooser-dialog.c, Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-chooser-dialog.c =================================================================== --- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-chooser-dialog.c 2007-06-04 07:54:09 UTC (rev 12082) +++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-chooser-dialog.c 2007-06-04 08:08:36 UTC (rev 12083) @@ -2198,6 +2198,44 @@ } /** + * hildon_file_chooser_dialog_get_extension + * @self: dialog widget + * + * Return the extension of the current filename. + * + * Return value: the current extension as a newly allocated string + */ +gchar * +hildon_file_chooser_dialog_get_extension (HildonFileChooserDialog *self) +{ + HildonFileChooserDialogPrivate *priv = self->priv; + + if (priv->ext_name) + return g_strdup (priv->ext_name + 1); + else + return NULL; +} + +/** + * hildon_file_chooser_dialog_set_extension + * @self: dialog widget + * @extension: the new extension + * + * Set the extension of the current filename. + */ +void +hildon_file_chooser_dialog_set_extension (HildonFileChooserDialog *self, + gchar *extension) +{ + HildonFileChooserDialogPrivate *priv = self->priv; + + g_free (priv->ext_name); + priv->ext_name = g_strconcat (".", extension, NULL); + hildon_file_chooser_dialog_do_autonaming (priv); + sync_extensions_combo (priv); +} + +/** * hildon_file_chooser_dialog_set_safe_folder: * @self: a #HildonFileChooserDialog widget. * @local_path: a path to safe folder. Modified: projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-chooser-dialog.h =================================================================== --- projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-chooser-dialog.h 2007-06-04 07:54:09 UTC (rev 12082) +++ projects/haf/trunk/hildon-fm/hildon-fm/hildon-file-chooser-dialog.h 2007-06-04 08:08:36 UTC (rev 12083) @@ -87,29 +87,18 @@ void hildon_file_chooser_dialog_set_show_upnp (HildonFileChooserDialog *self, gboolean value); gboolean hildon_file_chooser_dialog_get_show_upnp (HildonFileChooserDialog *self); -/* Add WIDGET to the dialog, below the "Name" and "Location" fields. - When WIDGET is a HildonCaption, care is taken that the labels line - up with existing HildonCaptions. -*/ void hildon_file_chooser_dialog_add_extra (HildonFileChooserDialog *self, GtkWidget *widget); -/* Create and add a combo box widget with a list of file extensions. - This combobox will track and modify the extension of the current - filename, it is not a filter. - - EXTENSIONS should be a vector of strings, terminated by NULL. The - strings in it are the extensions, without a leading '.'. - - EXT_NAMES, when non-NULL, is a vector parallel to EXTENSIONS that - determines the names of the extensions to use in the UI. When - EXT_NAMES is NULL, the exentions themselved are used as the names. -*/ GtkWidget * hildon_file_chooser_dialog_add_extensions_combo (HildonFileChooserDialog *self, char **extensions, char **ext_names); +gchar *hildon_file_chooser_dialog_get_extension (HildonFileChooserDialog *self); +void hildon_file_chooser_dialog_set_extension (HildonFileChooserDialog *self, + gchar *extension); + /* Note! Other functionality is provided by GtkFileChooser interface. See:
- Previous message: [maemo-commits] r12082 - projects/haf/trunk/libosso/debian
- Next message: [maemo-commits] r12084 - in projects/haf/trunk/libosso: debian src
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]