Skip to content

Commit

Permalink
* main.h: Remove all references to icons.
Browse files Browse the repository at this point in the history
* panel.h: Likewise.  Adjust all dependencies.
  • Loading branch information
Pavel Roskin committed Sep 27, 2002
1 parent bd4b187 commit b181f45
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 78 deletions.
3 changes: 3 additions & 0 deletions src/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2002-09-26 Pavel Roskin <[email protected]>

* 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.

Expand Down
10 changes: 6 additions & 4 deletions src/boxes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
}
Expand Down
1 change: 0 additions & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions src/panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 */

Expand Down
76 changes: 11 additions & 65 deletions src/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions src/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ static const struct {
{ "brief", list_brief },
{ "long", list_long },
{ "user", list_user },
{ "icons", list_icons },
{ 0, 0 }
};

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b181f45

Please sign in to comment.