From d92f1d19714c1eb122c8c69b4d65eee7b402ee4e Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Thu, 7 Jan 1999 21:40:50 +0000 Subject: [PATCH] 1999-01-07 Jonathan Blandford * gcmd.c (gnome_filter_cmd): Function filled in now. Actually works (amazing!.) Next: put a history on it, and maybe an event box for the label. Also, moved delete file around -- apparently it's proximity to Close was bothering people. --- gnome/ChangeLog | 4 ++++ gnome/gcmd.c | 42 ++++++++++++++++++++++++++++++++++++++++-- gnome/glayout.c | 2 +- gnome/gscreen.c | 2 +- 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 43a6b66b1..f493efbe0 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,5 +1,9 @@ 1999-01-07 Jonathan Blandford + * gcmd.c (gnome_filter_cmd): Function filled in now. Actually + works (amazing!.) Next: put a history on it, and maybe an event + box for the label. + * glayout.c: use the function below. * gcmd.c (gnome_filter_cmd): New function (or a sorry excuse for diff --git a/gnome/gcmd.c b/gnome/gcmd.c index ad5928cf7..8f935ae6e 100644 --- a/gnome/gcmd.c +++ b/gnome/gcmd.c @@ -200,7 +200,7 @@ gnome_sort_cmd (GtkWidget *widget, WPanel *panel) GtkWidget *menu; GtkWidget *menu_item; GtkWidget *cbox1, *cbox2; - sortfn *sfn; + sortfn *sfn = NULL; sort_box = gnome_dialog_new (_("Sort By"), GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL); @@ -546,5 +546,43 @@ gnome_filter_cmd (GtkWidget *widget, WPanel *panel) { GtkWidget *filter_dlg; GtkWidget *entry; + GtkWidget *label; + + filter_dlg = gnome_dialog_new (_("Set Filter"), GNOME_STOCK_BUTTON_OK, + GNOME_STOCK_BUTTON_CANCEL, NULL); + entry = gtk_entry_new (); + if (panel->filter && easy_patterns && !(strcmp (panel->filter, "*"))) + gtk_entry_set_text (GTK_ENTRY (entry), _("Show all files")); + else + gtk_entry_set_text (GTK_ENTRY (entry), panel->filter); + if (easy_patterns) + label = gtk_label_new (_("Enter a filter here for files in the panel view.\n\nFor example:\n*.gif will show just gif images")); + else + label = gtk_label_new (_("Enter a Regular Expression to filter files in the panel view.")); + gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); -} + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (filter_dlg)->vbox), label, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (filter_dlg)->vbox), entry, FALSE, FALSE, 0); + gtk_widget_show_all (GNOME_DIALOG (filter_dlg)->vbox); + switch (gnome_dialog_run (GNOME_DIALOG (filter_dlg))) { + case 0: + gtk_widget_hide (filter_dlg); + if (panel->filter) { + g_free (panel->filter); + panel->filter = NULL; + } + panel->filter = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))); + if (!strcmp ("*", panel->filter)) { + g_free (panel->filter); + panel->filter = NULL; + gtk_label_set_text (GTK_LABEL (panel->status), _("Show all files")); + } else + gtk_label_set_text (GTK_LABEL (panel->status), panel->filter); + reread_cmd (); + x_filter_changed (panel); + break; + } + gtk_widget_destroy (filter_dlg); +} diff --git a/gnome/glayout.c b/gnome/glayout.c index 24cfa895d..49aed2391 100644 --- a/gnome/glayout.c +++ b/gnome/glayout.c @@ -278,8 +278,8 @@ GnomeUIInfo gnome_panel_file_menu [] = { { GNOME_APP_UI_ITEM, N_("_Open"), N_("Open selected files"), NULL, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN }, { GNOME_APP_UI_ITEM, N_("_Copy..."), N_("Copy files"), copy_cmd, NULL}, - { GNOME_APP_UI_ITEM, N_("_Move..."), N_("Rename or move files"), ren_cmd }, { GNOME_APP_UI_ITEM, N_("_Delete..."), N_("Delete files from disk"), delete_cmd }, + { GNOME_APP_UI_ITEM, N_("_Move..."), N_("Rename or move files"), ren_cmd }, { GNOME_APP_UI_SEPARATOR }, { GNOME_APP_UI_ITEM, N_("C_lose"), N_("Close this panel"), gnome_close_panel, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CLOSE }, diff --git a/gnome/gscreen.c b/gnome/gscreen.c index d151df8bd..d62121d82 100644 --- a/gnome/gscreen.c +++ b/gnome/gscreen.c @@ -2267,7 +2267,7 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel) ministatus_box = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME(ministatus_box), GTK_SHADOW_IN); - panel->status = gtk_label_new (_("Show all Files")); + panel->status = gtk_label_new (_("Show all files")); gtk_misc_set_alignment (GTK_MISC (panel->status), 0.0, 0.0); gtk_box_pack_start (GTK_BOX (panel->ministatus), ministatus_box, FALSE, FALSE, 0);