mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
get_other_type works; sort order box works; rescan works; filter
is enabled; virtual fs setup dialog box is up; save setup; mkdir link command is hossed. It is more than hossed for some stoopid reason, the thing is selecting the first file in the panel just after I talked to it. No matter how argumentative I get with the code. Have to fix next. Commit the bits I forgot to commit yesterday. -miguel.
This commit is contained in:
parent
df4a6d6a3e
commit
d934dc4afe
@ -1,3 +1,19 @@
|
||||
Tue Mar 10 23:46:29 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||
|
||||
* glayout.c
|
||||
|
||||
* gscreen.c (x_adjust_top_file): We no longer adjust the top
|
||||
displayed filename.
|
||||
|
||||
(panel_build_selected_file_list): Fix for the transfered data.
|
||||
|
||||
(panel_drop_data_available): Now drop support uses the new
|
||||
coords.x and coords.y fields from the DropDataAvailableEvent to
|
||||
find out which directory receives the drop.
|
||||
|
||||
* glayout.c: added: configure_box, configure_vfs
|
||||
(get_other_type): Return the correct value.
|
||||
|
||||
1998-03-10 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gscreen.c (panel_file_list_size_allocate_hook): Now we
|
||||
@ -18,17 +34,6 @@
|
||||
|
||||
* gkey.c (find_select_closure_callback): Fix = -> == typo.
|
||||
|
||||
Tue Mar 10 14:01:47 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||
|
||||
* gscreen.c (x_adjust_top_file): We no longer adjust the top
|
||||
displayed filename.
|
||||
|
||||
(panel_build_selected_file_list): Fix for the transfered data.
|
||||
|
||||
(panel_drop_data_available): Now drop support uses the new
|
||||
coords.x and coords.y fields from the DropDataAvailableEvent to
|
||||
find out which directory receives the drop.
|
||||
|
||||
Tue Mar 10 00:10:32 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||
|
||||
* gscreen.c (panel_drop_data_available): Now drop support uses the
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <config.h>
|
||||
#include "x.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
@ -6,6 +7,7 @@
|
||||
#include "gscreen.h"
|
||||
#include "main.h"
|
||||
#include "cmd.h"
|
||||
#include "boxes.h"
|
||||
|
||||
#define UNDEFINED_INDEX -1
|
||||
|
||||
@ -123,8 +125,7 @@ get_current_type (void)
|
||||
int
|
||||
get_other_type (void)
|
||||
{
|
||||
/* FIXME: This is returning CURRENT panel */
|
||||
return view_nothing;
|
||||
return other_panel_ptr ? view_listing : view_nothing;
|
||||
}
|
||||
|
||||
int
|
||||
@ -165,7 +166,7 @@ gnome_listing_cmd (GtkWidget *widget, WPanel *panel)
|
||||
int view_type, use_msformat;
|
||||
char *user, *status;
|
||||
|
||||
view_type = display_box (panel, &user, &status, &use_msformat, index);
|
||||
view_type = display_box (panel, &user, &status, &use_msformat, get_current_index ());
|
||||
|
||||
if (view_type == -1)
|
||||
return;
|
||||
@ -179,15 +180,19 @@ GnomeUIInfo gnome_panel_filemenu [] = {
|
||||
{ GNOME_APP_UI_ITEM, "Network link...", NULL, netlink_cmd },
|
||||
{ GNOME_APP_UI_ITEM, "FTP link...", NULL, ftplink_cmd },
|
||||
{ GNOME_APP_UI_ITEM, "Display mode...", NULL, gnome_listing_cmd },
|
||||
{ GNOME_APP_UI_ITEM, "Sort order...", NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Filter...", NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Rescan", NULL, NULL },
|
||||
{ GNOME_APP_UI_ITEM, "Sort order...", NULL, sort_cmd },
|
||||
{ GNOME_APP_UI_ITEM, "Filter...", NULL, filter_cmd },
|
||||
{ GNOME_APP_UI_ITEM, "Rescan", NULL, reread_cmd },
|
||||
{ GNOME_APP_UI_ITEM, "Find", NULL, find_cmd },
|
||||
{ GNOME_APP_UI_ITEM, "Hotlist", NULL, quick_chdir_cmd },
|
||||
#ifdef USE_VFS
|
||||
{ GNOME_APP_UI_ITEM, "Active VFS", NULL, reselect_vfs },
|
||||
#endif
|
||||
{ GNOME_APP_UI_ITEM, "Confirmation", NULL, confirm_box },
|
||||
{ GNOME_APP_UI_ITEM, "Options", NULL, configure_box },
|
||||
{ GNOME_APP_UI_ITEM, "Virtual FS", NULL, configure_vfs },
|
||||
{ GNOME_APP_UI_ITEM, "Save setup", NULL, save_setup_cmd },
|
||||
{ GNOME_APP_UI_ITEM, "Mkdir", NULL, mkdir_cmd },
|
||||
{ GNOME_APP_UI_ENDOFINFO, 0, 0 }
|
||||
};
|
||||
|
||||
|
@ -331,6 +331,7 @@ static struct {
|
||||
{ "Copy...", (context_menu_callback) copy_cmd },
|
||||
{ "Rename/move..", (context_menu_callback) ren_cmd },
|
||||
{ "Delete...", (context_menu_callback) delete_cmd },
|
||||
{ "Link...", (context_menu_callback) link_cmd },
|
||||
{ NULL, NULL },
|
||||
};
|
||||
|
||||
@ -448,6 +449,7 @@ internal_select_item (GtkWidget *file_list, WPanel *panel, int row)
|
||||
{
|
||||
unselect_item (panel);
|
||||
panel->selected = row;
|
||||
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (file_list), panel);
|
||||
printf ("Selecttionando\n");
|
||||
select_item (panel);
|
||||
@ -786,7 +788,6 @@ panel_create_file_list (WPanel *panel)
|
||||
gtk_signal_connect_after (GTK_OBJECT (file_list), "size_allocate",
|
||||
GTK_SIGNAL_FUNC (panel_file_list_size_allocate_hook),
|
||||
panel);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (file_list), "realize",
|
||||
GTK_SIGNAL_FUNC (panel_realized),
|
||||
panel);
|
||||
|
104
gnome/layout
104
gnome/layout
@ -487,3 +487,107 @@ flags=
|
||||
[mfind-Widget-button-chdir]
|
||||
geometry=0,4,1,1
|
||||
flags=
|
||||
|
||||
[quick_confirm-Widget-c]
|
||||
geometry=3,2,1,1
|
||||
flags=ew
|
||||
|
||||
[quick_confirm-Widget-o]
|
||||
geometry=3,1,1,1
|
||||
flags=ew
|
||||
|
||||
[quick_confirm-Widget-x]
|
||||
geometry=1,3,1,1
|
||||
flags=w
|
||||
|
||||
[quick_confirm-Widget-de]
|
||||
geometry=1,1,1,1
|
||||
flags=w
|
||||
|
||||
[quick_confirm-Widget-ov]
|
||||
geometry=1,2,1,1
|
||||
flags=w
|
||||
|
||||
[quick_confirm-Widget-e]
|
||||
geometry=1,4,1,1
|
||||
flags=w
|
||||
|
||||
[quick_vfs-Widget-label-vfs]
|
||||
geometry=1,1,1,1
|
||||
flags=w
|
||||
|
||||
[quick_vfs-Widget-input-timo-vfs]
|
||||
geometry=2,1,1,1
|
||||
flags=
|
||||
|
||||
[quick_vfs-Widget-label-pass]
|
||||
geometry=1,4,1,1
|
||||
flags=
|
||||
|
||||
[quick_vfs-Widget-button-ok]
|
||||
geometry=5,1,1,1
|
||||
flags=ew
|
||||
|
||||
[quick_vfs-Widget-input-limit]
|
||||
geometry=2,3,1,1
|
||||
flags=s
|
||||
|
||||
[quick_vfs-Widget-input-ftp-proxy]
|
||||
geometry=2,6,1,1
|
||||
flags=
|
||||
|
||||
[quick_vfs-Widget-label-tar]
|
||||
geometry=1,2,1,1
|
||||
flags=w
|
||||
|
||||
[quick_vfs-Widget-label-cache]
|
||||
geometry=1,5,1,1
|
||||
flags=w
|
||||
|
||||
[quick_vfs-Widget-input-timeout]
|
||||
geometry=2,5,1,1
|
||||
flags=
|
||||
|
||||
[quick_vfs-Widget-check-ftp-proxy]
|
||||
geometry=1,6,1,1
|
||||
flags=
|
||||
|
||||
[quick_vfs-Widget-input-passwd]
|
||||
geometry=2,4,1,1
|
||||
flags=
|
||||
|
||||
[quick_vfs-Widget-label-sec]
|
||||
geometry=3,5,1,1
|
||||
flags=
|
||||
|
||||
[quick_vfs-Widget-button-cancel]
|
||||
geometry=5,2,1,1
|
||||
flags=
|
||||
|
||||
[quick_vfs-Widget-label-sec2]
|
||||
geometry=3,1,1,1
|
||||
flags=
|
||||
|
||||
[quick_vfs-Widget-radio]
|
||||
geometry=1,3,1,1
|
||||
flags=e
|
||||
|
||||
[sort-Widget-case-check]
|
||||
geometry=3,2,1,1
|
||||
flags=w
|
||||
|
||||
[sort-Widget-ok-button]
|
||||
geometry=4,1,1,1
|
||||
flags=ew
|
||||
|
||||
[sort-Widget-reverse-check]
|
||||
geometry=3,1,1,1
|
||||
flags=w
|
||||
|
||||
[sort-Widget-cancel-button]
|
||||
geometry=4,2,1,1
|
||||
flags=
|
||||
|
||||
[sort-Widget-radio-1]
|
||||
geometry=1,1,1,6
|
||||
flags=n
|
||||
|
@ -1,3 +1,14 @@
|
||||
Tue Mar 10 20:41:45 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||
|
||||
* cmd.c (unselect_cmd_panel, select_cmd_panel): To avoid races on
|
||||
the X11 version, these routines now take a panel argument at
|
||||
invocation time.
|
||||
|
||||
* widget.c (radio_callback): Call x_radio_focus for FOCUS/UNFOCUS
|
||||
events.
|
||||
(button_callback): Fallback to default_msg on WIDGET_FOCUS
|
||||
messages.
|
||||
|
||||
1998-03-10 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* xslint.c (getch): Added missing "return".
|
||||
|
38
src/cmd.c
38
src/cmd.c
@ -475,7 +475,7 @@ void reverse_selection_cmd (void)
|
||||
paint_panel (cpanel);
|
||||
}
|
||||
|
||||
void select_cmd (void)
|
||||
void select_cmd_panel (WPanel *panel)
|
||||
{
|
||||
char *reg_exp, *reg_exp_t;
|
||||
int i;
|
||||
@ -498,31 +498,36 @@ void select_cmd (void)
|
||||
reg_exp_t [strlen(reg_exp_t) - 1] = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < cpanel->count; i++){
|
||||
if (!strcmp( cpanel->dir.list [i].fname, ".."))
|
||||
for (i = 0; i < panel->count; i++){
|
||||
if (!strcmp (panel->dir.list [i].fname, ".."))
|
||||
continue;
|
||||
if (S_ISDIR (cpanel->dir.list [i].buf.st_mode)){
|
||||
if (S_ISDIR (panel->dir.list [i].buf.st_mode)){
|
||||
if (!dirflag)
|
||||
continue;
|
||||
} else {
|
||||
if (dirflag)
|
||||
continue;
|
||||
}
|
||||
c = regexp_match (reg_exp_t, cpanel->dir.list [i].fname, match_file);
|
||||
c = regexp_match (reg_exp_t, panel->dir.list [i].fname, match_file);
|
||||
if (c == -1){
|
||||
message (1, " Error ", " Malformed regular expression ");
|
||||
free (reg_exp);
|
||||
return;
|
||||
}
|
||||
if (c){
|
||||
do_file_mark (cpanel, i, 1);
|
||||
do_file_mark (panel, i, 1);
|
||||
}
|
||||
}
|
||||
paint_panel (cpanel);
|
||||
paint_panel (panel);
|
||||
free (reg_exp);
|
||||
}
|
||||
|
||||
void unselect_cmd (void)
|
||||
void select_cmd (void)
|
||||
{
|
||||
select_cmd_panel (cpanel);
|
||||
}
|
||||
|
||||
void unselect_cmd_panel (WPanel *panel)
|
||||
{
|
||||
char *reg_exp, *reg_exp_t;
|
||||
int i;
|
||||
@ -544,30 +549,35 @@ void unselect_cmd (void)
|
||||
dirflag = 1;
|
||||
reg_exp_t [strlen(reg_exp_t) - 1] = 0;
|
||||
}
|
||||
for (i = 0; i < cpanel->count; i++){
|
||||
if (!strcmp( cpanel->dir.list [i].fname, ".."))
|
||||
for (i = 0; i < panel->count; i++){
|
||||
if (!strcmp (panel->dir.list [i].fname, ".."))
|
||||
continue;
|
||||
if (S_ISDIR (cpanel->dir.list [i].buf.st_mode)){
|
||||
if (S_ISDIR (panel->dir.list [i].buf.st_mode)){
|
||||
if (!dirflag)
|
||||
continue;
|
||||
} else {
|
||||
if (dirflag)
|
||||
continue;
|
||||
}
|
||||
c = regexp_match (reg_exp_t, cpanel->dir.list [i].fname, match_file);
|
||||
c = regexp_match (reg_exp_t, panel->dir.list [i].fname, match_file);
|
||||
if (c == -1){
|
||||
message (1, " Error ", " Malformed regular expression ");
|
||||
free (reg_exp);
|
||||
return;
|
||||
}
|
||||
if (c){
|
||||
do_file_mark (cpanel, i, 0);
|
||||
do_file_mark (panel, i, 0);
|
||||
}
|
||||
}
|
||||
paint_panel (cpanel);
|
||||
paint_panel (panel);
|
||||
free (reg_exp);
|
||||
}
|
||||
|
||||
void unselect_cmd (void)
|
||||
{
|
||||
unselect_cmd_panel (cpanel);
|
||||
}
|
||||
|
||||
/* Check if the file exists */
|
||||
/* If not copy the default */
|
||||
static int check_for_default(char *default_file, char *file)
|
||||
|
@ -57,6 +57,7 @@ void source_routing (void);
|
||||
void info_cmd (void);
|
||||
void tree_cmd (void);
|
||||
void listing_cmd (void);
|
||||
void sort_cmd (void);
|
||||
void switch_to_listing (int panel_index);
|
||||
void quick_cmd_no_menu (void);
|
||||
void info_cmd_no_menu (void);
|
||||
|
@ -631,8 +631,11 @@ void dlg_key_event (Dlg_head *h, int d_key)
|
||||
int handled;
|
||||
|
||||
/* TAB used to cycle */
|
||||
if (!h->raw && d_key == '\t')
|
||||
dlg_one_down (h);
|
||||
if (!h->raw && (d_key == '\t' || d_key == KEY_BACKTAB))
|
||||
if (d_key == '\t')
|
||||
dlg_one_down (h);
|
||||
else
|
||||
dlg_one_up (h);
|
||||
else {
|
||||
|
||||
/* first can dlg_callback handle the key */
|
||||
|
@ -1068,7 +1068,7 @@ set_sort_to (WPanel *p, sortfn *sort_order)
|
||||
do_re_sort (p);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
sort_cmd (void)
|
||||
{
|
||||
WPanel *p;
|
||||
|
@ -11,7 +11,7 @@ enum {
|
||||
KEY_BACKSPACE = 400,
|
||||
KEY_END, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT,
|
||||
KEY_HOME, KEY_A1, KEY_C1, KEY_NPAGE, KEY_PPAGE, KEY_IC,
|
||||
KEY_ENTER, KEY_DC, KEY_SCANCEL
|
||||
KEY_ENTER, KEY_DC, KEY_SCANCEL, KEY_BACKTAB
|
||||
};
|
||||
|
||||
#define KEY_F(x) 1000+x
|
||||
|
25
src/screen.c
25
src/screen.c
@ -112,6 +112,18 @@ int panel_event (Gpm_Event *event, WPanel *panel);
|
||||
#define llines(p) (p->widget.lines)
|
||||
#endif
|
||||
|
||||
#ifdef PORT_NOT_FOCUS_SELECT_ITEM
|
||||
# define focus_select_item(x)
|
||||
#else
|
||||
# define focus_select_item(x) select_item(x)
|
||||
#endif
|
||||
|
||||
#ifdef PORT_NOT_UNFOCUS_UNSELECT_ITEM
|
||||
# define unfocus_unselect_item(x)
|
||||
#else
|
||||
# define unfocus_unselect_item(x) unselect_item(x)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_X
|
||||
# define set_colors(x)
|
||||
#else
|
||||
@ -2042,6 +2054,15 @@ static key_map panel_keymap [] = {
|
||||
{ XCTRL('t'), mark_file },
|
||||
{ ALT('o'), chdir_other_panel },
|
||||
{ ALT('l'), chdir_to_readlink },
|
||||
|
||||
#ifdef HAVE_GNOME
|
||||
{ '+', select_cmd },
|
||||
{ '\\', unselect_cmd },
|
||||
{ '-', unselect_cmd },
|
||||
{ XCTRL('r'), reread_cmd },
|
||||
{ ALT('o'), view_other_cmd },
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_X
|
||||
{ KEY_DC, delete_cmd},
|
||||
#endif
|
||||
@ -2135,7 +2156,7 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
|
||||
subshell_chdir (panel->cwd);
|
||||
|
||||
show_dir (panel);
|
||||
select_item (panel);
|
||||
focus_select_item (panel);
|
||||
#ifndef HAVE_X
|
||||
define_label (h, (Widget *)panel, 1, "Help", help_cmd);
|
||||
define_label (h, (Widget *)panel, 2, "Menu", user_menu_cmd);
|
||||
@ -2157,7 +2178,7 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
|
||||
}
|
||||
#ifdef HAVE_X
|
||||
show_dir (panel);
|
||||
unselect_item (panel);
|
||||
unfocus_unselect_item (panel);
|
||||
panel->active = 0;
|
||||
#else
|
||||
panel->active = 0;
|
||||
|
23
src/widget.c
23
src/widget.c
@ -62,6 +62,10 @@
|
||||
# define x_destroy_cmd(w)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_GNOME
|
||||
# define x_radio_focus_item(r)
|
||||
#endif
|
||||
|
||||
static int button_event (Gpm_Event *event, WButton *b);
|
||||
|
||||
int quote = 0;
|
||||
@ -152,7 +156,11 @@ button_callback (Dlg_head *h, WButton *b, int Msg, int Par)
|
||||
widget_move (&b->widget, 0, b->hotpos+off);
|
||||
addch (b->text [b->hotpos]);
|
||||
}
|
||||
return 1;
|
||||
if (Msg == WIDGET_FOCUS)
|
||||
break;
|
||||
else
|
||||
return 1;
|
||||
break;
|
||||
#endif
|
||||
#endif /* !HAVE_XVIEW */
|
||||
}
|
||||
@ -302,6 +310,7 @@ radio_callback (Dlg_head *h, WRadio *r, int Msg, int Par)
|
||||
case KEY_LEFT:
|
||||
if (r->pos > 0){
|
||||
r->pos--;
|
||||
x_radio_focus_item (r);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@ -310,21 +319,17 @@ radio_callback (Dlg_head *h, WRadio *r, int Msg, int Par)
|
||||
case KEY_RIGHT:
|
||||
if (r->count - 1 > r->pos) {
|
||||
r->pos++;
|
||||
x_radio_focus_item (r);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
#ifdef HAVE_TK
|
||||
/* We manage a group of widgets, while Tk manages independent
|
||||
* ones, so we have to do the focusing manually
|
||||
*/
|
||||
#ifdef HAVE_X
|
||||
case WIDGET_FOCUS:
|
||||
case WIDGET_CURSOR:
|
||||
tk_evalf ("focus %s.%d", (char *)(r->widget.wdata)+1, r->pos);
|
||||
/* Do not call default_proc: we did the tk focus command */
|
||||
return 1;
|
||||
|
||||
x_radio_focus_item (r);
|
||||
return 1;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -155,6 +155,12 @@ tk_radio_callback (ClientData cd, Tcl_Interp *interp, int argc, char *argv [])
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
void
|
||||
x_radio_focus_item (WRadio *r)
|
||||
{
|
||||
tk_evalf ("focus %s.%d", (char *)(r->widget.wdata)+1, r->pos);
|
||||
}
|
||||
|
||||
int
|
||||
x_create_radio (Dlg_head *h, widget_data parent, WRadio *r)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user