mirror of https://github.com/MidnightCommander/mc
* main.h: Remove all references to icons.
* panel.h: Likewise. Adjust all dependencies.
This commit is contained in:
parent
bd4b18731e
commit
b181f4519f
|
@ -1,5 +1,8 @@
|
|||
2002-09-26 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* main.h: Remove all references to icons.
|
||||
* panel.h: Likewise. Adjust all dependencies.
|
||||
|
||||
* hotlist.c (load_hotlist): Remove compatibility code with
|
||||
hotlist files created by ancient versions of mc.
|
||||
|
||||
|
|
10
src/boxes.c
10
src/boxes.c
|
@ -74,10 +74,12 @@ static char *displays [LIST_TYPES] = {
|
|||
N_("&Full file list"),
|
||||
N_("&Brief file list"),
|
||||
N_("&Long file list"),
|
||||
N_("&User defined:"),
|
||||
N_("&Icon view"),
|
||||
N_("&User defined:")
|
||||
};
|
||||
|
||||
/* Index in displays[] for "user defined" */
|
||||
#define USER_TYPE 3
|
||||
|
||||
static int user_hotkey = 'u';
|
||||
|
||||
static int
|
||||
|
@ -171,7 +173,7 @@ display_init (int radio_sel, char *init_text, int _check_status,
|
|||
button_start = DISPLAY_X - l - 5;
|
||||
|
||||
/* get hotkey of user-defined format string */
|
||||
cp = strchr (displays[LIST_TYPES - 1], '&');
|
||||
cp = strchr (displays[USER_TYPE], '&');
|
||||
if (cp != NULL && *++cp != '\0')
|
||||
user_hotkey = tolower (*cp);
|
||||
|
||||
|
@ -205,7 +207,7 @@ display_init (int radio_sel, char *init_text, int _check_status,
|
|||
add_widget (dd, user);
|
||||
input_set_point (user, 0);
|
||||
|
||||
my_radio = radio_new (3, 5, LIST_TYPES - 1, displays, 1, "radio");
|
||||
my_radio = radio_new (3, 5, LIST_TYPES, displays, 1, "radio");
|
||||
my_radio->sel = my_radio->pos = current_mode;
|
||||
add_widget (dd, my_radio);
|
||||
}
|
||||
|
|
|
@ -70,7 +70,6 @@ extern int confirm_delete;
|
|||
extern int confirm_execute;
|
||||
extern int confirm_exit;
|
||||
extern int confirm_overwrite;
|
||||
extern int iconify_on_exec;
|
||||
extern int force_colors;
|
||||
extern int boot_current_is_left;
|
||||
extern int acs_vline;
|
||||
|
|
|
@ -7,14 +7,13 @@
|
|||
#include "util.h"
|
||||
#include "widget.h" /* for history loading and saving */
|
||||
|
||||
#define LIST_TYPES 5
|
||||
#define LIST_TYPES 4
|
||||
|
||||
enum list_types {
|
||||
list_full, /* Name, size, perm/date */
|
||||
list_brief, /* Name */
|
||||
list_long, /* Like ls -l */
|
||||
list_user, /* User defined */
|
||||
list_icons /* iconic display */
|
||||
list_user /* User defined */
|
||||
};
|
||||
|
||||
enum view_modes {
|
||||
|
@ -92,7 +91,6 @@ typedef struct {
|
|||
int split; /* Split panel to allow two columns */
|
||||
int is_panelized; /* Flag: special filelisting, can't reload */
|
||||
int frame_size; /* half or full frame */
|
||||
int icons_per_row; /* Icon view; how many icons displayed per row */
|
||||
sortfn *sort_type; /* Sort type */
|
||||
char *filter; /* File name filter */
|
||||
|
||||
|
|
76
src/screen.c
76
src/screen.c
|
@ -92,10 +92,6 @@ set_colors (WPanel *panel)
|
|||
attrset (NORMAL_COLOR);
|
||||
}
|
||||
|
||||
#ifndef ICONS_PER_ROW
|
||||
# define ICONS_PER_ROW(x) 1
|
||||
#endif
|
||||
|
||||
/* Delete format string, it is a linked list */
|
||||
static void
|
||||
delete_format (format_e *format)
|
||||
|
@ -1523,7 +1519,7 @@ unselect_item (WPanel *panel)
|
|||
}
|
||||
|
||||
static void
|
||||
do_move_down (WPanel *panel)
|
||||
move_down (WPanel *panel)
|
||||
{
|
||||
if (panel->selected+1 == panel->count)
|
||||
return;
|
||||
|
@ -1544,7 +1540,7 @@ do_move_down (WPanel *panel)
|
|||
}
|
||||
|
||||
static void
|
||||
do_move_up (WPanel *panel)
|
||||
move_up (WPanel *panel)
|
||||
{
|
||||
if (panel->selected == 0)
|
||||
return;
|
||||
|
@ -1560,46 +1556,6 @@ do_move_up (WPanel *panel)
|
|||
select_item (panel);
|
||||
}
|
||||
|
||||
static void
|
||||
move_rel (WPanel *panel, int rel)
|
||||
{
|
||||
unselect_item (panel);
|
||||
|
||||
if (rel < 0){
|
||||
if (panel->selected + rel < 0)
|
||||
panel->selected = 0;
|
||||
else
|
||||
panel->selected = panel->selected + rel;
|
||||
} else {
|
||||
if (panel->selected + rel >= panel->count)
|
||||
panel->selected = panel->count - 1;
|
||||
else
|
||||
panel->selected = panel->selected + rel;
|
||||
}
|
||||
select_item (panel);
|
||||
}
|
||||
|
||||
/* */
|
||||
/* Panel key binded commands */
|
||||
/* */
|
||||
static void
|
||||
move_up (WPanel *panel)
|
||||
{
|
||||
if (panel->list_type == list_icons){
|
||||
move_rel (panel, -ICONS_PER_ROW (panel));
|
||||
} else
|
||||
do_move_up (panel);
|
||||
}
|
||||
|
||||
static void
|
||||
move_down (WPanel *panel)
|
||||
{
|
||||
if (panel->list_type == list_icons){
|
||||
move_rel (panel, ICONS_PER_ROW (panel));
|
||||
} else
|
||||
do_move_down (panel);
|
||||
}
|
||||
|
||||
/* Changes the selection by lines (may be negative) */
|
||||
static void
|
||||
move_selection (WPanel *panel, int lines)
|
||||
|
@ -1640,31 +1596,21 @@ move_selection (WPanel *panel, int lines)
|
|||
static int
|
||||
move_left (WPanel *panel, int c_code)
|
||||
{
|
||||
if (panel->list_type == list_icons){
|
||||
do_move_up (panel);
|
||||
if (panel->split) {
|
||||
move_selection (panel, -llines (panel));
|
||||
return 1;
|
||||
} else {
|
||||
if (panel->split){
|
||||
move_selection (panel, -llines (panel));
|
||||
return 1;
|
||||
} else
|
||||
return maybe_cd (c_code, 0);
|
||||
}
|
||||
} else
|
||||
return maybe_cd (c_code, 0);
|
||||
}
|
||||
|
||||
static int
|
||||
move_right (WPanel *panel, int c_code)
|
||||
{
|
||||
if (panel->list_type == list_icons){
|
||||
do_move_down (panel);
|
||||
if (panel->split) {
|
||||
move_selection (panel, llines (panel));
|
||||
return 1;
|
||||
} else {
|
||||
if (panel->split){
|
||||
move_selection (panel, llines (panel));
|
||||
return 1;
|
||||
} else
|
||||
return maybe_cd (c_code, 1);
|
||||
}
|
||||
} else
|
||||
return maybe_cd (c_code, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1941,7 +1887,7 @@ start_search (WPanel *panel)
|
|||
if (panel->selected+1 == panel->count)
|
||||
panel->selected = 0;
|
||||
else
|
||||
do_move_down (panel);
|
||||
move_down (panel);
|
||||
do_search (panel, 0);
|
||||
} else {
|
||||
panel->searching = 1;
|
||||
|
|
|
@ -100,7 +100,6 @@ static const struct {
|
|||
{ "brief", list_brief },
|
||||
{ "long", list_long },
|
||||
{ "user", list_user },
|
||||
{ "icons", list_icons },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
@ -395,9 +394,6 @@ panel_load_setup (WPanel *panel, char *section)
|
|||
break;
|
||||
}
|
||||
|
||||
if (panel->list_type == list_icons)
|
||||
panel->list_type = list_full;
|
||||
|
||||
/* User formats */
|
||||
if (panel->user_format){
|
||||
g_free (panel->user_format);
|
||||
|
|
Loading…
Reference in New Issue