mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Weee! gmc uses the gnome.m4 macros now and detects properly gnome installation - mig
This commit is contained in:
parent
442ad09caf
commit
09343b2393
63
aclocal.m4
vendored
63
aclocal.m4
vendored
@ -1,4 +1,67 @@
|
||||
dnl
|
||||
dnl GNOME_INIT_HOOK (script-if-gnome-enabled, failflag)
|
||||
dnl
|
||||
dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
|
||||
dnl is not found.
|
||||
dnl
|
||||
|
||||
AC_DEFUN([GNOME_INIT_HOOK],
|
||||
[
|
||||
AC_SUBST(GNOME_LIBS)
|
||||
AC_SUBST(GNOMEUI_LIBS)
|
||||
AC_SUBST(GTKXMHTML_LIBS)
|
||||
AC_SUBST(GNOME_LIBDIR)
|
||||
AC_SUBST(GNOME_INCLUDEDIR)
|
||||
|
||||
if test x$exec_prefix = xNONE; then
|
||||
if test x$prefix = xNONE; then
|
||||
gnome_prefix=$ac_default_prefix/lib
|
||||
else
|
||||
gnome_prefix=$prefix/lib
|
||||
fi
|
||||
else
|
||||
gnome_prefix=`eval echo \`echo $libdir\``
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(gnome-includes,
|
||||
[ --with-gnome-includes Specify location of GNOME headers],[
|
||||
CFLAGS="$CFLAGS -I$withval"
|
||||
])
|
||||
|
||||
AC_ARG_WITH(gnome-libs,
|
||||
[ --with-gnome-libs Specify location of GNOME libs],[
|
||||
LDFLAGS="$LDFLAGS -L$withval"
|
||||
gnome_prefix=$withval
|
||||
])
|
||||
|
||||
AC_ARG_WITH(gnome,
|
||||
[ --with-gnome Specify prefix for GNOME files],[
|
||||
if test x$withval = xyes; then
|
||||
$1
|
||||
else
|
||||
LDFLAGS="$LDFLAGS -L$withval/lib"
|
||||
CFLAGS="$CFLAGS -I$withval/include"
|
||||
gnome_prefix=$withval/lib
|
||||
fi
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
|
||||
if test -f $gnome_prefix/gnomeConf.sh; then
|
||||
AC_MSG_RESULT(found)
|
||||
echo "loading gnome configuration from $gnome_prefix/gnomeConf.sh"
|
||||
. $gnome_prefix/gnomeConf.sh
|
||||
$1
|
||||
else
|
||||
AC_MSG_RESULT(not found)
|
||||
if test x$2 = xfail; then
|
||||
AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([GNOME_INIT],[
|
||||
GNOME_INIT_HOOK([],fail)
|
||||
])dnl
|
||||
dnl XView & SlingShot library checking
|
||||
dnl (c) 1995 Jakub Jelinek
|
||||
dnl
|
||||
|
91
autogen.sh
91
autogen.sh
@ -1,88 +1,3 @@
|
||||
#! /bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
# Make it possible to specify path in the environment
|
||||
: ${AUTOCONF=autoconf}
|
||||
: ${AUTOHEADER=autoheader}
|
||||
: ${AUTOMAKE=automake}
|
||||
: ${ACLOCAL=aclocal}
|
||||
: ${GETTEXTIZE=gettextize}
|
||||
|
||||
srcdir=`dirname $0`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
(
|
||||
cd $srcdir
|
||||
|
||||
# The autoconf cache (version after 2.52) is not reliable yet.
|
||||
rm -rf autom4te.cache vfs/samba/autom4te.cache
|
||||
|
||||
# Ensure that gettext is reasonably new.
|
||||
gettext_ver=`$GETTEXTIZE --version | sed -n '1s/\.//g;1s/.* //p'`
|
||||
expr $gettext_ver '>=' 01038 >/dev/null
|
||||
if test $? != 0; then
|
||||
echo "Don't use gettext older than 0.10.38" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf intl
|
||||
$GETTEXTIZE --copy --force >tmpout || exit 1
|
||||
rm -f po/ChangeLog
|
||||
mv po/ChangeLog~ po/ChangeLog
|
||||
|
||||
if test ! -d config; then
|
||||
mkdir config || exit 1
|
||||
fi
|
||||
|
||||
rm -f aclocal.m4
|
||||
if test -f `aclocal --print-ac-dir`/gettext.m4; then
|
||||
: # gettext macro files are available to aclocal.
|
||||
else
|
||||
# gettext macro files are not available.
|
||||
# Find them and copy to a local directory.
|
||||
# Ugly way to parse the instructions gettexize gives us.
|
||||
m4files="`cat tmpout | sed -n -e '/^Please/,/^from/s/^ *//p'`"
|
||||
fromdir=`cat tmpout | sed -n -e '/^Please/,/^from/s/^from the \([^ ]*\) .*$/\1/p'`
|
||||
rm tmpout
|
||||
rm -rf gettext.m4
|
||||
mkdir gettext.m4
|
||||
for i in $m4files; do
|
||||
cp -f $fromdir/$i gettext.m4
|
||||
done
|
||||
ACLOCAL_INCLUDES="-I gettext.m4"
|
||||
fi
|
||||
|
||||
# Some old version of GNU build tools fail to set error codes.
|
||||
# Check that they generate some of the files they should.
|
||||
|
||||
$ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS || exit 1
|
||||
test -f aclocal.m4 || \
|
||||
{ echo "aclocal failed to generate aclocal.m4" 2>&1; exit 1; }
|
||||
|
||||
$AUTOHEADER || exit 1
|
||||
test -f config.h.in || \
|
||||
{ echo "autoheader failed to generate config.h.in" 2>&1; exit 1; }
|
||||
|
||||
$AUTOCONF || exit 1
|
||||
test -f configure || \
|
||||
{ echo "autoconf failed to generate configure" 2>&1; exit 1; }
|
||||
|
||||
# Workaround for Automake 1.5 to ensure that depcomp is distributed.
|
||||
$AUTOMAKE -a src/Makefile || exit 1
|
||||
$AUTOMAKE -a || exit 1
|
||||
test -f Makefile.in || \
|
||||
{ echo "automake failed to generate Makefile.in" 2>&1; exit 1; }
|
||||
|
||||
cd vfs/samba || exit 1
|
||||
date -u >include/stamp-h.in
|
||||
|
||||
$AUTOHEADER || exit 1
|
||||
test -f include/config.h.in || \
|
||||
{ echo "autoheader failed to generate vfs/samba/include/config.h.in" 2>&1; exit 1; }
|
||||
|
||||
$AUTOCONF || exit 1
|
||||
test -f configure || \
|
||||
{ echo "autoconf failed to generate vfs/samba/configure" 2>&1; exit 1; }
|
||||
) || exit 1
|
||||
|
||||
$srcdir/configure --cache-file=config.cache --enable-maintainer-mode "$@"
|
||||
cat macros/gnome.m4 mc-aclocal.m4 > aclocal.m4
|
||||
autoconf
|
||||
./configure $*
|
||||
|
@ -657,20 +657,17 @@ dnl Check for Gnome
|
||||
dnl
|
||||
gmc=""
|
||||
gmcdep=""
|
||||
if test x$no_x != xyes; then
|
||||
AC_ARG_WITH(gnome,[--with-gnome Compile the GNOME edition],[
|
||||
if test x$withval = xyes; then
|
||||
AC_SUBST(insticons)
|
||||
GNOME_INIT_HOOK([
|
||||
gmc=gmc
|
||||
gmcdep=gmcdep
|
||||
insticons=install_icons
|
||||
AC_SUBST(insticons)
|
||||
if test x"$xvers" = xnone; then
|
||||
xvers="Gnome"
|
||||
else
|
||||
xvers="Gnome+$xvers"
|
||||
fi
|
||||
fi])
|
||||
fi
|
||||
])
|
||||
AC_SUBST(gmc)
|
||||
AC_SUBST(gmcdep)
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
1998-03-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||
|
||||
* gscreen.c (display_mini_info): Implement mini status.
|
||||
|
||||
1998-03-19 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gdesktop.c (get_transparent_window_for_dentry): New function,
|
||||
|
@ -5,8 +5,8 @@ rootdir = $(srcdir)/..
|
||||
@MCFG@@MCF@
|
||||
|
||||
CFLAGS = $(XCFLAGS) @X_CFLAGS@
|
||||
CPPFLAGS = $(XCPPFLAGS) -I$(vfsdir) -I$(slangdir) -DHAVE_X -DHAVE_GNOME
|
||||
LDFLAGS = $(XLDFLAGS) @X_LIBS@
|
||||
CPPFLAGS = $(XCPPFLAGS) -I$(vfsdir) -I$(slangdir) -DHAVE_X -DHAVE_GNOME @GNOME_INCLUDEDIR@
|
||||
LDFLAGS = $(XLDFLAGS) @X_LIBS@ @GNOME_LIBDIR@ @GNOMEUI_LIBS@
|
||||
DEFS = $(XDEFS)
|
||||
LIBS = -lgnomeui -lgdk_imlib -lgnome -lgnomesupport -lgtk -lgdk -lglib @X_EXTRA_LIBS@ -lX11 @X_PRE_LIBS@ $(XLIBS) $(XLIB) @TERMNET@
|
||||
EXTRALIBS = @LVFS@ @LSLANG@ @LEDIT@
|
||||
|
@ -26,6 +26,7 @@
|
||||
#define PORT_HAS_DESTROY_CMD 1
|
||||
#define PORT_HAS_RADIO_FOCUS_ITEM 1
|
||||
#define PORT_HAS_DIALOG_STOP 1
|
||||
#define PORT_HAS_DISPLAY_MINI_INFO 1
|
||||
|
||||
#define mi_getch() fprintf (stderr, "mi_getch is not implemented in this port\n")
|
||||
#define frontend_run_dlg(x) gtkrundlg_event (x)
|
||||
|
@ -2,7 +2,6 @@ All:
|
||||
- Intenrationalization
|
||||
- It crashes
|
||||
- It leaks objects.
|
||||
- It does not object to leaks.
|
||||
- argp handling.
|
||||
- Session management
|
||||
|
||||
@ -12,7 +11,6 @@ Desktop:
|
||||
|
||||
Panels:
|
||||
- Global bindings (some shortcuts are not implemented)
|
||||
- Mini-info panel display
|
||||
- Finish regular property pages
|
||||
- Add a nifty toolbar
|
||||
- Split view.
|
||||
|
@ -264,6 +264,8 @@ panel_file_list_configure_contents (GtkWidget *file_list, WPanel *panel, int mai
|
||||
} else
|
||||
extra_space = expand_space = 0;
|
||||
|
||||
panel->estimated_total = total_columns;
|
||||
|
||||
/* If we dont have enough space, shorten the fields */
|
||||
if (used_columns > total_columns){
|
||||
expand_space = 0;
|
||||
@ -564,7 +566,6 @@ panel_file_list_compute_lines (GtkCList *file_list, WPanel *panel, int height)
|
||||
static void
|
||||
panel_file_list_size_allocate_hook (GtkWidget *file_list, GtkAllocation *allocation, WPanel *panel)
|
||||
{
|
||||
printf ("%d %d\n", allocation->width, allocation->height);
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (file_list), panel);
|
||||
panel_file_list_configure_contents (file_list, panel, allocation->width, allocation->height);
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (file_list), panel);
|
||||
@ -1077,6 +1078,62 @@ show_filter_popup (GtkWidget *button, gpointer data)
|
||||
GDK_CURRENT_TIME);
|
||||
}
|
||||
|
||||
void
|
||||
display_mini_info (WPanel *panel)
|
||||
{
|
||||
GtkLabel *label = GTK_LABEL (panel->ministatus);
|
||||
|
||||
if (panel->searching){
|
||||
char *str = copy_strings ("Search: ", panel->search_buffer, NULL);
|
||||
|
||||
gtk_label_set (label, str);
|
||||
free (str);
|
||||
return;
|
||||
}
|
||||
|
||||
if (panel->marked){
|
||||
char buffer [120];
|
||||
|
||||
sprintf (buffer, " %s bytes in %d files%s",
|
||||
size_trunc_sep (panel->total), panel->marked,
|
||||
panel->marked == 1 ? "" : "s");
|
||||
|
||||
gtk_label_set (label, buffer);
|
||||
}
|
||||
|
||||
if (S_ISLNK (panel->dir.list [panel->selected].buf.st_mode)){
|
||||
char *link, link_target [MC_MAXPATHLEN];
|
||||
int len;
|
||||
|
||||
link = concat_dir_and_file (panel->cwd, panel->dir.list [panel->selected].fname);
|
||||
len = mc_readlink (link, link_target, MC_MAXPATHLEN);
|
||||
free (link);
|
||||
|
||||
if (len > 0){
|
||||
char *str;
|
||||
|
||||
link_target [len] = 0;
|
||||
str = copy_strings ("-> ", link_target, NULL);
|
||||
gtk_label_set (label, str);
|
||||
free (str);
|
||||
} else
|
||||
gtk_label_set (label, "<readlink failed>");
|
||||
return;
|
||||
}
|
||||
|
||||
if (panel->estimated_total){
|
||||
int len = panel->estimated_total;
|
||||
char *buffer;
|
||||
|
||||
buffer = xmalloc (len + 2, "display_mini_info");
|
||||
format_file (buffer, panel, panel->selected, panel->estimated_total-2, 0, 1);
|
||||
buffer [len] = 0;
|
||||
gtk_label_set (label, buffer);
|
||||
|
||||
free (buffer);
|
||||
}
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
panel_create_filter (Dlg_head *h, WPanel *panel, GtkWidget **filter_w)
|
||||
{
|
||||
@ -1138,28 +1195,27 @@ void
|
||||
x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
|
||||
{
|
||||
GtkWidget *status_line, *filter, *statusbar, *vbox;
|
||||
GtkWidget *ministatus_align;
|
||||
|
||||
panel->table = gtk_table_new (2, 1, 0);
|
||||
gtk_widget_show (panel->table);
|
||||
|
||||
panel->list = panel_create_file_list (panel);
|
||||
gtk_widget_show (panel->list);
|
||||
|
||||
panel->current_dir = panel_create_cwd (panel);
|
||||
gtk_widget_show (panel->current_dir);
|
||||
|
||||
filter = panel_create_filter (h, panel, (GtkWidget **) &panel->filter_w);
|
||||
gtk_widget_show (filter);
|
||||
|
||||
/* ministatus */
|
||||
ministatus_align = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
|
||||
panel->ministatus = gtk_label_new ("");
|
||||
gtk_container_add (GTK_CONTAINER (ministatus_align), panel->ministatus);
|
||||
|
||||
status_line = gtk_hbox_new (0, 0);
|
||||
gtk_widget_show (status_line);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (status_line), panel->current_dir, 1, 1, 0);
|
||||
gtk_box_pack_end (GTK_BOX (status_line), filter, 0, 0, 0);
|
||||
|
||||
panel->status = statusbar = gtk_label_new ("");
|
||||
gtk_widget_show (statusbar);
|
||||
|
||||
gtk_table_attach (GTK_TABLE (panel->table), panel->list, 0, 1, 1, 2,
|
||||
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
|
||||
@ -1169,14 +1225,14 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
|
||||
gtk_table_attach (GTK_TABLE (panel->table), status_line, 0, 1, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
|
||||
|
||||
gtk_table_attach (GTK_TABLE (panel->table), panel->ministatus, 0, 1, 2, 3,
|
||||
GTK_EXPAND | GTK_FILL,
|
||||
gtk_table_attach (GTK_TABLE (panel->table), ministatus_align, 0, 1, 2, 3,
|
||||
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
|
||||
0, 0, 0);
|
||||
|
||||
gtk_table_attach (GTK_TABLE (panel->table), statusbar, 0, 1, 3, 4,
|
||||
GTK_EXPAND | GTK_FILL,
|
||||
0, 0, 0);
|
||||
|
||||
gtk_widget_show (panel->table);
|
||||
|
||||
/* Ultra nasty hack: pull the vbox from wdata */
|
||||
vbox = GTK_WIDGET (panel->widget.wdata);
|
||||
@ -1186,6 +1242,8 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
|
||||
/* Now, insert our table in our parent */
|
||||
gtk_container_add (GTK_CONTAINER (vbox), panel->table);
|
||||
|
||||
gtk_widget_show_all (panel->table);
|
||||
|
||||
if (!pixmaps_ready){
|
||||
if (!GTK_WIDGET_REALIZED (panel->list))
|
||||
gtk_widget_realize (panel->list);
|
||||
@ -1196,6 +1254,7 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
|
||||
* filter input line
|
||||
*/
|
||||
panel->widget.options |= W_WANT_CURSOR;
|
||||
panel->estimated_total = 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -72,6 +72,7 @@ view_percent (WView *view, int p)
|
||||
|
||||
sprintf (buffer, "%3d%%", percent);
|
||||
gtk_label_set (GTK_LABEL (view->gtk_percent), buffer);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
@ -300,7 +301,7 @@ int
|
||||
view (char *_command, char *_file, int *move_dir_p, int start_line)
|
||||
{
|
||||
Dlg_head *our_dlg;
|
||||
GtkWidget *toplevel, *status;
|
||||
GtkWidget *toplevel, *status, *scrollbar;
|
||||
GtkVBox *vbox;
|
||||
WView *wview;
|
||||
int midnight_colors [4];
|
||||
@ -328,6 +329,8 @@ view (char *_command, char *_file, int *move_dir_p, int start_line)
|
||||
if (move_dir_p)
|
||||
*move_dir_p = 0;
|
||||
|
||||
scrollbar = gtk_vscrollbar_new (sadj);
|
||||
|
||||
/* Please note that if you add another widget,
|
||||
* you have to modify view_adjust_size to
|
||||
* be aware of it
|
||||
|
1182
mc-aclocal.m4
Normal file
1182
mc-aclocal.m4
Normal file
File diff suppressed because it is too large
Load Diff
@ -116,6 +116,8 @@ typedef struct {
|
||||
void *filter_w;
|
||||
void *status;
|
||||
void *ministatus;
|
||||
|
||||
int estimated_total;
|
||||
#endif
|
||||
} WPanel;
|
||||
|
||||
|
19
src/screen.c
19
src/screen.c
@ -507,16 +507,25 @@ format_file (char *dest, WPanel *panel, int file_index, int width, int attr, int
|
||||
color = NORMAL_COLOR;
|
||||
for (format = home; format; format = format->next){
|
||||
if (format->string_fn){
|
||||
int len;
|
||||
|
||||
if (empty_line)
|
||||
txt = " ";
|
||||
else
|
||||
txt = (*format->string_fn)(fe, format->field_len);
|
||||
|
||||
old_pos = cdest;
|
||||
cdest = to_buffer (cdest, format->just_mode, format->field_len, txt);
|
||||
length += format->field_len;
|
||||
|
||||
#ifndef HAVE_X
|
||||
len = format->field_len;
|
||||
if (len + length > width)
|
||||
len = width - length;
|
||||
cdest = to_buffer (cdest, format->just_mode, len, txt);
|
||||
length += len;
|
||||
|
||||
#ifdef HAVE_X
|
||||
if (length == width)
|
||||
break;
|
||||
#else
|
||||
/* What shall we do? Will we color each line according to
|
||||
* the file type? Any suggestions to mc@timur.kazan.su
|
||||
*/
|
||||
@ -601,10 +610,10 @@ repaint_file (WPanel *panel, int file_index, int mv, int attr, int isstatus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef PORT_HAS_DISPLAY_MINI_INFO
|
||||
void
|
||||
display_mini_info (WPanel *panel)
|
||||
{
|
||||
#ifndef HAVE_X
|
||||
if (!show_mini_info)
|
||||
return;
|
||||
|
||||
@ -659,8 +668,8 @@ display_mini_info (WPanel *panel)
|
||||
/* Default behaviour */
|
||||
repaint_file (panel, panel->selected, 0, STATUS, 1);
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_X
|
||||
void
|
||||
|
@ -97,6 +97,7 @@ typedef struct {
|
||||
void *gtk_bytes; /* bytes */
|
||||
void *gtk_flags; /* flags (growing) */
|
||||
void *gtk_percent; /* percent */
|
||||
void *sadj; /* scrollbar adjustment */
|
||||
#endif
|
||||
|
||||
int move_dir; /* return value from widget:
|
||||
|
@ -11,6 +11,7 @@
|
||||
#define PORT_HAS_PANEL_RESET_SORT_LABELS 1
|
||||
#define PORT_HAS_DESTROY_CMD 1
|
||||
#define PORT_HAS_RADIO_FOCUS_ITEM 1
|
||||
#define PORT_HAS_DISPLAY_MINI_INFO 1
|
||||
|
||||
#define frontend_run_dlg(x) tkrundlg_event (x)
|
||||
|
||||
|
@ -554,3 +554,9 @@ panel_update_cols (Widget *widget, int frame_size)
|
||||
{
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
void
|
||||
display_mini_info (WPanel *panel)
|
||||
{
|
||||
/* FIXME: implement */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user