file chooser, recent files and mounts: search results, the location entry in local-only mode, folder activation, long bookmark names, recent filters by MIME type, the process list of mount operations and icon caches fixed as in GTK+ 3
This commit is contained in:
parent
188847cbfb
commit
9d93158f4e
8 changed files with 30 additions and 15 deletions
|
|
@ -625,10 +625,9 @@ unselect_current_file (GtkFileChooserButton *button)
|
|||
{
|
||||
g_object_unref (priv->selection_while_inactive);
|
||||
priv->selection_while_inactive = NULL;
|
||||
priv->is_changing_selection = TRUE;
|
||||
}
|
||||
|
||||
priv->is_changing_selection = TRUE;
|
||||
|
||||
update_label_and_image (button);
|
||||
update_combo_box (button);
|
||||
}
|
||||
|
|
@ -2347,6 +2346,8 @@ name_cell_data_func (GtkCellLayout *layout,
|
|||
|
||||
if (type == ROW_TYPE_CURRENT_FOLDER)
|
||||
g_object_set (cell, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
|
||||
else if (type == ROW_TYPE_BOOKMARK || type == ROW_TYPE_SHORTCUT)
|
||||
g_object_set (cell, "ellipsize", PANGO_ELLIPSIZE_MIDDLE, NULL);
|
||||
else
|
||||
g_object_set (cell, "ellipsize", PANGO_ELLIPSIZE_NONE, NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7000,6 +7000,7 @@ location_switch_to_filename_entry (GtkFileChooserDefault *impl)
|
|||
/* Configure the entry */
|
||||
|
||||
_gtk_file_chooser_entry_set_base_folder (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), impl->current_folder);
|
||||
_gtk_file_chooser_entry_set_local_only (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), impl->local_only);
|
||||
|
||||
/* Done */
|
||||
|
||||
|
|
@ -12562,7 +12563,7 @@ search_selected_foreach_get_file_cb (GtkTreeModel *model,
|
|||
list = data;
|
||||
|
||||
gtk_tree_model_get (model, iter, MODEL_COL_FILE, &file, -1);
|
||||
*list = g_slist_prepend (*list, g_object_ref (file));
|
||||
*list = g_slist_prepend (*list, file); /* The file already has a new ref courtesy of gtk_tree_model_get(); this will be unreffed by the caller */
|
||||
}
|
||||
|
||||
/* Constructs a list of the selected paths in search mode */
|
||||
|
|
@ -13669,13 +13670,15 @@ item_activated (GtkTreeModel *model,
|
|||
if (is_sensitive && is_folder && file)
|
||||
{
|
||||
change_folder_and_display_error (impl, file, FALSE);
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
|
||||
impl->action == GTK_FILE_CHOOSER_ACTION_SAVE)
|
||||
g_signal_emit_by_name (impl, "file-activated");
|
||||
|
||||
out:
|
||||
|
||||
if (file)
|
||||
g_object_unref (file);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,6 +233,9 @@ find_image_offset (GtkIconCache *cache,
|
|||
guint32 image_list_offset, n_images;
|
||||
int i;
|
||||
|
||||
if (!icon_name)
|
||||
return 0;
|
||||
|
||||
chain_offset = cache->last_chain_offset;
|
||||
if (chain_offset)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -658,7 +658,7 @@ pid_get_env (GPid pid,
|
|||
n = 0;
|
||||
while (TRUE)
|
||||
{
|
||||
if (env[n] == '\0' || n >= env_len)
|
||||
if (n >= env_len || env[n] == '\0')
|
||||
break;
|
||||
|
||||
if (g_str_has_prefix (env + n, key) && (*(env + n + key_len) == '='))
|
||||
|
|
@ -671,7 +671,7 @@ pid_get_env (GPid pid,
|
|||
break;
|
||||
}
|
||||
|
||||
for (; env[n] != '\0' && n < env_len; n++)
|
||||
for (; n < env_len && env[n] != '\0'; n++)
|
||||
;
|
||||
n++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1180,7 +1180,7 @@ on_button_press_event_for_process_tree_view (GtkWidget *widget,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
static GtkWidget *
|
||||
create_show_processes_dialog (GMountOperation *op,
|
||||
const char *message,
|
||||
const char *choices[])
|
||||
|
|
@ -1308,9 +1308,9 @@ create_show_processes_dialog (GMountOperation *op,
|
|||
g_object_add_weak_pointer (G_OBJECT (tree_view), (gpointer *) &priv->process_tree_view);
|
||||
|
||||
g_object_unref (list_store);
|
||||
|
||||
gtk_widget_show_all (dialog);
|
||||
g_object_ref (op);
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1320,6 +1320,7 @@ gtk_mount_operation_show_processes (GMountOperation *op,
|
|||
const char *choices[])
|
||||
{
|
||||
GtkMountOperationPrivate *priv;
|
||||
GtkWidget *dialog = NULL;
|
||||
|
||||
g_return_if_fail (GTK_IS_MOUNT_OPERATION (op));
|
||||
g_return_if_fail (message != NULL);
|
||||
|
|
@ -1331,7 +1332,7 @@ gtk_mount_operation_show_processes (GMountOperation *op,
|
|||
if (priv->process_list_store == NULL)
|
||||
{
|
||||
/* need to create the dialog */
|
||||
create_show_processes_dialog (op, message, choices);
|
||||
dialog = create_show_processes_dialog (op, message, choices);
|
||||
}
|
||||
|
||||
/* otherwise, we're showing the dialog, assume messages+choices hasn't changed */
|
||||
|
|
@ -1339,6 +1340,11 @@ gtk_mount_operation_show_processes (GMountOperation *op,
|
|||
update_process_list_store (GTK_MOUNT_OPERATION (op),
|
||||
priv->process_list_store,
|
||||
processes);
|
||||
|
||||
if (dialog != NULL)
|
||||
{
|
||||
gtk_widget_show_all (dialog);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -1183,6 +1183,9 @@ static void
|
|||
gtk_recent_chooser_sync_action_properties (GtkActivatable *activatable,
|
||||
GtkAction *action)
|
||||
{
|
||||
if (!action)
|
||||
return;
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action));
|
||||
|
||||
_gtk_recent_chooser_sync_action_properties (activatable, action);
|
||||
|
|
|
|||
|
|
@ -488,11 +488,12 @@ gtk_recent_filter_filter (GtkRecentFilter *filter,
|
|||
if (filter_info->mime_type != NULL)
|
||||
{
|
||||
gchar *filter_content_type, *rule_content_type;
|
||||
gboolean match;
|
||||
gboolean match = FALSE;
|
||||
|
||||
filter_content_type = g_content_type_from_mime_type (filter_info->mime_type);
|
||||
rule_content_type = g_content_type_from_mime_type (rule->u.mime_type);
|
||||
match = g_content_type_is_a (filter_content_type, rule_content_type);
|
||||
if (filter_content_type != NULL && rule_content_type != NULL)
|
||||
match = g_content_type_is_a (filter_content_type, rule_content_type);
|
||||
g_free (filter_content_type);
|
||||
g_free (rule_content_type);
|
||||
|
||||
|
|
|
|||
|
|
@ -314,8 +314,7 @@ load_icon_data (const char *path)
|
|||
data->n_attach_points = g_strv_length (split);
|
||||
data->attach_points = g_new (int, 2 * data->n_attach_points);
|
||||
|
||||
i = 0;
|
||||
while (split[i] != NULL && i < data->n_attach_points)
|
||||
for (i = 0; i < data->n_attach_points; ++i)
|
||||
{
|
||||
split_point = strchr (split[i], ',');
|
||||
if (split_point)
|
||||
|
|
@ -325,7 +324,6 @@ load_icon_data (const char *path)
|
|||
data->attach_points[2 * i] = atoi (split[i]);
|
||||
data->attach_points[2 * i + 1] = atoi (split_point);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
g_strfreev (split);
|
||||
|
|
|
|||
Loading…
Reference in a new issue