mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
1999-01-02 Jonathan Blandford <jrb@redhat.com>
* gcmd.c (gnome_sort_cmd): pretified (gnome_select_all_cmd): New command -- selects all files (in theory). * glayout.c: rearrange the edit menu some. * gscreen.c (x_create_panel): new icon view icons -- brief and custom.
This commit is contained in:
parent
8544e153ba
commit
d6016ea709
@ -1,3 +1,15 @@
|
||||
1999-01-02 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gcmd.c (gnome_sort_cmd): pretified
|
||||
(gnome_select_all_cmd): New command -- selects all files (in
|
||||
theory).
|
||||
|
||||
* glayout.c: rearrange the edit menu some.
|
||||
|
||||
|
||||
* gscreen.c (x_create_panel): new icon view icons -- brief and
|
||||
custom.
|
||||
|
||||
1999-01-01 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gdesktop.c (select_range): Fixed selection of ranges where the
|
||||
|
58
gnome/gcmd.c
58
gnome/gcmd.c
@ -180,6 +180,14 @@ gnome_custom_view_cmd (GtkWidget *widget, WPanel *panel)
|
||||
paint_panel (panel);
|
||||
do_refresh ();
|
||||
}
|
||||
static void
|
||||
sort_callback (GtkWidget *menu_item, GtkWidget *cbox1)
|
||||
{
|
||||
if (gtk_object_get_data (GTK_OBJECT (menu_item), "SORT_ORDER_CODE") == SORT_NAME)
|
||||
gtk_widget_set_sensitive (cbox1, TRUE);
|
||||
else
|
||||
gtk_widget_set_sensitive (cbox1, FALSE);
|
||||
}
|
||||
void
|
||||
gnome_sort_cmd (GtkWidget *widget, WPanel *panel)
|
||||
{
|
||||
@ -193,6 +201,8 @@ gnome_sort_cmd (GtkWidget *widget, WPanel *panel)
|
||||
|
||||
sort_box = gnome_dialog_new ("Sort By", GNOME_STOCK_BUTTON_OK,
|
||||
GNOME_STOCK_BUTTON_CANCEL, NULL);
|
||||
/* we define this up here so we can pass it in to our callback */
|
||||
cbox1 = gtk_check_button_new_with_label (N_("Ignore case sensitivity."));
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (sort_box)->vbox), hbox, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new ("Sort files by "), FALSE, FALSE, 0);
|
||||
@ -204,44 +214,55 @@ gnome_sort_cmd (GtkWidget *widget, WPanel *panel)
|
||||
/* FIXME: we want to set the option menu to be the correct ordering. */
|
||||
gtk_menu_append (GTK_MENU (menu), menu_item);
|
||||
gtk_object_set_data (GTK_OBJECT (menu_item), "SORT_ORDER_CODE", (gpointer) SORT_NAME);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
|
||||
GTK_SIGNAL_FUNC (sort_callback), cbox1);
|
||||
|
||||
menu_item = gtk_menu_item_new_with_label ( _("File Type"));
|
||||
gtk_menu_append (GTK_MENU (menu), menu_item);
|
||||
gtk_object_set_data (GTK_OBJECT (menu_item), "SORT_ORDER_CODE", (gpointer) SORT_EXTENSION);
|
||||
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
|
||||
GTK_SIGNAL_FUNC (sort_callback), cbox1);
|
||||
|
||||
menu_item = gtk_menu_item_new_with_label ( _("Size"));
|
||||
gtk_menu_append (GTK_MENU (menu), menu_item);
|
||||
gtk_object_set_data (GTK_OBJECT (menu_item), "SORT_ORDER_CODE", (gpointer) SORT_SIZE);
|
||||
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
|
||||
GTK_SIGNAL_FUNC (sort_callback), cbox1);
|
||||
|
||||
menu_item = gtk_menu_item_new_with_label ( _("Time Last Accessed"));
|
||||
gtk_menu_append (GTK_MENU (menu), menu_item);
|
||||
gtk_object_set_data (GTK_OBJECT (menu_item), "SORT_ORDER_CODE", (gpointer) SORT_ACCESS);
|
||||
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
|
||||
GTK_SIGNAL_FUNC (sort_callback), cbox1);
|
||||
|
||||
menu_item = gtk_menu_item_new_with_label ( _("Time Last Modified"));
|
||||
gtk_menu_append (GTK_MENU (menu), menu_item);
|
||||
gtk_object_set_data (GTK_OBJECT (menu_item), "SORT_ORDER_CODE", (gpointer) SORT_MODIFY);
|
||||
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
|
||||
GTK_SIGNAL_FUNC (sort_callback), cbox1);
|
||||
|
||||
menu_item = gtk_menu_item_new_with_label ( _("Time Last Changed"));
|
||||
gtk_menu_append (GTK_MENU (menu), menu_item);
|
||||
gtk_object_set_data (GTK_OBJECT (menu_item), "SORT_ORDER_CODE", (gpointer) SORT_CHANGE);
|
||||
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
|
||||
GTK_SIGNAL_FUNC (sort_callback), cbox1);
|
||||
|
||||
gtk_widget_show_all (menu);
|
||||
gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
|
||||
|
||||
|
||||
cbox1 = gtk_check_button_new_with_label (N_("Reverse the order."));
|
||||
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (cbox1), panel->reverse);
|
||||
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (cbox1), panel->case_sensitive);
|
||||
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (sort_box)->vbox),
|
||||
cbox1, FALSE, FALSE, 0);
|
||||
cbox2 = gtk_check_button_new_with_label (N_("Ignore case sensitivity."));
|
||||
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (cbox2), panel->case_sensitive);
|
||||
|
||||
cbox2 = gtk_check_button_new_with_label (N_("Reverse the order."));
|
||||
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (cbox2), panel->reverse);
|
||||
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (sort_box)->vbox),
|
||||
cbox2, FALSE, FALSE, 0);
|
||||
/* off to the races */
|
||||
gtk_widget_show_all (GNOME_DIALOG (sort_box)->vbox);
|
||||
switch (gnome_dialog_run (GNOME_DIALOG (sort_box))) {
|
||||
case 0:
|
||||
g_print ("Ok selected\n");
|
||||
switch( (gint) gtk_object_get_data (GTK_OBJECT
|
||||
(GTK_OPTION_MENU
|
||||
(omenu)->menu_item),
|
||||
@ -265,16 +286,33 @@ gnome_sort_cmd (GtkWidget *widget, WPanel *panel)
|
||||
sfn = sort_size;
|
||||
break;
|
||||
}
|
||||
/* Reverse order */
|
||||
panel->reverse = GTK_TOGGLE_BUTTON (cbox1)->active;
|
||||
/* case sensitive */
|
||||
panel->case_sensitive = GTK_TOGGLE_BUTTON (cbox2)->active;
|
||||
panel->case_sensitive = GTK_TOGGLE_BUTTON (cbox1)->active;
|
||||
/* Reverse order */
|
||||
panel->reverse = GTK_TOGGLE_BUTTON (cbox2)->active;
|
||||
|
||||
panel_set_sort_order (panel, sfn);
|
||||
break;
|
||||
case 1:
|
||||
default:
|
||||
g_print ("Cancel selected\n");
|
||||
break;
|
||||
}
|
||||
gtk_widget_destroy (sort_box);
|
||||
}
|
||||
void
|
||||
gnome_external_panelize (GtkWidget *widget, WPanel *panel)
|
||||
{
|
||||
|
||||
}
|
||||
void
|
||||
gnome_select_all_cmd (GtkWidget *widget, WPanel *panel)
|
||||
{
|
||||
gint i;
|
||||
for (i = 0; i < panel->count; i++){
|
||||
if (!strcmp (panel->dir.list [i].fname, ".."))
|
||||
continue;
|
||||
do_file_mark (panel, i, 1);
|
||||
}
|
||||
paint_panel (panel);
|
||||
do_refresh ();
|
||||
}
|
||||
|
@ -13,4 +13,5 @@ void gnome_partial_view_cmd (GtkWidget *widget, WPanel *panel);
|
||||
void gnome_full_view_cmd (GtkWidget *widget, WPanel *panel);
|
||||
void gnome_custom_view_cmd (GtkWidget *widget, WPanel *panel);
|
||||
void gnome_sort_cmd (GtkWidget *widget, WPanel *panel);
|
||||
void gnome_select_all_cmd (GtkWidget *widget, WPanel *panel);
|
||||
#endif /* __GCMD_H */
|
||||
|
@ -294,8 +294,10 @@ GnomeUIInfo gnome_panel_edit_menu [] = {
|
||||
{ GNOME_APP_UI_ITEM, N_("_Paste"), N_("Pastes files from the cut buffer into the current directory"), NULL, NULL,
|
||||
NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_PASTE },
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
{ GNOME_APP_UI_ITEM, N_("_Select All"), N_("Select all files in the current Panel"), gnome_select_all_cmd },
|
||||
{ GNOME_APP_UI_ITEM, N_("_Select Files..."), N_("Select a group of files"), select_cmd },
|
||||
{ GNOME_APP_UI_ITEM, N_("_Invert Selection"), N_("Reverses the list of tagged files"), reverse_selection_cmd },
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
{ GNOME_APP_UI_ITEM, N_("_Rescan Directory"), N_("Rescan the directory contents"), reread_cmd },
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
{ GNOME_APP_UI_ITEM, N_("Preferences..."), N_("Configure the GNOME Midnight Commander"), configure_box, NULL,
|
||||
|
@ -44,6 +44,9 @@
|
||||
#include "dev.xpm"
|
||||
#include "listing-list.xpm"
|
||||
#include "listing-iconic.xpm"
|
||||
#include "listing-custom.xpm"
|
||||
#include "listing-brief-list.xpm"
|
||||
|
||||
|
||||
/* This is used to initialize our pixmaps */
|
||||
static int pixmaps_ready;
|
||||
@ -1414,9 +1417,9 @@ panel_create_cwd (Dlg_head *h, WPanel *panel, void **entry)
|
||||
|
||||
*entry = in;
|
||||
/* FIXME: for now, we set the usize. Ultimately, toolbar
|
||||
* will let you expand it.
|
||||
* will let you expand it, we hope.
|
||||
*/
|
||||
gtk_widget_set_usize (GTK_WIDGET (in->widget.wdata), 320, -1);
|
||||
gtk_widget_set_usize (GTK_WIDGET (in->widget.wdata), 296, -1);
|
||||
return GTK_WIDGET (in->widget.wdata);
|
||||
}
|
||||
|
||||
@ -2072,15 +2075,35 @@ do_switch_to_iconic (GtkWidget *widget, WPanel *panel)
|
||||
}
|
||||
|
||||
static void
|
||||
do_switch_to_listing (GtkWidget *widget, WPanel *panel)
|
||||
do_switch_to_brief_listing (GtkWidget *widget, WPanel *panel)
|
||||
{
|
||||
if (panel->list_type != list_icons)
|
||||
if (panel->list_type == list_brief)
|
||||
return;
|
||||
panel->list_type = list_brief;
|
||||
set_panel_formats (panel);
|
||||
paint_panel (panel);
|
||||
do_refresh ();
|
||||
}
|
||||
static void
|
||||
do_switch_to_full_listing (GtkWidget *widget, WPanel *panel)
|
||||
{
|
||||
if (panel->list_type == list_full)
|
||||
return;
|
||||
panel->list_type = list_full;
|
||||
set_panel_formats (panel);
|
||||
paint_panel (panel);
|
||||
do_refresh ();
|
||||
}
|
||||
static void
|
||||
do_switch_to_custom_listing (GtkWidget *widget, WPanel *panel)
|
||||
{
|
||||
if (panel->list_type == list_user)
|
||||
return;
|
||||
panel->list_type = list_user;
|
||||
set_panel_formats (panel);
|
||||
paint_panel (panel);
|
||||
do_refresh ();
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
button_switch_to_icon (WPanel *panel)
|
||||
@ -2089,9 +2112,19 @@ button_switch_to_icon (WPanel *panel)
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
button_switch_to_listing (WPanel *panel)
|
||||
button_switch_to_full_listing (WPanel *panel)
|
||||
{
|
||||
return button_switch_to (listing_list_xpm, GTK_SIGNAL_FUNC (do_switch_to_listing), panel);
|
||||
return button_switch_to (listing_list_xpm, GTK_SIGNAL_FUNC (do_switch_to_full_listing), panel);
|
||||
}
|
||||
static GtkWidget *
|
||||
button_switch_to_brief_listing (WPanel *panel)
|
||||
{
|
||||
return button_switch_to (listing_brief_list_xpm, GTK_SIGNAL_FUNC (do_switch_to_brief_listing), panel);
|
||||
}
|
||||
static GtkWidget *
|
||||
button_switch_to_custom_listing (WPanel *panel)
|
||||
{
|
||||
return button_switch_to (listing_custom_xpm, GTK_SIGNAL_FUNC (do_switch_to_custom_listing), panel);
|
||||
}
|
||||
|
||||
void
|
||||
@ -2207,10 +2240,16 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
|
||||
gtk_toolbar_append_space (GTK_TOOLBAR (status_line));
|
||||
gtk_toolbar_append_widget (GTK_TOOLBAR (status_line),
|
||||
button_switch_to_icon (panel),
|
||||
"Switch view to icon view.", NULL);
|
||||
"Icon view.", NULL);
|
||||
gtk_toolbar_append_widget (GTK_TOOLBAR (status_line),
|
||||
button_switch_to_listing (panel),
|
||||
"Switch view to detailed view.", NULL);
|
||||
button_switch_to_brief_listing (panel),
|
||||
"Brief view.", NULL);
|
||||
gtk_toolbar_append_widget (GTK_TOOLBAR (status_line),
|
||||
button_switch_to_full_listing (panel),
|
||||
"Detailed view.", NULL);
|
||||
gtk_toolbar_append_widget (GTK_TOOLBAR (status_line),
|
||||
button_switch_to_custom_listing (panel),
|
||||
"Custom view.", NULL);
|
||||
dock = gnome_dock_item_new ("gmc-toolbar", GNOME_DOCK_ITEM_BEH_EXCLUSIVE | GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL);
|
||||
gtk_container_add (GTK_CONTAINER(dock),status_line);
|
||||
gnome_dock_add_item (GNOME_DOCK(GNOME_APP (panel->xwindow)->dock),
|
||||
|
22
gnome/listing-brief-list.xpm
Normal file
22
gnome/listing-brief-list.xpm
Normal file
@ -0,0 +1,22 @@
|
||||
/* XPM */
|
||||
static char * listing_brief_list_xpm[] = {
|
||||
"19 16 3 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
"+ c #FFFF00",
|
||||
" ",
|
||||
" ... ",
|
||||
" .+... . ",
|
||||
" .+++. . ",
|
||||
" ..... ..... ... ",
|
||||
" ",
|
||||
" ... ",
|
||||
" .+... . ",
|
||||
" .+++. . ",
|
||||
" ..... ..... ... ",
|
||||
" ",
|
||||
" ... ",
|
||||
" .+... . ",
|
||||
" .+++. . ",
|
||||
" ..... ..... ... ",
|
||||
" "};
|
23
gnome/listing-custom.xpm
Normal file
23
gnome/listing-custom.xpm
Normal file
@ -0,0 +1,23 @@
|
||||
/* XPM */
|
||||
static char * listing_custom_xpm[] = {
|
||||
"19 16 4 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
"+ c #FFFF00",
|
||||
"@ c #FFFFFF",
|
||||
" ",
|
||||
" ... ... ",
|
||||
" .+... . .@@@. ",
|
||||
" .+++. ..@@@@@. ",
|
||||
" ..... .@@...@@.. ",
|
||||
" .@@. .@@. ",
|
||||
" ... .. .@@. ",
|
||||
" .+... . .@@. ",
|
||||
" .+++. . .@@. ",
|
||||
" ..... ...@@. ... ",
|
||||
" .. ",
|
||||
" ... .@@. ",
|
||||
" .+... . .@@. ",
|
||||
" .+++. . .. ",
|
||||
" ..... ..... ... ",
|
||||
" "};
|
Loading…
Reference in New Issue
Block a user