1999-08-10 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdialogs.c (file_mask_dialog): Sigh, disabled background operations, since they are completely hosed. Re-aligned the widgets in the dialog.
Этот коммит содержится в:
родитель
d8e892cb48
Коммит
c314133465
@ -1,3 +1,9 @@
|
|||||||
|
1999-08-10 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* gdialogs.c (file_mask_dialog): Sigh, disabled background
|
||||||
|
operations, since they are completely hosed. Re-aligned the
|
||||||
|
widgets in the dialog.
|
||||||
|
|
||||||
1999-08-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
1999-08-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
* gscreen.c (editing_icon_list): New function to figure out
|
* gscreen.c (editing_icon_list): New function to figure out
|
||||||
|
135
gnome/gdialogs.c
135
gnome/gdialogs.c
@ -84,16 +84,17 @@ trim_file_name (FileOpContextUI *ui, gchar *path, gint length, gint cur_length)
|
|||||||
|
|
||||||
length -= dotdotdot;
|
length -= dotdotdot;
|
||||||
len = (gint) ((1.0 - (gfloat) length / (gfloat) cur_length) * strlen (path));
|
len = (gint) ((1.0 - (gfloat) length / (gfloat) cur_length) * strlen (path));
|
||||||
|
|
||||||
/* we guess a starting point */
|
/* we guess a starting point */
|
||||||
if (gdk_string_width (ui->op_source_label->style->font, path + len) < length) {
|
if (gdk_string_width (ui->op_source_label->style->font, path + len) < length) {
|
||||||
while (gdk_string_width (ui->op_source_label->style->font, path + len) < length)
|
while (gdk_string_width (ui->op_source_label->style->font, path + len) < length)
|
||||||
len --;
|
len--;
|
||||||
len++;
|
len++;
|
||||||
} else {
|
} else {
|
||||||
while (gdk_string_width (ui->op_source_label->style->font, path + len) > length)
|
while (gdk_string_width (ui->op_source_label->style->font, path + len) > length)
|
||||||
len ++;
|
len++;
|
||||||
}
|
}
|
||||||
|
|
||||||
path_copy = g_strdup_printf ("...%s", path + len);
|
path_copy = g_strdup_printf ("...%s", path + len);
|
||||||
return path_copy;
|
return path_copy;
|
||||||
}
|
}
|
||||||
@ -134,7 +135,7 @@ file_progress_show_source (FileOpContext *ctx, char *path)
|
|||||||
else {
|
else {
|
||||||
path_copy = trim_file_name (ui, path, GDIALOG_PROGRESS_WIDTH - from_width,
|
path_copy = trim_file_name (ui, path, GDIALOG_PROGRESS_WIDTH - from_width,
|
||||||
path_width);
|
path_width);
|
||||||
|
|
||||||
gtk_label_set_text (GTK_LABEL (ui->op_source_label), path_copy);
|
gtk_label_set_text (GTK_LABEL (ui->op_source_label), path_copy);
|
||||||
g_free (path_copy);
|
g_free (path_copy);
|
||||||
}
|
}
|
||||||
@ -167,7 +168,7 @@ file_progress_show_target (FileOpContext *ctx, char *path)
|
|||||||
return FILE_CONT;
|
return FILE_CONT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!to_width)
|
if (!to_width)
|
||||||
to_width = gdk_string_width (ui->op_target_label->style->font,
|
to_width = gdk_string_width (ui->op_target_label->style->font,
|
||||||
_(gdialog_to_string));
|
_(gdialog_to_string));
|
||||||
path_width = gdk_string_width (ui->op_target_label->style->font, path);
|
path_width = gdk_string_width (ui->op_target_label->style->font, path);
|
||||||
@ -216,7 +217,7 @@ file_progress_show_deleting (FileOpContext *ctx, char *path)
|
|||||||
else {
|
else {
|
||||||
path_copy = trim_file_name (ui, path, GDIALOG_PROGRESS_WIDTH - deleting_width,
|
path_copy = trim_file_name (ui, path, GDIALOG_PROGRESS_WIDTH - deleting_width,
|
||||||
path_width);
|
path_width);
|
||||||
|
|
||||||
gtk_label_set_text (GTK_LABEL (ui->op_source_label), path_copy);
|
gtk_label_set_text (GTK_LABEL (ui->op_source_label), path_copy);
|
||||||
g_free (path_copy);
|
g_free (path_copy);
|
||||||
}
|
}
|
||||||
@ -235,12 +236,12 @@ file_progress_show (FileOpContext *ctx, long done, long total)
|
|||||||
/* ctx->ui might be NULL for background processes */
|
/* ctx->ui might be NULL for background processes */
|
||||||
if (ctx->ui == NULL)
|
if (ctx->ui == NULL)
|
||||||
return FILE_CONT;
|
return FILE_CONT;
|
||||||
|
|
||||||
ui = ctx->ui;
|
ui = ctx->ui;
|
||||||
|
|
||||||
if (ui->aborting)
|
if (ui->aborting)
|
||||||
return FILE_ABORT;
|
return FILE_ABORT;
|
||||||
|
|
||||||
if (total > 0) {
|
if (total > 0) {
|
||||||
perc = (double) done / (double) total;
|
perc = (double) done / (double) total;
|
||||||
snprintf (count, 9, "%3d%% ", (gint) (100.0 * perc));
|
snprintf (count, 9, "%3d%% ", (gint) (100.0 * perc));
|
||||||
@ -262,7 +263,7 @@ file_progress_show_count (FileOpContext *ctx, long done, long total)
|
|||||||
/* ctx->ui might be NULL for background processes */
|
/* ctx->ui might be NULL for background processes */
|
||||||
if (ctx->ui == NULL)
|
if (ctx->ui == NULL)
|
||||||
return FILE_CONT;
|
return FILE_CONT;
|
||||||
|
|
||||||
ui = ctx->ui;
|
ui = ctx->ui;
|
||||||
|
|
||||||
if (ui->aborting)
|
if (ui->aborting)
|
||||||
@ -549,7 +550,6 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, char *text, char
|
|||||||
GtkWidget *notebook;
|
GtkWidget *notebook;
|
||||||
GtkWidget *hbox;
|
GtkWidget *hbox;
|
||||||
GtkWidget *vbox, *label;
|
GtkWidget *vbox, *label;
|
||||||
GtkWidget *alignment;
|
|
||||||
GtkWidget *fentry;
|
GtkWidget *fentry;
|
||||||
GtkWidget *cbox;
|
GtkWidget *cbox;
|
||||||
GtkWidget *icon;
|
GtkWidget *icon;
|
||||||
@ -558,45 +558,60 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, char *text, char
|
|||||||
const char *error;
|
const char *error;
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
int run;
|
int run;
|
||||||
|
|
||||||
g_return_val_if_fail (ctx != NULL, NULL);
|
g_return_val_if_fail (ctx != NULL, NULL);
|
||||||
|
|
||||||
ctx->stable_symlinks = 0;
|
ctx->stable_symlinks = 0;
|
||||||
|
|
||||||
/* Basic window */
|
/* Basic window */
|
||||||
if (operation == OP_COPY)
|
if (operation == OP_COPY)
|
||||||
fmd_win = gnome_dialog_new (_("Copy"), GNOME_STOCK_BUTTON_OK,
|
fmd_win = gnome_dialog_new (_("Copy"), GNOME_STOCK_BUTTON_OK,
|
||||||
GNOME_STOCK_BUTTON_CANCEL, NULL);
|
GNOME_STOCK_BUTTON_CANCEL, NULL);
|
||||||
else if (operation == OP_MOVE)
|
else if (operation == OP_MOVE)
|
||||||
fmd_win = gnome_dialog_new (_("Move"), GNOME_STOCK_BUTTON_OK,
|
fmd_win = gnome_dialog_new (_("Move"), GNOME_STOCK_BUTTON_OK,
|
||||||
GNOME_STOCK_BUTTON_CANCEL, NULL);
|
GNOME_STOCK_BUTTON_CANCEL, NULL);
|
||||||
|
|
||||||
gtk_window_set_position (GTK_WINDOW (fmd_win), GTK_WIN_POS_MOUSE);
|
gtk_window_set_position (GTK_WINDOW (fmd_win), GTK_WIN_POS_MOUSE);
|
||||||
|
|
||||||
hbox = gtk_hbox_new (FALSE, GNOME_PAD);
|
|
||||||
notebook = gtk_notebook_new ();
|
notebook = gtk_notebook_new ();
|
||||||
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (fmd_win)->vbox),
|
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (fmd_win)->vbox),
|
||||||
notebook, FALSE, FALSE, 0);
|
notebook, FALSE, FALSE, 0);
|
||||||
/*FIXME: I wan't a bigger, badder, better Icon here... */
|
|
||||||
|
hbox = gtk_hbox_new (FALSE, GNOME_PAD);
|
||||||
|
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||||
|
hbox,
|
||||||
|
gtk_label_new (_("Destination")));
|
||||||
|
|
||||||
|
/* FIXME: I want a bigger, badder, better Icon here... */
|
||||||
icon = gnome_stock_pixmap_widget (hbox, GNOME_STOCK_PIXMAP_HELP);
|
icon = gnome_stock_pixmap_widget (hbox, GNOME_STOCK_PIXMAP_HELP);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, GNOME_PAD);
|
vbox = gtk_vbox_new (FALSE, GNOME_PAD);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), GNOME_PAD);
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), GNOME_PAD);
|
||||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
|
||||||
hbox,
|
|
||||||
gtk_label_new (_("Destination")));
|
|
||||||
alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
|
|
||||||
label = gtk_label_new (text);
|
label = gtk_label_new (text);
|
||||||
gtk_container_add (GTK_CONTAINER (alignment), label);
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
|
||||||
|
|
||||||
fentry = gnome_file_entry_new ("gmc-copy-file", _("Find Destination Folder"));
|
fentry = gnome_file_entry_new ("gmc-copy-file", _("Find Destination Folder"));
|
||||||
gnome_file_entry_set_directory (GNOME_FILE_ENTRY (fentry), TRUE);
|
gnome_file_entry_set_directory (GNOME_FILE_ENTRY (fentry), TRUE);
|
||||||
gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (fentry))),
|
gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (fentry))),
|
||||||
def_text);
|
def_text);
|
||||||
gnome_file_entry_set_default_path (GNOME_FILE_ENTRY (fentry), def_text);
|
gnome_file_entry_set_default_path (GNOME_FILE_ENTRY (fentry), def_text);
|
||||||
|
gnome_file_entry_set_modal (GNOME_FILE_ENTRY (fentry), TRUE);
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox), fentry, FALSE, FALSE, 0);
|
||||||
|
|
||||||
|
/* Background operations are completely hosed, so we olympically disable
|
||||||
|
* them. How's that for foolproof bugfixing.
|
||||||
|
*/
|
||||||
|
|
||||||
|
*do_background = FALSE;
|
||||||
|
#if 0
|
||||||
cbox = gtk_check_button_new_with_label (_("Copy as a background process"));
|
cbox = gtk_check_button_new_with_label (_("Copy as a background process"));
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cbox), *do_background);
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cbox), *do_background);
|
||||||
gtk_signal_connect (GTK_OBJECT (cbox), "toggled", (GtkSignalFunc) fmd_check_box_callback, do_background);
|
gtk_signal_connect (GTK_OBJECT (cbox), "toggled",
|
||||||
|
(GtkSignalFunc) fmd_check_box_callback, do_background);
|
||||||
#if 0
|
#if 0
|
||||||
gnome_widget_add_help (cbox, "Selecting this will run the copying in the background. "
|
gnome_widget_add_help (cbox, "Selecting this will run the copying in the background. "
|
||||||
"This is useful for transfers over networks that might take a long "
|
"This is useful for transfers over networks that might take a long "
|
||||||
@ -604,16 +619,13 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, char *text, char
|
|||||||
#endif
|
#endif
|
||||||
gtk_box_pack_end (GTK_BOX (vbox), cbox, FALSE, FALSE, 0);
|
gtk_box_pack_end (GTK_BOX (vbox), cbox, FALSE, FALSE, 0);
|
||||||
gtk_box_pack_end (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
|
gtk_box_pack_end (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
|
||||||
gtk_box_pack_end (GTK_BOX (vbox), fentry, FALSE, FALSE, 0);
|
#endif
|
||||||
gnome_file_entry_set_modal(GNOME_FILE_ENTRY (fentry),TRUE);
|
|
||||||
|
|
||||||
gtk_box_pack_end (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
|
|
||||||
|
|
||||||
/* Advanced Options */
|
/* Advanced Options */
|
||||||
hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
|
hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
|
||||||
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
|
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
|
||||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
|
||||||
hbox,
|
hbox,
|
||||||
gtk_label_new (_("Advanced Options")));
|
gtk_label_new (_("Advanced Options")));
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), GNOME_PAD);
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), GNOME_PAD);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
||||||
@ -644,7 +656,8 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, char *text, char
|
|||||||
gtk_signal_connect (GTK_OBJECT (cbox), "toggled",
|
gtk_signal_connect (GTK_OBJECT (cbox), "toggled",
|
||||||
(GtkSignalFunc) fmd_check_box_callback, &ctx->op_preserve);
|
(GtkSignalFunc) fmd_check_box_callback, &ctx->op_preserve);
|
||||||
#if 0
|
#if 0
|
||||||
gnome_widget_add_help (cbox, _("Preserves the permissions and the UID/GID if possible"));
|
gnome_widget_add_help (cbox,
|
||||||
|
_("Preserves the permissions and the UID/GID if possible"));
|
||||||
#endif
|
#endif
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), cbox, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), cbox, FALSE, FALSE, 0);
|
||||||
|
|
||||||
@ -653,9 +666,11 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, char *text, char
|
|||||||
cbox = gtk_check_button_new_with_label (_("Recursively copy subdirectories."));
|
cbox = gtk_check_button_new_with_label (_("Recursively copy subdirectories."));
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cbox), ctx->dive_into_subdirs);
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cbox), ctx->dive_into_subdirs);
|
||||||
gtk_signal_connect (GTK_OBJECT (cbox), "toggled",
|
gtk_signal_connect (GTK_OBJECT (cbox), "toggled",
|
||||||
(GtkSignalFunc) fmd_check_box_callback, &ctx->dive_into_subdirs);
|
(GtkSignalFunc) fmd_check_box_callback,
|
||||||
|
&ctx->dive_into_subdirs);
|
||||||
#if 0
|
#if 0
|
||||||
gnome_widget_add_help (cbox, _("If set, this will copy the directories recursively"));
|
gnome_widget_add_help (cbox,
|
||||||
|
_("If set, this will copy the directories recursively"));
|
||||||
#endif
|
#endif
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), cbox, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), cbox, FALSE, FALSE, 0);
|
||||||
}
|
}
|
||||||
@ -667,7 +682,7 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, char *text, char
|
|||||||
|
|
||||||
/* Off to the races!!! */
|
/* Off to the races!!! */
|
||||||
run = gnome_dialog_run (GNOME_DIALOG (fmd_win));
|
run = gnome_dialog_run (GNOME_DIALOG (fmd_win));
|
||||||
|
|
||||||
if (run == 1) {
|
if (run == 1) {
|
||||||
gtk_widget_destroy (fmd_win);
|
gtk_widget_destroy (fmd_win);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -676,7 +691,7 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, char *text, char
|
|||||||
if (run == -1)
|
if (run == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
dest_dir = gnome_file_entry_get_full_path(GNOME_FILE_ENTRY (fentry), FALSE);
|
dest_dir = gnome_file_entry_get_full_path (GNOME_FILE_ENTRY (fentry), FALSE);
|
||||||
gtk_widget_destroy (fmd_win);
|
gtk_widget_destroy (fmd_win);
|
||||||
easy_patterns = 1;
|
easy_patterns = 1;
|
||||||
if (!dest_dir || !*dest_dir)
|
if (!dest_dir || !*dest_dir)
|
||||||
@ -735,12 +750,13 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, char *text, char
|
|||||||
else
|
else
|
||||||
ctx->dest_mask++;
|
ctx->dest_mask++;
|
||||||
orig_mask = ctx->dest_mask;
|
orig_mask = ctx->dest_mask;
|
||||||
if (!*ctx->dest_mask || (!ctx->dive_into_subdirs && !is_wildcarded (ctx->dest_mask) &&
|
if (!*ctx->dest_mask
|
||||||
(!only_one || (!mc_stat (dest_dir, &buf)
|
|| (!ctx->dive_into_subdirs && !is_wildcarded (ctx->dest_mask)
|
||||||
&& S_ISDIR (buf.st_mode)))) ||
|
&& (!only_one || (!mc_stat (dest_dir, &buf)
|
||||||
(ctx->dive_into_subdirs && ((!only_one && !is_wildcarded (ctx->dest_mask)) ||
|
&& S_ISDIR (buf.st_mode))))
|
||||||
(only_one && !mc_stat (dest_dir, &buf)
|
|| (ctx->dive_into_subdirs && ((!only_one && !is_wildcarded (ctx->dest_mask))
|
||||||
&& S_ISDIR (buf.st_mode)))))
|
|| (only_one && !mc_stat (dest_dir, &buf)
|
||||||
|
&& S_ISDIR (buf.st_mode)))))
|
||||||
ctx->dest_mask = g_strdup ("*");
|
ctx->dest_mask = g_strdup ("*");
|
||||||
else {
|
else {
|
||||||
ctx->dest_mask = g_strdup (ctx->dest_mask);
|
ctx->dest_mask = g_strdup (ctx->dest_mask);
|
||||||
@ -764,7 +780,8 @@ file_delete_query_recursive (FileOpContext *ctx, enum OperationMode mode, gchar
|
|||||||
gboolean rest_same;
|
gboolean rest_same;
|
||||||
|
|
||||||
if (ctx->recursive_result < RECURSIVE_ALWAYS) {
|
if (ctx->recursive_result < RECURSIVE_ALWAYS) {
|
||||||
msg = g_strdup_printf(_("%s\n\nDirectory not empty. Delete it recursively?"), name_trunc (s, 80));
|
msg = g_strdup_printf (_("%s\n\nDirectory not empty. Delete it recursively?"),
|
||||||
|
name_trunc (s, 80));
|
||||||
dialog = gnome_message_box_new (msg,
|
dialog = gnome_message_box_new (msg,
|
||||||
GNOME_MESSAGE_BOX_QUESTION,
|
GNOME_MESSAGE_BOX_QUESTION,
|
||||||
GNOME_STOCK_BUTTON_YES,
|
GNOME_STOCK_BUTTON_YES,
|
||||||
@ -772,7 +789,7 @@ file_delete_query_recursive (FileOpContext *ctx, enum OperationMode mode, gchar
|
|||||||
GNOME_STOCK_BUTTON_CANCEL,
|
GNOME_STOCK_BUTTON_CANCEL,
|
||||||
NULL);
|
NULL);
|
||||||
g_free (msg);
|
g_free (msg);
|
||||||
|
|
||||||
title = g_strconcat (_(" Delete: "), name_trunc (s, 30), " ", NULL);
|
title = g_strconcat (_(" Delete: "), name_trunc (s, 30), " ", NULL);
|
||||||
gtk_window_set_title (GTK_WINDOW (dialog), title);
|
gtk_window_set_title (GTK_WINDOW (dialog), title);
|
||||||
g_free (title);
|
g_free (title);
|
||||||
@ -781,14 +798,14 @@ file_delete_query_recursive (FileOpContext *ctx, enum OperationMode mode, gchar
|
|||||||
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
|
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
|
||||||
togglebutton, FALSE, FALSE, 0);
|
togglebutton, FALSE, FALSE, 0);
|
||||||
gtk_widget_show_all (GNOME_DIALOG (dialog)->vbox);
|
gtk_widget_show_all (GNOME_DIALOG (dialog)->vbox);
|
||||||
|
|
||||||
gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
|
gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
|
||||||
|
|
||||||
button = gnome_dialog_run (GNOME_DIALOG (dialog));
|
button = gnome_dialog_run (GNOME_DIALOG (dialog));
|
||||||
rest_same = GTK_TOGGLE_BUTTON (togglebutton)->active;
|
rest_same = GTK_TOGGLE_BUTTON (togglebutton)->active;
|
||||||
|
|
||||||
gtk_widget_destroy (dialog);
|
gtk_widget_destroy (dialog);
|
||||||
|
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case 0:
|
case 0:
|
||||||
ctx->recursive_result = rest_same ? RECURSIVE_ALWAYS : RECURSIVE_YES;
|
ctx->recursive_result = rest_same ? RECURSIVE_ALWAYS : RECURSIVE_YES;
|
||||||
@ -801,22 +818,22 @@ file_delete_query_recursive (FileOpContext *ctx, enum OperationMode mode, gchar
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->recursive_result != RECURSIVE_ABORT)
|
if (ctx->recursive_result != RECURSIVE_ABORT)
|
||||||
do_refresh ();
|
do_refresh ();
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (ctx->recursive_result){
|
switch (ctx->recursive_result){
|
||||||
case RECURSIVE_YES:
|
case RECURSIVE_YES:
|
||||||
case RECURSIVE_ALWAYS:
|
case RECURSIVE_ALWAYS:
|
||||||
return FILE_CONT;
|
return FILE_CONT;
|
||||||
|
|
||||||
case RECURSIVE_NO:
|
case RECURSIVE_NO:
|
||||||
case RECURSIVE_NEVER:
|
case RECURSIVE_NEVER:
|
||||||
return FILE_SKIP;
|
return FILE_SKIP;
|
||||||
|
|
||||||
case RECURSIVE_ABORT:
|
case RECURSIVE_ABORT:
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return FILE_ABORT;
|
return FILE_ABORT;
|
||||||
}
|
}
|
||||||
@ -883,19 +900,22 @@ file_op_context_create_ui (FileOpContext *ctx, FileOperation op, int with_eta)
|
|||||||
alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
|
alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
|
||||||
hbox = gtk_hbox_new (FALSE, 0);
|
hbox = gtk_hbox_new (FALSE, 0);
|
||||||
gtk_container_add (GTK_CONTAINER (alignment), hbox);
|
gtk_container_add (GTK_CONTAINER (alignment), hbox);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(gdialog_from_string)), FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(gdialog_from_string)),
|
||||||
|
FALSE, FALSE, 0);
|
||||||
ui->op_source_label = gtk_label_new ("");
|
ui->op_source_label = gtk_label_new ("");
|
||||||
|
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), ui->op_source_label, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), ui->op_source_label, FALSE, FALSE, 0);
|
||||||
gtk_box_set_spacing (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox), GNOME_PAD_SMALL);
|
gtk_box_set_spacing (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox), GNOME_PAD_SMALL);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (GNOME_DIALOG (ui->op_win)->vbox), GNOME_PAD);
|
gtk_container_set_border_width (GTK_CONTAINER (GNOME_DIALOG (ui->op_win)->vbox),
|
||||||
|
GNOME_PAD);
|
||||||
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox),
|
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox),
|
||||||
alignment, FALSE, FALSE, 0);
|
alignment, FALSE, FALSE, 0);
|
||||||
|
|
||||||
alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
|
alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
|
||||||
hbox = gtk_hbox_new (FALSE, 0);
|
hbox = gtk_hbox_new (FALSE, 0);
|
||||||
gtk_container_add (GTK_CONTAINER (alignment), hbox);
|
gtk_container_add (GTK_CONTAINER (alignment), hbox);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(gdialog_to_string)), FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(gdialog_to_string)),
|
||||||
|
FALSE, FALSE, 0);
|
||||||
ui->op_target_label = gtk_label_new ("");
|
ui->op_target_label = gtk_label_new ("");
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), ui->op_target_label, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), ui->op_target_label, FALSE, FALSE, 0);
|
||||||
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox),
|
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox),
|
||||||
@ -905,15 +925,18 @@ file_op_context_create_ui (FileOpContext *ctx, FileOperation op, int with_eta)
|
|||||||
alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
|
alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
|
||||||
hbox = gtk_hbox_new (FALSE, 0);
|
hbox = gtk_hbox_new (FALSE, 0);
|
||||||
gtk_container_add (GTK_CONTAINER (alignment), hbox);
|
gtk_container_add (GTK_CONTAINER (alignment), hbox);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(gdialog_deleting_string)), FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(gdialog_deleting_string)),
|
||||||
|
FALSE, FALSE, 0);
|
||||||
ui->op_source_label = gtk_label_new ("");
|
ui->op_source_label = gtk_label_new ("");
|
||||||
|
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), ui->op_source_label, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), ui->op_source_label, FALSE, FALSE, 0);
|
||||||
gtk_box_set_spacing (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox), GNOME_PAD_SMALL);
|
gtk_box_set_spacing (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox), GNOME_PAD_SMALL);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (GNOME_DIALOG (ui->op_win)->vbox), GNOME_PAD);
|
gtk_container_set_border_width (GTK_CONTAINER (GNOME_DIALOG (ui->op_win)->vbox),
|
||||||
|
GNOME_PAD);
|
||||||
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox),
|
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox),
|
||||||
alignment, FALSE, FALSE, 0);
|
alignment, FALSE, FALSE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
|
alignment = gtk_alignment_new (0.0, 0.5, 0, 0);
|
||||||
hbox = gtk_hbox_new (FALSE, 0);
|
hbox = gtk_hbox_new (FALSE, 0);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_("File ")), FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_("File ")), FALSE, FALSE, 0);
|
||||||
@ -948,7 +971,7 @@ file_op_context_destroy_ui (FileOpContext *ctx)
|
|||||||
|
|
||||||
if (ctx->ui == NULL)
|
if (ctx->ui == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ui = ctx->ui;
|
ui = ctx->ui;
|
||||||
|
|
||||||
gtk_widget_destroy (ui->op_win);
|
gtk_widget_destroy (ui->op_win);
|
||||||
|
@ -129,7 +129,7 @@ static void
|
|||||||
panel_cancel_drag_scroll (WPanel *panel)
|
panel_cancel_drag_scroll (WPanel *panel)
|
||||||
{
|
{
|
||||||
g_return_if_fail (panel != NULL);
|
g_return_if_fail (panel != NULL);
|
||||||
|
|
||||||
if (panel->timer_id != -1){
|
if (panel->timer_id != -1){
|
||||||
gtk_timeout_remove (panel->timer_id);
|
gtk_timeout_remove (panel->timer_id);
|
||||||
panel->timer_id = -1;
|
panel->timer_id = -1;
|
||||||
@ -194,7 +194,7 @@ panel_fill_panel_list (WPanel *panel)
|
|||||||
type_col = -1;
|
type_col = -1;
|
||||||
|
|
||||||
g_assert (items == cl->columns);
|
g_assert (items == cl->columns);
|
||||||
|
|
||||||
texts [items] = NULL;
|
texts [items] = NULL;
|
||||||
for (i = 0; i < top; i++){
|
for (i = 0; i < top; i++){
|
||||||
file_entry *fe = &panel->dir.list [i];
|
file_entry *fe = &panel->dir.list [i];
|
||||||
@ -224,7 +224,7 @@ panel_fill_panel_list (WPanel *panel)
|
|||||||
|
|
||||||
if (fe->f.marked)
|
if (fe->f.marked)
|
||||||
gtk_clist_select_row (cl, i, 0);
|
gtk_clist_select_row (cl, i, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
/* This is needed as the gtk_clist_append changes selected under us :-( */
|
/* This is needed as the gtk_clist_append changes selected under us :-( */
|
||||||
panel->selected = selected;
|
panel->selected = selected;
|
||||||
@ -263,7 +263,7 @@ panel_fill_panel_icons (WPanel *panel)
|
|||||||
for (i = 0; i < top; i++) {
|
for (i = 0; i < top; i++) {
|
||||||
file_entry *fe = &panel->dir.list [i];
|
file_entry *fe = &panel->dir.list [i];
|
||||||
int p;
|
int p;
|
||||||
|
|
||||||
image = gicon_get_icon_for_file (panel->cwd, fe, TRUE);
|
image = gicon_get_icon_for_file (panel->cwd, fe, TRUE);
|
||||||
p = gnome_icon_list_append_imlib (icons, image, fe->fname);
|
p = gnome_icon_list_append_imlib (icons, image, fe->fname);
|
||||||
if (fe->f.marked)
|
if (fe->f.marked)
|
||||||
@ -424,7 +424,7 @@ panel_file_list_configure_contents (GtkWidget *sw, WPanel *panel, int main_width
|
|||||||
used_columns += 2;
|
used_columns += 2;
|
||||||
else
|
else
|
||||||
used_columns += format->field_len;
|
used_columns += format->field_len;
|
||||||
|
|
||||||
items++;
|
items++;
|
||||||
if (format->expand)
|
if (format->expand)
|
||||||
expandables++;
|
expandables++;
|
||||||
@ -801,7 +801,7 @@ panel_icon_list_drag_data_received (GtkWidget *widget,
|
|||||||
file = panel->cwd;
|
file = panel->cwd;
|
||||||
free_file = FALSE;
|
free_file = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
free_fe = FALSE;
|
free_fe = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -862,7 +862,7 @@ panel_clist_drag_data_received (GtkWidget *widget,
|
|||||||
file = panel->cwd;
|
file = panel->cwd;
|
||||||
free_file = FALSE;
|
free_file = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
free_fe = FALSE;
|
free_fe = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2018,7 +2018,7 @@ panel_tree_drag_motion (GtkWidget *widget, GdkDragContext *context, int x, int y
|
|||||||
on_drag_row = strcmp (row_path, dtree->drag_dir) == 0;
|
on_drag_row = strcmp (row_path, dtree->drag_dir) == 0;
|
||||||
} else
|
} else
|
||||||
on_drag_row = FALSE;
|
on_drag_row = FALSE;
|
||||||
|
|
||||||
action = gdnd_validate_action (context,
|
action = gdnd_validate_action (context,
|
||||||
FALSE,
|
FALSE,
|
||||||
source_widget != NULL,
|
source_widget != NULL,
|
||||||
@ -2102,10 +2102,10 @@ static void
|
|||||||
panel_tree_button_press (GtkWidget *widget, GdkEventButton *event, WPanel *panel)
|
panel_tree_button_press (GtkWidget *widget, GdkEventButton *event, WPanel *panel)
|
||||||
{
|
{
|
||||||
GtkWidget *popup;
|
GtkWidget *popup;
|
||||||
|
|
||||||
if (event->type != GDK_BUTTON_PRESS)
|
if (event->type != GDK_BUTTON_PRESS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (event->button != 3)
|
if (event->button != 3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -2267,12 +2267,12 @@ static GnomeUIInfo toolbar[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
do_ui_signal_connect (GnomeUIInfo *uiinfo, gchar *signal_name,
|
do_ui_signal_connect (GnomeUIInfo *uiinfo, gchar *signal_name,
|
||||||
GnomeUIBuilderData *uibdata)
|
GnomeUIBuilderData *uibdata)
|
||||||
{
|
{
|
||||||
if (uiinfo->moreinfo)
|
if (uiinfo->moreinfo)
|
||||||
gtk_signal_connect (GTK_OBJECT (uiinfo->widget),
|
gtk_signal_connect (GTK_OBJECT (uiinfo->widget),
|
||||||
signal_name, uiinfo->moreinfo, uibdata->data ?
|
signal_name, uiinfo->moreinfo, uibdata->data ?
|
||||||
uibdata->data : uiinfo->user_data);
|
uibdata->data : uiinfo->user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2383,7 +2383,7 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
|
|||||||
* We fall back to icon view if a certain listing type is not supported.
|
* We fall back to icon view if a certain listing type is not supported.
|
||||||
* Be sure to keep this in sync with the uiinfo arrays in glayout.c.
|
* Be sure to keep this in sync with the uiinfo arrays in glayout.c.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (panel->list_type == list_brief)
|
if (panel->list_type == list_brief)
|
||||||
gtk_toggle_button_set_active (
|
gtk_toggle_button_set_active (
|
||||||
GTK_TOGGLE_BUTTON (panel_view_toolbar_uiinfo[1].widget), TRUE);
|
GTK_TOGGLE_BUTTON (panel_view_toolbar_uiinfo[1].widget), TRUE);
|
||||||
@ -2545,7 +2545,7 @@ void
|
|||||||
x_reset_sort_labels (WPanel *panel)
|
x_reset_sort_labels (WPanel *panel)
|
||||||
{
|
{
|
||||||
int page;
|
int page;
|
||||||
|
|
||||||
if (!panel->notebook)
|
if (!panel->notebook)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user