Revert last commit, this should have gone into a branch

This commit is contained in:
Miguel de Icaza 1998-12-16 06:33:55 +00:00
parent cb83d83796
commit 9d3578f803
8 changed files with 42 additions and 72 deletions

View File

@ -8,7 +8,7 @@ GNOMEDEFS = -DHAVE_X -DHAVE_GNOME @GNOME_INCLUDEDIR@
CFLAGS = -g $(XCFLAGS) @X_CFLAGS@
CPPFLAGS = $(XCPPFLAGS) -I$(vfsdir) -I$(slangdir) $(GNOMEDEFS)
LDFLAGS = $(XLDFLAGS) @GNOME_LIBDIR@ @GNOMEUI_LIBS@
pCORBA_LDFLAGS = $(XLDFLAGS) @GNOME_LIBDIR@ @GNOMEGNORBA_LIBS@
CORBA_LDFLAGS = $(XLDFLAGS) @GNOME_LIBDIR@ @GNOMEGNORBA_LIBS@
DEFS = $(XDEFS)
LIBS = $(XLIBS) @TERMNET@
EXTRALIBS = @LVFS@ -lgtkedit @LINTL@
@ -117,7 +117,6 @@ CORBAOBJS = \
OBJS = \
$(LOBJS) \
$(OOBJS) \
gaction.o \
gblist.o \
gcache.o \
gcliplabel.o \

View File

@ -247,8 +247,6 @@ gicon_get_icon_for_file (file_entry *fe)
*/
if (gnome_metadata_get (fe->fname, "icon-filename", &size, &buf) == 0){
image = gicon_get_by_filename (buf);
free (buf);
if (image)
return image;

View File

@ -332,35 +332,28 @@ get_label_text (GtkMenuItem *item)
}
static void
mime_command_from_panel (GtkMenuItem *item, WPanel *panel)
regex_command_from_panel (GtkMenuItem *item, WPanel *panel)
{
char *filename;
char *action;
int movedir;
/*
* This is broken, but we dont mind. Federico
* needs to explain me what was he intending here.
* panel->selected does not mean, it was the icon
* that got clicked.
*/
/* This is broken */
filename = panel->dir.list[panel->selected].fname;
action = get_label_text (item);
regex_command (filename, action, NULL, &movedir);
}
static void
mime_command_from_desktop_icon (GtkMenuItem *item, char *filename)
regex_command_from_desktop_icon (GtkMenuItem *item, char *filename)
{
char *action;
int movedir;
char *key, *mime_type, *val;
action = get_label_text (item);
key = gtk_object_get_user_data (GTK_OBJECT (item));
mime_type = gnome_mime_type_or_default (filename, NULL);
if (!mime_type)
return;
val = gnome_mime_get_value (mime_type, key);
exec_extension (filename, val, NULL, NULL, 0);
regex_command (filename, action, NULL, &movedir);
}
/* Create the menu items common to files from panel window and desktop icons, and also the items for
@ -373,8 +366,8 @@ create_regexp_actions (GtkWidget *menu, WPanel *panel, int panel_row, char *file
GnomeUIInfo *a_uiinfo;
int i;
GtkSignalFunc regex_callback;
char *mime_type;
GList *keys, *l;
char *p, *q;
int c;
GnomeUIInfo uiinfo[] = {
{ 0 },
GNOMEUIINFO_END
@ -383,12 +376,12 @@ create_regexp_actions (GtkWidget *menu, WPanel *panel, int panel_row, char *file
if (panel) {
a_uiinfo = panel_actions;
closure = panel;
regex_callback = mime_command_from_desktop_icon;
regex_callback = regex_command_from_desktop_icon;
regex_closure = filename;
} else {
a_uiinfo = desktop_icon_actions;
closure = filename;
regex_callback = mime_command_from_desktop_icon;
regex_callback = regex_command_from_desktop_icon;
regex_closure = filename;
}
@ -402,34 +395,30 @@ create_regexp_actions (GtkWidget *menu, WPanel *panel, int panel_row, char *file
/* Fill in the regex command part */
mime_type = gnome_mime_type_or_default (filename, NULL);
if (!mime_type)
p = regex_command (filename, NULL, NULL, NULL);
if (!p)
return;
keys = gnome_mime_get_keys (mime_type);
for (l = keys; l; l = l->next) {
char *key = l->data;
char *str;
str = key;
if (strncmp (key, "open.", 5) != 0)
continue;
for (;;) {
/* Strip off an entry */
str += 5;
while (*str && *str != '.')
str++;
while (*p == ' ' || *p == '\t')
p++;
if (*str)
str++;
if (!*str)
continue;
if (!*p)
break;
q = p;
while (*q && *q != '=' && *q != '\t')
q++;
c = *q;
*q = 0;
/* Create the item for that entry */
uiinfo[0].type = GNOME_APP_UI_ITEM;
uiinfo[0].label = str;
uiinfo[0].label = p;
uiinfo[0].hint = NULL;
uiinfo[0].moreinfo = regex_callback;
uiinfo[0].user_data = regex_closure;
@ -441,9 +430,14 @@ create_regexp_actions (GtkWidget *menu, WPanel *panel, int panel_row, char *file
uiinfo[0].widget = NULL;
fill_menu (GTK_MENU_SHELL (menu), uiinfo, insert_pos++);
gtk_object_set_user_data (GTK_OBJECT (uiinfo [0].widget), key);
/* Next! */
if (!c)
break;
p = q + 1;
}
g_list_free (keys);
}
/* Convenience callback to exit the main loop of a modal popup menu when it is deactivated*/

View File

@ -1108,8 +1108,6 @@ panel_icon_list_select_icon (GtkWidget *widget, int index, GdkEvent *event, WPan
display_mini_info (panel);
execute_hooks (select_file_hook);
if (event)
printf ("Icon list select icon, event->type= %d %d %d\n", event->type, GDK_BUTTON_PRESS, GDK_2BUTTON_PRESS);
if (!event)
return;
@ -2097,9 +2095,8 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
button_switch_to_listing (panel),
"Switch view to detailed view.", NULL);
dock = gnome_dock_item_new ("gmc-toolbar", GNOME_DOCK_ITEM_BEH_EXCLUSIVE | GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL);
gtk_container_add (GTK_CONTAINER(dock),status_line);
gnome_dock_add_item (GNOME_DOCK(GNOME_APP (panel->xwindow)->dock),
GNOME_DOCK_ITEM (dock), GNOME_DOCK_TOP, 1, 0, 0, FALSE);
gtk_container_add(GTK_CONTAINER(dock),status_line);
gnome_dock_add_item (GNOME_DOCK(GNOME_APP (panel->xwindow)->dock), dock, GNOME_DOCK_TOP, 1, 0, 0, FALSE);
gtk_widget_show_all (dock);

View File

@ -174,11 +174,6 @@ int view_file_at_line (char *filename, int plain_view, int internal, int start_l
if (internal){
char view_entry [32];
#ifdef HAVE_GNOME
if (!gmc_view (filename, start_line)){
view (0, filename, &move_dir, start_line);
}
#else
if (start_line != 0)
sprintf (view_entry, "View:%d", start_line);
else
@ -188,7 +183,6 @@ int view_file_at_line (char *filename, int plain_view, int internal, int start_l
view (0, filename, &move_dir, start_line);
repaint_screen ();
}
#endif
} else {
char *localcopy;

View File

@ -53,7 +53,6 @@
#include <sys/wait.h>
#endif /* SCO_FLAVOR */
#include <glib.h>
/* "$Id$" */
/* If set, we execute the file command to check the file type */
@ -103,7 +102,7 @@ quote_block (quote_func_t quote_func, char **quoting_block)
return result;
}
void
static void
exec_extension (char *filename, char *data, char **drops, int *move_dir, int start_line)
{
char *file_name;
@ -125,9 +124,6 @@ exec_extension (char *filename, char *data, char **drops, int *move_dir, int sta
struct stat mystat;
quote_func_t quote_func = name_quote;
g_return_if_fail (filename != NULL);
g_return_if_fail (data != NULL);
/* Avoid making a local copy if we are doing a cd */
if (!vfs_file_is_local(filename))
do_local_copy = 1;

View File

@ -2,7 +2,6 @@
#define __EXT_H
char *regex_command (char *filename, char *action, char **drops, int *move_dir);
void exec_extension (char *filename, char *data, char **drops, int *move_dir, int start_line);
/* Call it after the user has edited the mc.ext file,
* to flush the cached mc.ext file

View File

@ -2056,15 +2056,8 @@ do_enter_on_file_entry (file_entry *fe)
return 1;
} else {
char *p;
#ifdef HAVE_GNOME
if (gmc_open (fe))
return 1;
else
return 0;
#else
p = regex_command (fe->fname, "Open", NULL, 0);
#endif
if (p && (strcmp (p, "Success") == 0))
return 1;
else