1998-04-17 04:21:53 +04:00
|
|
|
/*
|
|
|
|
* Various Menu-invoked Command implementations specific to the GNOME port
|
|
|
|
*
|
|
|
|
* Copyright (C) 1998 the Free Software Foundation
|
|
|
|
*
|
|
|
|
* Author: Miguel de Icaza (miguel@kernel.org)
|
|
|
|
*/
|
1998-03-13 20:28:06 +03:00
|
|
|
#include <config.h>
|
|
|
|
#include "x.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include "dir.h"
|
|
|
|
#include "panel.h"
|
|
|
|
#include "gscreen.h"
|
|
|
|
#include "main.h"
|
1998-04-17 04:59:58 +04:00
|
|
|
#include "gmain.h"
|
1998-03-13 20:28:06 +03:00
|
|
|
#include "cmd.h"
|
|
|
|
#include "boxes.h"
|
|
|
|
#include "panelize.h"
|
|
|
|
#include "gcmd.h"
|
1998-03-25 08:16:00 +03:00
|
|
|
#include "dialog.h"
|
1998-04-17 04:59:58 +04:00
|
|
|
#include "layout.h"
|
1998-03-13 20:28:06 +03:00
|
|
|
|
|
|
|
void
|
|
|
|
gnome_listing_cmd (GtkWidget *widget, WPanel *panel)
|
|
|
|
{
|
|
|
|
int view_type, use_msformat;
|
|
|
|
char *user, *status;
|
|
|
|
|
|
|
|
view_type = display_box (panel, &user, &status, &use_msformat, get_current_index ());
|
|
|
|
|
|
|
|
if (view_type == -1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
configure_panel_listing (panel, view_type, use_msformat, user, status);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gnome_compare_panels (void)
|
|
|
|
{
|
|
|
|
if (get_other_panel () == NULL){
|
1998-03-25 08:16:00 +03:00
|
|
|
message (1, MSG_ERROR, _(" There is no other panel to compare contents to "));
|
1998-03-13 20:28:06 +03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
compare_dirs_cmd ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gnome_open_terminal (void)
|
|
|
|
{
|
1998-04-17 04:21:53 +04:00
|
|
|
char *p;
|
|
|
|
|
|
|
|
if (!(p = gnome_is_program_in_path ("gnome-terminal")))
|
|
|
|
if (!(p = gnome_is_program_in_path ("dtterm")))
|
|
|
|
if (!(p = gnome_is_program_in_path ("nxterm")))
|
|
|
|
if (!(p = gnome_is_program_in_path ("color-xterm")))
|
|
|
|
if (!(p = gnome_is_program_in_path ("rxvt")))
|
|
|
|
p = gnome_is_program_in_path ("xterm");
|
|
|
|
|
|
|
|
if (p)
|
I improved the movement keys of the internal viewer a little bit.
Now in wrap mode the End key and cursor up key behave much better
(e.g. when viewing binary files with lots of wrapped lines).
It's not perfekt but it's better than it used to be.
Tue Apr 28 06:52:24 1998 Norbert Warmuth <k3190@fh-sw.de>
* gnome/gcmd.c (gnome_open_terminal): Changed my_system(1,...) to
my_system(EXECUTE_AS_SHELL,...)
Tue Apr 28 06:06:03 1998 Norbert Warmuth <k3190@fh-sw.de>
* vfs/extfs.c (extfs_open, extfs_close): Changed my_system(1,...)
to my_system(EXECUTE_AS_SHELL,...), this fixes the broken copyin and
copyout in 4.1.32.
Tue Apr 28 06:11:08 1998 Norbert Warmuth <k3190@fh-sw.de>
* view.c (toggle_wrap_mode, toggle_hex_mode): Force recalculation
of bottom_first (we mustn't use an already calculated and cached
value because it is invalid for the new mode and the End key would
not move to the end of the file).
* configure.in: Renamed the option `--with-our-slang' to
`--with-included-slang' (this one looks better because we also
have an `--with-included-gettext').
Make the option `--with-ext2undel' recognice a given path.
* cmd.c (view_file_at_line): In plain view (F13) set the default
magic flag to zero in order to view the file content unprocessed
(esp. don't uncompress files if they are compressed). The
view_simple_cmd got broken when the default magic flag in view.c
was changed from 0 to 1.
* view.c (do_view_init, goto_line): Set wrap mode temporary off
to make goto line number work, i.e. `line number' now always means
line number in file and not line number on screen (in wrap mode
one long line wrapped once is displayed in two lines on the screen).
That's important when the viewer is invoked from the find file
dialog to display even in wrap mode approxiamtly the part of the
file where we found the content we searched for.
(move_forward2): In wrap mode lines were sometimes counted wrong
causing cursor up to move more than one line.
(move_backward2): Fixed the movement in wrap mode.
(change_viewer): Always re-init viewer when we have a filename,
i. e. if the viewer is invoked with simple_view_cmd then we can switch
with the F8 key between unprocessed file content und uncompressed
file content.
(view_init): re-init view also when magic flag was altered
1998-04-28 18:19:48 +04:00
|
|
|
my_system (EXECUTE_AS_SHELL, shell, p);
|
1998-04-17 04:21:53 +04:00
|
|
|
else
|
|
|
|
message (1, MSG_ERROR, " Could not start a terminal ");
|
1998-03-13 20:28:06 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gnome_about_cmd (void)
|
|
|
|
{
|
|
|
|
GtkWidget *about;
|
|
|
|
gchar *authors[] = {
|
|
|
|
"The Midnight Commander Team",
|
|
|
|
"http://mc.blackdown.org/mc",
|
|
|
|
"bug reports: mc-bugs@nuclecu.unam.mx",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
about = gnome_about_new (_("GNU Midnight Commander"), VERSION,
|
|
|
|
"(C) 1994-1998 the Free Software Fundation",
|
|
|
|
authors,
|
|
|
|
_("The GNOME edition of the Midnight Commander file manager."),
|
|
|
|
NULL);
|
|
|
|
gtk_widget_show (about);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gnome_quit_cmd (void)
|
|
|
|
{
|
1998-04-17 04:21:53 +04:00
|
|
|
int q = 0;
|
|
|
|
|
|
|
|
if (!confirm_exit)
|
|
|
|
q = 1;
|
|
|
|
else if (query_dialog (_(" The Midnight Commander "),
|
|
|
|
_(" Do you really want to quit the Midnight Commander? "),
|
|
|
|
0, 2, _("&Yes"), _("&No")) == 0)
|
|
|
|
q = 1;
|
|
|
|
|
|
|
|
if (q == 1)
|
|
|
|
gtk_main_quit ();
|
1998-03-13 20:28:06 +03:00
|
|
|
}
|
|
|
|
|
1998-03-23 20:49:04 +03:00
|
|
|
void
|
|
|
|
gnome_open_panel (GtkWidget *widget, WPanel *panel)
|
|
|
|
{
|
|
|
|
new_panel_at (panel->cwd);
|
|
|
|
}
|
1998-04-16 06:45:53 +04:00
|
|
|
|
|
|
|
int
|
|
|
|
gnome_close_panel (GtkWidget *widget, WPanel *panel)
|
|
|
|
{
|
|
|
|
Dlg_head *h = panel->widget.parent;
|
|
|
|
|
|
|
|
/* Remove the widgets from the dialog head */
|
|
|
|
remove_widget (h, panel->current_dir);
|
|
|
|
remove_widget (h, panel->filter_w);
|
|
|
|
remove_widget (h, panel);
|
|
|
|
|
|
|
|
/* Kill them */
|
|
|
|
destroy_widget (panel->current_dir);
|
|
|
|
destroy_widget (panel->filter_w);
|
|
|
|
destroy_widget ((void *)panel);
|
|
|
|
|
1998-04-17 04:21:53 +04:00
|
|
|
layout_panel_gone (panel);
|
1998-04-16 06:45:53 +04:00
|
|
|
return TRUE;
|
|
|
|
}
|