HildonFileChooserDialog

HildonFileChooserDialog — A dialog displaying HildonFileSelection.

Synopsis




GtkWidget*  hildon_file_chooser_dialog_new  (GtkWindow *parent,
                                             GtkFileChooserAction action);
GtkWidget*  hildon_file_chooser_dialog_new_with_properties
                                            (GtkWindow *parent,
                                             const gchar *first_property,
                                             ...);
void        hildon_file_chooser_dialog_focus_to_input
                                            (HildonFileChooserDialog *d);
void        hildon_file_chooser_dialog_set_safe_folder
                                            (HildonFileChooserDialog *self,
                                             const gchar *local_path);
void        hildon_file_chooser_dialog_set_safe_folder_uri
                                            (HildonFileChooserDialog *self,
                                             const gchar *uri);
gchar*      hildon_file_chooser_dialog_get_safe_folder
                                            (HildonFileChooserDialog *self);
gchar*      hildon_file_chooser_dialog_get_safe_folder_uri
                                            (HildonFileChooserDialog *self);

Description

HildonFileChooser dialog is a dialog used in many file handling tasks. It implements GtkFileChooser interface and uses HildonFileSelection to display file system.

We create a saving dialog and set a default name.
GtkWidget *dialog = hildon_file_chooser_dialog_new(GTK_FILE_CHOOSER_ACTION_SAVE);

gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), "default.txt");
if (gtk_dialog_run(GTK_DIALOG(dialog) == GTK_RESPONSE_OK)
{
  gchar *name;
  name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
  g_print("Saving as %s\n", name);
  g_free(name);
}

Details

hildon_file_chooser_dialog_new ()

GtkWidget*  hildon_file_chooser_dialog_new  (GtkWindow *parent,
                                             GtkFileChooserAction action);

Creates a new HildonFileChooserDialog using the given action.

parent : Transient parent window for dialog.
action : Action to perform (open file/save file/select folder/new folder).
Returns : a new HildonFileChooserDialog.

hildon_file_chooser_dialog_new_with_properties ()

GtkWidget*  hildon_file_chooser_dialog_new_with_properties
                                            (GtkWindow *parent,
                                             const gchar *first_property,
                                             ...);

Creates new HildonFileChooserDialog. This constructor is handy if you need to pass several options.

parent : Transient parent window for dialog.
first_property : First option to pass to dialog.
... : arguments
Returns : New HildonFileChooserDialog object.

hildon_file_chooser_dialog_focus_to_input ()

void        hildon_file_chooser_dialog_focus_to_input
                                            (HildonFileChooserDialog *d);

d :

hildon_file_chooser_dialog_set_safe_folder ()

void        hildon_file_chooser_dialog_set_safe_folder
                                            (HildonFileChooserDialog *self,
                                             const gchar *local_path);

Sets a safe folder that is used as a fallback in a case that automatic location change fails.

self : a HildonFileChooserDialog widget.
local_path : a path to safe folder.

hildon_file_chooser_dialog_set_safe_folder_uri ()

void        hildon_file_chooser_dialog_set_safe_folder_uri
                                            (HildonFileChooserDialog *self,
                                             const gchar *uri);

See hildon_file_chooser_dialog_set_safe_folder.

self : a HildonFileChooserDialog widget.
uri : an uri to safe folder.

hildon_file_chooser_dialog_get_safe_folder ()

gchar*      hildon_file_chooser_dialog_get_safe_folder
                                            (HildonFileChooserDialog *self);

Gets safe folder location as local path.

self : a HildonFileChooserDialog widget.
Returns : a local path. Free this with g_free.

hildon_file_chooser_dialog_get_safe_folder_uri ()

gchar*      hildon_file_chooser_dialog_get_safe_folder_uri
                                            (HildonFileChooserDialog *self);

Gets safe folder location as uri.

self : a HildonFileChooserDialog widget.
Returns : an uri. Free this with g_free.