mirror of https://github.com/MidnightCommander/mc
Various fixes reported by DrMike:
- Nicer dialog destruction (no flicker) - refresh of panels after a drop. - Pause after run is gone in the gnome edition. - Improved layout for options dialog box. - Checkbox widgets are implemented, they now work. Miguel.
This commit is contained in:
parent
c019ee5a56
commit
ca2ffb99b6
|
@ -1,3 +1,20 @@
|
|||
1998-04-07 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||
|
||||
* gscreen.c (panel_drop_data_available): Reload the panel contents
|
||||
upon a drop.
|
||||
|
||||
* gmain.c (gnome_dlg_send_destroy): Hide the widgets just before
|
||||
they are going to get destroyed, to avoid the shutdown
|
||||
flickering.
|
||||
(x_destroy_dlg_start): New routine/hook invoked when the destroy
|
||||
has just started
|
||||
(x_set_idle): Cancel the idle handlers properly.
|
||||
|
||||
* gwidget.c (x_create_check): Finish the checkbox implementation.
|
||||
|
||||
* gdesktop.c (get_desktop_icon): Fix this routine: it was
|
||||
cretating a file name when the filename was not set properly.
|
||||
|
||||
1998-04-01 Marc Ewing <marc@redhat.com>
|
||||
|
||||
* gscreen.c: Added #include <gdk/gdkprivate.h>
|
||||
|
|
|
@ -102,13 +102,15 @@ get_desktop_icon (char *pathname)
|
|||
return full_fname;
|
||||
g_free (full_fname);
|
||||
}
|
||||
|
||||
/* Try a mc icon */
|
||||
full_fname = concat_dir_and_file (ICONDIR, fname);
|
||||
if (exist_file (full_fname))
|
||||
return full_fname;
|
||||
|
||||
free (full_fname);
|
||||
/* Try a mc icon */
|
||||
if (fname){
|
||||
full_fname = concat_dir_and_file (ICONDIR, fname);
|
||||
if (exist_file (full_fname))
|
||||
return full_fname;
|
||||
|
||||
free (full_fname);
|
||||
}
|
||||
|
||||
return gnome_unconditional_pixmap_file ("launcher-program.xpm");
|
||||
}
|
||||
|
@ -119,13 +121,13 @@ get_desktop_icon (char *pathname)
|
|||
static void
|
||||
gdk_dnd_drag_begin (GdkWindow *initial_window)
|
||||
{
|
||||
GdkEventDragBegin tev;
|
||||
tev.type = GDK_DRAG_BEGIN;
|
||||
tev.window = initial_window;
|
||||
tev.u.allflags = 0;
|
||||
tev.u.flags.protocol_version = DND_PROTOCOL_VERSION;
|
||||
|
||||
gdk_event_put ((GdkEvent *) &tev);
|
||||
GdkEventDragBegin tev;
|
||||
tev.type = GDK_DRAG_BEGIN;
|
||||
tev.window = initial_window;
|
||||
tev.u.allflags = 0;
|
||||
tev.u.flags.protocol_version = DND_PROTOCOL_VERSION;
|
||||
|
||||
gdk_event_put ((GdkEvent *) &tev);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -142,7 +144,6 @@ artificial_drag_start (GdkWindow *window, int x, int y)
|
|||
if (gdk_dnd.drag_really)
|
||||
return;
|
||||
|
||||
printf ("Pushing artificial drag\n");
|
||||
gdk_dnd_drag_addwindow (window);
|
||||
gdk_dnd_drag_begin (window);
|
||||
XGrabPointer (gdk_display, wp->xwindow, False,
|
||||
|
@ -355,9 +356,11 @@ drop_on_directory (GdkEventDropDataAvailable *event, char *dest, int force_manua
|
|||
return;
|
||||
}
|
||||
|
||||
if (source_panel && !force_manually)
|
||||
if (source_panel && !force_manually){
|
||||
perform_drop_on_directory (source_panel, operation, dest);
|
||||
else
|
||||
update_one_panel_widget (source_panel, 0, UP_KEEPSEL);
|
||||
panel_update_contents (source_panel);
|
||||
} else
|
||||
perform_drop_manually (operation, event, dest);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -220,6 +220,7 @@ x_add_widget (Dlg_head *h, Widget_Item *w)
|
|||
static int
|
||||
gnome_dlg_send_destroy (GtkWidget *widget, GdkEvent *event, Dlg_head *h)
|
||||
{
|
||||
gtk_widget_hide (GTK_WIDGET (h->wdata));
|
||||
h->ret_value = B_CANCEL;
|
||||
dlg_stop (h);
|
||||
return TRUE;
|
||||
|
@ -242,7 +243,7 @@ x_init_dlg (Dlg_head *h)
|
|||
gtk_grab_add (GTK_WIDGET (ted));
|
||||
|
||||
if (!ted->need_gui)
|
||||
gtk_window_set_policy (GTK_WINDOW (ted), 0, 0, 0);
|
||||
gtk_window_set_policy (GTK_WINDOW (h->wdata), 0, 0, 0);
|
||||
|
||||
gtk_widget_show (GTK_WIDGET (h->wdata));
|
||||
}
|
||||
|
@ -251,7 +252,23 @@ x_init_dlg (Dlg_head *h)
|
|||
x_focus_widget (h->current);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is invoked when the dialog is started to be
|
||||
* destroyed, before any widgets have been destroyed.
|
||||
*
|
||||
* We only hide the toplevel Gtk widget to avoid the flickering
|
||||
* of the destruction process
|
||||
*/
|
||||
void
|
||||
x_destroy_dlg_start (Dlg_head *h)
|
||||
{
|
||||
gtk_widget_hide (GTK_WIDGET (h->wdata));
|
||||
}
|
||||
|
||||
/*
|
||||
* Called when the Dlg_head has been destroyed. This only cleans
|
||||
* up/releases the frontend resources
|
||||
*/
|
||||
void
|
||||
x_destroy_dlg (Dlg_head *h)
|
||||
{
|
||||
|
@ -298,8 +315,11 @@ gnome_idle_handler (gpointer data)
|
|||
{
|
||||
Dlg_head *h = data;
|
||||
|
||||
(*h->callback)(h, 0, DLG_IDLE);
|
||||
return TRUE;
|
||||
if (h->send_idle_msg){
|
||||
(*h->callback)(h, 0, DLG_IDLE);
|
||||
return TRUE;
|
||||
} else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Turn on and off the idle message sending */
|
||||
|
@ -315,6 +335,7 @@ x_set_idle (Dlg_head *h, int enable_idle)
|
|||
return;
|
||||
gtk_idle_remove (h->idle_fn_tag);
|
||||
h->idle_fn_tag = -1;
|
||||
gnome_idle_handler (h);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ All:
|
|||
Desktop:
|
||||
|
||||
- Add special destkop entries ("Network neighborhood")
|
||||
- Double clicking on some objects on the desktop does not do anything.
|
||||
- Solid icons on the desktop are required
|
||||
|
||||
Panels:
|
||||
|
||||
|
@ -85,10 +87,12 @@ Panel comments
|
|||
know the string is truncated in that column. I think its a really nice
|
||||
touch, but not a complete show stopper.
|
||||
|
||||
- I take it the shaped-window DnD isnt working, obviously we want to have
|
||||
nice looking drag cursor behavior at some point.
|
||||
> - I take it the shaped-window DnD isnt working, obviously we want to have
|
||||
> nice looking drag cursor behavior at some point.
|
||||
|
||||
- The panel refreshes VERY quickly, nice job!
|
||||
=========> This works on my machine. When you start a drag from a file,
|
||||
=========> or a group of files it should show a little icon. Same applies
|
||||
=========> to dragging the desktop icons.
|
||||
|
||||
- the user needs some feedback that something is happening - for example,
|
||||
on an ftp link, the cursor needs to change or a modal dialog popping
|
||||
|
@ -97,8 +101,10 @@ Panel comments
|
|||
- 'Compare panels' doesnt appear to do anything - i didnt see any feedback
|
||||
after I chose the compare method.
|
||||
|
||||
- No matter what the sort mode, the directories seem to always get listed
|
||||
first. Maybe this should be personal preference?
|
||||
> - No matter what the sort mode, the directories seem to always get listed
|
||||
> first. Maybe this should be personal preference?
|
||||
======> this is a setting. It is called mix files. If it is set, then you
|
||||
======> get a mixed directory/file listing, if not, you get the directories first.
|
||||
|
||||
- Alt-t didnt seem to change the listing mode.
|
||||
|
||||
|
@ -149,10 +155,8 @@ DONE is this just cause I'm nuts to try?
|
|||
|
||||
When the drag entered the other window, I got a 'Setting current panel to...'
|
||||
|
||||
- it might be good to do a rescan after a panel accepts a drag event. Is
|
||||
that an option?
|
||||
|
||||
- I like the different colors for the different file types in the listing.
|
||||
DONE - it might be good to do a rescan after a panel accepts a drag event. Is
|
||||
DONE that an option?
|
||||
|
||||
- I didnt get an error message when I tried to change the file modes
|
||||
on a file I didnt own.
|
||||
|
@ -169,14 +173,14 @@ DONE is this just cause I'm nuts to try?
|
|||
Configure Options
|
||||
-----------------
|
||||
|
||||
- Buttons at bottom (Ok, Save, Cancel) - Save overlays the Ok button
|
||||
DONE - Buttons at bottom (Ok, Save, Cancel) - Save overlays the Ok button
|
||||
|
||||
- the 'Pause after run' radio buttons - you can select 'on dumb Terminals'
|
||||
and Never at the same time, etc etc. I only one should be selectable
|
||||
at a time. I could get several combinations where multiple were selected.
|
||||
DONE - the 'Pause after run' radio buttons - you can select 'on dumb Terminals'
|
||||
DONE and Never at the same time, etc etc. I only one should be selectable
|
||||
DONE at a time. I could get several combinations where multiple were selected.
|
||||
|
||||
- no matter if I hit 'Ok' or 'Save', if I immediately reenter the Options
|
||||
dialog, the check buttons are all reset, ie. it didnt 'keep' my settings.
|
||||
DONE - no matter if I hit 'Ok' or 'Save', if I immediately reenter the Options
|
||||
DONE dialog, the check buttons are all reset, ie. it didnt 'keep' my settings.
|
||||
|
||||
- need some sort of help for all these options, they aren't too intuitive.
|
||||
We can't assume people are going to read the man page.
|
||||
|
|
|
@ -761,6 +761,9 @@ panel_drop_data_available (GtkWidget *widget, GdkEventDropDataAvailable *data, W
|
|||
|
||||
if (drop_dir != panel->cwd)
|
||||
free (drop_dir);
|
||||
|
||||
update_one_panel_widget (panel, 0, UP_KEEPSEL);
|
||||
panel_update_contents (panel);
|
||||
}
|
||||
|
||||
/* Workaround for the CList that is not adding its clist-window to the DND windows */
|
||||
|
|
|
@ -191,6 +191,13 @@ x_create_radio (Dlg_head *h, widget_data parent, WRadio *r)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
x_check_changed (GtkToggleButton *t, WCheck *c)
|
||||
{
|
||||
c->state ^= C_BOOL;
|
||||
c->state ^= C_CHANGE;
|
||||
}
|
||||
|
||||
/* Check buttons */
|
||||
int
|
||||
x_create_check (Dlg_head *h, widget_data parent, WCheck *c)
|
||||
|
@ -199,6 +206,8 @@ x_create_check (Dlg_head *h, widget_data parent, WCheck *c)
|
|||
int i;
|
||||
|
||||
w = gtk_check_button_new_with_label (c->text);
|
||||
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (w), (c->state & C_BOOL));
|
||||
gtk_signal_connect (GTK_OBJECT (w), "toggled", GTK_SIGNAL_FUNC (x_check_changed), c);
|
||||
gtk_widget_show (w);
|
||||
c->widget.wdata = (widget_data) w;
|
||||
return 1;
|
||||
|
|
21
gnome/layout
21
gnome/layout
|
@ -228,11 +228,6 @@ geometry=4,0,4,15
|
|||
flags=snew
|
||||
text=Other options
|
||||
|
||||
[option-Frame-Frame-2]
|
||||
geometry=0,9,4,5
|
||||
flags=snew
|
||||
text=Pause after run
|
||||
|
||||
[option-Frame-Frame-0]
|
||||
geometry=0,0,4,9
|
||||
flags=snew
|
||||
|
@ -458,11 +453,11 @@ flags=snew
|
|||
|
||||
[mfind-Widget-button-edit]
|
||||
geometry=2,5,1,1
|
||||
flags=
|
||||
flags=ew
|
||||
|
||||
[mfind-Widget-button-view]
|
||||
geometry=1,5,1,1
|
||||
flags=
|
||||
flags=ew
|
||||
|
||||
[mfind-Widget-button-quit]
|
||||
geometry=4,4,1,1
|
||||
|
@ -470,23 +465,23 @@ flags=
|
|||
|
||||
[mfind-Widget-button-again]
|
||||
geometry=1,4,1,1
|
||||
flags=
|
||||
flags=ew
|
||||
|
||||
[mfind-Widget-button-panelize]
|
||||
geometry=0,5,1,1
|
||||
flags=
|
||||
flags=ew
|
||||
|
||||
[mfind-Widget-start-stop]
|
||||
geometry=2,4,1,1
|
||||
flags=
|
||||
flags=ew
|
||||
|
||||
[mfind-Widget-label-search]
|
||||
geometry=0,3,1,1
|
||||
flags=
|
||||
geometry=0,3,7,1
|
||||
flags=w
|
||||
|
||||
[mfind-Widget-button-chdir]
|
||||
geometry=0,4,1,1
|
||||
flags=
|
||||
flags=ew
|
||||
|
||||
[quick_confirm-Widget-c]
|
||||
geometry=3,2,1,1
|
||||
|
|
|
@ -1,3 +1,18 @@
|
|||
1998-04-07 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||
|
||||
* main.c (update_one_panel_widget): New routine: Updates a panel
|
||||
based on the widget, not the index. Used by the GUI versions.
|
||||
|
||||
* find.c (find_file): Cancel idle tasks before we destroy the find
|
||||
dialog.
|
||||
|
||||
* dlg.c (destroy_dlg): Call x_destroy_dlg_start, a new hook that
|
||||
is invoked to allow the frontend code to prepare for dialog
|
||||
destruction. Only the Gnome edition is using this: it uses this
|
||||
to hide the dialog and avoid flickering.
|
||||
|
||||
* main.c: dtterm also has mouse support.
|
||||
|
||||
1998-04-06 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||
|
||||
* wtools.c (quick_callback): Process DLG_KEY events on X.
|
||||
|
|
|
@ -831,6 +831,7 @@ destroy_dlg (Dlg_head *h)
|
|||
if (h->refresh_pushed)
|
||||
pop_refresh ();
|
||||
|
||||
x_destroy_dlg_start (h);
|
||||
dlg_broadcast_msg (h, WIDGET_DESTROY, 0);
|
||||
c = h->current;
|
||||
for (i = 0; i < h->count; i++){
|
||||
|
|
|
@ -303,11 +303,13 @@ void x_focus_widget (Widget_Item *p);
|
|||
void x_unfocus_widget (Widget_Item *p);
|
||||
void x_init_dlg (Dlg_head *h);
|
||||
void x_destroy_dlg (Dlg_head *h);
|
||||
void x_destroy_dlg_start (Dlg_head *h);
|
||||
#else
|
||||
# define x_focus_widget(x) {}
|
||||
# define x_unfocus_widget(x) {}
|
||||
# define x_init_dlg(x) {}
|
||||
# define x_destroy_dlg(x) {}
|
||||
# define x_destroy_dlg_start(x) {}
|
||||
#endif
|
||||
|
||||
#endif /* MC_DLG_H */
|
||||
|
|
|
@ -779,6 +779,7 @@ find_file (char *start_dir, char *pattern, char *content, char **dirname, char
|
|||
}
|
||||
}
|
||||
|
||||
set_idle_proc (find_dlg, 0);
|
||||
destroy_dlg (find_dlg);
|
||||
do_search (0); /* force do_search to release resources */
|
||||
if (old_dir){
|
||||
|
|
22
src/main.c
22
src/main.c
|
@ -440,15 +440,9 @@ reload_panelized (WPanel *panel)
|
|||
}
|
||||
|
||||
void
|
||||
update_one_panel (int which, int force_update, char *current_file)
|
||||
update_one_panel_widget (WPanel *panel, int force_update, char *current_file)
|
||||
{
|
||||
int free_pointer;
|
||||
WPanel *panel;
|
||||
|
||||
if (get_display_type (which) != view_listing)
|
||||
return;
|
||||
|
||||
panel = (WPanel *) get_panel_widget (which);
|
||||
|
||||
if (force_update & UP_RELOAD){
|
||||
panel->is_panelized = 0;
|
||||
|
@ -476,6 +470,18 @@ update_one_panel (int which, int force_update, char *current_file)
|
|||
free (current_file);
|
||||
}
|
||||
|
||||
void
|
||||
update_one_panel (int which, int force_update, char *current_file)
|
||||
{
|
||||
WPanel *panel;
|
||||
|
||||
if (get_display_type (which) != view_listing)
|
||||
return;
|
||||
|
||||
panel = (WPanel *) get_panel_widget (which);
|
||||
update_one_panel_widget (panel, force_update, current_file);
|
||||
}
|
||||
|
||||
/* This routine reloads the directory in both panels. It tries to
|
||||
* select current_file in current_panel and other_file in other_panel.
|
||||
* If current_file == -1 then it automatically sets current_file and
|
||||
|
@ -2309,7 +2315,7 @@ OS_Setup ()
|
|||
termvalue = "";
|
||||
}
|
||||
#ifndef HAVE_X
|
||||
if (force_xterm || strncmp (termvalue, "xterm", 5) == 0){
|
||||
if (force_xterm || (strncmp (termvalue, "xterm", 5) == 0 || strcmp (termvalue, "dtterm") == 0){
|
||||
use_mouse_p = XTERM_MOUSE;
|
||||
xterm_flag = 1;
|
||||
# ifdef SET_TITLE
|
||||
|
|
|
@ -128,8 +128,6 @@ void outrefresh_screen (void);
|
|||
void suspend_cmd (void);
|
||||
void do_update_prompt (void);
|
||||
|
||||
|
||||
|
||||
extern char control_file [];
|
||||
extern char *shell;
|
||||
|
||||
|
|
|
@ -228,8 +228,9 @@ static void init_configure (void)
|
|||
|
||||
pause_radio = radio_new (RY+1, RX+2, 3, pause_options, 1, "pause-radio");
|
||||
pause_radio->sel = pause_after_run;
|
||||
#ifndef HAVE_GNOME
|
||||
add_widgetl (conf_dlg, pause_radio, XV_WLAY_BELOWCLOSE);
|
||||
|
||||
#endif
|
||||
for (i = 0; i < 6; i++){
|
||||
check_options [i+12].widget = check_new (PY + (6-i), PX+2,
|
||||
XTRACT(i+12));
|
||||
|
|
|
@ -234,5 +234,6 @@ void x_select_item (WPanel *panel);
|
|||
void x_unselect_item (WPanel *panel);
|
||||
sortfn *get_sort_fn (char *name);
|
||||
int panel_callback (Dlg_head *h, WPanel *panel, int msg, int par);
|
||||
void update_one_panel_widget (WPanel *panel, int force_update, char *current_file);
|
||||
|
||||
#endif /* __PANEL_H */
|
||||
|
|
|
@ -453,6 +453,12 @@ tk_dispatch_all (void)
|
|||
;
|
||||
}
|
||||
|
||||
void
|
||||
x_destroy_dlg_start (Dlg_head *h)
|
||||
{
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
void
|
||||
x_destroy_dlg (Dlg_head *h)
|
||||
{
|
||||
|
|
|
@ -1081,6 +1081,11 @@ x_init_dlg (Dlg_head *h)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
x_destroy_dlg_start (Dlg_head *h)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
x_destroy_dlg (Dlg_head *h)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue