summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooser.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2003-04-09 16:52:13 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-04-09 16:52:13 +0000
commitaf6bc44d86475e532712e4d230cbbc56ffdbff61 (patch)
tree3b9d0d54b2b52844e2bc4c4f47a9fc8b48a143b2 /gtk/gtkfilechooser.c
parent1926dbc1f6b30e89ac723fb87d72c09fc24ec302 (diff)
downloadgdk-pixbuf-af6bc44d86475e532712e4d230cbbc56ffdbff61.tar.gz
- Disconnect signal connections when appropriate. - Listen to
Wed Apr 9 12:28:04 2003 Owen Taylor <otaylor@redhat.com> * gtkfilesystemmodel.c: - Disconnect signal connections when appropriate. - Listen to ::roots-changed on the file system - When the last reference count on a child is removed, queue an idle to unload the parent. * gtkfilesystemgnomevfs.c - When URI's outside of file:/// are acessed, add toplevel URI's to the list of roots. - Improve display name computations * gtkfilechooserentry.c: Don't complete on empty file parts; free stored folder when base directory changes. * gtkfilechooser.c: Fill in some docs.
Diffstat (limited to 'gtk/gtkfilechooser.c')
-rw-r--r--gtk/gtkfilechooser.c97
1 files changed, 87 insertions, 10 deletions
diff --git a/gtk/gtkfilechooser.c b/gtk/gtkfilechooser.c
index 77d5a2882..d6a077cc2 100644
--- a/gtk/gtkfilechooser.c
+++ b/gtk/gtkfilechooser.c
@@ -152,27 +152,64 @@ gtk_file_chooser_get_action (GtkFileChooser *chooser)
return action;
}
+/**
+ * gtk_file_chooser_set_folder_mode:
+ * @chooser: a #GtkFileChooser
+ * @folder_mode: %TRUE if the file chooser is used to select folders
+ * rather than files.
+ *
+ * Sets whether the file chooser is used to select folders
+ * rather than files. If in folder mode, only folders are displayed
+ * to the use, and not the individual files inside the folders
+ * and the user selects a single folder rather than one or
+ * more files.
+ **/
void
-gtk_file_chooser_set_directory_mode (GtkFileChooser *chooser,
- gboolean directory_mode)
+gtk_file_chooser_set_folder_mode (GtkFileChooser *chooser,
+ gboolean folder_mode)
{
g_return_if_fail (GTK_IS_FILE_CHOOSER (chooser));
- g_object_set (chooser, "directory_mode", directory_mode, NULL);
+ g_object_set (chooser, "folder_mode", folder_mode, NULL);
}
+/**
+ * gtk_file_chooser_get_folder_mode:
+ * @chooser: a #GtkFileChooser
+ *
+ * Gets whether the file chooser is used to select folders
+ * rather than files. See gtk_file_chooser_set_folder_mode()
+ *
+ * Return value: %TRUE if the file chooser is used to select
+ folders rather than files.
+ **/
gboolean
-gtk_file_chooser_get_directory_mode (GtkFileChooser *chooser)
+gtk_file_chooser_get_folder_mode (GtkFileChooser *chooser)
{
- gboolean directory_mode;
+ gboolean folder_mode;
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), FALSE);
- g_object_get (chooser, "directory_mode", &directory_mode, NULL);
-
- return directory_mode;
-}
-
+ g_object_get (chooser, "folder_mode", &folder_mode, NULL);
+
+ return folder_mode;
+}
+
+/**
+ * gtk_file_chooser_set_local_only:
+ * @chooser: a #GtkFileChooser
+ * @local_only: %TRUE if only local files can be selected
+ *
+ * Sets whether only local files can be selected in the
+ * file selector. If @local_only is %TRUE (the default),
+ * then the selected file are files are guaranteed to be
+ * accessible through the operating systems native file
+ * file system and therefore the application only
+ * needs to worry about the filename functions in
+ * #GtkFileChooser, like gtk_file_chooser_get_filename(),
+ * rather than the URI functions like
+ * gtk_file_chooser_get_uri(),
+ **/
void
gtk_file_chooser_set_local_only (GtkFileChooser *chooser,
gboolean local_only)
@@ -182,6 +219,15 @@ gtk_file_chooser_set_local_only (GtkFileChooser *chooser,
g_object_set (chooser, "local_only", local_only, NULL);
}
+/**
+ * gtk_file_chooser_get_local_only:
+ * @chooser: a #GtkFileChoosre
+ *
+ * Gets whether only local files can be selected in the
+ * file selector. See gtk_file_chooser_set_local_only()
+ *
+ * Return value: %TRUE if only local files can be selected.
+ **/
gboolean
gtk_file_chooser_get_local_only (GtkFileChooser *chooser)
{
@@ -194,6 +240,16 @@ gtk_file_chooser_get_local_only (GtkFileChooser *chooser)
return local_only;
}
+/**
+ * gtk_file_chooser_set_select_multiple:
+ * @chooser: a #GtkFileChooser
+ * @select_multiple: %TRUE if multiple files can be selected.
+ *
+ * Sets whether multiple files can be selected in the file
+ * selector. If the file selector if in folder mode (see
+ * gtk_file_selector_set_folder_mode()) then only one folder
+ * can be selected, without regard to this setting.
+ **/
void
gtk_file_chooser_set_select_multiple (GtkFileChooser *chooser,
gboolean select_multiple)
@@ -203,6 +259,15 @@ gtk_file_chooser_set_select_multiple (GtkFileChooser *chooser,
g_object_set (chooser, "select_multiple", select_multiple, NULL);
}
+/**
+ * gtk_file_chooser_get_select_multiple:
+ * @chooser: a #GtkFileChooser
+ *
+ * Gets whether multiple files can be selected in the file
+ * selector. See gtk_file_chooser_set_select_multiple().
+ *
+ * Return value: %TRUE if multiple files can be selected.
+ **/
gboolean
gtk_file_chooser_get_select_multiple (GtkFileChooser *chooser)
{
@@ -215,6 +280,18 @@ gtk_file_chooser_get_select_multiple (GtkFileChooser *chooser)
return select_multiple;
}
+/**
+ * gtk_file_chooser_get_filename:
+ * @chooser: a #GtkFileChooser
+ *
+ * Gets the filename for the currently selected file in
+ * the file selector. If multiple files are selected,
+ * one of the filenames will be returned at random.
+ *
+ * Return value: The currently selected filename, or %NULL
+ * if no file is selected, or the selected file can't
+ * be represented with a local filename.
+ **/
gchar *
gtk_file_chooser_get_filename (GtkFileChooser *chooser)
{