From 6cc4269bebb5dbf9bf704e168c68468c2a9b2940 Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Wed, 20 Jan 1999 02:16:09 +0000 Subject: [PATCH] 1999-01-19 Jonathan Blandford * gdialogs.c (file_op_context_create_ui): OP_DELETE now has it's very own dialog. whee. * gscreen.c (panel_create_pixmaps): now we use dir-open.xpm instead of the (apparently) ugly yellow one. --- gnome/ChangeLog | 9 ++++- gnome/gcmd.c | 2 +- gnome/gdialogs.c | 96 ++++++++++++++++++++++++++++++++---------------- gnome/gprefs.c | 3 +- gnome/gscreen.c | 14 +++++-- gnome/gtkdtree.h | 1 + 6 files changed, 86 insertions(+), 39 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 8bb92cd5e..e22e0a59e 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,11 @@ +1999-01-19 Jonathan Blandford + + * gdialogs.c (file_op_context_create_ui): OP_DELETE now has it's + very own dialog. whee. + + * gscreen.c (panel_create_pixmaps): now we use dir-open.xpm + instead of the (apparently) ugly yellow one. + 1999-01-19 Miguel de Icaza * gtkdtree.c (gtk_dtree_select_row): Wonder why the code was @@ -8,7 +16,6 @@ * gprefs.c: applied a heavily modified patch by Dave Camp The preference box now works. - 1999-01-18 Miguel de Icaza * gtkdtree.c (gtk_dtree_construct): And the GTK+ people broke the diff --git a/gnome/gcmd.c b/gnome/gcmd.c index da13bff5c..0ee1c091b 100644 --- a/gnome/gcmd.c +++ b/gnome/gcmd.c @@ -122,7 +122,7 @@ int gnome_close_panel (GtkWidget *widget, WPanel *panel) { Dlg_head *h = panel->widget.parent; - + g_print ("closing the panel\n"); if (panel->timer_id){ gtk_timeout_remove (panel->timer_id); panel->timer_id = -1; diff --git a/gnome/gdialogs.c b/gnome/gdialogs.c index 029b682ac..05c7d3005 100644 --- a/gnome/gdialogs.c +++ b/gnome/gdialogs.c @@ -58,6 +58,7 @@ typedef struct { #define GDIALOG_TO_STRING "To: " #define GDIALOG_FROM_STRING "Copying from: " +#define GDIALOG_DELETING_STRING "Deleting file: " #define GDIALOG_PROGRESS_WIDTH 350 @@ -117,7 +118,7 @@ file_progress_show_source (FileOpContext *ctx, char *path) return FILE_ABORT; if (path == NULL){ - gtk_label_set (GTK_LABEL (ui->op_source_label), ""); + gtk_label_set_text (GTK_LABEL (ui->op_source_label), ""); return FILE_CONT; } @@ -127,12 +128,12 @@ file_progress_show_source (FileOpContext *ctx, char *path) } path_width = gdk_string_width (ui->op_source_label->style->font, path); if (from_width + path_width < GDIALOG_PROGRESS_WIDTH) - gtk_label_set (GTK_LABEL (ui->op_source_label), path); + gtk_label_set_text (GTK_LABEL (ui->op_source_label), path); else { path_copy = trim_file_name (ui, path, GDIALOG_PROGRESS_WIDTH - from_width, path_width); - gtk_label_set (GTK_LABEL (ui->op_source_label), path_copy); + gtk_label_set_text (GTK_LABEL (ui->op_source_label), path_copy); g_free (path_copy); } @@ -158,7 +159,7 @@ file_progress_show_target (FileOpContext *ctx, char *path) return FILE_ABORT; if (path == NULL){ - gtk_label_set (GTK_LABEL (ui->op_target_label), ""); + gtk_label_set_text (GTK_LABEL (ui->op_target_label), ""); return FILE_CONT; } @@ -167,10 +168,10 @@ file_progress_show_target (FileOpContext *ctx, char *path) _(GDIALOG_TO_STRING)); path_width = gdk_string_width (ui->op_target_label->style->font, path); if (to_width + path_width < GDIALOG_PROGRESS_WIDTH) - gtk_label_set (GTK_LABEL (ui->op_target_label), path); + gtk_label_set_text (GTK_LABEL (ui->op_target_label), path); else { path_copy = trim_file_name (ui, path, GDIALOG_PROGRESS_WIDTH - to_width, path_width); - gtk_label_set (GTK_LABEL (ui->op_target_label), path_copy); + gtk_label_set_text (GTK_LABEL (ui->op_target_label), path_copy); g_free (path_copy); } @@ -180,7 +181,10 @@ file_progress_show_target (FileOpContext *ctx, char *path) FileProgressStatus file_progress_show_deleting (FileOpContext *ctx, char *path) { + static gint deleting_width = 0; FileOpContextUI *ui; + gint path_width; + gchar *path_copy = NULL; g_return_val_if_fail (ctx != NULL, FILE_CONT); g_return_val_if_fail (ctx->ui != NULL, FILE_CONT); @@ -190,8 +194,25 @@ file_progress_show_deleting (FileOpContext *ctx, char *path) if (ui->aborting) return FILE_ABORT; - /* FIXME */ - g_warning ("memo: file_progress_show_deleting!\npath\t%s\n", path); + if (path == NULL){ + gtk_label_set_text (GTK_LABEL (ui->op_source_label), ""); + return FILE_CONT; + } + + if (!deleting_width){ + deleting_width = gdk_string_width (ui->op_source_label->style->font, + _(GDIALOG_DELETING_STRING)); + } + path_width = gdk_string_width (ui->op_source_label->style->font, path); + if (deleting_width + path_width < GDIALOG_PROGRESS_WIDTH) + gtk_label_set_text (GTK_LABEL (ui->op_source_label), path); + else { + path_copy = trim_file_name (ui, path, GDIALOG_PROGRESS_WIDTH - deleting_width, + path_width); + + gtk_label_set_text (GTK_LABEL (ui->op_source_label), path_copy); + g_free (path_copy); + } return FILE_CONT; } @@ -210,7 +231,7 @@ file_progress_show (FileOpContext *ctx, long done, long total) return FILE_ABORT; snprintf (count, 9, "%d%%", (gint)(100.0 *(gfloat)done/(gfloat)total)); - gtk_label_set (GTK_LABEL (ui->file_label), count); + gtk_label_set_text (GTK_LABEL (ui->file_label), count); while (gtk_events_pending ()) gtk_main_iteration (); return FILE_CONT; @@ -231,7 +252,7 @@ file_progress_show_count (FileOpContext *ctx, long done, long total) return FILE_ABORT; snprintf (count, 13, "%d/%d", done, total); - gtk_label_set (GTK_LABEL (ui->count_label), count); + gtk_label_set_text (GTK_LABEL (ui->count_label), count); while (gtk_events_pending ()) gtk_main_iteration (); return FILE_CONT; @@ -717,35 +738,47 @@ file_op_context_create_ui (FileOpContext *ctx, FileOperation op, int with_eta) break; case OP_DELETE: ui->op_win = gnome_dialog_new ("Delete Progress", GNOME_STOCK_BUTTON_CANCEL, NULL); - gtk_widget_show_all (GNOME_DIALOG (ui->op_win)->vbox); - gtk_widget_show_now (ui->op_win); - return; + break; } gnome_dialog_button_connect (GNOME_DIALOG (ui->op_win), 0, GTK_SIGNAL_FUNC (cancel_cb), ui); - alignment = gtk_alignment_new (0.0, 0.5, 0, 0); - hbox = gtk_hbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (alignment), hbox); - gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(GDIALOG_FROM_STRING)), FALSE, FALSE, 0); - ui->op_source_label = gtk_label_new (""); + if (op != OP_DELETE) { + alignment = gtk_alignment_new (0.0, 0.5, 0, 0); + hbox = gtk_hbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (alignment), hbox); + gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(GDIALOG_FROM_STRING)), FALSE, FALSE, 0); + ui->op_source_label = gtk_label_new (""); - 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_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), - alignment, 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_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), + alignment, FALSE, FALSE, 0); - alignment = gtk_alignment_new (0.0, 0.5, 0, 0); - hbox = gtk_hbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (alignment), hbox); - gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(GDIALOG_TO_STRING)), FALSE, FALSE, 0); - 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 (GNOME_DIALOG (ui->op_win)->vbox), - alignment, FALSE, FALSE, 0); + alignment = gtk_alignment_new (0.0, 0.5, 0, 0); + hbox = gtk_hbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (alignment), hbox); + gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(GDIALOG_TO_STRING)), FALSE, FALSE, 0); + 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 (GNOME_DIALOG (ui->op_win)->vbox), + alignment, FALSE, FALSE, 0); + } else { + alignment = gtk_alignment_new (0.0, 0.5, 0, 0); + hbox = gtk_hbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (alignment), hbox); + gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(GDIALOG_DELETING_STRING)), FALSE, FALSE, 0); + ui->op_source_label = gtk_label_new (""); + + 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_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), + alignment, FALSE, FALSE, 0); + } alignment = gtk_alignment_new (0.0, 0.5, 0, 0); hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_("File ")), FALSE, FALSE, 0); @@ -756,7 +789,6 @@ file_op_context_create_ui (FileOpContext *ctx, FileOperation op, int with_eta) ui->file_label = gtk_label_new (""); gtk_box_pack_start (GTK_BOX (hbox), ui->file_label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_(" Done.")), FALSE, FALSE, 0); - gtk_container_add (GTK_CONTAINER (alignment), hbox); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (ui->op_win)->vbox), diff --git a/gnome/gprefs.c b/gnome/gprefs.c index 3e7bc7c12..846655773 100644 --- a/gnome/gprefs.c +++ b/gnome/gprefs.c @@ -442,7 +442,6 @@ create_prop_box (PrefsDlg *dlg) gtk_signal_connect (GTK_OBJECT (dlg->prop_box), "apply", GTK_SIGNAL_FUNC (apply_callback), dlg); } - void gnome_configure_box (GtkWidget *widget, WPanel *panel) { @@ -450,7 +449,7 @@ gnome_configure_box (GtkWidget *widget, WPanel *panel) dlg.panel = panel; dlg.prefs_pages = prefs_pages; - + create_prop_box (&dlg); gtk_widget_show (dlg.prop_box); diff --git a/gnome/gscreen.c b/gnome/gscreen.c index e12df7ac3..c65cb231d 100644 --- a/gnome/gscreen.c +++ b/gnome/gscreen.c @@ -43,6 +43,7 @@ int tree_panel_visible = -1; /* The pixmaps */ #include "directory.xpm" +#include "dir-close.xpm" #include "link.xpm" #include "dev.xpm" #include "listing-list.xpm" @@ -604,7 +605,7 @@ panel_create_pixmaps (void) { pixmaps_ready = TRUE; - create_pixmap (directory_xpm, &icon_directory_pixmap, &icon_directory_mask); + create_pixmap (DIRECTORY_CLOSE_XPM, &icon_directory_pixmap, &icon_directory_mask); create_pixmap (link_xpm, &icon_link_pixmap, &icon_link_mask); create_pixmap (dev_xpm, &icon_dev_pixmap, &icon_dev_mask); } @@ -2170,7 +2171,7 @@ static GnomeUIInfo viewbar[] = { GNOME_APP_PIXMAP_DATA, listing_brief_list_xpm, 0, (GdkModifierType) 0, NULL }, { GNOME_APP_UI_ITEM, N_("Detailed"), N_("Switch view to show detailed file statistics"), do_switch_to_full_listing, NULL, NULL, \ GNOME_APP_PIXMAP_DATA, listing_list_xpm, 0, (GdkModifierType) 0, NULL }, - { GNOME_APP_UI_ITEM, N_("Custom"), N_("Switch view to show custom determined statistics"), do_switch_to_custom_listing, NULL, NULL, \ + { GNOME_APP_UI_ITEM, N_("Custom"), N_("Switch view to show custom determined statistics. You can set this in the "), do_switch_to_custom_listing, NULL, NULL, \ GNOME_APP_PIXMAP_DATA, listing_custom_xpm, 0, (GdkModifierType) 0, NULL }, GNOMEUIINFO_END }; @@ -2218,7 +2219,7 @@ void x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel) { GtkWidget *status_line, *filter, *vbox, *ministatus_box; - GtkWidget *cwd, *back_p, *fwd_p, *up_p; + GtkWidget *cwd; GtkWidget *hbox, *evbox, *dock, *box; GnomeUIBuilderData uibdata; @@ -2316,6 +2317,13 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel) panel->up_b = toolbar[1].widget; panel->fwd_b = toolbar[2].widget; panel_update_marks (panel); + if (panel->list_type == list_brief) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (viewbar[1].widget), TRUE); + else if (panel->list_type == list_full) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (viewbar[2].widget), TRUE); + else if (panel->list_type == list_user) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (viewbar[3].widget), TRUE); + /* * Here we make the view buttons. */ diff --git a/gnome/gtkdtree.h b/gnome/gtkdtree.h index 34ccb0049..c8a9fc47c 100644 --- a/gnome/gtkdtree.h +++ b/gnome/gtkdtree.h @@ -32,6 +32,7 @@ typedef struct { GdkBitmap *bitmap_close; int internal; + int *show_dot_files; } GtkDTree; typedef struct {