1
1

Metadata-aware Midnight Commander. WEEEcvs update . 1998-12-04 Miguel de Icaza <miguel@nuclecu.unam.mx>

* gscreen.c (load_imlib_icons): Make it use the new gicon files.

	* gicon.c, gicon.h: New files: they keep an image cache and
	provide the right icon to use based on the filename.  They use the
	GNOME metadata to fecth the "icon-filename" and "icon-inline-png"
	keys.

	* gdialogs.c (file_mask_dialog): Commented the help messages until
	the warnings are figured out.
Этот коммит содержится в:
Miguel de Icaza 1998-12-05 21:54:25 +00:00
родитель 6067afb1fc
Коммит 4a72b02987
7 изменённых файлов: 49 добавлений и 72 удалений

Просмотреть файл

@ -1,3 +1,15 @@
1998-12-04 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gscreen.c (load_imlib_icons): Make it use the new gicon files.
* gicon.c, gicon.h: New files: they keep an image cache and
provide the right icon to use based on the filename. They use the
GNOME metadata to fecth the "icon-filename" and "icon-inline-png"
keys.
* gdialogs.c (file_mask_dialog): Commented the help messages until
the warnings are figured out.
1998-12-04 Federico Mena Quintero <federico@nuclecu.unam.mx> 1998-12-04 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdesktop.c (desktop_icon_info_new): Connect the signals for DnD * gdesktop.c (desktop_icon_info_new): Connect the signals for DnD

Просмотреть файл

@ -5,7 +5,7 @@ rootdir = $(srcdir)/..
@MCFG@@MCF@ @MCFG@@MCF@
GNOMEDEFS = -DHAVE_X -DHAVE_GNOME @GNOME_INCLUDEDIR@ GNOMEDEFS = -DHAVE_X -DHAVE_GNOME @GNOME_INCLUDEDIR@
CFLAGS = $(XCFLAGS) @X_CFLAGS@ CFLAGS = -g $(XCFLAGS) @X_CFLAGS@
CPPFLAGS = $(XCPPFLAGS) -I$(vfsdir) -I$(slangdir) $(GNOMEDEFS) CPPFLAGS = $(XCPPFLAGS) -I$(vfsdir) -I$(slangdir) $(GNOMEDEFS)
LDFLAGS = $(XLDFLAGS) @GNOME_LIBDIR@ @GNOMEUI_LIBS@ LDFLAGS = $(XLDFLAGS) @GNOME_LIBDIR@ @GNOMEUI_LIBS@
CORBA_LDFLAGS = $(XLDFLAGS) @GNOME_LIBDIR@ @GNOMEGNORBA_LIBS@ CORBA_LDFLAGS = $(XLDFLAGS) @GNOME_LIBDIR@ @GNOMEGNORBA_LIBS@
@ -35,6 +35,7 @@ GNOMESRCS = \
gdesktop.c \ gdesktop.c \
gdnd.c \ gdnd.c \
ghelp.c \ ghelp.c \
gicon.c \
ginfo.c \ ginfo.c \
gkey.c \ gkey.c \
glayout.c \ glayout.c \
@ -63,6 +64,7 @@ GNOMEHDRS = \
gdesktop-icon.h \ gdesktop-icon.h \
gdesktop.h \ gdesktop.h \
gdnd.h \ gdnd.h \
gicon.h \
gmain.h \ gmain.h \
gmc-chargrid.h \ gmc-chargrid.h \
gmetadata.h \ gmetadata.h \
@ -80,10 +82,12 @@ ICONS = \
i-directory.png \ i-directory.png \
i-executable.png \ i-executable.png \
i-symlink.png \ i-symlink.png \
i-device.png \
i-regular.png \ i-regular.png \
i-core.png \ i-core.png \
i-sock.png i-sock.png \
i-chardev.png \
i-blockdev.png \
i-stalled.png
# #
# These objects from ../src do not depend on HAVE_X / HAVE_GNOME?? # These objects from ../src do not depend on HAVE_X / HAVE_GNOME??
@ -118,6 +122,7 @@ OBJS = \
gdesktop.o \ gdesktop.o \
gdnd.o \ gdnd.o \
ghelp.o \ ghelp.o \
gicon.o \
ginfo.o \ ginfo.o \
gkey.o \ gkey.o \
glayout.o \ glayout.o \

Просмотреть файл

@ -210,9 +210,11 @@ file_mask_dialog (FileOperation operation, char *text, char *def_text, int only_
cbox = gtk_check_button_new_with_label (N_("Copy as a background process")); cbox = gtk_check_button_new_with_label (N_("Copy as a background process"));
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (cbox), *do_background); gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (cbox), *do_background);
gtk_signal_connect (GTK_OBJECT (cbox), "toggled", (GtkSignalFunc) fmd_check_box_callback, do_background); gtk_signal_connect (GTK_OBJECT (cbox), "toggled", (GtkSignalFunc) fmd_check_box_callback, do_background);
#if 0
gnome_widget_add_help (cbox, "Selecting this will run the copying in the background. " gnome_widget_add_help (cbox, "Selecting this will run the copying in the background. "
"This is useful for transfers over networks that might take a long " "This is useful for transfers over networks that might take a long "
"time to complete."); "time to complete.");
#endif
gtk_box_pack_end (GTK_BOX (vbox), cbox, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (vbox), cbox, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (vbox), fentry, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (vbox), fentry, FALSE, FALSE, 0);
@ -232,7 +234,9 @@ file_mask_dialog (FileOperation operation, char *text, char *def_text, int only_
cbox = gtk_check_button_new_with_label (N_("Preserve symlinks")); cbox = gtk_check_button_new_with_label (N_("Preserve symlinks"));
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (cbox), file_mask_stable_symlinks); gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (cbox), file_mask_stable_symlinks);
gtk_signal_connect (GTK_OBJECT (cbox), "toggled", (GtkSignalFunc) fmd_check_box_callback, &file_mask_stable_symlinks); gtk_signal_connect (GTK_OBJECT (cbox), "toggled", (GtkSignalFunc) fmd_check_box_callback, &file_mask_stable_symlinks);
#if 0
gnome_widget_add_help (cbox, "FIXME: Add something here Miguel"); gnome_widget_add_help (cbox, "FIXME: Add something here Miguel");
#endif
gtk_box_pack_start (GTK_BOX (vbox), cbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), cbox, FALSE, FALSE, 0);

Просмотреть файл

@ -70,7 +70,7 @@ find_panel_owning_window (GdkDragContext *context)
{ {
GList *list; GList *list;
WPanel *panel; WPanel *panel;
GtkWidget *source_widget; GtkWidget *source_widget, *toplevel_widget;
source_widget = gtk_drag_get_source_widget (context); source_widget = gtk_drag_get_source_widget (context);
if (!source_widget) if (!source_widget)
@ -82,7 +82,7 @@ find_panel_owning_window (GdkDragContext *context)
* widget for each WPanel and compare this to the * widget for each WPanel and compare this to the
* toplevel source_widget * toplevel source_widget
*/ */
source_widget = gtk_widget_get_toplevel (source_widget); toplevel_widget = gtk_widget_get_toplevel (source_widget);
for (list = containers; list; list = list->next) { for (list = containers; list; list = list->next) {
GtkWidget *panel_toplevel_widget; GtkWidget *panel_toplevel_widget;
@ -91,7 +91,7 @@ find_panel_owning_window (GdkDragContext *context)
panel_toplevel_widget = panel->xwindow; panel_toplevel_widget = panel->xwindow;
if (panel->xwindow == source_widget){ if (panel->xwindow == toplevel_widget){
/* /*
* Now a WPanel actually contains a number of * Now a WPanel actually contains a number of
@ -267,6 +267,7 @@ gdnd_drop_on_directory (GdkDragContext *context, GtkSelectionData *selection_dat
/* If we are dragging from a file panel, we can display a nicer status display */ /* If we are dragging from a file panel, we can display a nicer status display */
source_panel = find_panel_owning_window (context); source_panel = find_panel_owning_window (context);
printf ("Panel found for this source: %p\n", source_panel);
/* Symlinks do not use file.c */ /* Symlinks do not use file.c */
if (source_panel && action != GDK_ACTION_LINK) if (source_panel && action != GDK_ACTION_LINK)

Просмотреть файл

@ -43,6 +43,7 @@
#include "dev.xpm" #include "dev.xpm"
#include "listing-list.xpm" #include "listing-list.xpm"
#include "listing-iconic.xpm" #include "listing-iconic.xpm"
/* This is used to initialize our pixmaps */ /* This is used to initialize our pixmaps */
static int pixmaps_ready; static int pixmaps_ready;
GdkPixmap *icon_directory_pixmap; GdkPixmap *icon_directory_pixmap;
@ -52,15 +53,6 @@ GdkBitmap *icon_link_mask;
GdkPixmap *icon_dev_pixmap; GdkPixmap *icon_dev_pixmap;
GdkBitmap *icon_dev_mask; GdkBitmap *icon_dev_mask;
/* These are big images used in the Icon View, for the gnome_icon_list */
static GdkImlibImage *icon_view_directory;
static GdkImlibImage *icon_view_executable;
static GdkImlibImage *icon_view_symlink;
static GdkImlibImage *icon_view_device;
static GdkImlibImage *icon_view_regular;
static GdkImlibImage *icon_view_core;
static GdkImlibImage *icon_view_sock;
static GtkTargetEntry drag_types [] = { static GtkTargetEntry drag_types [] = {
{ "text/uri-list", 0, TARGET_URI_LIST }, { "text/uri-list", 0, TARGET_URI_LIST },
{ "text/plain", 0, TARGET_TEXT_PLAIN } { "text/plain", 0, TARGET_TEXT_PLAIN }
@ -218,37 +210,7 @@ panel_fill_panel_icons (WPanel *panel)
for (i = 0; i < top; i++){ for (i = 0; i < top; i++){
file_entry *fe = &panel->dir.list [i]; file_entry *fe = &panel->dir.list [i];
image = gicon_get_icon_for_file (fe);
switch (file_entry_color (fe)){
case DIRECTORY_COLOR:
image = icon_view_directory;
break;
case LINK_COLOR:
image = icon_view_symlink;
break;
case DEVICE_COLOR:
image = icon_view_device;
break;
case SPECIAL_COLOR:
image = icon_view_sock;
break;
case EXECUTABLE_COLOR:
image = icon_view_executable;
break;
case CORE_COLOR:
image = icon_view_core;
break;
case STALLED_COLOR:
case NORMAL_COLOR:
default:
image = icon_view_regular;
}
gnome_icon_list_append_imlib (icons, image, fe->fname); gnome_icon_list_append_imlib (icons, image, fe->fname);
} }
/* This is needed as the gtk_clist_append changes selected under us :-( */ /* This is needed as the gtk_clist_append changes selected under us :-( */
@ -1056,17 +1018,6 @@ panel_icon_renamed (GtkWidget *widget, int index, char *dest, WPanel *panel)
return FALSE; return FALSE;
} }
static GdkImlibImage *
load_image_icon_view (char *base)
{
GdkImlibImage *im;
char *f = concat_dir_and_file (ICONDIR, base);
im = gdk_imlib_load_image (f);
g_free (f);
return im;
}
static void static void
load_imlib_icons (void) load_imlib_icons (void)
{ {
@ -1075,14 +1026,6 @@ load_imlib_icons (void)
if (loaded) if (loaded)
return; return;
icon_view_directory = load_image_icon_view ("i-directory.png");
icon_view_executable = load_image_icon_view ("i-executable.png");
icon_view_symlink = load_image_icon_view ("i-symlink.png");
icon_view_device = load_image_icon_view ("i-device.png");
icon_view_regular = load_image_icon_view ("i-regular.png");
icon_view_core = load_image_icon_view ("i-core.png");
icon_view_sock = load_image_icon_view ("i-sock.png");
loaded = 1; loaded = 1;
} }
@ -1580,7 +1523,7 @@ panel_tree_scroll (gpointer data)
else{ else{
gtk_adjustment_set_value (va, va->value + va->step_increment); gtk_adjustment_set_value (va, va->value + va->step_increment);
} }
return FALSE; return TRUE;
} }
/** /**

Просмотреть файл

@ -281,6 +281,8 @@ gtk_dtree_do_select_dir (GtkDTree *dtree, char *path)
if (node){ if (node){
gtk_ctree_expand (GTK_CTREE (dtree), node); gtk_ctree_expand (GTK_CTREE (dtree), node);
while (gtk_events_pending ())
gtk_main_iteration ();
current_node = node; current_node = node;
} else } else
break; break;
@ -507,7 +509,7 @@ gtk_dtree_construct (GtkDTree *dtree)
gtk_clist_columns_autosize (clist); gtk_clist_columns_autosize (clist);
gtk_ctree_set_line_style (ctree, GTK_CTREE_LINES_DOTTED); gtk_ctree_set_line_style (ctree, GTK_CTREE_LINES_DOTTED);
gtk_ctree_set_reorderable (ctree, TRUE); gtk_ctree_set_reorderable (ctree, FALSE);
gdk_dtree_load_pixmaps (dtree); gdk_dtree_load_pixmaps (dtree);
gtk_dtree_load_root_tree (dtree); gtk_dtree_load_root_tree (dtree);

Просмотреть файл

@ -286,17 +286,27 @@ gnome_monitor (GtkWidget *widget, WView *view)
} }
GnomeUIInfo gview_file_menu [] = { GnomeUIInfo gview_file_menu [] = {
GNOMEUIINFO_ITEM (N_("Goto line"), N_("Jump to a specified line number"), &gnome_goto_line, NULL), GNOMEUIINFO_ITEM_STOCK (N_("Goto line"),
N_("Jump to a specified line number"),
&gnome_goto_line, GNOME_STOCK_PIXMAP_JUMP_TO),
GNOMEUIINFO_ITEM (N_("Monitor file"), N_("Monitor file growing"), &gnome_monitor, NULL), GNOMEUIINFO_ITEM (N_("Monitor file"), N_("Monitor file growing"), &gnome_monitor, NULL),
GNOMEUIINFO_ITEM (N_("Quit"), N_("Terminate the viewer"), &gview_quit, NULL), GNOMEUIINFO_ITEM_STOCK (N_("Quit"),
N_("Terminate the viewer"),
&gview_quit, GNOME_STOCK_PIXMAP_QUIT),
{ GNOME_APP_UI_ENDOFINFO, 0, 0 } { GNOME_APP_UI_ENDOFINFO, 0, 0 }
}; };
GnomeUIInfo gview_search_menu [] = { GnomeUIInfo gview_search_menu [] = {
GNOMEUIINFO_ITEM (N_("Search"), N_("String search"), gnome_normal_search_cmd, NULL), GNOMEUIINFO_ITEM_STOCK (N_("Search"),
GNOMEUIINFO_ITEM (N_("Regexp search"), N_("Regular expression search"), gnome_regexp_search_cmd, NULL), N_("String search"),
gnome_normal_search_cmd, GNOME_STOCK_MENU_SEARCH),
GNOMEUIINFO_ITEM_STOCK (N_("Regexp search"),
N_("Regular expression search"),
gnome_regexp_search_cmd, GNOME_STOCK_MENU_SEARCH),
GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_ITEM (N_("Search again..."), N_("Continue searching"), gnome_continue_search, NULL), GNOMEUIINFO_ITEM_STOCK (N_("Search again..."),
N_("Continue searching"),
gnome_continue_search, GNOME_STOCK_MENU_SRCHRPL),
{ GNOME_APP_UI_ENDOFINFO, 0, 0 } { GNOME_APP_UI_ENDOFINFO, 0, 0 }
}; };