Fully eliminate all references to HAVE_X and HAVE_GNOME.
Этот коммит содержится в:
родитель
5fac744c29
Коммит
fa89635b51
@ -1,5 +1,7 @@
|
|||||||
2001-11-14 Pavel Roskin <proski@gnu.org>
|
2001-11-14 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
Fully eliminate all references to HAVE_X and HAVE_GNOME.
|
||||||
|
|
||||||
* dir.c (do_sort): Correctly handle the case when there is no
|
* dir.c (do_sort): Correctly handle the case when there is no
|
||||||
".." entry (i.e. panelized mode).
|
".." entry (i.e. panelized mode).
|
||||||
|
|
||||||
|
@ -398,9 +398,7 @@ background_attention (int fd, void *closure)
|
|||||||
|
|
||||||
do_refresh ();
|
do_refresh ();
|
||||||
mc_refresh ();
|
mc_refresh ();
|
||||||
#ifndef HAVE_X
|
|
||||||
doupdate ();
|
doupdate ();
|
||||||
#endif /* !HAVE_X */
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,6 @@ static struct {
|
|||||||
{ TY+10,TX+2 }
|
{ TY+10,TX+2 }
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
static void
|
static void
|
||||||
chown_refresh (void)
|
chown_refresh (void)
|
||||||
{
|
{
|
||||||
@ -127,7 +126,6 @@ chown_refresh (void)
|
|||||||
dlg_move (ch_dlg, TY, TX + 1);
|
dlg_move (ch_dlg, TY, TX + 1);
|
||||||
addstr (_(" File "));
|
addstr (_(" File "));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
next_file (void)
|
next_file (void)
|
||||||
@ -142,11 +140,9 @@ static int
|
|||||||
chown_callback (Dlg_head * h, int Par, int Msg)
|
chown_callback (Dlg_head * h, int Par, int Msg)
|
||||||
{
|
{
|
||||||
switch (Msg) {
|
switch (Msg) {
|
||||||
#ifndef HAVE_X
|
|
||||||
case DLG_DRAW:
|
case DLG_DRAW:
|
||||||
chown_refresh ();
|
chown_refresh ();
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
22
src/cmd.c
22
src/cmd.c
@ -1040,16 +1040,7 @@ void link_cmd (void)
|
|||||||
void symlink_cmd (void)
|
void symlink_cmd (void)
|
||||||
{
|
{
|
||||||
char *filename = NULL;
|
char *filename = NULL;
|
||||||
if (is_a_desktop_panel (cpanel)) {
|
filename = selection (cpanel)->fname;
|
||||||
gint i;
|
|
||||||
for (i = 0; i < cpanel->count; i++)
|
|
||||||
if (cpanel->dir.list [i].f.marked) {
|
|
||||||
filename = cpanel->dir.list [i].fname;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
filename = selection (cpanel)->fname;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (filename) {
|
if (filename) {
|
||||||
do_link (1, filename);
|
do_link (1, filename);
|
||||||
@ -1064,16 +1055,7 @@ void edit_symlink_cmd (void)
|
|||||||
int i;
|
int i;
|
||||||
char *dest, *q;
|
char *dest, *q;
|
||||||
|
|
||||||
if (is_a_desktop_panel (cpanel)) {
|
p = selection (cpanel)->fname;
|
||||||
gint i;
|
|
||||||
for (i = 0; i < cpanel->count; i++)
|
|
||||||
if (cpanel->dir.list [i].f.marked) {
|
|
||||||
p = cpanel->dir.list [i].fname;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
p = selection (cpanel)->fname;
|
|
||||||
}
|
|
||||||
|
|
||||||
q = g_strdup_printf (_(" Symlink `%s\' points to: "), name_trunc (p, 32));
|
q = g_strdup_printf (_(" Symlink `%s\' points to: "), name_trunc (p, 32));
|
||||||
|
|
||||||
|
@ -803,11 +803,9 @@ void free_completions (WInput *in)
|
|||||||
in->completions = NULL;
|
in->completions = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_GNOME
|
|
||||||
static int query_height, query_width;
|
static int query_height, query_width;
|
||||||
static WInput *input;
|
static WInput *input;
|
||||||
static int min_end;
|
static int min_end;
|
||||||
#endif /* !HAVE_GNOME */
|
|
||||||
static int start, end;
|
static int start, end;
|
||||||
|
|
||||||
static int insert_text (WInput *in, char *text, int len)
|
static int insert_text (WInput *in, char *text, int len)
|
||||||
@ -840,7 +838,6 @@ static int insert_text (WInput *in, char *text, int len)
|
|||||||
return len != 0;
|
return len != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_GNOME
|
|
||||||
static int query_callback (Dlg_head * h, int Par, int Msg)
|
static int query_callback (Dlg_head * h, int Par, int Msg)
|
||||||
{
|
{
|
||||||
switch (Msg) {
|
switch (Msg) {
|
||||||
@ -944,7 +941,6 @@ static int querylist_callback (void *data)
|
|||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_GNOME */
|
|
||||||
|
|
||||||
#define DO_INSERTION 1
|
#define DO_INSERTION 1
|
||||||
#define DO_QUERY 2
|
#define DO_QUERY 2
|
||||||
@ -977,7 +973,6 @@ complete_engine (WInput *in, int what_to_do)
|
|||||||
* because we do not have a Gtk dialog for it. Gtk-ted does not like
|
* because we do not have a Gtk dialog for it. Gtk-ted does not like
|
||||||
* this; if we enable this code, it will crash.
|
* this; if we enable this code, it will crash.
|
||||||
*/
|
*/
|
||||||
#ifndef HAVE_GNOME
|
|
||||||
if ((what_to_do & DO_QUERY) && in->completions [1]) {
|
if ((what_to_do & DO_QUERY) && in->completions [1]) {
|
||||||
int maxlen = 0, i, count = 0;
|
int maxlen = 0, i, count = 0;
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
@ -1036,10 +1031,6 @@ complete_engine (WInput *in, int what_to_do)
|
|||||||
if (i == B_USER)
|
if (i == B_USER)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (what_to_do & DO_QUERY)
|
|
||||||
beep ();
|
|
||||||
#endif
|
|
||||||
} else
|
} else
|
||||||
beep ();
|
beep ();
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#ifndef __CONS_SAVER_H
|
#ifndef __CONS_SAVER_H
|
||||||
#define __CONS_SAVER_H
|
#define __CONS_SAVER_H
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
enum {
|
enum {
|
||||||
CONSOLE_INIT = '1',
|
CONSOLE_INIT = '1',
|
||||||
CONSOLE_DONE,
|
CONSOLE_DONE,
|
||||||
@ -21,10 +20,4 @@ int look_for_rxvt_extensions (void);
|
|||||||
/* Used only in the principal program */
|
/* Used only in the principal program */
|
||||||
extern int cons_saver_pid;
|
extern int cons_saver_pid;
|
||||||
|
|
||||||
#else /* HAVE_X */
|
|
||||||
# define console_flag 0
|
|
||||||
# define show_console_contents(w,f,l) { }
|
|
||||||
# define handle_console(x) { }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __CONS_SAVER_H */
|
#endif /* __CONS_SAVER_H */
|
||||||
|
@ -76,7 +76,6 @@ void do_refresh (void)
|
|||||||
if (we_are_background)
|
if (we_are_background)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef HAVE_GNOME
|
|
||||||
if (!refresh_list)
|
if (!refresh_list)
|
||||||
return;
|
return;
|
||||||
else {
|
else {
|
||||||
@ -86,7 +85,6 @@ void do_refresh (void)
|
|||||||
do_complete_refresh (refresh_list);
|
do_complete_refresh (refresh_list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
10
src/dir.c
10
src/dir.c
@ -32,16 +32,8 @@
|
|||||||
|
|
||||||
/* "$Id$" */
|
/* "$Id$" */
|
||||||
|
|
||||||
/*
|
/* If true show files starting with a dot */
|
||||||
* If true show files starting with a dot.
|
|
||||||
*
|
|
||||||
* In GNOME we default to not showing them.
|
|
||||||
*/
|
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
int show_dot_files = 0;
|
|
||||||
#else
|
|
||||||
int show_dot_files = 1;
|
int show_dot_files = 1;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If true show files ending in ~ */
|
/* If true show files ending in ~ */
|
||||||
int show_backups = 0;
|
int show_backups = 0;
|
||||||
|
@ -13,9 +13,7 @@ void flush_extension_file (void);
|
|||||||
# define MC_USER_EXT "mc.ext"
|
# define MC_USER_EXT "mc.ext"
|
||||||
# define MC_LIB_EXT "mc.ext"
|
# define MC_LIB_EXT "mc.ext"
|
||||||
#else
|
#else
|
||||||
# ifndef HAVE_GNOME
|
# define MC_USER_EXT ".mc/bindings"
|
||||||
# define MC_USER_EXT ".mc/bindings"
|
# define MC_LIB_EXT "mc.ext"
|
||||||
# define MC_LIB_EXT "mc.ext"
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
113
src/file.c
113
src/file.c
@ -547,12 +547,6 @@ copy_file_file (FileOpContext *ctx, char *src_path, char *dst_path, int ask_over
|
|||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
retval = make_symlink (ctx, src_path, dst_path);
|
retval = make_symlink (ctx, src_path, dst_path);
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
if (retval == FILE_CONT) {
|
|
||||||
gnome_metadata_delete (dst_path);
|
|
||||||
gnome_metadata_copy (src_path, dst_path);
|
|
||||||
}
|
|
||||||
#endif /* !HAVE_GNOME */
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -585,10 +579,6 @@ copy_file_file (FileOpContext *ctx, char *src_path, char *dst_path, int ask_over
|
|||||||
return temp_status;
|
return temp_status;
|
||||||
}
|
}
|
||||||
#endif /* !__os2__ */
|
#endif /* !__os2__ */
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
gnome_metadata_delete (dst_path);
|
|
||||||
gnome_metadata_copy (src_path, dst_path);
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
return FILE_CONT;
|
return FILE_CONT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -631,11 +621,6 @@ copy_file_file (FileOpContext *ctx, char *src_path, char *dst_path, int ask_over
|
|||||||
do not create a security hole. FIXME: You have security hole
|
do not create a security hole. FIXME: You have security hole
|
||||||
here, btw. Imagine copying to /tmp and symlink attack :-( */
|
here, btw. Imagine copying to /tmp and symlink attack :-( */
|
||||||
|
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
if (!ctx->do_append)
|
|
||||||
gnome_metadata_delete (dst_path);
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
|
|
||||||
while ((dest_desc = mc_open (dst_path, O_WRONLY |
|
while ((dest_desc = mc_open (dst_path, O_WRONLY |
|
||||||
(ctx->do_append ? O_APPEND : (O_CREAT | O_TRUNC)), 0600)) < 0){
|
(ctx->do_append ? O_APPEND : (O_CREAT | O_TRUNC)), 0600)) < 0){
|
||||||
return_status = file_error (_(" Cannot create target file \"%s\" \n %s "), dst_path);
|
return_status = file_error (_(" Cannot create target file \"%s\" \n %s "), dst_path);
|
||||||
@ -808,10 +793,6 @@ copy_file_file (FileOpContext *ctx, char *src_path, char *dst_path, int ask_over
|
|||||||
}
|
}
|
||||||
#endif /* !OS2_NT */
|
#endif /* !OS2_NT */
|
||||||
|
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
gnome_metadata_delete (dst_path);
|
|
||||||
gnome_metadata_copy (src_path, dst_path);
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
/*
|
/*
|
||||||
* .ado: according to the XPG4 standard, the file must be closed before
|
* .ado: according to the XPG4 standard, the file must be closed before
|
||||||
* chmod can be invoked
|
* chmod can be invoked
|
||||||
@ -911,10 +892,6 @@ copy_dir_dir (FileOpContext *ctx, char *s, char *d, int toplevel,
|
|||||||
|
|
||||||
if (move_over){
|
if (move_over){
|
||||||
if (mc_rename (s, d) == 0){
|
if (mc_rename (s, d) == 0){
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
gnome_metadata_delete (d);
|
|
||||||
gnome_metadata_copy (s, d);
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
g_free (parent_dirs);
|
g_free (parent_dirs);
|
||||||
return FILE_CONT;
|
return FILE_CONT;
|
||||||
}
|
}
|
||||||
@ -957,11 +934,6 @@ copy_dir_dir (FileOpContext *ctx, char *s, char *d, int toplevel,
|
|||||||
goto ret;
|
goto ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
gnome_metadata_delete (dest_dir);
|
|
||||||
gnome_metadata_copy (s, dest_dir);
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
|
|
||||||
lp = g_new (struct link, 1);
|
lp = g_new (struct link, 1);
|
||||||
mc_stat (dest_dir, &buf);
|
mc_stat (dest_dir, &buf);
|
||||||
lp->vfs = vfs_type (dest_dir);
|
lp->vfs = vfs_type (dest_dir);
|
||||||
@ -1075,9 +1047,6 @@ move_file_file (FileOpContext *ctx, char *s, char *d,
|
|||||||
{
|
{
|
||||||
struct stat src_stats, dst_stats;
|
struct stat src_stats, dst_stats;
|
||||||
int return_status = FILE_CONT;
|
int return_status = FILE_CONT;
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
int delete_metadata = TRUE;
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
|
|
||||||
if (file_progress_show_source (ctx, s) == FILE_ABORT
|
if (file_progress_show_source (ctx, s) == FILE_ABORT
|
||||||
|| file_progress_show_target (ctx, d) == FILE_ABORT)
|
|| file_progress_show_target (ctx, d) == FILE_ABORT)
|
||||||
@ -1133,21 +1102,12 @@ move_file_file (FileOpContext *ctx, char *s, char *d,
|
|||||||
if (!ctx->do_append) {
|
if (!ctx->do_append) {
|
||||||
if (S_ISLNK (src_stats.st_mode) && ctx->stable_symlinks) {
|
if (S_ISLNK (src_stats.st_mode) && ctx->stable_symlinks) {
|
||||||
if ((return_status = make_symlink (ctx, s, d)) == FILE_CONT) {
|
if ((return_status = make_symlink (ctx, s, d)) == FILE_CONT) {
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
gnome_metadata_delete (d);
|
|
||||||
gnome_metadata_rename (s, d);
|
|
||||||
delete_metadata = FALSE;
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
goto retry_src_remove;
|
goto retry_src_remove;
|
||||||
} else
|
} else
|
||||||
return return_status;
|
return return_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mc_rename (s, d) == 0){
|
if (mc_rename (s, d) == 0){
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
gnome_metadata_delete (d);
|
|
||||||
gnome_metadata_rename (s, d);
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
return FILE_CONT;
|
return FILE_CONT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1185,10 +1145,6 @@ move_file_file (FileOpContext *ctx, char *s, char *d,
|
|||||||
goto retry_src_remove;
|
goto retry_src_remove;
|
||||||
return return_status;
|
return return_status;
|
||||||
}
|
}
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
if (delete_metadata)
|
|
||||||
gnome_metadata_delete (s);
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
|
|
||||||
if (return_status == FILE_CONT)
|
if (return_status == FILE_CONT)
|
||||||
return_status = progress_update_one (ctx,
|
return_status = progress_update_one (ctx,
|
||||||
@ -1266,10 +1222,6 @@ move_dir_dir (FileOpContext *ctx, char *s, char *d,
|
|||||||
|
|
||||||
retry_rename:
|
retry_rename:
|
||||||
if (mc_rename (s, destdir) == 0){
|
if (mc_rename (s, destdir) == 0){
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
gnome_metadata_delete (destdir);
|
|
||||||
gnome_metadata_rename (s, destdir);
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
return_status = FILE_CONT;
|
return_status = FILE_CONT;
|
||||||
goto ret;
|
goto ret;
|
||||||
}
|
}
|
||||||
@ -1350,9 +1302,7 @@ erase_file (FileOpContext *ctx, char *s, off_t *progress_count, double *progress
|
|||||||
if (return_status != FILE_RETRY)
|
if (return_status != FILE_RETRY)
|
||||||
return return_status;
|
return return_status;
|
||||||
}
|
}
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
gnome_metadata_delete (s);
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
if (progress_count)
|
if (progress_count)
|
||||||
return progress_update_one (ctx, progress_count, progress_bytes, buf.st_size,
|
return progress_update_one (ctx, progress_count, progress_bytes, buf.st_size,
|
||||||
is_toplevel_file);
|
is_toplevel_file);
|
||||||
@ -1412,9 +1362,7 @@ recursive_erase (FileOpContext *ctx, char *s, off_t *progress_count, double *pro
|
|||||||
goto retry_rmdir;
|
goto retry_rmdir;
|
||||||
return return_status;
|
return return_status;
|
||||||
}
|
}
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
gnome_metadata_delete (s);
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
return FILE_CONT;
|
return FILE_CONT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1482,9 +1430,7 @@ erase_dir (FileOpContext *ctx, char *s, off_t *progress_count, double *progress_
|
|||||||
goto retry_rmdir;
|
goto retry_rmdir;
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
gnome_metadata_delete (s);
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
return FILE_CONT;
|
return FILE_CONT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1514,9 +1460,7 @@ erase_dir_iff_empty (FileOpContext *ctx, char *s)
|
|||||||
goto retry_rmdir;
|
goto retry_rmdir;
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
gnome_metadata_delete (s);
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
return FILE_CONT;
|
return FILE_CONT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1673,7 +1617,6 @@ static char *op_names1 [] = { N_("1Copy"), N_("1Move"), N_("1Delete") };
|
|||||||
|
|
||||||
int fmd_xlen = FMD_XLEN;
|
int fmd_xlen = FMD_XLEN;
|
||||||
|
|
||||||
#ifndef HAVE_GNOME
|
|
||||||
/*
|
/*
|
||||||
* These are formats for building a prompt. Parts encoded as follows:
|
* These are formats for building a prompt. Parts encoded as follows:
|
||||||
* %o - operation from op_names1
|
* %o - operation from op_names1
|
||||||
@ -1687,12 +1630,6 @@ int fmd_xlen = FMD_XLEN;
|
|||||||
static char* one_format = N_("%o %f \"%s\"%m");
|
static char* one_format = N_("%o %f \"%s\"%m");
|
||||||
/* xgettext:no-c-format */
|
/* xgettext:no-c-format */
|
||||||
static char* many_format = N_("%o %d %f%m");
|
static char* many_format = N_("%o %d %f%m");
|
||||||
#else
|
|
||||||
/* xgettext:no-c-format */
|
|
||||||
static char* one_format = N_("%o %f \"%s\"%e");
|
|
||||||
/* xgettext:no-c-format */
|
|
||||||
static char* many_format = N_("%o %d %f%e");
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
static char* prompt_parts [] =
|
static char* prompt_parts [] =
|
||||||
{
|
{
|
||||||
N_("file"), N_("files"), N_("directory"), N_("directories"),
|
N_("file"), N_("files"), N_("directory"), N_("directories"),
|
||||||
@ -1798,15 +1735,6 @@ panel_operate_generate_prompt (WPanel* panel, int operation, int only_one,
|
|||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
extern FileProgressStatus file_progress_query_replace_policy (FileOpContext *ctx,
|
|
||||||
gboolean dialog_needed);
|
|
||||||
extern int file_delete_query_recursive (FileOpContext *ctx,
|
|
||||||
enum OperationMode mode,
|
|
||||||
gchar *s);
|
|
||||||
|
|
||||||
#endif /* HAVE_GNOME */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* panel_operate:
|
* panel_operate:
|
||||||
*
|
*
|
||||||
@ -1865,13 +1793,10 @@ panel_operate (void *source_panel, FileOperation operation, char *thedefault, in
|
|||||||
if (operation == OP_DELETE && confirm_delete){
|
if (operation == OP_DELETE && confirm_delete){
|
||||||
if (know_not_what_am_i_doing)
|
if (know_not_what_am_i_doing)
|
||||||
query_set_sel (1);
|
query_set_sel (1);
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
i = query_dialog (_(op_names [operation]), cmd_buf,
|
|
||||||
D_ERROR, 2, _("Yes"), _("No"));
|
|
||||||
#else
|
|
||||||
i = query_dialog (_(op_names [operation]), cmd_buf,
|
i = query_dialog (_(op_names [operation]), cmd_buf,
|
||||||
D_ERROR, 2, _("&Yes"), _("&No"));
|
D_ERROR, 2, _("&Yes"), _("&No"));
|
||||||
#endif /* !HAVE_GNOME */
|
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
file_op_context_destroy (ctx);
|
file_op_context_destroy (ctx);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1954,7 +1879,6 @@ panel_operate (void *source_panel, FileOperation operation, char *thedefault, in
|
|||||||
file_op_context_create_ui (ctx, operation, 1);
|
file_op_context_create_ui (ctx, operation, 1);
|
||||||
|
|
||||||
/* This code is only called by the tree and panel code */
|
/* This code is only called by the tree and panel code */
|
||||||
#ifndef HAVE_GNOME
|
|
||||||
if (only_one){
|
if (only_one){
|
||||||
/* We now have ETA in all cases */
|
/* We now have ETA in all cases */
|
||||||
|
|
||||||
@ -2011,11 +1935,10 @@ panel_operate (void *source_panel, FileOperation operation, char *thedefault, in
|
|||||||
}
|
}
|
||||||
} /* Copy or move operation */
|
} /* Copy or move operation */
|
||||||
|
|
||||||
if (value == FILE_CONT && !(is_a_desktop_panel(panel)))
|
if (value == FILE_CONT)
|
||||||
unmark_files (panel);
|
unmark_files (panel);
|
||||||
} else {
|
} else {
|
||||||
/* Many files */
|
/* Many files */
|
||||||
#endif /* !HAVE_GNOME */
|
|
||||||
/* Check destination for copy or move operation */
|
/* Check destination for copy or move operation */
|
||||||
if (operation != OP_DELETE){
|
if (operation != OP_DELETE){
|
||||||
retry_many_dst_stat:
|
retry_many_dst_stat:
|
||||||
@ -2099,15 +2022,8 @@ panel_operate (void *source_panel, FileOperation operation, char *thedefault, in
|
|||||||
if (value == FILE_ABORT)
|
if (value == FILE_ABORT)
|
||||||
goto clean_up;
|
goto clean_up;
|
||||||
|
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
/* if panel->selection is -1, then we have a desktop panel. */
|
|
||||||
if (value == FILE_CONT && !(is_a_desktop_panel(panel)))
|
|
||||||
do_file_mark (panel, i, 0);
|
|
||||||
#else
|
|
||||||
if (value == FILE_CONT)
|
if (value == FILE_CONT)
|
||||||
do_file_mark (panel, i, 0);
|
do_file_mark (panel, i, 0);
|
||||||
#endif /* !HAVE_GNOME */
|
|
||||||
|
|
||||||
|
|
||||||
if (file_progress_show_count (ctx, count, ctx->progress_count) == FILE_ABORT)
|
if (file_progress_show_count (ctx, count, ctx->progress_count) == FILE_ABORT)
|
||||||
goto clean_up;
|
goto clean_up;
|
||||||
@ -2120,9 +2036,7 @@ panel_operate (void *source_panel, FileOperation operation, char *thedefault, in
|
|||||||
|
|
||||||
mc_refresh ();
|
mc_refresh ();
|
||||||
} /* Loop for every file */
|
} /* Loop for every file */
|
||||||
#ifndef HAVE_GNOME
|
|
||||||
} /* Many files */
|
} /* Many files */
|
||||||
#endif /* !HAVE_GNOME */
|
|
||||||
clean_up:
|
clean_up:
|
||||||
/* Clean up */
|
/* Clean up */
|
||||||
|
|
||||||
@ -2225,7 +2139,6 @@ files_error (char *format, char *file1, char *file2)
|
|||||||
return do_file_error (cmd_buf);
|
return do_file_error (cmd_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_GNOME
|
|
||||||
static int
|
static int
|
||||||
real_query_recursive (FileOpContext *ctx, enum OperationMode mode, char *s)
|
real_query_recursive (FileOpContext *ctx, enum OperationMode mode, char *s)
|
||||||
{
|
{
|
||||||
@ -2283,7 +2196,6 @@ real_query_recursive (FileOpContext *ctx, enum OperationMode mode, char *s)
|
|||||||
return FILE_ABORT;
|
return FILE_ABORT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_GNOME */
|
|
||||||
|
|
||||||
#ifdef WITH_BACKGROUND
|
#ifdef WITH_BACKGROUND
|
||||||
static int
|
static int
|
||||||
@ -2298,17 +2210,10 @@ do_file_error (char *str)
|
|||||||
static int
|
static int
|
||||||
query_recursive (FileOpContext *ctx, char *s)
|
query_recursive (FileOpContext *ctx, char *s)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
if (we_are_background)
|
|
||||||
return parent_call (file_delete_query_recursive, ctx, 1, strlen (s), s);
|
|
||||||
else
|
|
||||||
return file_delete_query_recursive (ctx, Foreground, s);
|
|
||||||
#else
|
|
||||||
if (we_are_background)
|
if (we_are_background)
|
||||||
return parent_call (real_query_recursive, ctx, 1, strlen (s), s);
|
return parent_call (real_query_recursive, ctx, 1, strlen (s), s);
|
||||||
else
|
else
|
||||||
return real_query_recursive (ctx, Foreground, s);
|
return real_query_recursive (ctx, Foreground, s);
|
||||||
#endif /* !HAVE_GNOME */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -2335,11 +2240,7 @@ do_file_error (char *str)
|
|||||||
static int
|
static int
|
||||||
query_recursive (FileOpContext *ctx, char *s)
|
query_recursive (FileOpContext *ctx, char *s)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
return file_delete_query_recursive (ctx, Foreground, s);
|
|
||||||
#else
|
|
||||||
return real_query_recursive (ctx, Foreground, s);
|
return real_query_recursive (ctx, Foreground, s);
|
||||||
#endif /* !HAVE_GNOME */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
38
src/i18n.h
38
src/i18n.h
@ -1,4 +1,3 @@
|
|||||||
/* GNOME already handles the intenrationalization issues */
|
|
||||||
#ifndef _MC_I18N_H_
|
#ifndef _MC_I18N_H_
|
||||||
#define _MC_I18N_H_
|
#define _MC_I18N_H_
|
||||||
|
|
||||||
@ -6,25 +5,22 @@
|
|||||||
#undef ENABLE_NLS
|
#undef ENABLE_NLS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_GNOME
|
#ifdef ENABLE_NLS
|
||||||
# ifdef ENABLE_NLS
|
# include <libintl.h>
|
||||||
# include <libintl.h>
|
# define _(String) gettext (String)
|
||||||
# define _(String) gettext (String)
|
# ifdef gettext_noop
|
||||||
# ifdef gettext_noop
|
# define N_(String) gettext_noop (String)
|
||||||
# define N_(String) gettext_noop (String)
|
# else
|
||||||
# else
|
# define N_(String) (String)
|
||||||
# define N_(String) (String)
|
# endif
|
||||||
# endif
|
#else /* Stubs that do something close enough. */
|
||||||
# else
|
# define textdomain(String)
|
||||||
/* Stubs that do something close enough. */
|
# define gettext(String) (String)
|
||||||
# define textdomain(String)
|
# define dgettext(Domain,Message) (Message)
|
||||||
# define gettext(String) (String)
|
# define dcgettext(Domain,Message,Type) (Message)
|
||||||
# define dgettext(Domain,Message) (Message)
|
# define bindtextdomain(Domain,Directory)
|
||||||
# define dcgettext(Domain,Message,Type) (Message)
|
# define _(String) (String)
|
||||||
# define bindtextdomain(Domain,Directory)
|
# define N_(String) (String)
|
||||||
# define _(String) (String)
|
#endif /* !ENABLE_NLS */
|
||||||
# define N_(String) (String)
|
|
||||||
# endif
|
|
||||||
#endif /* !HAVE_GNOME */
|
|
||||||
|
|
||||||
#endif /* _MC_I18N_H_ */
|
#endif /* _MC_I18N_H_ */
|
||||||
|
@ -81,9 +81,7 @@ extern key_code_name_t key_name_conv_tab [];
|
|||||||
extern int we_are_background;
|
extern int we_are_background;
|
||||||
|
|
||||||
/* Set keypad mode (xterm and linux console only) */
|
/* Set keypad mode (xterm and linux console only) */
|
||||||
#ifndef HAVE_X
|
void numeric_keypad_mode (void);
|
||||||
void numeric_keypad_mode (void);
|
void application_keypad_mode (void);
|
||||||
void application_keypad_mode (void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __KEY_H */
|
#endif /* __KEY_H */
|
||||||
|
@ -2753,7 +2753,7 @@ main (int argc, char *argv [])
|
|||||||
|
|
||||||
#ifdef HAVE_SUBSHELL_SUPPORT
|
#ifdef HAVE_SUBSHELL_SUPPORT
|
||||||
|
|
||||||
/* Don't use subshell in GNOME and when invoked as a viewer or editor */
|
/* Don't use subshell when invoked as a viewer or editor */
|
||||||
if (edit_one_file || view_one_file)
|
if (edit_one_file || view_one_file)
|
||||||
use_subshell = 0;
|
use_subshell = 0;
|
||||||
|
|
||||||
|
@ -109,15 +109,10 @@ extern char search_buffer [256];
|
|||||||
extern char cmd_buf [512];
|
extern char cmd_buf [512];
|
||||||
extern char *cmdline_geometry;
|
extern char *cmdline_geometry;
|
||||||
|
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
#define MENU_PANEL get_current_panel ()
|
|
||||||
#define SELECTED_IS_PANEL 1
|
|
||||||
#else
|
|
||||||
/* The menu panels */
|
/* The menu panels */
|
||||||
extern int is_right; /* If the selected menu was the right */
|
extern int is_right; /* If the selected menu was the right */
|
||||||
#define MENU_PANEL (is_right ? right_panel : left_panel)
|
#define MENU_PANEL (is_right ? right_panel : left_panel)
|
||||||
#define SELECTED_IS_PANEL (get_display_type (is_right ? 1 : 0) == view_listing)
|
#define SELECTED_IS_PANEL (get_display_type (is_right ? 1 : 0) == view_listing)
|
||||||
#endif /* !HAVE_GNOME */
|
|
||||||
|
|
||||||
/* Useful macros to avoid too much typing */
|
/* Useful macros to avoid too much typing */
|
||||||
#define cpanel get_current_panel()
|
#define cpanel get_current_panel()
|
||||||
|
87
src/panel.h
87
src/panel.h
@ -9,22 +9,6 @@
|
|||||||
|
|
||||||
#define LIST_TYPES 5
|
#define LIST_TYPES 5
|
||||||
|
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
/* Keep the following in sync with setup.c */
|
|
||||||
|
|
||||||
/* Number of columns that each mode requires */
|
|
||||||
#define GMC_COLUMNS_BRIEF 2 /* brief view */
|
|
||||||
#define GMC_COLUMNS_DETAILED 4 /* detailed view */
|
|
||||||
#define GMC_COLUMNS_CUSTOM 15 /* custom view */
|
|
||||||
#define GMC_COLUMNS (GMC_COLUMNS_BRIEF + GMC_COLUMNS_DETAILED + GMC_COLUMNS_CUSTOM)
|
|
||||||
|
|
||||||
/* Default column widths */
|
|
||||||
extern int default_column_width[GMC_COLUMNS];
|
|
||||||
|
|
||||||
/* custom listing format */
|
|
||||||
extern char *default_user_format;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
enum list_types {
|
enum list_types {
|
||||||
list_full, /* Name, size, perm/date */
|
list_full, /* Name, size, perm/date */
|
||||||
list_brief, /* Name */
|
list_brief, /* Name */
|
||||||
@ -139,67 +123,6 @@ typedef struct {
|
|||||||
char search_buffer [256];
|
char search_buffer [256];
|
||||||
|
|
||||||
void *port_ui; /* UI stuff specific to each GUI port */
|
void *port_ui; /* UI stuff specific to each GUI port */
|
||||||
|
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
/* These are standard GtkWidgets */
|
|
||||||
|
|
||||||
void *xwindow; /* The toplevel window */
|
|
||||||
|
|
||||||
void *table;
|
|
||||||
void *view_table;
|
|
||||||
void *pane;
|
|
||||||
void *list;
|
|
||||||
void *tree;
|
|
||||||
void *icons;
|
|
||||||
void *notebook;
|
|
||||||
void *status;
|
|
||||||
void *ministatus;
|
|
||||||
void *tree_scrolled_window;
|
|
||||||
|
|
||||||
void *filter_w; /* A WInput* */
|
|
||||||
void *current_dir; /* A WInput* */
|
|
||||||
int estimated_total;
|
|
||||||
|
|
||||||
/* default column layout */
|
|
||||||
int column_width[GMC_COLUMNS];
|
|
||||||
|
|
||||||
/* navigation buttons */
|
|
||||||
void *back_b;
|
|
||||||
void *fwd_b;
|
|
||||||
void *up_b;
|
|
||||||
|
|
||||||
/* Used during drag and drop */
|
|
||||||
int maybe_start_drag;
|
|
||||||
int click_x, click_y;
|
|
||||||
|
|
||||||
/* View menu and toolbar items */
|
|
||||||
void **view_menu_items;
|
|
||||||
void **view_toolbar_items;
|
|
||||||
|
|
||||||
int dragging;
|
|
||||||
|
|
||||||
/* Unique numerical ID for session management */
|
|
||||||
int id;
|
|
||||||
|
|
||||||
/* Used for scrolling nicely during drags */
|
|
||||||
int timer_id;
|
|
||||||
int drag_motion_x;
|
|
||||||
int drag_motion_y;
|
|
||||||
|
|
||||||
/* The highlighted row in the tree for drag and drop */
|
|
||||||
int drag_tree_row;
|
|
||||||
int drag_tree_timeout_id;
|
|
||||||
file_entry *drag_tree_fe;
|
|
||||||
|
|
||||||
/* Whether the user is dragging something over the tree */
|
|
||||||
int drag_tree_dragging_over;
|
|
||||||
|
|
||||||
void *panel_listbox; /* container for the list */
|
|
||||||
int is_a_desktop_panel;
|
|
||||||
|
|
||||||
/* CORBA servant */
|
|
||||||
void *servant;
|
|
||||||
#endif
|
|
||||||
} WPanel;
|
} WPanel;
|
||||||
|
|
||||||
WPanel *panel_new (const char *panel_name);
|
WPanel *panel_new (const char *panel_name);
|
||||||
@ -217,16 +140,8 @@ extern int show_mini_info;
|
|||||||
extern int panel_scroll_pages;
|
extern int panel_scroll_pages;
|
||||||
|
|
||||||
#define selection(p) (&(p->dir.list [p->selected]))
|
#define selection(p) (&(p->dir.list [p->selected]))
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
#define is_a_desktop_panel(p) ((p->is_a_desktop_panel))
|
|
||||||
/* Evil empty trash_hack */
|
|
||||||
extern int is_trash_panel;
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define is_a_desktop_panel(p) FALSE
|
|
||||||
#endif
|
|
||||||
extern int fast_reload;
|
extern int fast_reload;
|
||||||
|
|
||||||
extern int extra_info;
|
extern int extra_info;
|
||||||
|
|
||||||
/*#define ITEMS(p) ((p)->view_type == view_brief ? (p)->lines *2 : (p)->lines)
|
/*#define ITEMS(p) ((p)->view_type == view_brief ? (p)->lines *2 : (p)->lines)
|
||||||
@ -255,7 +170,6 @@ void show_dir (WPanel *panel);
|
|||||||
void panel_set_sort_order (WPanel *panel, sortfn *sort_order);
|
void panel_set_sort_order (WPanel *panel, sortfn *sort_order);
|
||||||
void panel_re_sort (WPanel *panel);
|
void panel_re_sort (WPanel *panel);
|
||||||
|
|
||||||
/* NOTE: Have to be ifdefed for HAVE_X */
|
|
||||||
void x_panel_set_size (int index);
|
void x_panel_set_size (int index);
|
||||||
void x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel);
|
void x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel);
|
||||||
void x_fill_panel (WPanel *panel);
|
void x_fill_panel (WPanel *panel);
|
||||||
@ -330,7 +244,6 @@ void do_file_mark_range (WPanel *panel, int r1, int r2);
|
|||||||
int do_enter_on_file_entry (file_entry *fe);
|
int do_enter_on_file_entry (file_entry *fe);
|
||||||
int do_enter (WPanel *panel);
|
int do_enter (WPanel *panel);
|
||||||
|
|
||||||
/* NOTE: Have to be ifdefed for HAVE_X */
|
|
||||||
void x_panel_select_item (WPanel *panel, int index, int val);
|
void x_panel_select_item (WPanel *panel, int index, int val);
|
||||||
void x_select_item (WPanel *panel);
|
void x_select_item (WPanel *panel);
|
||||||
void x_unselect_item (WPanel *panel);
|
void x_unselect_item (WPanel *panel);
|
||||||
|
@ -60,7 +60,6 @@ void do_external_panelize (char *command);
|
|||||||
#define B_ADD B_USER
|
#define B_ADD B_USER
|
||||||
#define B_REMOVE B_USER + 1
|
#define B_REMOVE B_USER + 1
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
static WListbox *l_panelize;
|
static WListbox *l_panelize;
|
||||||
static Dlg_head *panelize_dlg;
|
static Dlg_head *panelize_dlg;
|
||||||
static int last_listitem;
|
static int last_listitem;
|
||||||
@ -76,7 +75,6 @@ static struct {
|
|||||||
{ B_REMOVE, NORMAL_BUTTON, 0, 16, N_("&Remove"), "r"},
|
{ B_REMOVE, NORMAL_BUTTON, 0, 16, N_("&Remove"), "r"},
|
||||||
{ B_ENTER, DEFPUSH_BUTTON, 0, 0, N_("Pane&lize"),"l"},
|
{ B_ENTER, DEFPUSH_BUTTON, 0, 0, N_("Pane&lize"),"l"},
|
||||||
};
|
};
|
||||||
#endif /* !HAVE_X */
|
|
||||||
|
|
||||||
static char *panelize_section = "Panelize";
|
static char *panelize_section = "Panelize";
|
||||||
|
|
||||||
@ -87,7 +85,6 @@ static struct panelize {
|
|||||||
struct panelize *next;
|
struct panelize *next;
|
||||||
} *panelize = NULL;
|
} *panelize = NULL;
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
static char* panelize_title = N_(" External panelize ");
|
static char* panelize_title = N_(" External panelize ");
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -211,7 +208,6 @@ static void panelize_done (void)
|
|||||||
destroy_dlg (panelize_dlg);
|
destroy_dlg (panelize_dlg);
|
||||||
repaint_screen ();
|
repaint_screen ();
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_X */
|
|
||||||
|
|
||||||
static void add2panelize (char *label, char *command)
|
static void add2panelize (char *label, char *command)
|
||||||
{
|
{
|
||||||
@ -239,7 +235,6 @@ static void add2panelize (char *label, char *command)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
void
|
void
|
||||||
add2panelize_cmd (void)
|
add2panelize_cmd (void)
|
||||||
{
|
{
|
||||||
@ -325,7 +320,6 @@ external_panelize (void)
|
|||||||
|
|
||||||
panelize_done ();
|
panelize_done ();
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_X */
|
|
||||||
|
|
||||||
void load_panelize (void)
|
void load_panelize (void)
|
||||||
{
|
{
|
||||||
|
203
src/screen.c
203
src/screen.c
@ -97,13 +97,10 @@ static int panel_event (Gpm_Event *event, WPanel *panel);
|
|||||||
# define unfocus_unselect_item(x) unselect_item(x)
|
# define unfocus_unselect_item(x) unselect_item(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_X
|
#define x_create_panel(x,y,z) 1;
|
||||||
# define set_colors(x)
|
#define x_panel_load_index(p,x)
|
||||||
#else
|
#define x_panel_select_item(a,b,c)
|
||||||
# define x_create_panel(x,y,z) 1;
|
#define x_panel_destroy(p)
|
||||||
# define x_panel_load_index(p,x)
|
|
||||||
# define x_panel_select_item(a,b,c)
|
|
||||||
# define x_panel_destroy(p)
|
|
||||||
|
|
||||||
void
|
void
|
||||||
set_colors (WPanel *panel)
|
set_colors (WPanel *panel)
|
||||||
@ -112,7 +109,6 @@ set_colors (WPanel *panel)
|
|||||||
if (hascolors)
|
if (hascolors)
|
||||||
attrset (NORMAL_COLOR);
|
attrset (NORMAL_COLOR);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ICONS_PER_ROW
|
#ifndef ICONS_PER_ROW
|
||||||
# define ICONS_PER_ROW(x) 1
|
# define ICONS_PER_ROW(x) 1
|
||||||
@ -131,7 +127,6 @@ delete_format (format_e *format)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
/* This code relies on the default justification!!! */
|
/* This code relies on the default justification!!! */
|
||||||
static void
|
static void
|
||||||
add_permission_string (char *dest, int width, file_entry *fe, int attr, int color, int is_octal)
|
add_permission_string (char *dest, int width, file_entry *fe, int attr, int color, int is_octal)
|
||||||
@ -162,7 +157,6 @@ add_permission_string (char *dest, int width, file_entry *fe, int attr, int colo
|
|||||||
addch (dest[i]);
|
addch (dest[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* HAVE_X */
|
|
||||||
|
|
||||||
/* String representations of various file attributes */
|
/* String representations of various file attributes */
|
||||||
/* name */
|
/* name */
|
||||||
@ -368,11 +362,7 @@ string_dot (file_entry *fe, int len)
|
|||||||
return ".";
|
return ".";
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_GNOME
|
#define GT 1
|
||||||
# define GT 2
|
|
||||||
#else
|
|
||||||
# define GT 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
char *id;
|
char *id;
|
||||||
@ -527,7 +517,6 @@ format_file (char *dest, WPanel *panel, int file_index, int width, int attr, int
|
|||||||
cdest = to_buffer (cdest, format->just_mode, len, txt);
|
cdest = to_buffer (cdest, format->just_mode, len, txt);
|
||||||
length += len;
|
length += len;
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
attrset (color);
|
attrset (color);
|
||||||
|
|
||||||
if (permission_mode && !strcmp(format->id, "perm"))
|
if (permission_mode && !strcmp(format->id, "perm"))
|
||||||
@ -537,17 +526,12 @@ format_file (char *dest, WPanel *panel, int file_index, int width, int attr, int
|
|||||||
else
|
else
|
||||||
addstr (old_pos);
|
addstr (old_pos);
|
||||||
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
#ifndef HAVE_X
|
|
||||||
if (attr == SELECTED || attr == MARKED_SELECTED)
|
if (attr == SELECTED || attr == MARKED_SELECTED)
|
||||||
attrset (SELECTED_COLOR);
|
attrset (SELECTED_COLOR);
|
||||||
else
|
else
|
||||||
attrset (NORMAL_COLOR);
|
attrset (NORMAL_COLOR);
|
||||||
one_vline ();
|
one_vline ();
|
||||||
#else
|
|
||||||
*cdest++ = ' ';
|
|
||||||
#endif
|
|
||||||
length++;
|
length++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -555,12 +539,7 @@ format_file (char *dest, WPanel *panel, int file_index, int width, int attr, int
|
|||||||
if (length < width){
|
if (length < width){
|
||||||
int still = width - length;
|
int still = width - length;
|
||||||
while (still--)
|
while (still--)
|
||||||
#ifdef HAVE_X
|
|
||||||
*cdest++ = ' ';
|
|
||||||
*cdest = '\0';
|
|
||||||
#else
|
|
||||||
addch (' ');
|
addch (' ');
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -703,7 +682,7 @@ mini_info_separator (WPanel *panel)
|
|||||||
#else
|
#else
|
||||||
hline ((slow_terminal ? '-' : ACS_HLINE) | NORMAL_COLOR,
|
hline ((slow_terminal ? '-' : ACS_HLINE) | NORMAL_COLOR,
|
||||||
panel->widget.cols-2);
|
panel->widget.cols-2);
|
||||||
#endif
|
#endif /* !HAVE_SLANG */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -733,7 +712,7 @@ show_dir (WPanel *panel)
|
|||||||
panel->widget.x + panel->widget.cols - 1, SLSMG_RTEE_CHAR);
|
panel->widget.x + panel->widget.cols - 1, SLSMG_RTEE_CHAR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* have_slang */
|
#endif /* HAVE_SLANG */
|
||||||
|
|
||||||
if (panel->active)
|
if (panel->active)
|
||||||
attrset (REVERSE_COLOR);
|
attrset (REVERSE_COLOR);
|
||||||
@ -770,11 +749,7 @@ void
|
|||||||
panel_update_contents (WPanel *panel)
|
panel_update_contents (WPanel *panel)
|
||||||
{
|
{
|
||||||
show_dir (panel);
|
show_dir (panel);
|
||||||
#ifdef HAVE_X
|
|
||||||
x_fill_panel (panel);
|
|
||||||
#else
|
|
||||||
paint_dir (panel);
|
paint_dir (panel);
|
||||||
#endif
|
|
||||||
display_mini_info (panel);
|
display_mini_info (panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -924,9 +899,6 @@ is_a_panel (Widget *w)
|
|||||||
WPanel *
|
WPanel *
|
||||||
panel_new (const char *panel_name)
|
panel_new (const char *panel_name)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
static int panel_id = 0;
|
|
||||||
#endif
|
|
||||||
WPanel *panel;
|
WPanel *panel;
|
||||||
char *section;
|
char *section;
|
||||||
int i, err;
|
int i, err;
|
||||||
@ -965,12 +937,6 @@ panel_new (const char *panel_name)
|
|||||||
panel->format = 0;
|
panel->format = 0;
|
||||||
panel->status_format = 0;
|
panel->status_format = 0;
|
||||||
panel->format_modified = 1;
|
panel->format_modified = 1;
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
panel->drag_tree_row = -1;
|
|
||||||
panel->is_a_desktop_panel = FALSE;
|
|
||||||
panel->id = panel_id++;
|
|
||||||
panel->servant = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
panel->panel_name = g_strdup (panel_name);
|
panel->panel_name = g_strdup (panel_name);
|
||||||
panel->user_format = g_strdup (DEFAULT_USER_FORMAT);
|
panel->user_format = g_strdup (DEFAULT_USER_FORMAT);
|
||||||
@ -1479,14 +1445,6 @@ select_item (WPanel *panel)
|
|||||||
top file to decent values before calling select_item, I could
|
top file to decent values before calling select_item, I could
|
||||||
forget it someday, so it's better to do the actual fitting here */
|
forget it someday, so it's better to do the actual fitting here */
|
||||||
|
|
||||||
#ifdef HAVE_X
|
|
||||||
int old_top;
|
|
||||||
old_top = panel->top_file;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (is_a_desktop_panel (panel))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (panel->top_file < 0){
|
if (panel->top_file < 0){
|
||||||
repaint = 1;
|
repaint = 1;
|
||||||
panel->top_file = 0;
|
panel->top_file = 0;
|
||||||
@ -1520,16 +1478,10 @@ select_item (WPanel *panel)
|
|||||||
panel->top_file = panel->selected - items + 1;
|
panel->top_file = panel->selected - items + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
if (repaint)
|
if (repaint)
|
||||||
paint_panel (panel);
|
paint_panel (panel);
|
||||||
else
|
else
|
||||||
repaint_file (panel, panel->selected, 1, 2*selection (panel)->f.marked+1, 0);
|
repaint_file (panel, panel->selected, 1, 2*selection (panel)->f.marked+1, 0);
|
||||||
#else
|
|
||||||
if (old_top != panel->top_file)
|
|
||||||
x_adjust_top_file (panel);
|
|
||||||
x_select_item (panel);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
display_mini_info (panel);
|
display_mini_info (panel);
|
||||||
|
|
||||||
@ -1552,19 +1504,11 @@ unmark_files (WPanel *panel)
|
|||||||
panel->total = 0;
|
panel->total = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_X
|
|
||||||
void
|
|
||||||
unselect_item (WPanel *panel)
|
|
||||||
{
|
|
||||||
x_unselect_item (panel);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void
|
void
|
||||||
unselect_item (WPanel *panel)
|
unselect_item (WPanel *panel)
|
||||||
{
|
{
|
||||||
repaint_file (panel, panel->selected, 1, 2*selection (panel)->f.marked, 0);
|
repaint_file (panel, panel->selected, 1, 2*selection (panel)->f.marked, 0);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
do_move_down (WPanel *panel)
|
do_move_down (WPanel *panel)
|
||||||
@ -1575,7 +1519,6 @@ do_move_down (WPanel *panel)
|
|||||||
unselect_item (panel);
|
unselect_item (panel);
|
||||||
panel->selected++;
|
panel->selected++;
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
if (panel->selected - panel->top_file == ITEMS (panel) &&
|
if (panel->selected - panel->top_file == ITEMS (panel) &&
|
||||||
panel_scroll_pages){
|
panel_scroll_pages){
|
||||||
/* Scroll window half screen */
|
/* Scroll window half screen */
|
||||||
@ -1585,7 +1528,6 @@ do_move_down (WPanel *panel)
|
|||||||
paint_dir (panel);
|
paint_dir (panel);
|
||||||
select_item (panel);
|
select_item (panel);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
select_item (panel);
|
select_item (panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1597,14 +1539,12 @@ do_move_up (WPanel *panel)
|
|||||||
|
|
||||||
unselect_item (panel);
|
unselect_item (panel);
|
||||||
panel->selected--;
|
panel->selected--;
|
||||||
#ifndef HAVE_X
|
|
||||||
if (panel->selected < panel->top_file && panel_scroll_pages){
|
if (panel->selected < panel->top_file && panel_scroll_pages){
|
||||||
/* Scroll window half screen */
|
/* Scroll window half screen */
|
||||||
panel->top_file -= ITEMS (panel)/2;
|
panel->top_file -= ITEMS (panel)/2;
|
||||||
if (panel->top_file < 0) panel->top_file = 0;
|
if (panel->top_file < 0) panel->top_file = 0;
|
||||||
paint_dir (panel);
|
paint_dir (panel);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
select_item (panel);
|
select_item (panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1653,9 +1593,7 @@ static void
|
|||||||
move_selection (WPanel *panel, int lines)
|
move_selection (WPanel *panel, int lines)
|
||||||
{
|
{
|
||||||
int new_pos;
|
int new_pos;
|
||||||
#ifndef HAVE_X
|
|
||||||
int adjust = 0;
|
int adjust = 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
new_pos = panel->selected + lines;
|
new_pos = panel->selected + lines;
|
||||||
if (new_pos >= panel->count)
|
if (new_pos >= panel->count)
|
||||||
@ -1667,7 +1605,6 @@ move_selection (WPanel *panel, int lines)
|
|||||||
unselect_item (panel);
|
unselect_item (panel);
|
||||||
panel->selected = new_pos;
|
panel->selected = new_pos;
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
if (panel->selected - panel->top_file >= ITEMS (panel)){
|
if (panel->selected - panel->top_file >= ITEMS (panel)){
|
||||||
panel->top_file += lines;
|
panel->top_file += lines;
|
||||||
adjust = 1;
|
adjust = 1;
|
||||||
@ -1685,7 +1622,6 @@ move_selection (WPanel *panel, int lines)
|
|||||||
panel->top_file = 0;
|
panel->top_file = 0;
|
||||||
paint_dir (panel);
|
paint_dir (panel);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
select_item (panel);
|
select_item (panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1743,20 +1679,17 @@ prev_page (WPanel *panel)
|
|||||||
panel->top_file = 0;
|
panel->top_file = 0;
|
||||||
x_adjust_top_file (panel);
|
x_adjust_top_file (panel);
|
||||||
select_item (panel);
|
select_item (panel);
|
||||||
#ifndef HAVE_X
|
|
||||||
paint_dir (panel);
|
paint_dir (panel);
|
||||||
#endif /* !HAVE_X */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
prev_page_key (WPanel *panel)
|
prev_page_key (WPanel *panel)
|
||||||
{
|
{
|
||||||
#ifndef HAVE_X
|
|
||||||
if (ctrl_pressed ()){
|
if (ctrl_pressed ()){
|
||||||
do_cd ("..", cd_exact);
|
do_cd ("..", cd_exact);
|
||||||
} else
|
} else {
|
||||||
#endif /* !HAVE_X */
|
|
||||||
prev_page (panel);
|
prev_page (panel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1785,21 +1718,18 @@ next_page (WPanel *panel)
|
|||||||
panel->top_file = panel->count - 1;
|
panel->top_file = panel->count - 1;
|
||||||
x_adjust_top_file (panel);
|
x_adjust_top_file (panel);
|
||||||
select_item (panel);
|
select_item (panel);
|
||||||
#ifndef HAVE_X
|
|
||||||
paint_dir (panel);
|
paint_dir (panel);
|
||||||
#endif /* !HAVE_X */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void next_page_key (WPanel *panel)
|
static void next_page_key (WPanel *panel)
|
||||||
{
|
{
|
||||||
#ifndef HAVE_X
|
|
||||||
if (ctrl_pressed() &&
|
if (ctrl_pressed() &&
|
||||||
(S_ISDIR(selection (panel)->buf.st_mode) ||
|
(S_ISDIR(selection (panel)->buf.st_mode) ||
|
||||||
link_isdir (selection (panel))))
|
link_isdir (selection (panel)))) {
|
||||||
do_cd (selection (panel)->fname, cd_exact);
|
do_cd (selection (panel)->fname, cd_exact);
|
||||||
else
|
} else {
|
||||||
#endif /* !HAVE_X */
|
|
||||||
next_page (panel);
|
next_page (panel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1853,9 +1783,7 @@ move_home (WPanel *panel)
|
|||||||
panel->top_file = 0;
|
panel->top_file = 0;
|
||||||
panel->selected = 0;
|
panel->selected = 0;
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
paint_dir (panel);
|
paint_dir (panel);
|
||||||
#endif
|
|
||||||
select_item (panel);
|
select_item (panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1879,9 +1807,7 @@ move_end (WPanel *panel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
panel->selected = panel->count-1;
|
panel->selected = panel->count-1;
|
||||||
#ifndef HAVE_X
|
|
||||||
paint_dir (panel);
|
paint_dir (panel);
|
||||||
#endif
|
|
||||||
select_item (panel);
|
select_item (panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2007,9 +1933,8 @@ do_search (WPanel *panel, int c_code)
|
|||||||
}
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
panel->search_buffer [--l] = 0;
|
panel->search_buffer [--l] = 0;
|
||||||
#ifndef HAVE_X
|
|
||||||
paint_panel (panel);
|
paint_panel (panel);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -2028,67 +1953,7 @@ start_search (WPanel *panel)
|
|||||||
mc_refresh ();
|
mc_refresh ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* This procedure was getting really messy with all the rewriting and ifdef's
|
|
||||||
* so I just splet them out. -jrb */
|
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
extern void set_cursor_busy (WPanel *panel);
|
|
||||||
extern void set_cursor_normal (WPanel *panel);
|
|
||||||
int
|
|
||||||
do_enter_on_file_entry (file_entry *fe)
|
|
||||||
{
|
|
||||||
gint retval;
|
|
||||||
char *full_name;
|
|
||||||
|
|
||||||
set_cursor_busy (cpanel);
|
|
||||||
/* Can we change dirs? */
|
|
||||||
if (S_ISDIR (fe->buf.st_mode) || link_isdir (fe)) {
|
|
||||||
do_cd (fe->fname, cd_exact);
|
|
||||||
set_cursor_normal (cpanel);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
/* do metadata/mime stuff tell us anything? */
|
|
||||||
if (gmc_open (fe) != 0) {
|
|
||||||
set_cursor_normal (cpanel);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
/* can we change dirs? */
|
|
||||||
full_name = concat_dir_and_file (cpanel->cwd, fe->fname);
|
|
||||||
if (is_exe (fe->buf.st_mode) && if_link_is_exe (full_name, fe)) {
|
|
||||||
g_free (full_name);
|
|
||||||
#ifdef USE_VFS
|
|
||||||
if (vfs_current_is_local ())
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
char *tmp = name_quote (fe->fname, 0);
|
|
||||||
char *cmd = g_strconcat (".", PATH_SEP_STR, tmp, NULL);
|
|
||||||
g_free (tmp);
|
|
||||||
if (!confirm_execute || (query_dialog (_(" The Midnight Commander "),
|
|
||||||
_(" Do you really want to execute? "),
|
|
||||||
0, 2, _("Yes"), _("No")) == 0))
|
|
||||||
execute (cmd);
|
|
||||||
g_free (cmd);
|
|
||||||
}
|
|
||||||
#ifdef USE_VFS
|
|
||||||
else {
|
|
||||||
char *tmp;
|
|
||||||
|
|
||||||
tmp = concat_dir_and_file (vfs_get_current_dir(), fe->fname);
|
|
||||||
if (!mc_setctl (tmp, MCCTL_EXTFS_RUN, NULL))
|
|
||||||
message (1, _(" Warning "), _(" No action taken "));
|
|
||||||
g_free (tmp);
|
|
||||||
}
|
|
||||||
#endif /* USE_VFS */
|
|
||||||
set_cursor_normal (cpanel);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (full_name);
|
|
||||||
/* looks like we couldn't open it. Let's ask the user */
|
|
||||||
retval = gmc_open_with (fe->fname);
|
|
||||||
set_cursor_normal (cpanel);
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
int
|
int
|
||||||
do_enter_on_file_entry (file_entry *fe)
|
do_enter_on_file_entry (file_entry *fe)
|
||||||
{
|
{
|
||||||
@ -2143,14 +2008,13 @@ do_enter_on_file_entry (file_entry *fe)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* else not HAVE_GNOME */
|
|
||||||
int
|
int
|
||||||
do_enter (WPanel *panel)
|
do_enter (WPanel *panel)
|
||||||
{
|
{
|
||||||
return do_enter_on_file_entry (selection (panel));
|
return do_enter_on_file_entry (selection (panel));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
static void
|
static void
|
||||||
chdir_other_panel (WPanel *panel)
|
chdir_other_panel (WPanel *panel)
|
||||||
{
|
{
|
||||||
@ -2216,7 +2080,6 @@ chdir_to_readlink (WPanel *panel)
|
|||||||
g_free (new_dir);
|
g_free (new_dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_X */
|
|
||||||
|
|
||||||
static const key_map panel_keymap [] = {
|
static const key_map panel_keymap [] = {
|
||||||
{ KEY_DOWN, move_down },
|
{ KEY_DOWN, move_down },
|
||||||
@ -2253,11 +2116,9 @@ static const key_map panel_keymap [] = {
|
|||||||
{ XCTRL('s'), start_search }, /* C-s like emacs */
|
{ XCTRL('s'), start_search }, /* C-s like emacs */
|
||||||
{ ALT('s'), start_search }, /* M-s not like emacs */
|
{ ALT('s'), start_search }, /* M-s not like emacs */
|
||||||
{ XCTRL('t'), mark_file },
|
{ XCTRL('t'), mark_file },
|
||||||
#ifndef HAVE_X
|
|
||||||
{ ALT('o'), chdir_other_panel },
|
{ ALT('o'), chdir_other_panel },
|
||||||
{ ALT('l'), chdir_to_readlink },
|
{ ALT('l'), chdir_to_readlink },
|
||||||
{ ALT('H'), directory_history_list },
|
{ ALT('H'), directory_history_list },
|
||||||
#endif /* HAVE_X */
|
|
||||||
{ KEY_F(13), view_simple_cmd },
|
{ KEY_F(13), view_simple_cmd },
|
||||||
{ KEY_F(14), edit_cmd_new },
|
{ KEY_F(14), edit_cmd_new },
|
||||||
{ ALT('y'), directory_history_prev },
|
{ ALT('y'), directory_history_prev },
|
||||||
@ -2269,23 +2130,6 @@ static const key_map panel_keymap [] = {
|
|||||||
{ KEY_KP_SUBTRACT, unselect_cmd_panel },
|
{ KEY_KP_SUBTRACT, unselect_cmd_panel },
|
||||||
{ ALT('*'), reverse_selection_cmd_panel },
|
{ ALT('*'), reverse_selection_cmd_panel },
|
||||||
{ KEY_KP_MULTIPLY, reverse_selection_cmd_panel },
|
{ KEY_KP_MULTIPLY, reverse_selection_cmd_panel },
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_GNOME
|
|
||||||
{ '+', select_cmd_panel },
|
|
||||||
{ '\\', unselect_cmd_panel },
|
|
||||||
{ '-', unselect_cmd_panel },
|
|
||||||
{ '*', reverse_selection_cmd_panel },
|
|
||||||
{ XCTRL('r'), reread_cmd },
|
|
||||||
{ KEY_F(3), view_panel_cmd },
|
|
||||||
{ KEY_F(4), edit_panel_cmd },
|
|
||||||
{ KEY_F(5), copy_cmd },
|
|
||||||
{ KEY_F(6), ren_cmd },
|
|
||||||
{ KEY_F(7), mkdir_panel_cmd },
|
|
||||||
{ KEY_F(8), delete_cmd },
|
|
||||||
{ KEY_DC, delete_cmd },
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2328,9 +2172,7 @@ panel_key (WPanel *panel, int key)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
if (!command_prompt)
|
if (!command_prompt)
|
||||||
#endif /* !HAVE_X */
|
|
||||||
{
|
{
|
||||||
start_search (panel);
|
start_search (panel);
|
||||||
do_search (panel, key);
|
do_search (panel, key);
|
||||||
@ -2341,20 +2183,15 @@ panel_key (WPanel *panel, int key)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
void user_file_menu_cmd (void) {
|
void user_file_menu_cmd (void) {
|
||||||
user_menu_cmd (NULL);
|
user_menu_cmd (NULL);
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_X */
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
|
panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
|
||||||
{
|
{
|
||||||
switch (msg){
|
switch (msg){
|
||||||
case WIDGET_INIT:
|
case WIDGET_INIT:
|
||||||
#ifdef HAVE_X
|
|
||||||
x_create_panel (h, h->wdata, panel);
|
|
||||||
#endif /* !HAVE_X */
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case WIDGET_DRAW:
|
case WIDGET_DRAW:
|
||||||
@ -2362,9 +2199,7 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WIDGET_FOCUS:
|
case WIDGET_FOCUS:
|
||||||
#ifndef HAVE_GNOME
|
|
||||||
current_panel = panel;
|
current_panel = panel;
|
||||||
#endif
|
|
||||||
panel->active = 1;
|
panel->active = 1;
|
||||||
if (mc_chdir (panel->cwd) != 0){
|
if (mc_chdir (panel->cwd) != 0){
|
||||||
message (1, MSG_ERROR, _(" Cannot chdir to \"%s\" \n %s "),
|
message (1, MSG_ERROR, _(" Cannot chdir to \"%s\" \n %s "),
|
||||||
@ -2374,7 +2209,7 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
|
|||||||
|
|
||||||
show_dir (panel);
|
show_dir (panel);
|
||||||
focus_select_item (panel);
|
focus_select_item (panel);
|
||||||
#ifndef HAVE_X
|
|
||||||
define_label (h, (Widget *)panel, 1, _("Help"), help_cmd);
|
define_label (h, (Widget *)panel, 1, _("Help"), help_cmd);
|
||||||
define_label (h, (Widget *)panel, 2, _("Menu"), user_file_menu_cmd);
|
define_label (h, (Widget *)panel, 2, _("Menu"), user_file_menu_cmd);
|
||||||
define_label (h, (Widget *)panel, 3, _("View"), view_panel_cmd);
|
define_label (h, (Widget *)panel, 3, _("View"), view_panel_cmd);
|
||||||
@ -2384,7 +2219,7 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
|
|||||||
define_label (h, (Widget *)panel, 7, _("Mkdir"), mkdir_panel_cmd);
|
define_label (h, (Widget *)panel, 7, _("Mkdir"), mkdir_panel_cmd);
|
||||||
define_label (h, (Widget *)panel, 8, _("Delete"), delete_cmd);
|
define_label (h, (Widget *)panel, 8, _("Delete"), delete_cmd);
|
||||||
redraw_labels (h, (Widget *)panel);
|
redraw_labels (h, (Widget *)panel);
|
||||||
#endif
|
|
||||||
/* Chain behaviour */
|
/* Chain behaviour */
|
||||||
default_proc (h, WIDGET_FOCUS, par);
|
default_proc (h, WIDGET_FOCUS, par);
|
||||||
return 1;
|
return 1;
|
||||||
@ -2395,15 +2230,9 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
|
|||||||
panel->searching = 0;
|
panel->searching = 0;
|
||||||
display_mini_info (panel);
|
display_mini_info (panel);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_X
|
|
||||||
show_dir (panel);
|
|
||||||
unfocus_unselect_item (panel);
|
|
||||||
panel->active = 0;
|
|
||||||
#else
|
|
||||||
panel->active = 0;
|
panel->active = 0;
|
||||||
show_dir (panel);
|
show_dir (panel);
|
||||||
unselect_item (panel);
|
unselect_item (panel);
|
||||||
#endif
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case WIDGET_KEY:
|
case WIDGET_KEY:
|
||||||
|
@ -47,10 +47,8 @@
|
|||||||
#define MAX_ENTRIES 16
|
#define MAX_ENTRIES 16
|
||||||
#define MAX_ENTRY_LEN 60
|
#define MAX_ENTRY_LEN 60
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
static int debug_flag = 0;
|
static int debug_flag = 0;
|
||||||
static int debug_error = 0;
|
static int debug_error = 0;
|
||||||
#endif /* !HAVE_X */
|
|
||||||
static char *menu = NULL;
|
static char *menu = NULL;
|
||||||
|
|
||||||
/* Formats defined:
|
/* Formats defined:
|
||||||
@ -266,7 +264,6 @@ char *expand_format (WEdit *edit_widget, char c, int quote)
|
|||||||
return g_strdup ("");
|
return g_strdup ("");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
/* Checks for shell patterns definition */
|
/* Checks for shell patterns definition */
|
||||||
char *check_patterns (char *p)
|
char *check_patterns (char *p)
|
||||||
{
|
{
|
||||||
@ -796,4 +793,4 @@ void user_menu_cmd (WEdit *edit_widget)
|
|||||||
g_free (entries);
|
g_free (entries);
|
||||||
g_free (data);
|
g_free (data);
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_X */
|
|
||||||
|
@ -64,7 +64,6 @@ int tilde_trunc = 1;
|
|||||||
#ifndef VFS_STANDALONE
|
#ifndef VFS_STANDALONE
|
||||||
int is_printable (int c)
|
int is_printable (int c)
|
||||||
{
|
{
|
||||||
#ifndef HAVE_X
|
|
||||||
static const unsigned char xterm_printable[] = {
|
static const unsigned char xterm_printable[] = {
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||||
@ -99,9 +98,6 @@ int is_printable (int c)
|
|||||||
} else
|
} else
|
||||||
return (c > 31 && c < 127);
|
return (c > 31 && c < 127);
|
||||||
#endif /* !HAVE_CHARSET */
|
#endif /* !HAVE_CHARSET */
|
||||||
#else
|
|
||||||
return 1;
|
|
||||||
#endif /* HAVE_X */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the message dimensions (lines and columns) */
|
/* Returns the message dimensions (lines and columns) */
|
||||||
|
@ -749,7 +749,6 @@ view_display_clean (WView *view, int height, int width)
|
|||||||
#define view_add_string(view,s) addstr (s)
|
#define view_add_string(view,s) addstr (s)
|
||||||
#define view_gotoyx(v,r,c) widget_move (v,r,c)
|
#define view_gotoyx(v,r,c) widget_move (v,r,c)
|
||||||
|
|
||||||
/* Both the text mode and gnome editions use this */
|
|
||||||
#define BOLD_COLOR MARKED_COLOR
|
#define BOLD_COLOR MARKED_COLOR
|
||||||
#define UNDERLINE_COLOR VIEW_UNDERLINED_COLOR
|
#define UNDERLINE_COLOR VIEW_UNDERLINED_COLOR
|
||||||
#define MARK_COLOR SELECTED_COLOR
|
#define MARK_COLOR SELECTED_COLOR
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
/* "$Id$" */
|
/* "$Id$" */
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
typedef void (*fnptr)(void);
|
typedef void (*fnptr)(void);
|
||||||
|
|
||||||
typedef struct Fkey_Table_List {
|
typedef struct Fkey_Table_List {
|
||||||
@ -94,7 +93,6 @@ int check_fkeys (int c)
|
|||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_X */
|
|
||||||
|
|
||||||
/* Return values: 0 = not a movement key, 1 = was a movement key */
|
/* Return values: 0 = not a movement key, 1 = was a movement key */
|
||||||
int check_movement_keys (int c, int additional, int page_size, void *data,
|
int check_movement_keys (int c, int additional, int page_size, void *data,
|
||||||
@ -165,7 +163,6 @@ int is_abort_char (int c)
|
|||||||
c == KEY_F(10));
|
c == KEY_F(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
void mc_raw_mode (void)
|
void mc_raw_mode (void)
|
||||||
{
|
{
|
||||||
raw ();
|
raw ();
|
||||||
@ -253,4 +250,3 @@ int lookup_key (char *keyname)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !HAVE_X */
|
|
||||||
|
25
src/wtools.c
25
src/wtools.c
@ -55,7 +55,6 @@
|
|||||||
void
|
void
|
||||||
dialog_repaint (struct Dlg_head *h, int back, int title_fore)
|
dialog_repaint (struct Dlg_head *h, int back, int title_fore)
|
||||||
{
|
{
|
||||||
#ifndef HAVE_X
|
|
||||||
attrset (back);
|
attrset (back);
|
||||||
dlg_erase (h);
|
dlg_erase (h);
|
||||||
draw_box (h, 1, 1, h->lines - 2, h->cols - 2);
|
draw_box (h, 1, 1, h->lines - 2, h->cols - 2);
|
||||||
@ -64,7 +63,6 @@ dialog_repaint (struct Dlg_head *h, int back, int title_fore)
|
|||||||
dlg_move (h, 1, (h->cols-strlen (h->title))/2);
|
dlg_move (h, 1, (h->cols-strlen (h->title))/2);
|
||||||
addstr (h->title);
|
addstr (h->title);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -84,11 +82,7 @@ common_dialog_callback (struct Dlg_head *h, int id, int msg)
|
|||||||
/* }}} */
|
/* }}} */
|
||||||
/* {{{ Listbox utility functions */
|
/* {{{ Listbox utility functions */
|
||||||
|
|
||||||
#ifdef HAVE_X
|
|
||||||
#define listbox_refresh(h)
|
|
||||||
#else
|
|
||||||
#define listbox_refresh(h) common_dialog_repaint(h)
|
#define listbox_refresh(h) common_dialog_repaint(h)
|
||||||
#endif
|
|
||||||
|
|
||||||
static int listbox_callback (Dlg_head *h, int id, int msg)
|
static int listbox_callback (Dlg_head *h, int id, int msg)
|
||||||
{
|
{
|
||||||
@ -156,7 +150,6 @@ int run_listbox (Listbox *l)
|
|||||||
|
|
||||||
|
|
||||||
/* {{{ Query Dialog functions */
|
/* {{{ Query Dialog functions */
|
||||||
#ifndef HAVE_GNOME
|
|
||||||
struct text_struct {
|
struct text_struct {
|
||||||
char *text;
|
char *text;
|
||||||
char *header;
|
char *header;
|
||||||
@ -164,7 +157,6 @@ struct text_struct {
|
|||||||
|
|
||||||
static int query_callback (struct Dlg_head *h, int Id, int Msg)
|
static int query_callback (struct Dlg_head *h, int Id, int Msg)
|
||||||
{
|
{
|
||||||
#ifndef HAVE_X
|
|
||||||
struct text_struct *info;
|
struct text_struct *info;
|
||||||
|
|
||||||
info = (struct text_struct *) h->data;
|
info = (struct text_struct *) h->data;
|
||||||
@ -180,7 +172,6 @@ static int query_callback (struct Dlg_head *h, int Id, int Msg)
|
|||||||
addstr (info->header);
|
addstr (info->header);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,9 +193,6 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
|
|||||||
char *cur_name;
|
char *cur_name;
|
||||||
static int query_colors [4];
|
static int query_colors [4];
|
||||||
static struct text_struct pass;
|
static struct text_struct pass;
|
||||||
#ifdef HAVE_X
|
|
||||||
static char *buttonnames [10];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* set dialog colors */
|
/* set dialog colors */
|
||||||
query_colors [0] = (flags & D_ERROR) ? ERROR_COLOR : Q_UNSELECTED_COLOR;
|
query_colors [0] = (flags & D_ERROR) ? ERROR_COLOR : Q_UNSELECTED_COLOR;
|
||||||
@ -279,17 +267,8 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
|
|||||||
/* free used memory */
|
/* free used memory */
|
||||||
destroy_dlg (query_dlg);
|
destroy_dlg (query_dlg);
|
||||||
} else {
|
} else {
|
||||||
#ifdef HAVE_X
|
|
||||||
add_widget (query_dlg, button_new(0, 0, B_EXIT, NORMAL_BUTTON,
|
|
||||||
_("&Ok"), 0, 0, NULL));
|
|
||||||
|
|
||||||
add_widget (query_dlg, label_new (2, 3, text, NULL));
|
|
||||||
run_dlg (query_dlg);
|
|
||||||
destroy_dlg (query_dlg);
|
|
||||||
#else
|
|
||||||
add_widget (query_dlg, label_new (2, 3, text, NULL));
|
add_widget (query_dlg, label_new (2, 3, text, NULL));
|
||||||
add_widget (query_dlg, button_new(0, 0, 0, HIDDEN_BUTTON, "-", 0, 0, NULL));
|
add_widget (query_dlg, button_new(0, 0, 0, HIDDEN_BUTTON, "-", 0, 0, NULL));
|
||||||
#endif /* HAVE_X */
|
|
||||||
last_query_dlg = query_dlg;
|
last_query_dlg = query_dlg;
|
||||||
}
|
}
|
||||||
sel_pos = 0;
|
sel_pos = 0;
|
||||||
@ -331,7 +310,6 @@ Dlg_head *message (int error, char *header, const char *text, ...)
|
|||||||
return d;
|
return d;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
/* {{{ The chooser routines */
|
/* {{{ The chooser routines */
|
||||||
@ -393,8 +371,6 @@ void destroy_chooser (Chooser *c)
|
|||||||
|
|
||||||
/* {{{ Quick dialog routines */
|
/* {{{ Quick dialog routines */
|
||||||
|
|
||||||
#ifndef HAVE_X
|
|
||||||
|
|
||||||
static int quick_callback (struct Dlg_head *h, int id, int Msg)
|
static int quick_callback (struct Dlg_head *h, int id, int Msg)
|
||||||
{
|
{
|
||||||
switch (Msg){
|
switch (Msg){
|
||||||
@ -610,7 +586,6 @@ char *real_input_dialog_help (char *header, char *text, char *help, char *def_te
|
|||||||
} else
|
} else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_X */
|
|
||||||
|
|
||||||
char *input_dialog (char *header, char *text, char *def_text)
|
char *input_dialog (char *header, char *text, char *def_text)
|
||||||
{
|
{
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user