Add a couple of icons for devices and symlinks
Этот коммит содержится в:
родитель
e78e0bd556
Коммит
c6d65c1bd3
@ -1,3 +1,22 @@
|
|||||||
|
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
|
||||||
|
new coords.x and coords.y fields from the DropDataAvailableEvent
|
||||||
|
to find out which directory receives the drop.
|
||||||
|
|
||||||
|
* gwidget.c (x_radio_focus_item): Add support for focusing radio
|
||||||
|
buttons.
|
||||||
|
|
||||||
|
Mon Mar 9 15:12:00 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* gtools.c (translate_gdk_keysym_to_curses), dlg.c
|
||||||
|
(dlg_key_event): Support for backtab.
|
||||||
|
|
||||||
|
* gwidget.c: highlight properly the focused radio entry.
|
||||||
|
|
||||||
|
* gmain.c (x_init_dlg): After setting up the X widget, set the
|
||||||
|
Gtk focus to h->current;
|
||||||
|
|
||||||
1998-03-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
1998-03-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
* gscreen.c (x_panel_select_item): Set the colors of the row.
|
* gscreen.c (x_panel_select_item): Set the colors of the row.
|
||||||
|
@ -8,7 +8,7 @@ CFLAGS = $(XCFLAGS) @X_CFLAGS@
|
|||||||
CPPFLAGS = $(XCPPFLAGS) -I$(vfsdir) -I$(slangdir) -DHAVE_X -DHAVE_GNOME
|
CPPFLAGS = $(XCPPFLAGS) -I$(vfsdir) -I$(slangdir) -DHAVE_X -DHAVE_GNOME
|
||||||
LDFLAGS = $(XLDFLAGS) @X_LIBS@
|
LDFLAGS = $(XLDFLAGS) @X_LIBS@
|
||||||
DEFS = $(XDEFS)
|
DEFS = $(XDEFS)
|
||||||
LIBS = -lgnomeui -lgnome -lgtk -lgdk -lglib @X_EXTRA_LIBS@ -lX11 @X_PRE_LIBS@ $(XLIBS) $(XLIB) @TERMNET@
|
LIBS = -lgnomeui -lgdk_imlib -lgnome -lgnomesupport -lgtk -lgdk -lglib @X_EXTRA_LIBS@ -lX11 @X_PRE_LIBS@ $(XLIBS) $(XLIB) @TERMNET@
|
||||||
EXTRALIBS = @LVFS@ @LSLANG@ @LEDIT@
|
EXTRALIBS = @LVFS@ @LSLANG@ @LEDIT@
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
@ -58,7 +58,7 @@ OBJS = $(LOBJS) $(OOBJS) \
|
|||||||
# Distribution variables
|
# Distribution variables
|
||||||
#
|
#
|
||||||
|
|
||||||
PIXMAPS = directory.xpm
|
PIXMAPS = directory.xpm link.xpm
|
||||||
|
|
||||||
DISTGNOME = Makefile.in gnome.TODO layout $(PIXMAPS) $(GNOMESRCS) $(GNOMEHDRS)
|
DISTGNOME = Makefile.in gnome.TODO layout $(PIXMAPS) $(GNOMESRCS) $(GNOMEHDRS)
|
||||||
|
|
||||||
|
@ -17,6 +17,9 @@
|
|||||||
#define PORT_HAS_PANEL_RESET_SORT_LABELS 1
|
#define PORT_HAS_PANEL_RESET_SORT_LABELS 1
|
||||||
#define PORT_HAS_FLUSH_EVENTS 1
|
#define PORT_HAS_FLUSH_EVENTS 1
|
||||||
#define PORT_HAS_SET_IDLE 1
|
#define PORT_HAS_SET_IDLE 1
|
||||||
|
#define PORT_HAS_BACKTAB_CHAR 1
|
||||||
|
#define PORT_NOT_FOCUS_SELECT_ITEM 1
|
||||||
|
#define PORT_NOT_UNFOCUS_UNSELECT_ITEM 1
|
||||||
|
|
||||||
#define mi_getch() fprintf (stderr, "mi_getch is not implemented in this port\n")
|
#define mi_getch() fprintf (stderr, "mi_getch is not implemented in this port\n")
|
||||||
#define frontend_run_dlg(x) gtkrundlg_event (x)
|
#define frontend_run_dlg(x) gtkrundlg_event (x)
|
||||||
|
@ -271,11 +271,10 @@ drop_on_panel (GdkEventDropDataAvailable *event, char *dest)
|
|||||||
int x, y;
|
int x, y;
|
||||||
int operation;
|
int operation;
|
||||||
|
|
||||||
gdk_window_get_pointer (NULL, &x, &y, NULL);
|
operation = get_operation (event->coords.x, event->coords.y);
|
||||||
operation = get_operation (x, y);
|
|
||||||
|
|
||||||
source_panel = find_panel_owning_window_id (event->requestor);
|
source_panel = find_panel_owning_window_id (event->requestor);
|
||||||
|
|
||||||
if (source_panel)
|
if (source_panel)
|
||||||
perform_drop_on_panel (source_panel, operation, dest);
|
perform_drop_on_panel (source_panel, operation, dest);
|
||||||
else
|
else
|
||||||
@ -569,13 +568,14 @@ desktop_setup_default (char *desktop_dir)
|
|||||||
char *mc_desktop_dir;
|
char *mc_desktop_dir;
|
||||||
|
|
||||||
mc_desktop_dir = concat_dir_and_file (mc_home, MC_LIB_DESKTOP);
|
mc_desktop_dir = concat_dir_and_file (mc_home, MC_LIB_DESKTOP);
|
||||||
|
|
||||||
create_op_win (OP_COPY, 0);
|
|
||||||
file_mask_defaults ();
|
|
||||||
copy_dir_dir (mc_desktop_dir, desktop_dir);
|
|
||||||
destroy_op_win ();
|
|
||||||
free (mc_desktop_dir);
|
|
||||||
|
|
||||||
|
if (exist_file (mc_desktop_dir)){
|
||||||
|
create_op_win (OP_COPY, 0);
|
||||||
|
file_mask_defaults ();
|
||||||
|
copy_dir_dir (mc_desktop_dir, desktop_dir);
|
||||||
|
destroy_op_win ();
|
||||||
|
}
|
||||||
|
free (mc_desktop_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -183,12 +183,6 @@ x_panel_container_show (widget_data wdata)
|
|||||||
gtk_widget_show (GTK_WIDGET (wdata));
|
gtk_widget_show (GTK_WIDGET (wdata));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
x_focus_widget (Widget_Item *p)
|
|
||||||
{
|
|
||||||
gtk_widget_grab_focus (GTK_WIDGET (p->widget->wdata));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
x_add_widget (Dlg_head *h, Widget_Item *w)
|
x_add_widget (Dlg_head *h, Widget_Item *w)
|
||||||
{
|
{
|
||||||
@ -218,6 +212,7 @@ x_init_dlg (Dlg_head *h)
|
|||||||
|
|
||||||
gtk_widget_show (GTK_WIDGET (h->wdata));
|
gtk_widget_show (GTK_WIDGET (h->wdata));
|
||||||
}
|
}
|
||||||
|
x_focus_widget (h->current);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,13 +30,19 @@
|
|||||||
#include "dialog.h"
|
#include "dialog.h"
|
||||||
#include "gdesktop.h"
|
#include "gdesktop.h"
|
||||||
|
|
||||||
|
/* The pixmaps */
|
||||||
#include "directory.xpm"
|
#include "directory.xpm"
|
||||||
|
#include "link.xpm"
|
||||||
|
#include "dev.xpm"
|
||||||
|
|
||||||
/* This is used to initialize our pixmaps */
|
/* This is used to initialize our pixmaps */
|
||||||
static int pixmaps_ready;
|
static int pixmaps_ready;
|
||||||
GdkPixmap *directory_pixmap;
|
GdkPixmap *icon_directory_pixmap;
|
||||||
GdkBitmap *directory_mask;
|
GdkBitmap *icon_directory_mask;
|
||||||
|
GdkPixmap *icon_link_pixmap;
|
||||||
|
GdkBitmap *icon_link_mask;
|
||||||
|
GdkPixmap *icon_dev_pixmap;
|
||||||
|
GdkBitmap *icon_dev_mask;
|
||||||
|
|
||||||
static char *drag_types [] = { "text/plain", "url:ALL" };
|
static char *drag_types [] = { "text/plain", "url:ALL" };
|
||||||
static char *drop_types [] = { "url:ALL" };
|
static char *drop_types [] = { "url:ALL" };
|
||||||
@ -58,8 +64,6 @@ show_dir (WPanel *panel)
|
|||||||
|
|
||||||
list = g_list_alloc ();
|
list = g_list_alloc ();
|
||||||
g_list_append (list, panel->cwd);
|
g_list_append (list, panel->cwd);
|
||||||
|
|
||||||
printf ("show_dir to %s %s\n", panel->cwd, panel->filter ? panel->filter : "<no-filt>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -68,7 +72,13 @@ panel_file_list_set_type_bitmap (GtkCList *cl, int row, int column, int color, f
|
|||||||
/* Here, add more icons */
|
/* Here, add more icons */
|
||||||
switch (color){
|
switch (color){
|
||||||
case DIRECTORY_COLOR:
|
case DIRECTORY_COLOR:
|
||||||
gtk_clist_set_pixmap (cl, row, column, directory_pixmap, directory_mask);
|
gtk_clist_set_pixmap (cl, row, column, icon_directory_pixmap, icon_directory_mask);
|
||||||
|
break;
|
||||||
|
case LINK_COLOR:
|
||||||
|
gtk_clist_set_pixmap (cl, row, column, icon_link_pixmap, icon_link_mask);
|
||||||
|
break;
|
||||||
|
case DEVICE_COLOR:
|
||||||
|
gtk_clist_set_pixmap (cl, row, column, icon_dev_pixmap, icon_dev_mask);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -444,8 +454,6 @@ internal_select_item (GtkWidget *file_list, WPanel *panel, int row)
|
|||||||
static void
|
static void
|
||||||
panel_file_list_select_row (GtkWidget *file_list, int row, int column, GdkEvent *event, WPanel *panel)
|
panel_file_list_select_row (GtkWidget *file_list, int row, int column, GdkEvent *event, WPanel *panel)
|
||||||
{
|
{
|
||||||
printf ("panel_file_list_select_row\n");
|
|
||||||
|
|
||||||
if (!event) {
|
if (!event) {
|
||||||
internal_select_item (file_list, panel, row);
|
internal_select_item (file_list, panel, row);
|
||||||
return;
|
return;
|
||||||
@ -500,8 +508,6 @@ panel_file_list_compute_lines (GtkCList *file_list, WPanel *panel, int height)
|
|||||||
static void
|
static void
|
||||||
panel_file_list_size_allocate_hook (GtkWidget *file_list, GtkAllocation *allocation, WPanel *panel)
|
panel_file_list_size_allocate_hook (GtkWidget *file_list, GtkAllocation *allocation, WPanel *panel)
|
||||||
{
|
{
|
||||||
printf ("Aqui\n");
|
|
||||||
|
|
||||||
panel_file_list_configure_contents (file_list, panel, allocation->width, allocation->height);
|
panel_file_list_configure_contents (file_list, panel, allocation->width, allocation->height);
|
||||||
|
|
||||||
panel_file_list_compute_lines (GTK_CLIST (file_list), panel, allocation->height);
|
panel_file_list_compute_lines (GTK_CLIST (file_list), panel, allocation->height);
|
||||||
@ -540,14 +546,16 @@ panel_create_pixmaps (GtkWidget *parent)
|
|||||||
GdkColor color = gtk_widget_get_style (parent)->bg [GTK_STATE_NORMAL];
|
GdkColor color = gtk_widget_get_style (parent)->bg [GTK_STATE_NORMAL];
|
||||||
|
|
||||||
pixmaps_ready = 1;
|
pixmaps_ready = 1;
|
||||||
directory_pixmap = gdk_pixmap_create_from_xpm_d (parent->window, &directory_mask, &color, directory_xpm);
|
icon_directory_pixmap = gdk_pixmap_create_from_xpm_d (parent->window, &icon_directory_mask, &color, directory_xpm);
|
||||||
|
icon_link_pixmap = gdk_pixmap_create_from_xpm_d (parent->window, &icon_link_mask, &color, link_xpm);
|
||||||
|
icon_dev_pixmap = gdk_pixmap_create_from_xpm_d (parent->window, &icon_dev_mask, &color, dev_xpm);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
panel_file_list_scrolled (GtkAdjustment *adj, WPanel *panel)
|
panel_file_list_scrolled (GtkAdjustment *adj, WPanel *panel)
|
||||||
{
|
{
|
||||||
if (!GTK_IS_ADJUSTMENT (adj)) {
|
if (!GTK_IS_ADJUSTMENT (adj)) {
|
||||||
fprintf (stderr, "CRAP!\n");
|
fprintf (stderr, "file_list_is_scrolled is called and there are not enough boats!\n");
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -656,15 +664,32 @@ panel_drop_enter (GtkWidget *widget, GdkEvent *event)
|
|||||||
static void
|
static void
|
||||||
panel_drop_data_available (GtkWidget *widget, GdkEventDropDataAvailable *data, WPanel *panel)
|
panel_drop_data_available (GtkWidget *widget, GdkEventDropDataAvailable *data, WPanel *panel)
|
||||||
{
|
{
|
||||||
/* Sigh, the DropDataAvailable does not provide the location where the drag
|
gint winx, winy;
|
||||||
* happened, so for now, the only thing we can do is ask gdk to tell us
|
gint dropx, dropy;
|
||||||
* where the pointer is, even if it bears little resemblance with the
|
gint row;
|
||||||
* actual spot where the drop happened.
|
char *drop_dir;
|
||||||
*
|
|
||||||
* FIXME: gtk+ needs fixing here.
|
gdk_window_get_origin (GTK_CLIST (widget)->clist_window, &winx, &winy);
|
||||||
*/
|
dropx = data->coords.x - winx;
|
||||||
|
dropy = data->coords.y - winy;
|
||||||
|
|
||||||
drop_on_panel (data, panel->cwd);
|
if (dropx < 0 || dropy < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (gtk_clist_get_selection_info (GTK_CLIST (widget), dropx, dropy, &row, NULL) == 0)
|
||||||
|
drop_dir = panel->cwd;
|
||||||
|
else {
|
||||||
|
g_assert (row < panel->count);
|
||||||
|
|
||||||
|
if (S_ISDIR (panel->dir.list [row].buf.st_mode))
|
||||||
|
drop_dir = concat_dir_and_file (panel->cwd, panel->dir.list [row].fname);
|
||||||
|
else
|
||||||
|
drop_dir = panel->cwd;
|
||||||
|
}
|
||||||
|
drop_on_panel (data, drop_dir);
|
||||||
|
|
||||||
|
if (drop_dir != panel->cwd)
|
||||||
|
free (drop_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Workaround for the CList that is not adding its clist-window to the DND windows */
|
/* Workaround for the CList that is not adding its clist-window to the DND windows */
|
||||||
@ -737,6 +762,7 @@ panel_create_file_list (WPanel *panel)
|
|||||||
const int items = panel->format->items;
|
const int items = panel->format->items;
|
||||||
format_e *format = panel->format;
|
format_e *format = panel->format;
|
||||||
GtkWidget *file_list;
|
GtkWidget *file_list;
|
||||||
|
GtkCList *clist;
|
||||||
gchar **titles;
|
gchar **titles;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -746,6 +772,7 @@ panel_create_file_list (WPanel *panel)
|
|||||||
titles [i++] = format->title;
|
titles [i++] = format->title;
|
||||||
|
|
||||||
file_list = gtk_clist_new_with_titles (items, titles);
|
file_list = gtk_clist_new_with_titles (items, titles);
|
||||||
|
clist = GTK_CLIST (file_list);
|
||||||
panel_configure_file_list (panel, file_list);
|
panel_configure_file_list (panel, file_list);
|
||||||
free (titles);
|
free (titles);
|
||||||
|
|
||||||
@ -760,7 +787,6 @@ panel_create_file_list (WPanel *panel)
|
|||||||
|
|
||||||
gtk_signal_connect (GTK_OBJECT (file_list), "select_row",
|
gtk_signal_connect (GTK_OBJECT (file_list), "select_row",
|
||||||
GTK_SIGNAL_FUNC (panel_file_list_select_row), panel);
|
GTK_SIGNAL_FUNC (panel_file_list_select_row), panel);
|
||||||
|
|
||||||
return file_list;
|
return file_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -804,8 +830,6 @@ panel_change_filter (GtkWidget *entry, WPanel *panel)
|
|||||||
* item to bring up a "set filter" dialog box.
|
* item to bring up a "set filter" dialog box.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
printf ("panel_change_filter\n");
|
|
||||||
|
|
||||||
reg_exp = gtk_entry_get_text (GTK_ENTRY (entry));
|
reg_exp = gtk_entry_get_text (GTK_ENTRY (entry));
|
||||||
|
|
||||||
if (panel->filter) {
|
if (panel->filter) {
|
||||||
|
@ -125,6 +125,8 @@ translate_gdk_keysym_to_curses (GdkEventKey *event)
|
|||||||
case GDK_BackSpace:
|
case GDK_BackSpace:
|
||||||
return KEY_BACKSPACE;
|
return KEY_BACKSPACE;
|
||||||
case GDK_Tab:
|
case GDK_Tab:
|
||||||
|
if (event->state & GDK_SHIFT_MASK)
|
||||||
|
return KEY_BACKTAB;
|
||||||
return '\t';
|
return '\t';
|
||||||
case GDK_KP_Enter:
|
case GDK_KP_Enter:
|
||||||
case GDK_Return:
|
case GDK_Return:
|
||||||
|
@ -16,6 +16,14 @@
|
|||||||
#include "gwidget.h"
|
#include "gwidget.h"
|
||||||
#include "dlg.h"
|
#include "dlg.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
x_focus_widget (Widget_Item *p)
|
||||||
|
{
|
||||||
|
GtkWidget *w = GTK_WIDGET (p->widget->wdata);
|
||||||
|
|
||||||
|
gtk_widget_grab_focus (GTK_WIDGET (p->widget->wdata));
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
x_destroy_cmd (void *w)
|
x_destroy_cmd (void *w)
|
||||||
{
|
{
|
||||||
@ -55,7 +63,7 @@ x_create_button (Dlg_head *h, widget_data parent, WButton *b)
|
|||||||
tag = gtk_signal_connect (GTK_OBJECT(button), "clicked", (GtkSignalFunc) gbutton_callback, b);
|
tag = gtk_signal_connect (GTK_OBJECT(button), "clicked", (GtkSignalFunc) gbutton_callback, b);
|
||||||
gtk_object_set_data (GTK_OBJECT (button), "click-signal-tag", (void *) tag);
|
gtk_object_set_data (GTK_OBJECT (button), "click-signal-tag", (void *) tag);
|
||||||
b->widget.wdata = (widget_data) button;
|
b->widget.wdata = (widget_data) button;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,6 +84,24 @@ x_button_set (WButton *b, char *text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Radio buttons */
|
/* Radio buttons */
|
||||||
|
|
||||||
|
void
|
||||||
|
x_radio_focus_item (WRadio *radio)
|
||||||
|
{
|
||||||
|
GList *children = GTK_BOX (radio->widget.wdata)->children;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < radio->count; i++){
|
||||||
|
if (i == radio->pos){
|
||||||
|
GtkBoxChild *bc = (GtkBoxChild *) children->data;
|
||||||
|
|
||||||
|
gtk_widget_grab_focus (GTK_WIDGET (bc->widget));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
children = children->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
radio_toggle (GtkObject *object, WRadio *r)
|
radio_toggle (GtkObject *object, WRadio *r)
|
||||||
{
|
{
|
||||||
@ -110,7 +136,7 @@ x_create_radio (Dlg_head *h, widget_data parent, WRadio *r)
|
|||||||
gtk_box_pack_start_defaults (GTK_BOX (vbox), w);
|
gtk_box_pack_start_defaults (GTK_BOX (vbox), w);
|
||||||
}
|
}
|
||||||
gtk_widget_show_all (vbox);
|
gtk_widget_show_all (vbox);
|
||||||
|
|
||||||
r->widget.wdata = (widget_data) vbox;
|
r->widget.wdata = (widget_data) vbox;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ flags=snew
|
|||||||
text=Directory path
|
text=Directory path
|
||||||
|
|
||||||
[option-Widget-button-ok]
|
[option-Widget-button-ok]
|
||||||
geometry=1,15,1,1
|
geometry=2,15,1,1
|
||||||
flags=w
|
flags=w
|
||||||
|
|
||||||
[option-Widget-safe-del]
|
[option-Widget-safe-del]
|
||||||
@ -220,7 +220,7 @@ geometry=2,2,1,1
|
|||||||
flags=w
|
flags=w
|
||||||
|
|
||||||
[option-Widget-pause-radio]
|
[option-Widget-pause-radio]
|
||||||
geometry=2,12,1,5
|
geometry=2,10,1,5
|
||||||
flags=nw
|
flags=nw
|
||||||
|
|
||||||
[option-Frame-Frame-1]
|
[option-Frame-Frame-1]
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user