mirror of https://github.com/MidnightCommander/mc
2000-01-03 Aaron Lehmann <aaronl@vitelus.com>
* gdesktop.c, gdnd.c, gaction.c, gicon.c, gnome-file-property-dialog.c, gpopup.c, gpopup2.c, gprefs.cgmain.h, setup.c: Add option of using GNOME "magic" routines to determine file types. This makes MC intelligently look at the data in the file to see what type of file it is, rather than looking at the filename extension. This slows down MC quite a bit, so it has been made an optional preference item. Type detection is expected to improve as mime-magic matures.
This commit is contained in:
parent
7a4cf0fcbb
commit
0a1238fe83
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2000-01-03 Aaron Lehmann <aaronl@vitelus.com>
|
||||
|
||||
* gdesktop.c, gdnd.c, gaction.c, gicon.c,
|
||||
gnome-file-property-dialog.c, gpopup.c, gpopup2.c, gprefs.cgmain.h,
|
||||
setup.c: Add option of using GNOME "magic" routines to determine file
|
||||
types. This makes MC intelligently look at the data in the file to see
|
||||
what type of file it is, rather than looking at the filename extension.
|
||||
This slows down MC quite a bit, so it has been made an optional
|
||||
preference item. Type detection is expected to improve as mime-magic
|
||||
matures.
|
||||
|
||||
2000-01-15 Federico Mena Quintero <federico@helixcode.com>
|
||||
|
||||
* lib/mc.menu (shell_patterns): Add a missing "esac". Thanks to
|
||||
|
|
|
@ -103,13 +103,18 @@ gmc_check_exec_string (const char *buf)
|
|||
int
|
||||
gmc_open_filename (char *fname, GList *args)
|
||||
{
|
||||
/* fname is a full name */
|
||||
|
||||
const char *mime_type;
|
||||
const char *cmd;
|
||||
char *buf = NULL;
|
||||
int size;
|
||||
int needs_terminal = 0;
|
||||
|
||||
mime_type = gnome_mime_type_or_default (fname, NULL);
|
||||
if (use_magic)
|
||||
mime_type = gnome_mime_type_or_default_of_file (fname, NULL);
|
||||
else
|
||||
mime_type = gnome_mime_type_or_default (fname, NULL);
|
||||
/*
|
||||
* We accept needs_terminal as -1, which means our caller
|
||||
* did not want to do the work
|
||||
|
@ -167,6 +172,8 @@ gmc_open_filename (char *fname, GList *args)
|
|||
int
|
||||
gmc_edit (char *fname)
|
||||
{
|
||||
/* fname is a full path */
|
||||
|
||||
const char *mime_type;
|
||||
const char *cmd;
|
||||
char *buf;
|
||||
|
@ -183,7 +190,11 @@ gmc_edit (char *fname)
|
|||
return 1;
|
||||
}
|
||||
|
||||
mime_type = gnome_mime_type_or_default (fname, NULL);
|
||||
if (use_magic)
|
||||
mime_type = gnome_mime_type_or_default_of_file (fname, NULL);
|
||||
else
|
||||
mime_type = gnome_mime_type_or_default (fname, NULL);
|
||||
|
||||
if (mime_type){
|
||||
cmd = gnome_mime_get_value (mime_type, "edit");
|
||||
|
||||
|
@ -296,7 +307,11 @@ gmc_view_command (gchar *filename)
|
|||
if (gnome_metadata_get (filename, "view", &size, &buf) == 0)
|
||||
return buf;
|
||||
|
||||
mime_type = gnome_mime_type_or_default (filename, NULL);
|
||||
if (use_magic)
|
||||
mime_type = gnome_mime_type_or_default_of_file (filename, NULL);
|
||||
else
|
||||
mime_type = gnome_mime_type_or_default (filename, NULL);
|
||||
|
||||
if (!mime_type)
|
||||
return NULL;
|
||||
|
||||
|
@ -318,7 +333,10 @@ gmc_view (char *filename, int start_line)
|
|||
{
|
||||
gchar *cmd;
|
||||
const gchar *mime_type;
|
||||
mime_type = gnome_mime_type_or_default (filename, NULL);
|
||||
if (use_magic)
|
||||
mime_type = gnome_mime_type_or_default_of_file (filename, NULL);
|
||||
else
|
||||
mime_type = gnome_mime_type_or_default (filename, NULL);
|
||||
cmd = gmc_view_command (filename);
|
||||
if (cmd) {
|
||||
if (gmc_check_exec_string (cmd))
|
||||
|
|
|
@ -43,13 +43,22 @@ struct layout_slot {
|
|||
/* Configuration options for the desktop */
|
||||
|
||||
int desktop_use_shaped_icons = TRUE;
|
||||
int desktop_use_shaped_text = FALSE;
|
||||
int desktop_auto_placement = FALSE;
|
||||
int desktop_snap_icons = FALSE;
|
||||
int desktop_arr_r2l = FALSE;
|
||||
int desktop_arr_b2t = FALSE;
|
||||
int desktop_arr_rows = FALSE;
|
||||
|
||||
/*
|
||||
* Possible values for this one:
|
||||
*
|
||||
* 0 -- Enable shaped text only if window manager is GNOME compliant
|
||||
* 1 -- Enable shaped text always
|
||||
* 2 -- Disable shaped text
|
||||
*
|
||||
* This might seem a bit stra
|
||||
int desktop_use_shaped_text = 0;
|
||||
|
||||
/* The computed name of the user's desktop directory */
|
||||
char *desktop_directory;
|
||||
|
||||
|
@ -661,7 +670,15 @@ desktop_reload_icons (int user_pos, int xpos, int ypos)
|
|||
/* If the file dropped was a .desktop file, pull the suggested
|
||||
* title and icon from there
|
||||
*/
|
||||
mime = gnome_mime_type_or_default (fau->filename, NULL);
|
||||
if (use_magic)
|
||||
{
|
||||
char *full_name;
|
||||
full_name = g_concat_dir_and_file (desktop_directory, fau->filename);
|
||||
mime = gnome_mime_type_or_default_of_file (full_name, NULL);
|
||||
g_free (full_name);
|
||||
}
|
||||
else
|
||||
mime = gnome_mime_type_or_default (fau->filename, NULL);
|
||||
if (mime && strcmp (mime, "application/x-gnome-app-info") == 0) {
|
||||
GnomeDesktopEntry *entry;
|
||||
char *fullname;
|
||||
|
|
16
gnome/gdnd.c
16
gnome/gdnd.c
|
@ -20,6 +20,7 @@
|
|||
#include <gdk/gdkprivate.h>
|
||||
#include "gdesktop.h"
|
||||
#include "gdnd.h"
|
||||
#include "gmain.h"
|
||||
|
||||
|
||||
/* Atoms for the DnD target types */
|
||||
|
@ -304,6 +305,9 @@ drop_on_directory (GdkDragContext *context, GtkSelectionData *selection_data,
|
|||
static int
|
||||
file_has_drop_action (char *filename)
|
||||
{
|
||||
/* This function should be called with a full name,
|
||||
so no full_name is necessary */
|
||||
|
||||
char *buf;
|
||||
int size;
|
||||
const char *mime_type;
|
||||
|
@ -312,7 +316,11 @@ file_has_drop_action (char *filename)
|
|||
g_free (buf);
|
||||
return TRUE;
|
||||
} else {
|
||||
mime_type = gnome_mime_type_or_default (filename, NULL);
|
||||
if (use_magic)
|
||||
mime_type = gnome_mime_type_or_default_of_file (filename, NULL);
|
||||
else
|
||||
mime_type = gnome_mime_type_or_default (filename, NULL);
|
||||
|
||||
if (!mime_type)
|
||||
return FALSE;
|
||||
|
||||
|
@ -365,7 +373,11 @@ drop_on_file (GdkDragContext *context, GtkSelectionData *selection_data,
|
|||
|
||||
/* 2. Try a drop action from the MIME-type */
|
||||
|
||||
mime_type = gnome_mime_type_or_default (dest_full_name, NULL);
|
||||
if (use_magic)
|
||||
mime_type = gnome_mime_type_or_default_of_file (dest_full_name, NULL);
|
||||
else
|
||||
mime_type = gnome_mime_type_or_default (dest_full_name, NULL);
|
||||
|
||||
if (mime_type) {
|
||||
const char *action;
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include <gnome.h>
|
||||
#include "gicon.h"
|
||||
#include "gmain.h"
|
||||
|
||||
|
||||
/* What kinds of images can an icon set contain */
|
||||
|
@ -59,7 +60,6 @@ static gid_t our_gid;
|
|||
/* Whether we should always use (expensive) metadata lookups for file panels or not */
|
||||
int we_can_afford_the_speed = 0;
|
||||
|
||||
|
||||
/* Builds a composite of the plain image and the litle symlink icon */
|
||||
static GdkImlibImage *
|
||||
build_overlay (GdkImlibImage *plain, GdkImlibImage *overlay)
|
||||
|
@ -474,7 +474,15 @@ gicon_get_icon_for_file (char *directory, file_entry *fe, gboolean do_quick)
|
|||
|
||||
/* 4. Try MIME-types */
|
||||
|
||||
mime_type = gnome_mime_type_or_default (fe->fname, NULL);
|
||||
if (use_magic) {
|
||||
char *full_name;
|
||||
full_name = g_concat_dir_and_file (directory, fe->fname);
|
||||
mime_type = gnome_mime_type_or_default_of_file (full_name, NULL);
|
||||
g_free (full_name);
|
||||
}
|
||||
else
|
||||
mime_type = gnome_mime_type_or_default (fe->fname, NULL);
|
||||
|
||||
if (mime_type) {
|
||||
const char *icon_name;
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ void xtoolkit_end (void);
|
|||
extern Dlg_head *desktop_dlg;
|
||||
extern int nowindows;
|
||||
extern int corba_have_server;
|
||||
extern int use_magic;
|
||||
|
||||
/* Required by the standard code */
|
||||
widget_data xtoolkit_create_dialog (Dlg_head *h, int with_grid);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "../vfs/vfs.h"
|
||||
#include "gicon.h"
|
||||
#include "dialog.h"
|
||||
#include "gmain.h"
|
||||
|
||||
static void gnome_file_property_dialog_init (GnomeFilePropertyDialog *file_property_dialog);
|
||||
static void gnome_file_property_dialog_class_init (GnomeFilePropertyDialogClass *klass);
|
||||
|
@ -198,9 +199,18 @@ create_general_properties (GnomeFilePropertyDialog *fp_dlg)
|
|||
/* File statistics */
|
||||
/* File type first */
|
||||
if (S_ISREG (fp_dlg->st.st_mode)) {
|
||||
gen_string = g_strconcat (_("File Type: "),
|
||||
gnome_mime_type (fp_dlg->file_name),
|
||||
NULL);
|
||||
if (use_magic)
|
||||
{
|
||||
gen_string = g_strconcat (_("File Type: "),
|
||||
gnome_mime_type_or_default_of_file (fp_dlg->file_name, "text/plain"),
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
gen_string = g_strconcat (_("File Type: "),
|
||||
gnome_mime_type (fp_dlg->file_name),
|
||||
NULL);
|
||||
}
|
||||
label = gtk_label_new (gen_string);
|
||||
g_free (gen_string);
|
||||
} else if (S_ISLNK (fp_dlg->st.st_mode)) {
|
||||
|
@ -624,8 +634,10 @@ create_settings_pane (GnomeFilePropertyDialog *fp_dlg)
|
|||
}
|
||||
|
||||
/* Permissions Pane */
|
||||
/* Name changed to dialog_label_new so it doesn't conflict with something
|
||||
in widget.h */
|
||||
static GtkWidget *
|
||||
label_new (char *text, double xalign, double yalign)
|
||||
dialog_label_new (char *text, double xalign, double yalign)
|
||||
{
|
||||
GtkWidget *label;
|
||||
|
||||
|
@ -724,7 +736,7 @@ gtk_table_attach (GTK_TABLE (table), widget, \
|
|||
w = perm_check_new (NULL, fp_dlg->st.st_mode & wmask, fp_dlg); \
|
||||
x = perm_check_new (NULL, fp_dlg->st.st_mode & xmask, fp_dlg); \
|
||||
\
|
||||
ATTACH (table, label_new (name, 0.0, 0.5), 0, 1, y, y + 1); \
|
||||
ATTACH (table, dialog_label_new (name, 0.0, 0.5), 0, 1, y, y + 1);\
|
||||
ATTACH (table, r, 1, 2, y, y + 1); \
|
||||
ATTACH (table, w, 2, 3, y, y + 1); \
|
||||
ATTACH (table, x, 3, 4, y, y + 1); \
|
||||
|
@ -750,9 +762,9 @@ perm_mode_new (GnomeFilePropertyDialog *fp_dlg)
|
|||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label_new (_("Current mode: "), 0.0, 0.5), FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), dialog_label_new (_("Current mode: "), 0.0, 0.5), FALSE, FALSE, 0);
|
||||
|
||||
fp_dlg->mode_label = label_new ("0000", 0.0, 0.5);
|
||||
fp_dlg->mode_label = dialog_label_new ("0000", 0.0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), fp_dlg->mode_label, FALSE, FALSE, 0);
|
||||
|
||||
table = gtk_table_new (4, 5, FALSE);
|
||||
|
@ -765,10 +777,10 @@ perm_mode_new (GnomeFilePropertyDialog *fp_dlg)
|
|||
|
||||
/* Headings */
|
||||
|
||||
ATTACH (table, label_new (_("Read"), 0.0, 0.5), 1, 2, 0, 1);
|
||||
ATTACH (table, label_new (_("Write"), 0.0, 0.5), 2, 3, 0, 1);
|
||||
ATTACH (table, label_new (_("Exec"), 0.0, 0.5), 3, 4, 0, 1);
|
||||
ATTACH (table, label_new (_("Special"), 0.0, 0.5), 4, 5, 0, 1);
|
||||
ATTACH (table, dialog_label_new (_("Read"), 0.0, 0.5), 1, 2, 0, 1);
|
||||
ATTACH (table, dialog_label_new (_("Write"), 0.0, 0.5), 2, 3, 0, 1);
|
||||
ATTACH (table, dialog_label_new (_("Exec"), 0.0, 0.5), 3, 4, 0, 1);
|
||||
ATTACH (table, dialog_label_new (_("Special"), 0.0, 0.5), 4, 5, 0, 1);
|
||||
|
||||
/* Permissions */
|
||||
|
||||
|
@ -927,7 +939,7 @@ perm_ownership_new (GnomeFilePropertyDialog *fp_dlg)
|
|||
|
||||
/* Owner */
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), label_new (_("Owner"), 0.0, 0.5),
|
||||
gtk_table_attach (GTK_TABLE (table), dialog_label_new (_("Owner"), 0.0, 0.5),
|
||||
0, 1, 0, 1,
|
||||
GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK,
|
||||
0, 0);
|
||||
|
@ -942,7 +954,7 @@ perm_ownership_new (GnomeFilePropertyDialog *fp_dlg)
|
|||
|
||||
/* Group */
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), label_new (_("Group"), 0.0, 0.5),
|
||||
gtk_table_attach (GTK_TABLE (table), dialog_label_new (_("Group"), 0.0, 0.5),
|
||||
0, 1, 1, 2,
|
||||
GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK,
|
||||
0, 0);
|
||||
|
@ -1016,7 +1028,13 @@ init_metadata (GnomeFilePropertyDialog *fp_dlg)
|
|||
/*
|
||||
* Mime type.
|
||||
*/
|
||||
mime_type = (char *) gnome_mime_type_or_default (file_name, NULL);
|
||||
if (use_magic)
|
||||
{
|
||||
mime_type = (char *) gnome_mime_type_or_default_of_file (file_name, NULL);
|
||||
}
|
||||
else
|
||||
mime_type = (char *) gnome_mime_type_or_default (file_name, NULL);
|
||||
|
||||
if (!mime_type)
|
||||
return;
|
||||
fp_dlg->mime_fm_open = gnome_mime_get_value (mime_type, "fm-open");
|
||||
|
|
|
@ -483,7 +483,10 @@ mime_command_from_desktop_icon (GtkMenuItem *item, char *filename)
|
|||
action = get_label_text (item);
|
||||
|
||||
key = gtk_object_get_user_data (GTK_OBJECT (item));
|
||||
mime_type = gnome_mime_type_or_default (filename, NULL);
|
||||
if (use_magic)
|
||||
mime_type = gnome_mime_type_or_default_of_file (filename, NULL);
|
||||
else
|
||||
mime_type = gnome_mime_type_or_default (filename, NULL);
|
||||
if (!mime_type)
|
||||
return;
|
||||
|
||||
|
@ -534,7 +537,10 @@ create_regexp_actions (GtkWidget *menu, WPanel *panel,
|
|||
|
||||
/* Fill in the regex command part */
|
||||
|
||||
mime_type = gnome_mime_type_or_default (filename, NULL);
|
||||
if (use_magic)
|
||||
mime_type = gnome_mime_type_or_default_of_file (filename, NULL);
|
||||
else
|
||||
mime_type = gnome_mime_type_or_default (filename, NULL);
|
||||
if (!mime_type)
|
||||
return;
|
||||
|
||||
|
|
|
@ -305,7 +305,10 @@ mime_action_callback (GtkWidget *widget, gpointer data)
|
|||
g_assert (filename != NULL);
|
||||
g_assert (key != NULL);
|
||||
|
||||
mime_type = gnome_mime_type_or_default (filename, NULL);
|
||||
if (use_magic)
|
||||
mime_type = gnome_mime_type_or_default_of_file (filename, NULL);
|
||||
else
|
||||
mime_type = gnome_mime_type_or_default (filename, NULL);
|
||||
g_assert (mime_type != NULL);
|
||||
|
||||
/*
|
||||
|
@ -371,8 +374,10 @@ create_mime_actions (GtkWidget *menu, WPanel *panel, int pos, DesktopIconInfo *d
|
|||
} else
|
||||
full_name = g_concat_dir_and_file (panel->cwd,
|
||||
panel->dir.list[panel->selected].fname);
|
||||
mime_type = gnome_mime_type_or_default (full_name, NULL);
|
||||
|
||||
if (use_magic)
|
||||
mime_type = gnome_mime_type_or_default_of_file (full_name, NULL);
|
||||
else
|
||||
mime_type = gnome_mime_type_or_default (full_name, NULL);
|
||||
if (!mime_type) {
|
||||
g_free (full_name);
|
||||
return pos;
|
||||
|
|
|
@ -104,6 +104,10 @@ static Property file_display_props [] =
|
|||
N_("Use shell patterns instead of regular expressions"), PROPERTY_BOOL,
|
||||
&easy_patterns, NULL, NULL, NULL
|
||||
},
|
||||
{
|
||||
N_("Determine file types from file content instead of extensions"), PROPERTY_BOOL,
|
||||
&use_magic, NULL, NULL, NULL
|
||||
},
|
||||
PROPERTIES_DONE
|
||||
};
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ Hint: Find File: you can work on the files found using the Panelize button.
|
|||
Hint: Want to do complex searches? Use the External Panelize command.
|
||||
Hint: To change directory halfway through typing a command, use M-c (quick cd).
|
||||
Note: Shell commands will not work when you are on a non-local file system.
|
||||
Hint: Bring text back from the dead with C-y.
|
||||
Hint: Bring text back from the dead with C-u.
|
||||
Hint: Are some of your keys not working? Look at Options/Learn keys.
|
||||
Hint: To look at the output of a command in the viewer, use M-!
|
||||
Hint: F13 (or Shift-F3) invokes the viewer in raw mode.
|
||||
|
|
|
@ -4,85 +4,86 @@
|
|||
# define VERSION "undefined"
|
||||
#endif
|
||||
|
||||
char *features =
|
||||
"Edition: "
|
||||
static const char * const features [] = {
|
||||
N_("Edition: "),
|
||||
#ifdef HAVE_X
|
||||
# ifdef HAVE_XVIEW
|
||||
"XView"
|
||||
N_("XView"),
|
||||
# else
|
||||
"Tk"
|
||||
N_("Tk"),
|
||||
# endif
|
||||
#else
|
||||
"text mode"
|
||||
N_("text mode"),
|
||||
#ifdef HAVE_TEXTMODE_X11_SUPPORT
|
||||
" with X11 support to read modifiers"
|
||||
N_(" with X11 support to read modifiers"),
|
||||
#endif
|
||||
#endif
|
||||
".\n"
|
||||
".\n",
|
||||
|
||||
#ifdef USE_VFS
|
||||
"Virtual File System: tarfs, extfs"
|
||||
N_("Virtual File System: tarfs, extfs"),
|
||||
#ifdef USE_NETCODE
|
||||
", ftpfs"
|
||||
N_(", ftpfs"),
|
||||
# ifdef HSC_PROXY
|
||||
" (proxies: hsc proxy)"
|
||||
N_(" (proxies: hsc proxy)"),
|
||||
# endif
|
||||
", mcfs"
|
||||
N_(", mcfs"),
|
||||
# ifdef USE_TERMNET
|
||||
" (with termnet support)"
|
||||
N_(" (with termnet support)"),
|
||||
# endif
|
||||
# ifdef WITH_SMBFS
|
||||
", smbfs"
|
||||
N_(", smbfs"),
|
||||
# endif
|
||||
#endif
|
||||
#ifdef USE_EXT2FSLIB
|
||||
", undelfs"
|
||||
N_(", undelfs"),
|
||||
#endif
|
||||
".\n"
|
||||
".\n",
|
||||
#endif
|
||||
|
||||
#ifdef USE_INTERNAL_EDIT
|
||||
"With builtin Editor\n"
|
||||
N_("With builtin Editor\n"),
|
||||
#endif
|
||||
|
||||
"Using "
|
||||
N_("Using "),
|
||||
#ifdef HAVE_SLANG
|
||||
# ifdef HAVE_SYSTEM_SLANG
|
||||
"system-installed "
|
||||
N_("system-installed "),
|
||||
# endif
|
||||
"S-lang library with "
|
||||
N_("S-lang library with "),
|
||||
|
||||
# ifdef SLANG_TERMINFO
|
||||
"terminfo"
|
||||
N_("terminfo"),
|
||||
# else
|
||||
# ifdef USE_TERMCAP
|
||||
"termcap"
|
||||
N_("termcap"),
|
||||
# else
|
||||
"an unknown terminal"
|
||||
N_("an unknown terminal"),
|
||||
# endif
|
||||
# endif
|
||||
" database"
|
||||
N_(" database"),
|
||||
#else
|
||||
# ifdef USE_NCURSES
|
||||
"the ncurses library"
|
||||
N_("the ncurses library"),
|
||||
# else
|
||||
"some unknown curses library"
|
||||
N_("some unknown curses library"),
|
||||
# endif
|
||||
#endif
|
||||
"\n"
|
||||
"\n",
|
||||
#ifdef HAVE_SUBSHELL_SUPPORT
|
||||
"With subshell support: "
|
||||
N_("With subshell support: "),
|
||||
# ifdef SUBSHELL_OPTIONAL
|
||||
"optional"
|
||||
N_("optional"),
|
||||
# else
|
||||
"as default"
|
||||
N_("as default"),
|
||||
# endif
|
||||
"\n"
|
||||
"\n",
|
||||
#endif
|
||||
|
||||
#ifdef WITH_BACKGROUND
|
||||
"With support for background operations\n"
|
||||
N_("With support for background operations\n"),
|
||||
#endif
|
||||
NULL }
|
||||
;
|
||||
|
||||
static const int status_mouse_support =
|
||||
|
@ -103,4 +104,3 @@ const int status_using_ncurses =
|
|||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
|
86
src/main.c
86
src/main.c
|
@ -2283,8 +2283,8 @@ version (int verbose)
|
|||
_("with mouse support on xterm%s.\n"),
|
||||
status_mouse_support ? _(" and the Linux console") : "");
|
||||
#endif /* HAVE_X */
|
||||
|
||||
fprintf (stderr, features);
|
||||
for (verbose = 0; features [verbose]; verbose++)
|
||||
fprintf (stderr, _(features [verbose]));
|
||||
if (print_last_wd)
|
||||
write (stdout_fd, ".", 1);
|
||||
}
|
||||
|
@ -2480,63 +2480,69 @@ init_sigchld (void)
|
|||
static void
|
||||
print_mc_usage (void)
|
||||
{
|
||||
version (0);
|
||||
fprintf (stderr,
|
||||
"Usage is:\n\n"
|
||||
"mc [flags] [this_dir] [other_panel_dir]\n\n"
|
||||
const char * const ptr;
|
||||
const char * const usage [] = {
|
||||
|
||||
N_("Usage is:\n\n"
|
||||
"mc [flags] [this_dir] [other_panel_dir]\n\n"),
|
||||
#if defined(HAVE_SLANG) && !defined(OS2_NT)
|
||||
"-a, --stickchars Force use of +, -, | for line drawing.\n"
|
||||
N_("-a, --stickchars Force use of +, -, | for line drawing.\n"),
|
||||
#endif
|
||||
"-b, --nocolor Force black and white display.\n"
|
||||
N_("-b, --nocolor Force black and white display.\n"),
|
||||
#ifdef WITH_BACKGROUND
|
||||
"-B, --background [DEVEL-ONLY: Debug the background code]\n"
|
||||
N_("-B, --background [DEVEL-ONLY: Debug the background code]\n"),
|
||||
#endif
|
||||
"-c, --color Force color mode.\n"
|
||||
"-C, --colors Specify colors (use --help-colors to get a list).\n"
|
||||
"-d, --nomouse Disable mouse support.\n"
|
||||
N_("-c, --color Force color mode.\n"
|
||||
"-C, --colors Specify colors (use --help-colors to get a list).\n"
|
||||
"-d, --nomouse Disable mouse support.\n"),
|
||||
#ifdef USE_INTERNAL_EDIT
|
||||
"-e, --edit Startup the internal editor.\n"
|
||||
N_("-e, --edit Startup the internal editor.\n"),
|
||||
#endif
|
||||
"-f, --libdir Print configured paths.\n"
|
||||
"-h, --help Shows this help message.\n"
|
||||
"-k, --resetsoft Reset softkeys (HP terminals only) to their terminfo/termcap\n"
|
||||
" default.\n"
|
||||
N_("-f, --libdir Print configured paths.\n"
|
||||
"-h, --help Shows this help message.\n"
|
||||
"-k, --resetsoft Reset softkeys (HP terminals only) to their terminfo/termcap\n"
|
||||
" default.\n"),
|
||||
#ifdef USE_NETCODE
|
||||
"-l, --ftplog file Log ftpfs commands to the file.\n"
|
||||
N_("-l, --ftplog file Log ftpfs commands to the file.\n"),
|
||||
#endif
|
||||
#ifdef HAVE_MAD
|
||||
"-M, --memory file [DEVEL-ONLY: Log MAD messages to the file.]\n"
|
||||
N_("-M, --memory file [DEVEL-ONLY: Log MAD messages to the file.]\n"),
|
||||
#endif
|
||||
"-P, --printwd At exit, print the last working directory.\n"
|
||||
"-s, --slow Disables verbose operation (for slow terminals).\n"
|
||||
N_("-P, --printwd At exit, print the last working directory.\n"
|
||||
"-s, --slow Disables verbose operation (for slow terminals).\n"),
|
||||
#if defined(HAVE_SLANG) && !defined(OS2_NT)
|
||||
"-t, --termcap Activate support for the TERMCAP variable.\n"
|
||||
N_("-t, --termcap Activate support for the TERMCAP variable.\n"),
|
||||
#endif
|
||||
#if defined(HAVE_SLANG) && defined(OS2_NT)
|
||||
"-S, --createcmdile Create command file to set default directory upon exit.\n"
|
||||
N_("-S, --createcmdile Create command file to set default directory upon exit.\n"),
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SUBSHELL_SUPPORT
|
||||
"-u, --nosubshell Disable the concurrent subshell mode.\n"
|
||||
"-U, --subshell Force the concurrent subshell mode.\n"
|
||||
"-r, --forceexec Force subshell execution.\n"
|
||||
N_("-u, --nosubshell Disable the concurrent subshell mode.\n"
|
||||
"-U, --subshell Force the concurrent subshell mode.\n"
|
||||
"-r, --forceexec Force subshell execution.\n"),
|
||||
#endif
|
||||
"-v, --view fname Start up into the viewer mode.\n"
|
||||
"-V, --version Report version and configuration options.\n"
|
||||
"-x, --xterm Force xterm mouse support and screen save/restore.\n"
|
||||
N_("-v, --view fname Start up into the viewer mode.\n"
|
||||
"-V, --version Report version and configuration options.\n"
|
||||
"-x, --xterm Force xterm mouse support and screen save/restore.\n"),
|
||||
#ifdef HAVE_SUBSHELL_SUPPORT
|
||||
"-X, --dbgsubshell [DEVEL-ONLY: Debug the subshell].\n"
|
||||
N_("-X, --dbgsubshell [DEVEL-ONLY: Debug the subshell].\n"),
|
||||
#endif
|
||||
"\n"
|
||||
"Please send any bug reports (including the output of `mc -V')\n"
|
||||
"to mc-bugs@nuclecu.unam.mx\n"
|
||||
);
|
||||
N_("\n"
|
||||
"Please send any bug reports (including the output of `mc -V')\n"
|
||||
"to mc-bugs@nuclecu.unam.mx\n"),
|
||||
NULL
|
||||
};
|
||||
|
||||
version (0);
|
||||
|
||||
for (ptr = usage; *ptr; ptr++)
|
||||
fprintf (stderr, _(*ptr));
|
||||
}
|
||||
|
||||
static void
|
||||
print_color_usage (void)
|
||||
{
|
||||
fprintf (stderr,
|
||||
fprintf (stderr, _(
|
||||
"--colors KEYWORD={FORE},{BACK}\n\n"
|
||||
"{FORE} and {BACK} can be ommited, and the default will be used\n"
|
||||
"\n"
|
||||
|
@ -2551,11 +2557,9 @@ print_color_usage (void)
|
|||
"Colors:\n"
|
||||
" black, gray, red, brightred, green, brightgreen, brown,\n"
|
||||
" yellow, blue, brightblue, magenta, brightmagenta, cyan,\n"
|
||||
" brightcyan, lightgray and white\n\n");
|
||||
|
||||
" brightcyan, lightgray and white\n\n"));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
probably_finish_program (void)
|
||||
{
|
||||
|
@ -2755,6 +2759,7 @@ static struct poptOption argument_table [] = {
|
|||
{ NULL, 0, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
#if defined(HAVE_CORBA) || defined(HAVE_GNOME)
|
||||
/* Convenience function to display the desktop initialization directory and exit */
|
||||
static void
|
||||
maybe_display_linksdir (void)
|
||||
|
@ -2764,6 +2769,7 @@ maybe_display_linksdir (void)
|
|||
exit (1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CORBA
|
||||
/* Initializes the ORB and does the initial argument processing */
|
||||
|
@ -3008,7 +3014,7 @@ main (int argc, char *argv [])
|
|||
if (base){
|
||||
if (strcmp (base, "mcedit") == 0)
|
||||
edit_one_file = "";
|
||||
|
||||
else
|
||||
if (strcmp (base, "mcview") == 0)
|
||||
view_one_file = "";
|
||||
}
|
||||
|
|
|
@ -67,6 +67,7 @@ extern int ftpfs_first_cd_then_ls;
|
|||
#ifdef HAVE_GNOME
|
||||
extern int tree_panel_visible;
|
||||
extern int we_can_afford_the_speed;
|
||||
int use_magic = 0;
|
||||
#endif
|
||||
|
||||
/* "$Id$" */
|
||||
|
@ -219,6 +220,9 @@ static struct {
|
|||
{ "xtree_mode", &xtree_mode },
|
||||
{ "num_history_items_recorded", &num_history_items_recorded },
|
||||
{ "file_op_compute_totals", &file_op_compute_totals },
|
||||
#ifdef HAVE_GNOME
|
||||
{ "use_magic", &use_magic },
|
||||
#endif
|
||||
#ifdef SAVE_CHANGES_OUTSIDE_OPTIONS_MENU
|
||||
{ "dive_into_subdirs", &dive_into_subdirs },
|
||||
{ "preserve_uidgid", &preserve_uidgid },
|
||||
|
|
Loading…
Reference in New Issue