summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2003-12-10 03:46:30 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2003-12-10 03:46:30 +0000
commit6a97a169217cfbc14f4e1244159b44c564b2cf12 (patch)
tree7e759e743fd92240156eba8f75619754d01465ce /gtk
parent3f6441ea3ab67b4deea57e1ab127d27021738895 (diff)
downloadgtk+-6a97a169217cfbc14f4e1244159b44c564b2cf12.tar.gz
Use "Home" rather than "Username's Home" (#125964).
2003-12-09 Federico Mena Quintero <federico@ximian.com> * gtk/gtkfilechooserdefault.c (shortcuts_append_home): Use "Home" rather than "Username's Home" (#125964). (shortcuts_selection_changed_cb): New callback, check the sensitivity of the Remove Bookmark button at the right time. (shortcuts_row_activated_cb): It is not necessary to check the sensitivity here.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkfilechooserdefault.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 766111b200..1f837c9f74 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -209,10 +209,10 @@ static void filter_combo_changed (GtkComboBox *combo_box,
static void tree_selection_changed (GtkTreeSelection *tree_selection,
GtkFileChooserDefault *impl);
-static void shortcuts_row_activated (GtkTreeView *tree_view,
- GtkTreePath *path,
- GtkTreeViewColumn *column,
- GtkFileChooserDefault *impl);
+static void shortcuts_row_activated_cb (GtkTreeView *tree_view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ GtkFileChooserDefault *impl);
static gboolean shortcuts_select_func (GtkTreeSelection *selection,
GtkTreeModel *model,
GtkTreePath *path,
@@ -556,24 +556,18 @@ shortcuts_insert_path (GtkFileChooserDefault *impl,
static void
shortcuts_append_home (GtkFileChooserDefault *impl)
{
- const char *name;
const char *home;
GtkFilePath *home_path;
- char *label;
GError *error;
- name = g_get_user_name ();
- label = g_strdup_printf (_("%s's Home"), name);
-
home = g_get_home_dir ();
home_path = gtk_file_system_filename_to_path (impl->file_system, home);
error = NULL;
- impl->has_home = shortcuts_insert_path (impl, -1, home_path, FALSE, label, &error);
+ impl->has_home = shortcuts_insert_path (impl, -1, home_path, FALSE, _("Home"), &error);
if (!impl->has_home)
error_getting_info_dialog (impl, home_path, error);
- g_free (label);
gtk_file_path_free (home_path);
}
@@ -1060,6 +1054,14 @@ shortcuts_drag_data_received_cb (GtkWidget *widget,
g_slist_free (uris);
}
+/* Callback used when the selection in the shortcuts tree changes */
+static void
+shortcuts_selection_changed_cb (GtkTreeSelection *selection,
+ GtkFileChooserDefault *impl)
+{
+ bookmarks_check_remove_sensitivity (impl);
+}
+
/* Creates the widgets for the shortcuts and bookmarks tree */
static GtkWidget *
create_shortcuts_tree (GtkFileChooserDefault *impl)
@@ -1093,9 +1095,12 @@ create_shortcuts_tree (GtkFileChooserDefault *impl)
gtk_tree_selection_set_select_function (selection,
shortcuts_select_func,
impl, NULL);
+
+ g_signal_connect (selection, "changed",
+ G_CALLBACK (shortcuts_selection_changed_cb), impl);
g_signal_connect (impl->shortcuts_tree, "row-activated",
- G_CALLBACK (shortcuts_row_activated), impl);
+ G_CALLBACK (shortcuts_row_activated_cb), impl);
g_signal_connect (impl->shortcuts_tree, "drag-data-received",
G_CALLBACK (shortcuts_drag_data_received_cb), impl);
@@ -2407,10 +2412,10 @@ tree_selection_changed (GtkTreeSelection *selection,
/* Callback used when a row in the shortcuts list is activated */
static void
-shortcuts_row_activated (GtkTreeView *tree_view,
- GtkTreePath *path,
- GtkTreeViewColumn *column,
- GtkFileChooserDefault *impl)
+shortcuts_row_activated_cb (GtkTreeView *tree_view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ GtkFileChooserDefault *impl)
{
GtkTreeIter iter;
GtkFilePath *model_path;
@@ -2418,8 +2423,6 @@ shortcuts_row_activated (GtkTreeView *tree_view,
if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (impl->shortcuts_model), &iter, path))
return;
- bookmarks_check_remove_sensitivity (impl);
-
/* Set the current folder */
gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), &iter, SHORTCUTS_COL_PATH, &model_path, -1);