These are a bunch of changes to fix CORBA and session management. They
are almost complete (i.e. to handle all nitty gritty cases), but they seem to be working OK right now. SM should be much more stable now. Please tell me if you find any weird behavior - Federico 1999-03-30 Federico Mena Quintero <federico@nuclecu.unam.mx> * gdesktop-icon.c (desktop_icon_realize): Remove the WM_CLIENT_LEADER property from icon windows so that window managers will not store SM information for them. * gnome-open-dialog.c: Added missing #includes. * gdesktop-init.c (desktop_init_at): Removed an unused variable. * gdesktop.h: Added some missing prototypes. * gmain.h: Added some missing prototypes. * Makefile.in: Added gsession.[ch] to the list of sources. * gmain.c (create_panels): Consider whether we have a CORBA server and session management. * gdesktop.c: #include "gdesktop-init.h" * gdesktop.c: Added a missing cast to GNOME_DIALOG. * gmain.c (create_panels): Removed the run_desktop global variable. * glayout.c (create_container): Set the wmclass of the panel to include its unique ID. * gsession.[ch]: New file with the functions that deal with session management. * glayout.c (gnome_exit): Use session_set_restart(). * gcorba.c (corba_init): Now returns an int with an error value. (corba_init_server): Initialize the server properly. Fixed all the object implementation code. (corba_create_window): New function used to create a window with the CORBA server. * gmain.c (gnome_check_super_user): Now the check for running as root is done here. There should be no GUI code in src/. 1999-03-30 Federico Mena Quintero <federico@nuclecu.unam.mx> * dlg.c (dlg_run_done): Do not call the callback of a NULL current widget. * setup.h: Added missing prototype for setup_init(). * filegui.c (check_progress_buttons): Added a missing return value. * dlg.c (remove_widget): Added a missing return value. * main.c: Removed the global directory_list variable. Removed the main_corba_register_server() function. * main.h: Removed the global run_desktop variable. * panel.h: Now the panel structure has a unique numerical ID used for session management. * screen.c (panel_new): Maintain a unique ID for each panel. * main.c (maybe_display_linksdir): Handle display of the desktop init dir here. (main): Call gnome_check_super_user(). (init_corba_with_args): Call corba_init_server(). * main.c (init_corba_with_args): Do CORBA initialization here. Also removed the global force_activation option. 1999-03-30 Federico Mena Quintero <federico@nuclecu.unam.mx> * vfs.c (vfs_add_current_stamps): Only do stamping of the panels if they exist. * mcserv.c: #include <sys/wait.h> (get_client): Put `#ifdef __EMX__' around an otherwise-unused variable. * utilvfs.c (vfs_split_url): Fix NULL <-> 0 confusion when comparing characters. * ftpfs.c (retrieve_dir): Removed unused variable dot_dot_found. * extfs.c (extfs_init): Assign `key' to c, not `&key'.
Этот коммит содержится в:
родитель
05e0754f46
Коммит
b3bb157ad5
@ -1,3 +1,45 @@
|
|||||||
|
1999-03-30 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* gdesktop-icon.c (desktop_icon_realize): Remove the
|
||||||
|
WM_CLIENT_LEADER property from icon windows so that window
|
||||||
|
managers will not store SM information for them.
|
||||||
|
|
||||||
|
* gnome-open-dialog.c: Added missing #includes.
|
||||||
|
|
||||||
|
* gdesktop-init.c (desktop_init_at): Removed an unused variable.
|
||||||
|
|
||||||
|
* gdesktop.h: Added some missing prototypes.
|
||||||
|
|
||||||
|
* gmain.h: Added some missing prototypes.
|
||||||
|
|
||||||
|
* Makefile.in: Added gsession.[ch] to the list of sources.
|
||||||
|
|
||||||
|
* gmain.c (create_panels): Consider whether we have a CORBA server
|
||||||
|
and session management.
|
||||||
|
|
||||||
|
* gdesktop.c: #include "gdesktop-init.h"
|
||||||
|
* gdesktop.c: Added a missing cast to GNOME_DIALOG.
|
||||||
|
|
||||||
|
* gmain.c (create_panels): Removed the run_desktop global
|
||||||
|
variable.
|
||||||
|
|
||||||
|
* glayout.c (create_container): Set the wmclass of the panel to
|
||||||
|
include its unique ID.
|
||||||
|
|
||||||
|
* gsession.[ch]: New file with the functions that deal with
|
||||||
|
session management.
|
||||||
|
|
||||||
|
* glayout.c (gnome_exit): Use session_set_restart().
|
||||||
|
|
||||||
|
* gcorba.c (corba_init): Now returns an int with an error value.
|
||||||
|
(corba_init_server): Initialize the server properly.
|
||||||
|
Fixed all the object implementation code.
|
||||||
|
(corba_create_window): New function used to create a window with
|
||||||
|
the CORBA server.
|
||||||
|
|
||||||
|
* gmain.c (gnome_check_super_user): Now the check for running as
|
||||||
|
root is done here. There should be no GUI code in src/.
|
||||||
|
|
||||||
1999-03-29 Jonathan Blandford <jrb@redhat.com>
|
1999-03-29 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
* gdesktop.c (create_desktop_dir): improved wording.
|
* gdesktop.c (create_desktop_dir): improved wording.
|
||||||
|
@ -27,69 +27,71 @@ PIXMAPS = \
|
|||||||
dir-close.xpm \
|
dir-close.xpm \
|
||||||
dir-open.xpm
|
dir-open.xpm
|
||||||
|
|
||||||
GNOMESRCS = \
|
GNOMESRCS = \
|
||||||
gaction.c \
|
gaction.c \
|
||||||
gcache.c \
|
gcache.c \
|
||||||
gcliplabel.c \
|
gcliplabel.c \
|
||||||
gcustom-layout.c\
|
gcustom-layout.c \
|
||||||
gcmd.c \
|
gcmd.c \
|
||||||
gcorba.c \
|
gcorba.c \
|
||||||
gdesktop-icon.c \
|
gdesktop-icon.c \
|
||||||
gdesktop-init.c \
|
gdesktop-init.c \
|
||||||
gdesktop.c \
|
gdesktop.c \
|
||||||
gdialogs.c \
|
gdialogs.c \
|
||||||
gdnd.c \
|
gdnd.c \
|
||||||
ghelp.c \
|
ghelp.c \
|
||||||
gicon.c \
|
gicon.c \
|
||||||
ginfo.c \
|
ginfo.c \
|
||||||
gkey.c \
|
gkey.c \
|
||||||
glayout.c \
|
glayout.c \
|
||||||
gmain.c \
|
gmain.c \
|
||||||
gmount.c \
|
gmount.c \
|
||||||
gmc-chargrid.c \
|
gmc-chargrid.c \
|
||||||
gmenu.c \
|
gmenu.c \
|
||||||
gmetadata.c \
|
gmetadata.c \
|
||||||
gpageprop.c \
|
gpageprop.c \
|
||||||
gpopup2.c \
|
gpopup2.c \
|
||||||
gprefs.c \
|
gprefs.c \
|
||||||
gprint.c \
|
gprint.c \
|
||||||
gprop.c \
|
gprop.c \
|
||||||
gnome-file-property-dialog.c \
|
gnome-file-property-dialog.c \
|
||||||
gnome-open-dialog.c \
|
gnome-open-dialog.c \
|
||||||
gscreen.c \
|
gscreen.c \
|
||||||
gtools.c \
|
gsession.c \
|
||||||
gtkdtree.c \
|
gtools.c \
|
||||||
gtree.c \
|
gtkdtree.c \
|
||||||
gutil.c \
|
gtree.c \
|
||||||
gview.c \
|
gutil.c \
|
||||||
|
gview.c \
|
||||||
gwidget.c
|
gwidget.c
|
||||||
|
|
||||||
GNOMEHDRS = \
|
GNOMEHDRS = \
|
||||||
gcache.h \
|
gcache.h \
|
||||||
gcliplabel.h \
|
gcliplabel.h \
|
||||||
gcmd.h \
|
gcmd.h \
|
||||||
gconf.h \
|
gconf.h \
|
||||||
gcorba.h \
|
gcorba.h \
|
||||||
gcustom-layout.h\
|
gcustom-layout.h \
|
||||||
gdesktop-icon.h \
|
gdesktop-icon.h \
|
||||||
gdesktop-init.h \
|
gdesktop-init.h \
|
||||||
gdesktop.h \
|
gdesktop.h \
|
||||||
gdnd.h \
|
gdnd.h \
|
||||||
gicon.h \
|
gicon.h \
|
||||||
gmain.h \
|
gmain.h \
|
||||||
gmount.h \
|
gmount.h \
|
||||||
gmc-chargrid.h \
|
gmc-chargrid.h \
|
||||||
gmetadata.h \
|
gmetadata.h \
|
||||||
gpageprop.h \
|
gpageprop.h \
|
||||||
gpopup.h \
|
gpopup.h \
|
||||||
gprefs.h \
|
gprefs.h \
|
||||||
gprint.h \
|
gprint.h \
|
||||||
gprop.h \
|
gprop.h \
|
||||||
gnome-file-property-dialog.h \
|
gnome-file-property-dialog.h \
|
||||||
gnome-open-dialog.h \
|
gnome-open-dialog.h \
|
||||||
gscreen.h \
|
gscreen.h \
|
||||||
gtkdtree.h \
|
gsession.h \
|
||||||
gtree.h \
|
gtkdtree.h \
|
||||||
|
gtree.h \
|
||||||
gwidget.h
|
gwidget.h
|
||||||
|
|
||||||
ICONS = \
|
ICONS = \
|
||||||
@ -134,44 +136,45 @@ CORBAOBJS = \
|
|||||||
FileManager-stubs.o \
|
FileManager-stubs.o \
|
||||||
FileManager-common.o
|
FileManager-common.o
|
||||||
|
|
||||||
OBJS = \
|
OBJS = \
|
||||||
$(LOBJS) \
|
$(LOBJS) \
|
||||||
$(OOBJS) \
|
$(OOBJS) \
|
||||||
gaction.o \
|
gaction.o \
|
||||||
gcache.o \
|
gcache.o \
|
||||||
gcliplabel.o \
|
gcliplabel.o \
|
||||||
gcmd.o \
|
gcmd.o \
|
||||||
gcustom-layout.o\
|
gcustom-layout.o \
|
||||||
gdesktop-icon.o \
|
gdesktop-icon.o \
|
||||||
gdesktop-init.o \
|
gdesktop-init.o \
|
||||||
gdesktop.o \
|
gdesktop.o \
|
||||||
gdnd.o \
|
gdnd.o \
|
||||||
ghelp.o \
|
ghelp.o \
|
||||||
gicon.o \
|
gicon.o \
|
||||||
ginfo.o \
|
ginfo.o \
|
||||||
gkey.o \
|
gkey.o \
|
||||||
glayout.o \
|
glayout.o \
|
||||||
gmain.o \
|
gmain.o \
|
||||||
gmount.o \
|
gmount.o \
|
||||||
gmc-chargrid.o \
|
gmc-chargrid.o \
|
||||||
gmenu.o \
|
gmenu.o \
|
||||||
gmetadata.o \
|
gmetadata.o \
|
||||||
gpageprop.o \
|
gpageprop.o \
|
||||||
gpopup2.o \
|
gpopup2.o \
|
||||||
gprefs.o \
|
gprefs.o \
|
||||||
gprint.o \
|
gprint.o \
|
||||||
gprop.o \
|
gprop.o \
|
||||||
gnome-file-property-dialog.o \
|
gnome-file-property-dialog.o \
|
||||||
gnome-open-dialog.o \
|
gnome-open-dialog.o \
|
||||||
gscreen.o \
|
gscreen.o \
|
||||||
gtools.o \
|
gsession.o \
|
||||||
gtree.o \
|
gtools.o \
|
||||||
gutil.o \
|
gtree.o \
|
||||||
gview.o \
|
gutil.o \
|
||||||
gtkdtree.o \
|
gview.o \
|
||||||
|
gtkdtree.o \
|
||||||
gwidget.o
|
gwidget.o
|
||||||
|
|
||||||
NORMALOBJS = \
|
NORMALOBJS = \
|
||||||
main.o
|
main.o
|
||||||
|
|
||||||
CORBA_GENERATED = \
|
CORBA_GENERATED = \
|
||||||
|
478
gnome/gcorba.c
478
gnome/gcorba.c
@ -1,36 +1,37 @@
|
|||||||
/*
|
/* CORBA support for the Midhignt Commander
|
||||||
* gcorba.c: CORBA support code for the GNOME Midnight Commander
|
|
||||||
*
|
*
|
||||||
* Author:
|
* Copyright (C) 1999 The Free Sofware Foundation
|
||||||
* Miguel de Icaza (miguel@gnu.org)
|
*
|
||||||
* Elliot Lee (sopwith@cuc.edu)
|
* Authors: Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
* Federico Mena <federico@nuclecu.unam.mx>
|
||||||
|
* Elliot Lee <sopwith@cuc.edu>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <libgnorba/gnorba.h>
|
|
||||||
#include <libgnorba/gnome-factory.h>
|
|
||||||
#include "FileManager.h"
|
|
||||||
#include <config.h>
|
|
||||||
#include "x.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include "dir.h"
|
|
||||||
#include "global.h"
|
|
||||||
#include "panel.h"
|
#include "panel.h"
|
||||||
#include "gscreen.h"
|
#include <libgnorba/gnorba.h>
|
||||||
#include "main.h"
|
#include "FileManager.h"
|
||||||
#include "gmain.h"
|
|
||||||
#include "gcmd.h"
|
#include "gcmd.h"
|
||||||
#include "gcorba.h"
|
#include "gcorba.h"
|
||||||
|
#include "global.h"
|
||||||
|
#include "gmain.h"
|
||||||
|
|
||||||
PortableServer_POA poa;
|
/*** Global variables ***/
|
||||||
PortableServer_POAManager poa_manager;
|
|
||||||
CORBA_ORB orb;
|
CORBA_ORB orb = CORBA_OBJECT_NIL;
|
||||||
|
|
||||||
|
/*** Local variables ***/
|
||||||
|
|
||||||
|
/* Reference to the server object */
|
||||||
|
static CORBA_Object gmc_server;
|
||||||
|
|
||||||
|
/*** App-specific servant structures ***/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
POA_GNOME_FileManagerWindow servant;
|
POA_GNOME_FileManagerWindow servant;
|
||||||
PortableServer_POA poa;
|
PortableServer_POA poa;
|
||||||
|
|
||||||
WPanel *mywin;
|
WPanel *panel;
|
||||||
} impl_POA_GNOME_FileManagerWindow;
|
} impl_POA_GNOME_FileManagerWindow;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -40,55 +41,64 @@ typedef struct {
|
|||||||
|
|
||||||
/*** Implementation stub prototypes ***/
|
/*** Implementation stub prototypes ***/
|
||||||
|
|
||||||
static void
|
static void impl_GNOME_FileManagerWindow__destroy (impl_POA_GNOME_FileManagerWindow *servant,
|
||||||
impl_GNOME_FileManagerWindow_close (impl_POA_GNOME_FileManagerWindow * servant,
|
CORBA_Environment *ev);
|
||||||
CORBA_Environment * ev);
|
static void impl_GNOME_FileManagerWindow_close (impl_POA_GNOME_FileManagerWindow *servant,
|
||||||
|
CORBA_Environment *ev);
|
||||||
|
|
||||||
GNOME_FileManagerWindow
|
static void impl_GNOME_FileManagerFactory__destroy (impl_POA_GNOME_FileManagerFactory *servant,
|
||||||
impl_GNOME_FileManagerFactory_create_window (impl_POA_GNOME_FileManagerFactory * servant,
|
CORBA_Environment *ev);
|
||||||
CORBA_char * dir,
|
|
||||||
CORBA_Environment * ev);
|
|
||||||
|
|
||||||
CORBA_boolean
|
static CORBA_boolean impl_GNOME_FileManagerFactory_supports (
|
||||||
impl_GNOME_FileManagerFactory_supports (impl_POA_GNOME_FileManagerFactory * servant,
|
impl_POA_GNOME_FileManagerFactory *servant,
|
||||||
CORBA_char * obj_goad_id,
|
const CORBA_char *obj_goad_id,
|
||||||
CORBA_Environment * ev);
|
CORBA_Environment *ev);
|
||||||
CORBA_Object
|
|
||||||
impl_GNOME_FileManagerFactory_create_object (impl_POA_GNOME_FileManagerFactory * servant,
|
static CORBA_Object impl_GNOME_FileManagerFactory_create_object (
|
||||||
CORBA_char * goad_id,
|
impl_POA_GNOME_FileManagerFactory *servant,
|
||||||
GNOME_stringlist * params,
|
const CORBA_char *goad_id,
|
||||||
CORBA_Environment * ev);
|
const GNOME_stringlist *params,
|
||||||
|
CORBA_Environment *ev);
|
||||||
|
|
||||||
|
static GNOME_FileManagerWindow impl_GNOME_FileManagerFactory_create_window (
|
||||||
|
impl_POA_GNOME_FileManagerFactory * servant,
|
||||||
|
const CORBA_char * dir,
|
||||||
|
CORBA_Environment * ev);
|
||||||
|
|
||||||
/*** epv structures ***/
|
/*** epv structures ***/
|
||||||
|
|
||||||
static PortableServer_ServantBase__epv impl_GNOME_FileManagerWindow_base_epv =
|
static PortableServer_ServantBase__epv impl_GNOME_FileManagerWindow_base_epv =
|
||||||
{
|
{
|
||||||
NULL, NULL, NULL
|
NULL, /* _private data */
|
||||||
|
NULL, /* finalize routine */
|
||||||
|
NULL, /* default_POA routine */
|
||||||
};
|
};
|
||||||
|
|
||||||
static POA_GNOME_FileManagerWindow__epv impl_GNOME_FileManagerWindow_epv =
|
static POA_GNOME_FileManagerWindow__epv impl_GNOME_FileManagerWindow_epv =
|
||||||
{
|
{
|
||||||
NULL, /* _private */
|
NULL, /* _private */
|
||||||
(gpointer) & impl_GNOME_FileManagerWindow_close,
|
(gpointer) &impl_GNOME_FileManagerWindow_close,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static PortableServer_ServantBase__epv impl_GNOME_FileManagerFactory_base_epv =
|
static PortableServer_ServantBase__epv impl_GNOME_FileManagerFactory_base_epv =
|
||||||
{
|
{
|
||||||
NULL, /* _private data */
|
NULL, /* _private data */
|
||||||
NULL,
|
NULL, /* finalize routine */
|
||||||
NULL /* default_POA routine */
|
NULL, /* default_POA routine */
|
||||||
};
|
};
|
||||||
|
|
||||||
static POA_GNOME_FileManagerFactory__epv impl_GNOME_FileManagerFactory_epv =
|
static POA_GNOME_FileManagerFactory__epv impl_GNOME_FileManagerFactory_epv =
|
||||||
{
|
{
|
||||||
NULL, /* _private */
|
NULL, /* _private */
|
||||||
(gpointer) & impl_GNOME_FileManagerFactory_create_window,
|
(gpointer) &impl_GNOME_FileManagerFactory_create_window,
|
||||||
};
|
};
|
||||||
|
|
||||||
static POA_GNOME_GenericFactory__epv impl_GNOME_FileManagerFactory_GNOME_GenericFactory_epv =
|
static POA_GNOME_GenericFactory__epv impl_GNOME_FileManagerFactory_GNOME_GenericFactory_epv =
|
||||||
{
|
{
|
||||||
NULL, /* _private */
|
NULL, /* _private */
|
||||||
(gpointer) & impl_GNOME_FileManagerFactory_supports,
|
(gpointer) &impl_GNOME_FileManagerFactory_supports,
|
||||||
(gpointer) & impl_GNOME_FileManagerFactory_create_object,
|
(gpointer) &impl_GNOME_FileManagerFactory_create_object
|
||||||
};
|
};
|
||||||
|
|
||||||
/*** vepv structures ***/
|
/*** vepv structures ***/
|
||||||
@ -96,205 +106,269 @@ static POA_GNOME_GenericFactory__epv impl_GNOME_FileManagerFactory_GNOME_Generic
|
|||||||
static POA_GNOME_FileManagerWindow__vepv impl_GNOME_FileManagerWindow_vepv =
|
static POA_GNOME_FileManagerWindow__vepv impl_GNOME_FileManagerWindow_vepv =
|
||||||
{
|
{
|
||||||
&impl_GNOME_FileManagerWindow_base_epv,
|
&impl_GNOME_FileManagerWindow_base_epv,
|
||||||
&impl_GNOME_FileManagerWindow_epv,
|
&impl_GNOME_FileManagerWindow_epv
|
||||||
};
|
};
|
||||||
|
|
||||||
static POA_GNOME_FileManagerFactory__vepv impl_GNOME_FileManagerFactory_vepv =
|
static POA_GNOME_FileManagerFactory__vepv impl_GNOME_FileManagerFactory_vepv =
|
||||||
{
|
{
|
||||||
&impl_GNOME_FileManagerFactory_base_epv,
|
&impl_GNOME_FileManagerFactory_base_epv,
|
||||||
&impl_GNOME_FileManagerFactory_GNOME_GenericFactory_epv,
|
&impl_GNOME_FileManagerFactory_GNOME_GenericFactory_epv,
|
||||||
&impl_GNOME_FileManagerFactory_epv,
|
&impl_GNOME_FileManagerFactory_epv
|
||||||
};
|
};
|
||||||
|
|
||||||
impl_POA_GNOME_FileManagerFactory poa_filemanagerfactory_servant =
|
|
||||||
{
|
|
||||||
{ NULL, &impl_GNOME_FileManagerFactory_vepv}, NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
GNOME_FileManagerFactory filemanagerfactory_server;
|
|
||||||
|
|
||||||
/*** Stub implementations ***/
|
/*** Stub implementations ***/
|
||||||
|
|
||||||
static void
|
static GNOME_FileManagerWindow
|
||||||
do_window_close(GtkWidget *widget, gpointer _servant)
|
impl_GNOME_FileManagerWindow__create(PortableServer_POA poa,
|
||||||
{
|
impl_POA_GNOME_FileManagerWindow **servant,
|
||||||
CORBA_Environment ev;
|
CORBA_Environment *ev)
|
||||||
PortableServer_ObjectId *objid;
|
|
||||||
impl_POA_GNOME_FileManagerWindow *servant = _servant;
|
|
||||||
|
|
||||||
CORBA_exception_init(&ev);
|
|
||||||
objid = PortableServer_POA_servant_to_id (servant->poa, _servant, &ev);
|
|
||||||
PortableServer_POA_deactivate_object (servant->poa, objid, &ev);
|
|
||||||
#if 1
|
|
||||||
#warning Remove this ifdef when the new ORBit is released.
|
|
||||||
g_warning ("Developer Warning: when a new ORBIt is released, remove this code\n");
|
|
||||||
#else
|
|
||||||
CORBA_free (objid);
|
|
||||||
#endif
|
|
||||||
POA_GNOME_FileManagerWindow__fini(_servant, &ev);
|
|
||||||
|
|
||||||
g_free(servant);
|
|
||||||
CORBA_exception_free(&ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
impl_GNOME_FileManagerWindow_close (impl_POA_GNOME_FileManagerWindow * servant, CORBA_Environment * ev)
|
|
||||||
{
|
|
||||||
gnome_close_panel (GTK_WIDGET (servant->mywin->widget.wdata), servant->mywin);
|
|
||||||
}
|
|
||||||
|
|
||||||
GNOME_FileManagerWindow
|
|
||||||
impl_GNOME_FileManagerFactory_create_window (impl_POA_GNOME_FileManagerFactory * servant,
|
|
||||||
CORBA_char * dir,
|
|
||||||
CORBA_Environment * ev)
|
|
||||||
{
|
{
|
||||||
GNOME_FileManagerWindow retval;
|
GNOME_FileManagerWindow retval;
|
||||||
impl_POA_GNOME_FileManagerWindow *newservant;
|
impl_POA_GNOME_FileManagerWindow *newservant;
|
||||||
PortableServer_ObjectId *objid;
|
PortableServer_ObjectId *objid;
|
||||||
|
|
||||||
newservant = g_new0(impl_POA_GNOME_FileManagerWindow, 1);
|
newservant = g_new0 (impl_POA_GNOME_FileManagerWindow, 1);
|
||||||
newservant->servant.vepv = &impl_GNOME_FileManagerWindow_vepv;
|
newservant->servant.vepv = &impl_GNOME_FileManagerWindow_vepv;
|
||||||
newservant->poa = poa;
|
newservant->poa = poa;
|
||||||
newservant->mywin = new_panel_at ((dir && *dir) ? dir : home_dir);
|
POA_GNOME_FileManagerWindow__init ((PortableServer_Servant) newservant, ev);
|
||||||
|
objid = PortableServer_POA_activate_object (poa, newservant, ev);
|
||||||
gtk_signal_connect(GTK_OBJECT(newservant->mywin->xwindow),
|
CORBA_free (objid);
|
||||||
"destroy", do_window_close,
|
retval = PortableServer_POA_servant_to_reference (poa, newservant, ev);
|
||||||
newservant);
|
|
||||||
|
if (servant)
|
||||||
POA_GNOME_FileManagerWindow__init((PortableServer_Servant) newservant, ev);
|
*servant = newservant;
|
||||||
objid = PortableServer_POA_activate_object(poa, newservant, ev);
|
|
||||||
CORBA_free(objid);
|
|
||||||
retval = PortableServer_POA_servant_to_reference(poa, newservant, ev);
|
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
CORBA_boolean
|
/* You shouldn't call this routine directly without first deactivating the servant... */
|
||||||
impl_GNOME_FileManagerFactory_supports (impl_POA_GNOME_FileManagerFactory * servant,
|
static void
|
||||||
CORBA_char * obj_goad_id,
|
impl_GNOME_FileManagerWindow__destroy(impl_POA_GNOME_FileManagerWindow *servant,
|
||||||
CORBA_Environment * ev)
|
CORBA_Environment *ev)
|
||||||
{
|
{
|
||||||
return !strcmp(obj_goad_id, "gmc_filemanager_window");
|
PortableServer_ObjectId *objid;
|
||||||
|
|
||||||
|
objid = PortableServer_POA_servant_to_id (servant->poa, servant, ev);
|
||||||
|
PortableServer_POA_deactivate_object (servant->poa, objid, ev);
|
||||||
|
CORBA_free (objid);
|
||||||
|
|
||||||
|
POA_GNOME_FileManagerWindow__fini ((PortableServer_Servant) servant, ev);
|
||||||
|
g_free(servant);
|
||||||
}
|
}
|
||||||
|
|
||||||
CORBA_Object
|
static void
|
||||||
impl_GNOME_FileManagerFactory_create_object(impl_POA_GNOME_FileManagerFactory * servant,
|
impl_GNOME_FileManagerWindow_close(impl_POA_GNOME_FileManagerWindow *servant,
|
||||||
CORBA_char * goad_id,
|
CORBA_Environment *ev)
|
||||||
GNOME_stringlist * params,
|
|
||||||
CORBA_Environment * ev)
|
|
||||||
{
|
{
|
||||||
if(!strcmp(goad_id, "gmc_filemanager_window"))
|
gnome_close_panel (GTK_WIDGET (servant->panel->xwindow), servant->panel);
|
||||||
return impl_GNOME_FileManagerFactory_create_window(
|
|
||||||
servant,
|
|
||||||
params->_length ? params->_buffer [0] : home_dir, ev);
|
|
||||||
|
|
||||||
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
|
|
||||||
ex_GNOME_GenericFactory_CannotActivate,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
return CORBA_OBJECT_NIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static GNOME_FileManagerFactory
|
||||||
try_to_activate_running_copy (void)
|
impl_GNOME_FileManagerFactory__create(PortableServer_POA poa,
|
||||||
|
impl_POA_GNOME_FileManagerFactory **servant,
|
||||||
|
CORBA_Environment *ev)
|
||||||
{
|
{
|
||||||
CORBA_Object name_service;
|
GNOME_FileManagerFactory retval;
|
||||||
CORBA_Environment ev;
|
impl_POA_GNOME_FileManagerFactory *newservant;
|
||||||
CosNaming_NameComponent nc[3] = {{"GNOME", "subcontext"},
|
PortableServer_ObjectId *objid;
|
||||||
{"Servers", "subcontext"},
|
|
||||||
{"gmc_filemanager_factory", "object"}};
|
|
||||||
CosNaming_Name nom = {0, 3, nc, CORBA_FALSE};
|
|
||||||
CORBA_Object retval = CORBA_OBJECT_NIL;
|
|
||||||
|
|
||||||
CORBA_exception_init (&ev);
|
|
||||||
|
|
||||||
name_service = gnome_name_service_get();
|
|
||||||
if (name_service == CORBA_OBJECT_NIL)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
retval = CosNaming_NamingContext_resolve (name_service, &nom, &ev);
|
newservant = g_new0 (impl_POA_GNOME_FileManagerFactory, 1);
|
||||||
if (ev._major == CORBA_USER_EXCEPTION
|
newservant->servant.vepv = &impl_GNOME_FileManagerFactory_vepv;
|
||||||
&& strcmp(CORBA_exception_id(&ev), ex_CosNaming_NamingContext_NotFound) == 0){
|
newservant->poa = poa;
|
||||||
retval = CORBA_OBJECT_NIL;
|
POA_GNOME_FileManagerFactory__init ((PortableServer_Servant) newservant, ev);
|
||||||
goto out;
|
objid = PortableServer_POA_activate_object (poa, newservant, ev);
|
||||||
|
CORBA_free (objid);
|
||||||
|
retval = PortableServer_POA_servant_to_reference (poa, newservant, ev);
|
||||||
|
|
||||||
|
if (servant)
|
||||||
|
*servant = newservant;
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* You shouldn't call this routine directly without first deactivating the servant... */
|
||||||
|
static void
|
||||||
|
impl_GNOME_FileManagerFactory__destroy(impl_POA_GNOME_FileManagerFactory *servant,
|
||||||
|
CORBA_Environment *ev)
|
||||||
|
{
|
||||||
|
PortableServer_ObjectId *objid;
|
||||||
|
|
||||||
|
objid = PortableServer_POA_servant_to_id (servant->poa, servant, ev);
|
||||||
|
PortableServer_POA_deactivate_object (servant->poa, objid, ev);
|
||||||
|
CORBA_free (objid);
|
||||||
|
|
||||||
|
POA_GNOME_FileManagerFactory__fini ((PortableServer_Servant) servant, ev);
|
||||||
|
g_free (servant);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CORBA_boolean
|
||||||
|
impl_GNOME_FileManagerFactory_supports (impl_POA_GNOME_FileManagerFactory *servant,
|
||||||
|
const CORBA_char *obj_goad_id,
|
||||||
|
CORBA_Environment *ev)
|
||||||
|
{
|
||||||
|
if (strcmp (obj_goad_id, "gmc_filemanager_window") == 0)
|
||||||
|
return CORBA_TRUE;
|
||||||
|
else
|
||||||
|
return CORBA_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static CORBA_Object
|
||||||
|
impl_GNOME_FileManagerFactory_create_object (impl_POA_GNOME_FileManagerFactory *servant,
|
||||||
|
const CORBA_char *goad_id,
|
||||||
|
const GNOME_stringlist *params,
|
||||||
|
CORBA_Environment *ev)
|
||||||
|
{
|
||||||
|
if (strcmp (goad_id, "gmc_filemanager_window") != 0) {
|
||||||
|
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
|
||||||
|
ex_GNOME_GenericFactory_CannotActivate,
|
||||||
|
NULL);
|
||||||
|
return CORBA_OBJECT_NIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CORBA_Object_is_nil (retval, &ev))
|
return impl_GNOME_FileManagerFactory_create_window (
|
||||||
goto out;
|
servant,
|
||||||
|
params->_length ? params->_buffer[0] : home_dir,
|
||||||
GNOME_FileManagerFactory_create_window (retval, home_dir, &ev);
|
ev);
|
||||||
|
|
||||||
if (ev._major != CORBA_NO_EXCEPTION)
|
|
||||||
retval = CORBA_OBJECT_NIL;
|
|
||||||
out:
|
|
||||||
CORBA_exception_free (&ev);
|
|
||||||
CORBA_Object_release (name_service, &ev);
|
|
||||||
return retval != CORBA_OBJECT_NIL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
/* Callback used when a panel is destroyed */
|
||||||
corba_init (void)
|
static void
|
||||||
|
panel_destroyed (GtkObject *object, gpointer data)
|
||||||
|
{
|
||||||
|
impl_POA_GNOME_FileManagerWindow *servant;
|
||||||
|
CORBA_Environment ev;
|
||||||
|
|
||||||
|
servant = data;
|
||||||
|
|
||||||
|
CORBA_exception_init (&ev);
|
||||||
|
impl_GNOME_FileManagerWindow__destroy (servant, &ev);
|
||||||
|
CORBA_exception_free (&ev);
|
||||||
|
}
|
||||||
|
|
||||||
|
static GNOME_FileManagerWindow
|
||||||
|
impl_GNOME_FileManagerFactory_create_window(impl_POA_GNOME_FileManagerFactory *servant,
|
||||||
|
const CORBA_char *dir,
|
||||||
|
CORBA_Environment *ev)
|
||||||
|
{
|
||||||
|
GNOME_FileManagerWindow retval;
|
||||||
|
impl_POA_GNOME_FileManagerWindow *newservant;
|
||||||
|
WPanel *panel;
|
||||||
|
|
||||||
|
retval = impl_GNOME_FileManagerWindow__create (servant->poa,
|
||||||
|
&newservant,
|
||||||
|
ev);
|
||||||
|
|
||||||
|
panel = new_panel_at ((dir && *dir) ? dir : home_dir);
|
||||||
|
newservant->panel = panel;
|
||||||
|
|
||||||
|
gtk_signal_connect (GTK_OBJECT (panel->xwindow), "destroy",
|
||||||
|
(GtkSignalFunc) panel_destroyed,
|
||||||
|
newservant);
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** Public non-implementation functions ***/
|
||||||
|
|
||||||
|
/* Creates the CORBA server */
|
||||||
|
static int
|
||||||
|
create_server (void)
|
||||||
{
|
{
|
||||||
CORBA_Environment ev;
|
CORBA_Environment ev;
|
||||||
|
PortableServer_POA poa;
|
||||||
|
PortableServer_POAManager poa_manager;
|
||||||
|
int retval;
|
||||||
|
int v;
|
||||||
|
|
||||||
|
retval = FALSE;
|
||||||
CORBA_exception_init (&ev);
|
CORBA_exception_init (&ev);
|
||||||
|
|
||||||
orb = gnome_CORBA_ORB ();
|
/* Get the POA and create the server */
|
||||||
|
|
||||||
poa = (PortableServer_POA) CORBA_ORB_resolve_initial_references (orb, "RootPOA", &ev);
|
poa = (PortableServer_POA) CORBA_ORB_resolve_initial_references (orb, "RootPOA", &ev);
|
||||||
if (ev._major != CORBA_NO_EXCEPTION){
|
if (ev._major != CORBA_NO_EXCEPTION)
|
||||||
printf ("Can not resolve initial reference to RootPOA");
|
goto out;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
poa_manager = PortableServer_POA__get_the_POAManager (poa, &ev);
|
poa_manager = PortableServer_POA__get_the_POAManager (poa, &ev);
|
||||||
if (ev._major != CORBA_NO_EXCEPTION){
|
if (ev._major != CORBA_NO_EXCEPTION)
|
||||||
printf ("Can not get the POAmanager");
|
goto out;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PortableServer_POAManager_activate (poa_manager, &ev);
|
PortableServer_POAManager_activate (poa_manager, &ev);
|
||||||
if (ev._major != CORBA_NO_EXCEPTION){
|
if (ev._major != CORBA_NO_EXCEPTION)
|
||||||
printf ("Can not get the POAmanager");
|
goto out;
|
||||||
return;
|
|
||||||
|
gmc_server = impl_GNOME_FileManagerFactory__create (poa, NULL, &ev);
|
||||||
|
if (ev._major != CORBA_NO_EXCEPTION)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
CORBA_Object_release ((CORBA_Object) poa, &ev);
|
||||||
|
if (ev._major != CORBA_NO_EXCEPTION)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
/* Register the server and see if it was already there */
|
||||||
|
|
||||||
|
v = goad_server_register (CORBA_OBJECT_NIL, gmc_server,
|
||||||
|
"gmc_filemanager_factory", "server", &ev);
|
||||||
|
switch (v) {
|
||||||
|
case 0:
|
||||||
|
corba_have_server = FALSE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case -2:
|
||||||
|
corba_have_server = FALSE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
retval = TRUE;
|
||||||
|
|
||||||
|
/* Done */
|
||||||
|
|
||||||
|
out:
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* corba_init_server:
|
||||||
|
* @void:
|
||||||
|
*
|
||||||
|
* Initializes the CORBA factory object for gmc. Returns whether initialization
|
||||||
|
* was successful or not, and sets the global corba_have_server variable.
|
||||||
|
*
|
||||||
|
* Return value: TRUE if successful, FALSE otherwise.
|
||||||
|
**/
|
||||||
|
int
|
||||||
|
corba_init_server (void)
|
||||||
|
{
|
||||||
|
gmc_server = goad_server_activate_with_id (NULL,
|
||||||
|
"gmc_filemanager_factory",
|
||||||
|
GOAD_ACTIVATE_EXISTING_ONLY,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
if (gmc_server != CORBA_OBJECT_NIL) {
|
||||||
|
corba_have_server = TRUE;
|
||||||
|
return TRUE;
|
||||||
|
} else
|
||||||
|
return create_server ();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* corba_create_window:
|
||||||
|
* @void:
|
||||||
|
*
|
||||||
|
* Creates a GMC window using a CORBA call to the server.
|
||||||
|
**/
|
||||||
void
|
void
|
||||||
corba_register_server (void)
|
corba_create_window (void)
|
||||||
{
|
{
|
||||||
CORBA_Environment ev;
|
CORBA_Environment ev;
|
||||||
int v;
|
char cwd[MC_MAXPATHLEN];
|
||||||
|
|
||||||
|
mc_get_current_wd (cwd, MC_MAXPATHLEN);
|
||||||
|
|
||||||
CORBA_exception_init (&ev);
|
CORBA_exception_init (&ev);
|
||||||
|
GNOME_FileManagerFactory_create_window (gmc_server, cwd, &ev);
|
||||||
/*
|
|
||||||
* Initialize the Factory Object
|
|
||||||
*/
|
|
||||||
POA_GNOME_FileManagerFactory__init (
|
|
||||||
(POA_GNOME_FileManagerFactory*)&poa_filemanagerfactory_servant,
|
|
||||||
&ev);
|
|
||||||
|
|
||||||
if (ev._major != CORBA_NO_EXCEPTION){
|
|
||||||
CORBA_exception_free (&ev);
|
|
||||||
printf ("Can not initialize FileManagerFactory object\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Activate the object */
|
|
||||||
CORBA_free (PortableServer_POA_activate_object
|
|
||||||
(poa, &poa_filemanagerfactory_servant, &ev));
|
|
||||||
|
|
||||||
/* Get a refeerence to te object */
|
|
||||||
filemanagerfactory_server = PortableServer_POA_servant_to_reference (
|
|
||||||
poa, &poa_filemanagerfactory_servant, &ev);
|
|
||||||
|
|
||||||
v = goad_server_register (
|
|
||||||
NULL, filemanagerfactory_server,
|
|
||||||
"gmc_filemanager_factory", "server", &ev);
|
|
||||||
|
|
||||||
CORBA_exception_free (&ev);
|
CORBA_exception_free (&ev);
|
||||||
if (v != 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,24 @@
|
|||||||
|
/* CORBA support for the Midhignt Commander
|
||||||
|
*
|
||||||
|
* Copyright (C) 1999 The Free Sofware Foundation
|
||||||
|
*
|
||||||
|
* Authors: Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
* Federico Mena <federico@nuclecu.unam.mx>
|
||||||
|
* Elliot Lee <sopwith@cuc.edu>
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef __GCORBA_H
|
#ifndef __GCORBA_H
|
||||||
#define __GCORBA_H
|
#define __GCORBA_H
|
||||||
|
|
||||||
|
#include <orb/orbit.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* The ORB */
|
||||||
extern CORBA_ORB orb;
|
extern CORBA_ORB orb;
|
||||||
|
|
||||||
void corba_register_server (void);
|
|
||||||
|
int corba_init_server (void);
|
||||||
|
void corba_create_window (void);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -157,6 +157,14 @@ desktop_icon_realize (GtkWidget *widget)
|
|||||||
|
|
||||||
gdk_window_set_decorations (widget->window, 0);
|
gdk_window_set_decorations (widget->window, 0);
|
||||||
gdk_window_set_functions (widget->window, 0);
|
gdk_window_set_functions (widget->window, 0);
|
||||||
|
|
||||||
|
/* Remove the client leader property so that the window manager will not
|
||||||
|
* save SM information for icons.
|
||||||
|
*/
|
||||||
|
|
||||||
|
gdk_property_delete (widget->window, gdk_atom_intern ("WM_CLIENT_LEADER", FALSE));
|
||||||
|
|
||||||
|
/* Set the proper GNOME hints */
|
||||||
|
|
||||||
gnome_win_hints_init ();
|
gnome_win_hints_init ();
|
||||||
|
|
||||||
|
@ -82,8 +82,7 @@ desktop_init_at (const char *dir)
|
|||||||
DIR *d;
|
DIR *d;
|
||||||
struct dirent *dent;
|
struct dirent *dent;
|
||||||
const int links_extlen = sizeof (".links")-1;
|
const int links_extlen = sizeof (".links")-1;
|
||||||
struct stat s;
|
|
||||||
|
|
||||||
d = opendir (dir);
|
d = opendir (dir);
|
||||||
if (!d)
|
if (!d)
|
||||||
return;
|
return;
|
||||||
@ -100,7 +99,7 @@ desktop_init_at (const char *dir)
|
|||||||
if (access (fname, X_OK) == 0){
|
if (access (fname, X_OK) == 0){
|
||||||
char *desktop_quoted;
|
char *desktop_quoted;
|
||||||
char *command;
|
char *command;
|
||||||
|
|
||||||
desktop_quoted = name_quote (desktop_directory, 0);
|
desktop_quoted = name_quote (desktop_directory, 0);
|
||||||
command = g_strconcat (fname, " --desktop-dir", desktop_quoted, NULL);
|
command = g_strconcat (fname, " --desktop-dir", desktop_quoted, NULL);
|
||||||
g_free (desktop_quoted);
|
g_free (desktop_quoted);
|
||||||
@ -115,12 +114,12 @@ desktop_init_at (const char *dir)
|
|||||||
g_free (fname);
|
g_free (fname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp (dent->d_name + len - links_extlen, ".links")){
|
if (strcmp (dent->d_name + len - links_extlen, ".links")){
|
||||||
g_free (fname);
|
g_free (fname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
desktop_load_init_from (fname);
|
desktop_load_init_from (fname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "gconf.h"
|
#include "gconf.h"
|
||||||
#include "gdesktop.h"
|
#include "gdesktop.h"
|
||||||
#include "gdesktop-icon.h"
|
#include "gdesktop-icon.h"
|
||||||
|
#include "gdesktop-init.h"
|
||||||
#include "gicon.h"
|
#include "gicon.h"
|
||||||
#include "gmain.h"
|
#include "gmain.h"
|
||||||
#include "gmetadata.h"
|
#include "gmetadata.h"
|
||||||
@ -1364,6 +1365,7 @@ create_panel_from_desktop (void)
|
|||||||
panel->total = total;
|
panel->total = total;
|
||||||
panel->selected = selected_index;
|
panel->selected = selected_index;
|
||||||
panel->is_a_desktop_panel = TRUE;
|
panel->is_a_desktop_panel = TRUE;
|
||||||
|
panel->id = -1;
|
||||||
|
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
@ -2399,19 +2401,22 @@ set_background_image (GtkWidget *widget, gpointer data)
|
|||||||
{
|
{
|
||||||
gchar *bg_capplet;
|
gchar *bg_capplet;
|
||||||
gchar *argv[1];
|
gchar *argv[1];
|
||||||
|
GtkWidget *msg_box;
|
||||||
|
|
||||||
bg_capplet = gnome_is_program_in_path ("background-properties-capplet");
|
bg_capplet = gnome_is_program_in_path ("background-properties-capplet");
|
||||||
|
|
||||||
if (bg_capplet) {
|
if (bg_capplet) {
|
||||||
argv[0] = bg_capplet;
|
argv[0] = bg_capplet;
|
||||||
gnome_execute_async (bg_capplet, 1, argv);
|
gnome_execute_async (bg_capplet, 1, argv);
|
||||||
g_free (bg_capplet);
|
g_free (bg_capplet);
|
||||||
} else {
|
} else {
|
||||||
GtkWidget *msg_box;
|
msg_box = gnome_message_box_new (
|
||||||
msg_box = gnome_message_box_new (_("Unable to locate the file:\nbackground-properties-capplet\n"
|
_("Unable to locate the file:\nbackground-properties-capplet\n"
|
||||||
"in your path.\n\nWe are unable to set the background."),
|
"in your path.\n\nWe are unable to set the background."),
|
||||||
GNOME_MESSAGE_BOX_WARNING,
|
GNOME_MESSAGE_BOX_WARNING,
|
||||||
GNOME_STOCK_BUTTON_OK,
|
GNOME_STOCK_BUTTON_OK,
|
||||||
NULL);
|
NULL);
|
||||||
gnome_dialog_run (msg_box);
|
gnome_dialog_run (GNOME_DIALOG (msg_box));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static GnomeUIInfo gnome_panel_new_menu [] = {
|
static GnomeUIInfo gnome_panel_new_menu [] = {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* Desktop management for the Midnight Commander
|
/* Desktop management for the Midnight Commander
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 The Free Software Foundation
|
* Copyright (C) 1998-1999 The Free Software Foundation
|
||||||
*
|
*
|
||||||
* Authors: Federico Mena <federico@nuclecu.unam.mx>
|
* Authors: Federico Mena <federico@nuclecu.unam.mx>
|
||||||
* Miguel de Icaza <miguel@nuclecu.unam.mx>
|
* Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
@ -66,6 +66,8 @@ gboolean do_eject (char *filename);
|
|||||||
void desktop_arrange_icons (void);
|
void desktop_arrange_icons (void);
|
||||||
void desktop_rescan_devices (void);
|
void desktop_rescan_devices (void);
|
||||||
void desktop_reload_icons (int user_pos, int xpos, int ypos);
|
void desktop_reload_icons (int user_pos, int xpos, int ypos);
|
||||||
|
void desktop_create_url (const char *filename, const char *title, const char *url, const char *icon);
|
||||||
|
|
||||||
extern int desktop_wm_is_gnome_compliant;
|
extern int desktop_wm_is_gnome_compliant;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include "gscreen.h"
|
#include "gscreen.h"
|
||||||
#include "../vfs/vfs.h"
|
#include "../vfs/vfs.h"
|
||||||
#include <gdk/gdkprivate.h>
|
#include <gdk/gdkprivate.h>
|
||||||
|
#include "gdesktop.h"
|
||||||
#include "gdnd.h"
|
#include "gdnd.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include "../vfs/vfs.h"
|
#include "../vfs/vfs.h"
|
||||||
#include "gprefs.h"
|
#include "gprefs.h"
|
||||||
|
#include "gsession.h"
|
||||||
#include "listing-iconic.xpm"
|
#include "listing-iconic.xpm"
|
||||||
#include "listing-brief-list.xpm"
|
#include "listing-brief-list.xpm"
|
||||||
#include "listing-list.xpm"
|
#include "listing-list.xpm"
|
||||||
@ -333,11 +334,11 @@ gnome_exit (void)
|
|||||||
GNOME_STOCK_BUTTON_CANCEL,
|
GNOME_STOCK_BUTTON_CANCEL,
|
||||||
NULL);
|
NULL);
|
||||||
v = gnome_dialog_run (GNOME_DIALOG (w));
|
v = gnome_dialog_run (GNOME_DIALOG (w));
|
||||||
if (v == 0){
|
if (v == 0) {
|
||||||
/*
|
/*
|
||||||
* We do not want to be restarted by the session manager now
|
* We do not want to be restarted by the session manager now
|
||||||
*/
|
*/
|
||||||
gnome_client_set_restart_style (session_client, GNOME_RESTART_NEVER);
|
session_set_restart (FALSE);
|
||||||
gmc_do_quit ();
|
gmc_do_quit ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -705,17 +706,19 @@ copy_uiinfo_widgets (GnomeUIInfo *uiinfo, gpointer **dest)
|
|||||||
WPanel *
|
WPanel *
|
||||||
create_container (Dlg_head *h, char *name, char *geometry)
|
create_container (Dlg_head *h, char *name, char *geometry)
|
||||||
{
|
{
|
||||||
PanelContainer *container = g_new (PanelContainer, 1);
|
PanelContainer *container;
|
||||||
WPanel *panel;
|
WPanel *panel;
|
||||||
GtkWidget *app, *vbox;
|
GtkWidget *app, *vbox;
|
||||||
int xpos, ypos, width, height;
|
int xpos, ypos, width, height;
|
||||||
GnomeUIInfo *uiinfo;
|
GnomeUIInfo *uiinfo;
|
||||||
|
char buf[50];
|
||||||
|
|
||||||
|
container = g_new (PanelContainer, 1);
|
||||||
|
|
||||||
gnome_parse_geometry (geometry, &xpos, &ypos, &width, &height);
|
gnome_parse_geometry (geometry, &xpos, &ypos, &width, &height);
|
||||||
|
|
||||||
container->splitted = 0;
|
container->splitted = 0;
|
||||||
app = gnome_app_new ("gmc", name);
|
app = gnome_app_new ("gmc", name);
|
||||||
gtk_window_set_wmclass (GTK_WINDOW (app), "gmc", "gmc");
|
|
||||||
|
|
||||||
/* Geometry configuration */
|
/* Geometry configuration */
|
||||||
if (width != -1 && height != -1)
|
if (width != -1 && height != -1)
|
||||||
@ -727,7 +730,13 @@ create_container (Dlg_head *h, char *name, char *geometry)
|
|||||||
|
|
||||||
panel = panel_new (name);
|
panel = panel_new (name);
|
||||||
|
|
||||||
|
/* Set the unique name for session management */
|
||||||
|
|
||||||
|
sprintf (buf, "%d", panel->id);
|
||||||
|
gtk_window_set_wmclass (GTK_WINDOW (app), "gmc", buf);
|
||||||
|
|
||||||
|
/* Create the holder for the contents */
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 0);
|
vbox = gtk_vbox_new (FALSE, 0);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
|
||||||
gnome_app_set_contents (GNOME_APP (app), vbox);
|
gnome_app_set_contents (GNOME_APP (app), vbox);
|
||||||
@ -739,7 +748,7 @@ create_container (Dlg_head *h, char *name, char *geometry)
|
|||||||
|
|
||||||
my_app_create_menus (GNOME_APP (app), uiinfo, panel);
|
my_app_create_menus (GNOME_APP (app), uiinfo, panel);
|
||||||
copy_uiinfo_widgets (panel_view_menu_uiinfo, &panel->view_menu_items);
|
copy_uiinfo_widgets (panel_view_menu_uiinfo, &panel->view_menu_items);
|
||||||
|
|
||||||
create_new_menu (GNOME_APP (app), panel);
|
create_new_menu (GNOME_APP (app), panel);
|
||||||
|
|
||||||
panel->ministatus = GNOME_APPBAR(gnome_appbar_new(FALSE, TRUE, GNOME_PREFERENCES_NEVER));
|
panel->ministatus = GNOME_APPBAR(gnome_appbar_new(FALSE, TRUE, GNOME_PREFERENCES_NEVER));
|
||||||
@ -749,7 +758,7 @@ create_container (Dlg_head *h, char *name, char *geometry)
|
|||||||
gnome_app_install_menu_hints (GNOME_APP (app), gnome_panel_menu_without_desktop);
|
gnome_app_install_menu_hints (GNOME_APP (app), gnome_panel_menu_without_desktop);
|
||||||
else
|
else
|
||||||
gnome_app_install_menu_hints (GNOME_APP (app), gnome_panel_menu_with_desktop);
|
gnome_app_install_menu_hints (GNOME_APP (app), gnome_panel_menu_with_desktop);
|
||||||
|
|
||||||
gtk_signal_connect (GTK_OBJECT (app),
|
gtk_signal_connect (GTK_OBJECT (app),
|
||||||
"enter_notify_event",
|
"enter_notify_event",
|
||||||
GTK_SIGNAL_FUNC (panel_enter_event),
|
GTK_SIGNAL_FUNC (panel_enter_event),
|
||||||
@ -766,7 +775,7 @@ create_container (Dlg_head *h, char *name, char *geometry)
|
|||||||
*/
|
*/
|
||||||
panel->widget.wdata = (widget_data) vbox;
|
panel->widget.wdata = (widget_data) vbox;
|
||||||
container->panel = panel;
|
container->panel = panel;
|
||||||
|
|
||||||
containers = g_list_append (containers, container);
|
containers = g_list_append (containers, container);
|
||||||
|
|
||||||
if (!current_panel_ptr){
|
if (!current_panel_ptr){
|
||||||
@ -787,7 +796,9 @@ new_panel_with_geometry_at (char *dir, char *geometry)
|
|||||||
panel = create_container (desktop_dlg, dir, geometry);
|
panel = create_container (desktop_dlg, dir, geometry);
|
||||||
add_widget (desktop_dlg, panel);
|
add_widget (desktop_dlg, panel);
|
||||||
set_current_panel (panel);
|
set_current_panel (panel);
|
||||||
|
#if 0
|
||||||
x_flush_events ();
|
x_flush_events ();
|
||||||
|
#endif
|
||||||
|
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
156
gnome/gmain.c
156
gnome/gmain.c
@ -21,9 +21,11 @@
|
|||||||
#include "panel.h"
|
#include "panel.h"
|
||||||
#include "gscreen.h"
|
#include "gscreen.h"
|
||||||
#include "gcmd.h"
|
#include "gcmd.h"
|
||||||
|
#include "gcorba.h"
|
||||||
|
#include "gdesktop.h"
|
||||||
|
#include "gsession.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
#include "gdesktop.h"
|
|
||||||
|
|
||||||
GdkColorContext *mc_cc;
|
GdkColorContext *mc_cc;
|
||||||
|
|
||||||
@ -52,14 +54,15 @@ int dialog_panel_callback (struct Dlg_head *h, int id, int msg);
|
|||||||
/* The Dlg_head for the whole desktop */
|
/* The Dlg_head for the whole desktop */
|
||||||
Dlg_head *desktop_dlg;
|
Dlg_head *desktop_dlg;
|
||||||
|
|
||||||
int run_desktop = 1;
|
|
||||||
|
|
||||||
/* Session client */
|
/* Session client */
|
||||||
GnomeClient *session_client;
|
GnomeClient *session_client;
|
||||||
|
|
||||||
/* Used during argument processing */
|
/* Used during argument processing */
|
||||||
extern int finish_program;
|
extern int finish_program;
|
||||||
|
|
||||||
|
/* Whether the gmc server was present or not */
|
||||||
|
int corba_have_server = FALSE;
|
||||||
|
|
||||||
/* This is only used by the editor, so we provide a dummy implementation */
|
/* This is only used by the editor, so we provide a dummy implementation */
|
||||||
void
|
void
|
||||||
try_alloc_color_pair (char *str, char *str2)
|
try_alloc_color_pair (char *str, char *str2)
|
||||||
@ -453,52 +456,48 @@ dialog_panel_callback (struct Dlg_head *h, int id, int msg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern char *cmdline_geometry;
|
/* Ugly function to support the hack described in non_corba_create_panels() */
|
||||||
|
static gint
|
||||||
typedef struct {
|
idle_destroy_panel (gpointer data)
|
||||||
char *dir; char *geometry;
|
|
||||||
} dir_and_geometry;
|
|
||||||
|
|
||||||
static int
|
|
||||||
idle_create_panel (void *data)
|
|
||||||
{
|
{
|
||||||
dir_and_geometry *dg = data;
|
WPanel *panel;
|
||||||
|
|
||||||
new_panel_with_geometry_at (dg->dir, dg->geometry);
|
|
||||||
g_free (data);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
idle_destroy_window (void *data)
|
|
||||||
{
|
|
||||||
WPanel *panel = data;
|
|
||||||
|
|
||||||
|
panel = data;
|
||||||
gnome_close_panel (GTK_WIDGET (panel->widget.wdata), panel);
|
gnome_close_panel (GTK_WIDGET (panel->widget.wdata), panel);
|
||||||
return 0;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Initializes the desktop and creates the initial panels. This is to be used
|
||||||
* wrapper for new_panel_with_geometry_at.
|
* when we do not have a CORBA server.
|
||||||
* first invocation is called directly, further calls use
|
|
||||||
* the idle handler
|
|
||||||
*/
|
*/
|
||||||
static WPanel *
|
static void
|
||||||
create_one_panel (char *dir, char *geometry)
|
non_corba_create_panels (void)
|
||||||
{
|
{
|
||||||
static int first = 1;
|
WPanel *panel;
|
||||||
|
|
||||||
if (first){
|
desktop_init ();
|
||||||
first = 0;
|
gnome_init_panels ();
|
||||||
return new_panel_with_geometry_at (dir, geometry);
|
|
||||||
} else {
|
cmdline = command_new (0, 0, 0);
|
||||||
dir_and_geometry *dg = g_new (dir_and_geometry, 1);
|
the_hint = label_new (0, 0, 0, NULL);
|
||||||
dg->dir = dir;
|
desktop_dlg = create_dlg (0, 0, 24, 80, 0,
|
||||||
dg->geometry = geometry;
|
dialog_panel_callback, "[panel]", "midnight", DLG_NO_TED);
|
||||||
gtk_idle_add (idle_create_panel, dg);
|
|
||||||
return NULL;
|
session_load ();
|
||||||
}
|
|
||||||
|
/* The following is a hack. We have to have at least one panel for
|
||||||
|
* run_dlg() to be happy. So we destroy it in the idle loop if we
|
||||||
|
* didn't need it in the first place. This idle function is to be run
|
||||||
|
* at a higher priority than the one used in session_load().
|
||||||
|
*/
|
||||||
|
|
||||||
|
panel = new_panel_at (".");
|
||||||
|
gtk_idle_add_priority (GTK_PRIORITY_DEFAULT, idle_destroy_panel, panel);
|
||||||
|
panel->widget.options |= W_PANEL_HIDDEN;
|
||||||
|
|
||||||
|
run_dlg (desktop_dlg);
|
||||||
|
|
||||||
|
desktop_destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -511,46 +510,14 @@ create_one_panel (char *dir, char *geometry)
|
|||||||
void
|
void
|
||||||
create_panels (void)
|
create_panels (void)
|
||||||
{
|
{
|
||||||
WPanel *panel;
|
if (!corba_have_server)
|
||||||
|
non_corba_create_panels ();
|
||||||
|
else {
|
||||||
|
if (!nowindows)
|
||||||
|
corba_create_window ();
|
||||||
|
|
||||||
if (run_desktop)
|
session_set_restart (FALSE);
|
||||||
desktop_init ();
|
|
||||||
|
|
||||||
cmdline = command_new (0, 0, 0);
|
|
||||||
the_hint = label_new (0, 0, 0, NULL);
|
|
||||||
|
|
||||||
gnome_init_panels ();
|
|
||||||
|
|
||||||
desktop_dlg = create_dlg (0, 0, 24, 80, 0, dialog_panel_callback, "[panel]", "midnight", DLG_NO_TED);
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (directory_list){
|
|
||||||
|
|
||||||
for (p = directory_list; p; p = p->next){
|
|
||||||
create_one_panel (p->data, cmdline_geometry);
|
|
||||||
}
|
|
||||||
panel = NULL;
|
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
panel = create_one_panel (".", cmdline_geometry);
|
|
||||||
|
|
||||||
if (nowindows){
|
|
||||||
gtk_idle_add (idle_destroy_window, panel);
|
|
||||||
panel->widget.options |= W_PANEL_HIDDEN;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
g_list_free (directory_list);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
main_corba_register_server ();
|
|
||||||
|
|
||||||
run_dlg (desktop_dlg);
|
|
||||||
|
|
||||||
/* shutdown gnome specific bits of midnight commander */
|
|
||||||
|
|
||||||
desktop_destroy ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -561,7 +528,7 @@ gmc_do_quit (void)
|
|||||||
quit = 1;
|
quit = 1;
|
||||||
dlg_stop (desktop_dlg);
|
dlg_stop (desktop_dlg);
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
static void
|
static void
|
||||||
session_die (void)
|
session_die (void)
|
||||||
{
|
{
|
||||||
@ -632,7 +599,7 @@ session_management_setup (char *name)
|
|||||||
GTK_SIGNAL_FUNC (session_die), NULL);
|
GTK_SIGNAL_FUNC (session_die), NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
* Configures the GtkWindow/GnomeDialog from a WPanel.
|
* Configures the GtkWindow/GnomeDialog from a WPanel.
|
||||||
*
|
*
|
||||||
@ -645,3 +612,28 @@ gmc_window_setup_from_panel (GnomeDialog *dialog, WPanel *panel)
|
|||||||
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
|
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
|
||||||
gnome_dialog_set_parent (dialog, GTK_WINDOW (panel->xwindow));
|
gnome_dialog_set_parent (dialog, GTK_WINDOW (panel->xwindow));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gnome_check_super_user:
|
||||||
|
* @void:
|
||||||
|
*
|
||||||
|
* Puts out a warning if the user is running gmc as root. If the user selects
|
||||||
|
* Cancel, then gmc will terminate.
|
||||||
|
**/
|
||||||
|
void
|
||||||
|
gnome_check_super_user (void)
|
||||||
|
{
|
||||||
|
GtkWidget *warning_dlg;
|
||||||
|
GnomeClient *client;
|
||||||
|
|
||||||
|
if (geteuid () != 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
warning_dlg = gnome_message_box_new (
|
||||||
|
_("You are running the GNOME Midnight Commander as root. \n\n"
|
||||||
|
"You will not be protected from severly damaging your system."),
|
||||||
|
GNOME_MESSAGE_BOX_WARNING,
|
||||||
|
GNOME_STOCK_BUTTON_OK, NULL);
|
||||||
|
|
||||||
|
gnome_dialog_run (GNOME_DIALOG (warning_dlg));
|
||||||
|
}
|
||||||
|
@ -10,6 +10,7 @@ void xtoolkit_end (void);
|
|||||||
|
|
||||||
extern Dlg_head *desktop_dlg;
|
extern Dlg_head *desktop_dlg;
|
||||||
extern int nowindows;
|
extern int nowindows;
|
||||||
|
extern int corba_have_server;
|
||||||
|
|
||||||
/* Required by the standard code */
|
/* Required by the standard code */
|
||||||
widget_data xtoolkit_create_dialog (Dlg_head *h, int with_grid);
|
widget_data xtoolkit_create_dialog (Dlg_head *h, int with_grid);
|
||||||
@ -44,6 +45,8 @@ int gmc_can_view_file (char *filename);
|
|||||||
int gmc_view (char *filename, int start_line);
|
int gmc_view (char *filename, int start_line);
|
||||||
void x_show_info (WInfo *info, struct my_statfs *s, struct stat *b);
|
void x_show_info (WInfo *info, struct my_statfs *s, struct stat *b);
|
||||||
void x_create_info (Dlg_head *h, widget_data parent, WInfo *info);
|
void x_create_info (Dlg_head *h, widget_data parent, WInfo *info);
|
||||||
|
void gnome_check_super_user (void);
|
||||||
|
gint create_new_menu_from (char *file, GtkWidget *shell, gint pos);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* stuff from gaction.c
|
* stuff from gaction.c
|
||||||
@ -60,7 +63,9 @@ struct gmc_color_pairs_s {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void gmc_do_quit (void);
|
void gmc_do_quit (void);
|
||||||
|
#if 0
|
||||||
extern GnomeClient *session_client;
|
extern GnomeClient *session_client;
|
||||||
|
#endif
|
||||||
|
|
||||||
extern struct gmc_color_pairs_s gmc_color_pairs [];
|
extern struct gmc_color_pairs_s gmc_color_pairs [];
|
||||||
#endif
|
#endif
|
||||||
|
@ -434,7 +434,7 @@ static GtkWidget *
|
|||||||
generate_icon_sel (GnomeFilePropertyDialog *fp_dlg)
|
generate_icon_sel (GnomeFilePropertyDialog *fp_dlg)
|
||||||
{
|
{
|
||||||
GtkWidget *retval;
|
GtkWidget *retval;
|
||||||
const gchar *icon;
|
gchar *icon;
|
||||||
|
|
||||||
retval = gnome_icon_entry_new ("gmc_file_icon", "Select an Icon");
|
retval = gnome_icon_entry_new ("gmc_file_icon", "Select an Icon");
|
||||||
icon = g_strdup (gicon_get_filename_for_icon (fp_dlg->im));
|
icon = g_strdup (gicon_get_filename_for_icon (fp_dlg->im));
|
||||||
|
@ -17,12 +17,15 @@
|
|||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "util.h"
|
||||||
#include <gnome.h>
|
#include <gnome.h>
|
||||||
#include "gnome-open-dialog.h"
|
#include "gnome-open-dialog.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
static void gnome_open_dialog_init (GnomeOpenDialog *open_dialog);
|
static void gnome_open_dialog_init (GnomeOpenDialog *open_dialog);
|
||||||
static void gnome_open_dialog_class_init (GnomeOpenDialogClass *klass);
|
static void gnome_open_dialog_class_init (GnomeOpenDialogClass *klass);
|
||||||
static void gnome_open_dialog_destroy (GtkObject *object);
|
static void gnome_open_dialog_destroy (GtkObject *object);
|
||||||
|
@ -2022,10 +2022,11 @@ static void
|
|||||||
panel_tree_check_auto_expand (WPanel *panel, GtkCTreeNode *current)
|
panel_tree_check_auto_expand (WPanel *panel, GtkCTreeNode *current)
|
||||||
{
|
{
|
||||||
GtkDTree *dtree = GTK_DTREE (panel->tree);
|
GtkDTree *dtree = GTK_DTREE (panel->tree);
|
||||||
GtkCList *clist = GTK_CLIST (dtree);
|
|
||||||
GList *tmp_list = dtree->auto_expanded_nodes;
|
GList *tmp_list = dtree->auto_expanded_nodes;
|
||||||
GList *free_list;
|
#if 0
|
||||||
|
GtkCList *clist = GTK_CLIST (dtree);
|
||||||
gint row, old_y, new_y;
|
gint row, old_y, new_y;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (current) {
|
if (current) {
|
||||||
while (tmp_list) {
|
while (tmp_list) {
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "treestore.h"
|
#include "treestore.h"
|
||||||
#include "gtkdtree.h"
|
#include "gtkdtree.h"
|
||||||
|
#include "../vfs/vfs.h"
|
||||||
|
|
||||||
#ifdef HACK
|
#ifdef HACK
|
||||||
# define mc_opendir opendir
|
# define mc_opendir opendir
|
||||||
|
@ -20,26 +20,20 @@
|
|||||||
#include "color.h"
|
#include "color.h"
|
||||||
#include "gmain.h"
|
#include "gmain.h"
|
||||||
#include "gwidget.h"
|
#include "gwidget.h"
|
||||||
|
|
||||||
Dlg_head *last_query_dlg;
|
Dlg_head *last_query_dlg;
|
||||||
static int sel_pos;
|
static int sel_pos;
|
||||||
|
|
||||||
void query_set_sel (int new_sel)
|
void
|
||||||
|
query_set_sel (int new_sel)
|
||||||
{
|
{
|
||||||
sel_pos = new_sel;
|
sel_pos = new_sel;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
int
|
||||||
pack_button (WButton *button, GtkBox *box)
|
query_dialog (char *header, char *text, int flags, int count, ...)
|
||||||
{
|
|
||||||
if (!button)
|
|
||||||
return;
|
|
||||||
gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (button->widget.wdata), 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int query_dialog (char *header, char *text, int flags, int count, ...)
|
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
WLabel *label;
|
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
int i, result = -1;
|
int i, result = -1;
|
||||||
const gchar **buttons;
|
const gchar **buttons;
|
||||||
@ -94,7 +88,8 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* To show nice messages to the users */
|
/* To show nice messages to the users */
|
||||||
Dlg_head *message (int error, char *header, char *text, ...)
|
Dlg_head *
|
||||||
|
message (int error, char *header, char *text, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
char buffer [4096];
|
char buffer [4096];
|
||||||
|
@ -326,7 +326,9 @@ x_create_input (Dlg_head *h, widget_data parent, WInput *in)
|
|||||||
void
|
void
|
||||||
x_update_input (WInput *in)
|
x_update_input (WInput *in)
|
||||||
{
|
{
|
||||||
|
#ifdef USE_GNOME_ENTRY
|
||||||
GnomeEntry *gnome_entry;
|
GnomeEntry *gnome_entry;
|
||||||
|
#endif
|
||||||
GtkEntry *entry;
|
GtkEntry *entry;
|
||||||
char *text;
|
char *text;
|
||||||
int draw = 0;
|
int draw = 0;
|
||||||
@ -545,6 +547,7 @@ x_label_set_text (WLabel *label, char *text)
|
|||||||
gtk_label_set (GTK_LABEL (label->widget.wdata), text);
|
gtk_label_set (GTK_LABEL (label->widget.wdata), text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* Buttonbar */
|
/* Buttonbar */
|
||||||
static void
|
static void
|
||||||
buttonbar_clicked (GtkWidget *widget, WButtonBar *bb)
|
buttonbar_clicked (GtkWidget *widget, WButtonBar *bb)
|
||||||
@ -563,12 +566,15 @@ buttonbar_clicked (GtkWidget *widget, WButtonBar *bb)
|
|||||||
}
|
}
|
||||||
printf ("Mhm, should not happen or The Cow is out\n");
|
printf ("Mhm, should not happen or The Cow is out\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
x_create_buttonbar (Dlg_head *h, widget_data parent, WButtonBar *bb)
|
x_create_buttonbar (Dlg_head *h, widget_data parent, WButtonBar *bb)
|
||||||
{
|
{
|
||||||
GtkWidget *hbox;
|
GtkWidget *hbox;
|
||||||
|
#if 0
|
||||||
int i;
|
int i;
|
||||||
|
#endif
|
||||||
|
|
||||||
hbox = gtk_hbox_new (0, 0);
|
hbox = gtk_hbox_new (0, 0);
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -1,3 +1,33 @@
|
|||||||
|
1999-03-30 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* dlg.c (dlg_run_done): Do not call the callback of a NULL current
|
||||||
|
widget.
|
||||||
|
|
||||||
|
* setup.h: Added missing prototype for setup_init().
|
||||||
|
|
||||||
|
* filegui.c (check_progress_buttons): Added a missing return
|
||||||
|
value.
|
||||||
|
|
||||||
|
* dlg.c (remove_widget): Added a missing return value.
|
||||||
|
|
||||||
|
* main.c: Removed the global directory_list variable.
|
||||||
|
Removed the main_corba_register_server() function.
|
||||||
|
|
||||||
|
* main.h: Removed the global run_desktop variable.
|
||||||
|
|
||||||
|
* panel.h: Now the panel structure has a unique numerical ID used
|
||||||
|
for session management.
|
||||||
|
|
||||||
|
* screen.c (panel_new): Maintain a unique ID for each panel.
|
||||||
|
|
||||||
|
* main.c (maybe_display_linksdir): Handle display of the desktop
|
||||||
|
init dir here.
|
||||||
|
(main): Call gnome_check_super_user().
|
||||||
|
(init_corba_with_args): Call corba_init_server().
|
||||||
|
|
||||||
|
* main.c (init_corba_with_args): Do CORBA initialization here. Also
|
||||||
|
removed the global force_activation option.
|
||||||
|
|
||||||
1999-03-29 Jonathan Blandford <jrb@redhat.com>
|
1999-03-29 Jonathan Blandford <jrb@redhat.com>
|
||||||
|
|
||||||
* main.c (main): updated message.
|
* main.c (main): updated message.
|
||||||
|
@ -341,7 +341,7 @@ int remove_widget (Dlg_head *h, void *what)
|
|||||||
Widget_Item *first, *p;
|
Widget_Item *first, *p;
|
||||||
|
|
||||||
if (!h->current)
|
if (!h->current)
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
first = p = h->current;
|
first = p = h->current;
|
||||||
|
|
||||||
@ -866,7 +866,9 @@ void init_dlg (Dlg_head *h)
|
|||||||
/* Shutdown the run_dlg */
|
/* Shutdown the run_dlg */
|
||||||
void dlg_run_done (Dlg_head *h)
|
void dlg_run_done (Dlg_head *h)
|
||||||
{
|
{
|
||||||
(*h->callback) (h, h->current->dlg_id, DLG_END);
|
if (h->current)
|
||||||
|
(*h->callback) (h, h->current->dlg_id, DLG_END);
|
||||||
|
|
||||||
current_dlg = (Dlg_head *) h->previous_dialog;
|
current_dlg = (Dlg_head *) h->previous_dialog;
|
||||||
if (current_dlg){
|
if (current_dlg){
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ check_progress_buttons (FileOpContext *ctx)
|
|||||||
FileOpContextUI *ui;
|
FileOpContextUI *ui;
|
||||||
|
|
||||||
if (ctx->ui == NULL)
|
if (ctx->ui == NULL)
|
||||||
return;
|
return FILE_CONT;
|
||||||
|
|
||||||
ui = ctx->ui;
|
ui = ctx->ui;
|
||||||
|
|
||||||
|
104
src/main.c
104
src/main.c
@ -81,7 +81,6 @@
|
|||||||
|
|
||||||
#ifdef HAVE_CORBA
|
#ifdef HAVE_CORBA
|
||||||
# include <libgnorba/gnorba.h>
|
# include <libgnorba/gnorba.h>
|
||||||
# include "gcorba.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
@ -139,6 +138,12 @@
|
|||||||
|
|
||||||
#include "popt.h"
|
#include "popt.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_GNOME
|
||||||
|
#include "gcorba.h"
|
||||||
|
#include "gmain.h"
|
||||||
|
#include "gsession.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* "$Id$" */
|
/* "$Id$" */
|
||||||
|
|
||||||
/* When the modes are active, left_panel, right_panel and tree_panel */
|
/* When the modes are active, left_panel, right_panel and tree_panel */
|
||||||
@ -2637,8 +2642,6 @@ static void parse_an_arg (poptContext state,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *cmdline_geometry = NULL;
|
char *cmdline_geometry = NULL;
|
||||||
char **directory_list = NULL;
|
|
||||||
int force_activation = 0;
|
|
||||||
|
|
||||||
static struct poptOption argument_table [] = {
|
static struct poptOption argument_table [] = {
|
||||||
#ifdef HAVE_GNOME
|
#ifdef HAVE_GNOME
|
||||||
@ -2715,22 +2718,59 @@ static struct poptOption argument_table [] = {
|
|||||||
#ifdef HAVE_GNOME
|
#ifdef HAVE_GNOME
|
||||||
{ "geometry", '\0', POPT_ARG_STRING, &cmdline_geometry, 0, N_("Geometry for the window"), N_("GEOMETRY")},
|
{ "geometry", '\0', POPT_ARG_STRING, &cmdline_geometry, 0, N_("Geometry for the window"), N_("GEOMETRY")},
|
||||||
{"nowindows", '\0', POPT_ARG_NONE, &nowindows, 0, N_("No windows opened at startup"), NULL},
|
{"nowindows", '\0', POPT_ARG_NONE, &nowindows, 0, N_("No windows opened at startup"), NULL},
|
||||||
{"force-activation",0,POPT_ARG_NONE, &force_activation, 0, N_("Force activation even if a server is already running"), NULL},
|
|
||||||
{"desktop-linksdir", '\0', POPT_ARG_NONE, &display_linksdir, 0,
|
{"desktop-linksdir", '\0', POPT_ARG_NONE, &display_linksdir, 0,
|
||||||
N_("Displays the directory that holds the .links startup files")},
|
N_("Display the directory that holds the .links startup files and exit")},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{ NULL, 0, 0, NULL, 0 }
|
{ NULL, 0, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
/* Convenience function to display the desktop initialization directory and exit */
|
||||||
main_corba_register_server (void)
|
static void
|
||||||
|
maybe_display_linksdir (void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_CORBA
|
if (display_linksdir) {
|
||||||
corba_register_server ();
|
puts (DESKTOP_INIT_DIR);
|
||||||
#endif
|
exit (1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_CORBA
|
||||||
|
/* Initializes the ORB and does the initial argument processing */
|
||||||
|
static void
|
||||||
|
init_corba_with_args (int *argc, char **argv, poptContext *ctx)
|
||||||
|
{
|
||||||
|
CORBA_Environment ev;
|
||||||
|
|
||||||
|
CORBA_exception_init (&ev);
|
||||||
|
orb = gnome_CORBA_init_with_popt_table ("gmc", VERSION, argc, argv, argument_table, 0, ctx,
|
||||||
|
GNORBA_INIT_SERVER_FUNC, &ev);
|
||||||
|
|
||||||
|
maybe_display_linksdir ();
|
||||||
|
|
||||||
|
if (ev._major != CORBA_NO_EXCEPTION) {
|
||||||
|
CORBA_exception_free (&ev);
|
||||||
|
g_warning ("Could not initialize CORBA");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
CORBA_exception_free (&ev);
|
||||||
|
|
||||||
|
if (!corba_init_server ()) {
|
||||||
|
g_warning ("Could not initialize the CORBA server");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_CORBA
|
||||||
|
void
|
||||||
|
corba_create_window (void)
|
||||||
|
{
|
||||||
|
/* nothing */
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_args (int argc, char *argv [])
|
handle_args (int argc, char *argv [])
|
||||||
{
|
{
|
||||||
@ -2740,28 +2780,12 @@ handle_args (int argc, char *argv [])
|
|||||||
|
|
||||||
#ifdef HAVE_GNOME
|
#ifdef HAVE_GNOME
|
||||||
#ifdef HAVE_CORBA
|
#ifdef HAVE_CORBA
|
||||||
CORBA_Environment ev;
|
init_corba_with_args (&argc, argv, &ctx);
|
||||||
|
|
||||||
CORBA_exception_init (&ev);
|
|
||||||
orb = gnome_CORBA_init_with_popt_table (
|
|
||||||
"gmc", VERSION, &argc, argv, argument_table, 0, &ctx, GNORBA_INIT_SERVER_FUNC, &ev);
|
|
||||||
|
|
||||||
if (display_linksdir){
|
|
||||||
puts (DESKTOP_INIT_DIR);
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
corba_init ();
|
|
||||||
if (!force_activation)
|
|
||||||
if (try_to_activate_running_copy ())
|
|
||||||
exit (1);
|
|
||||||
#else
|
#else
|
||||||
gnome_init_with_popt_table ("gmc", VERSION, argc, argv, argument_table, 0, &ctx);
|
gnome_init_with_popt_table ("gmc", VERSION, argc, argv, argument_table, 0, &ctx);
|
||||||
#endif
|
#endif
|
||||||
if (display_linksdir){
|
maybe_display_linksdir ();
|
||||||
puts (DESKTOP_INIT_DIR);
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
gtk_widget_push_visual (gdk_imlib_get_visual ());
|
gtk_widget_push_visual (gdk_imlib_get_visual ());
|
||||||
gtk_widget_push_colormap (gdk_imlib_get_colormap ());
|
gtk_widget_push_colormap (gdk_imlib_get_colormap ());
|
||||||
|
|
||||||
@ -2913,15 +2937,17 @@ int main (int argc, char *argv [])
|
|||||||
setlocale (LC_ALL, "");
|
setlocale (LC_ALL, "");
|
||||||
bindtextdomain ("mc", LOCALEDIR);
|
bindtextdomain ("mc", LOCALEDIR);
|
||||||
textdomain ("mc");
|
textdomain ("mc");
|
||||||
|
#if 0
|
||||||
/* This is here to debug the CORBA async invocations */
|
/* This is here to debug startup stuff */
|
||||||
{
|
{
|
||||||
volatile int i = 1;
|
volatile int i = 0;
|
||||||
|
|
||||||
|
printf ("GMC IS WAITING %d\n", getpid ());
|
||||||
while (!i)
|
while (!i)
|
||||||
;
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/* Initialize list of all user group for timur_clr_mode */
|
/* Initialize list of all user group for timur_clr_mode */
|
||||||
init_groups ();
|
init_groups ();
|
||||||
|
|
||||||
@ -2956,7 +2982,7 @@ int main (int argc, char *argv [])
|
|||||||
|
|
||||||
mc_tree_store_load ();
|
mc_tree_store_load ();
|
||||||
|
|
||||||
session_management_setup (argv [0]);
|
session_init ();
|
||||||
probably_finish_program ();
|
probably_finish_program ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -3065,17 +3091,11 @@ int main (int argc, char *argv [])
|
|||||||
if (alternate_plus_minus)
|
if (alternate_plus_minus)
|
||||||
application_keypad_mode ();
|
application_keypad_mode ();
|
||||||
# endif
|
# endif
|
||||||
/* INSERT ROOT DIALOG HERE */
|
|
||||||
#ifdef HAVE_GNOME
|
#ifdef HAVE_GNOME
|
||||||
if (geteuid () == 0) {
|
gnome_check_super_user ();
|
||||||
GtkWidget *warning_dlg;
|
|
||||||
warning_dlg = gnome_message_box_new (_("You are running the GNOME Midnight Commander as root. \n\n"
|
|
||||||
"You will not be protected from severly damaging your system.")
|
|
||||||
GNOME_MESSAGE_BOX_WARNING,
|
|
||||||
GNOME_STOCK_BUTTON_OK, NULL);
|
|
||||||
gnome_dialog_run (GNOME_DIALOG (warning_dlg));
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (show_change_notice){
|
if (show_change_notice){
|
||||||
message (1, _(" Notice "),
|
message (1, _(" Notice "),
|
||||||
_(" The Midnight Commander configuration files \n"
|
_(" The Midnight Commander configuration files \n"
|
||||||
|
@ -99,7 +99,7 @@ extern int output_starts_shell;
|
|||||||
extern int midnight_shutdown;
|
extern int midnight_shutdown;
|
||||||
extern char search_buffer [256];
|
extern char search_buffer [256];
|
||||||
extern char cmd_buf [512];
|
extern char cmd_buf [512];
|
||||||
extern int run_desktop;
|
extern char *cmdline_geometry;
|
||||||
|
|
||||||
#if HAVE_GNOME
|
#if HAVE_GNOME
|
||||||
#define MENU_PANEL get_current_panel ()
|
#define MENU_PANEL get_current_panel ()
|
||||||
@ -188,8 +188,6 @@ void done_menu (void);
|
|||||||
void init_menu (void);
|
void init_menu (void);
|
||||||
void exec_shell (void);
|
void exec_shell (void);
|
||||||
|
|
||||||
void main_corba_register_server (void);
|
|
||||||
|
|
||||||
#ifdef OS2_NT
|
#ifdef OS2_NT
|
||||||
# define MC_BASE ""
|
# define MC_BASE ""
|
||||||
#else
|
#else
|
||||||
|
@ -158,6 +158,9 @@ typedef struct {
|
|||||||
|
|
||||||
int dragging;
|
int dragging;
|
||||||
|
|
||||||
|
/* Unique numerical ID for session management */
|
||||||
|
int id;
|
||||||
|
|
||||||
/* Used for scrolling nicely during drags */
|
/* Used for scrolling nicely during drags */
|
||||||
int timer_id;
|
int timer_id;
|
||||||
int drag_motion_x;
|
int drag_motion_x;
|
||||||
|
16
src/screen.c
16
src/screen.c
@ -955,12 +955,15 @@ void directory_history_add (WPanel * panel, char *s);
|
|||||||
WPanel *
|
WPanel *
|
||||||
panel_new (char *panel_name)
|
panel_new (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;
|
||||||
|
|
||||||
panel = g_new0 (WPanel, 1);
|
panel = g_new0 (WPanel, 1);
|
||||||
|
|
||||||
/* No know sizes of the panel at startup */
|
/* No know sizes of the panel at startup */
|
||||||
init_widget (&panel->widget, 0, 0, 0, 0, (callback_fn)
|
init_widget (&panel->widget, 0, 0, 0, 0, (callback_fn)
|
||||||
panel_callback, (destroy_fn) panel_destroy,
|
panel_callback, (destroy_fn) panel_destroy,
|
||||||
@ -968,7 +971,7 @@ panel_new (char *panel_name)
|
|||||||
|
|
||||||
/* We do not want the cursor */
|
/* We do not want the cursor */
|
||||||
widget_want_cursor (panel->widget, 0);
|
widget_want_cursor (panel->widget, 0);
|
||||||
|
|
||||||
mc_get_current_wd (panel->cwd, sizeof (panel->cwd)-2);
|
mc_get_current_wd (panel->cwd, sizeof (panel->cwd)-2);
|
||||||
strcpy (panel->lwd, ".");
|
strcpy (panel->lwd, ".");
|
||||||
|
|
||||||
@ -995,14 +998,15 @@ panel_new (char *panel_name)
|
|||||||
panel->format_modified = 1;
|
panel->format_modified = 1;
|
||||||
#ifdef HAVE_GNOME
|
#ifdef HAVE_GNOME
|
||||||
panel->is_a_desktop_panel = FALSE;
|
panel->is_a_desktop_panel = FALSE;
|
||||||
|
panel->id = panel_id++;
|
||||||
#endif
|
#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);
|
||||||
|
|
||||||
for(i = 0; i < LIST_TYPES; i++)
|
for(i = 0; i < LIST_TYPES; i++)
|
||||||
panel->user_status_format [i] = g_strdup (DEFAULT_USER_FORMAT);
|
panel->user_status_format [i] = g_strdup (DEFAULT_USER_FORMAT);
|
||||||
|
|
||||||
panel->search_buffer [0] = 0;
|
panel->search_buffer [0] = 0;
|
||||||
panel->frame_size = frame_half;
|
panel->frame_size = frame_half;
|
||||||
section = g_strconcat ("Temporal:", panel->panel_name, NULL);
|
section = g_strconcat ("Temporal:", panel->panel_name, NULL);
|
||||||
@ -1026,7 +1030,7 @@ panel_new (char *panel_name)
|
|||||||
}
|
}
|
||||||
set_panel_formats (panel);
|
set_panel_formats (panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Load the default format */
|
/* Load the default format */
|
||||||
panel->count = do_load_dir (&panel->dir, panel->sort_type,
|
panel->count = do_load_dir (&panel->dir, panel->sort_type,
|
||||||
panel->reverse, panel->case_sensitive, panel->filter);
|
panel->reverse, panel->case_sensitive, panel->filter);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef __SETUP_H
|
#ifndef __SETUP_H
|
||||||
#define __SETUP_H
|
#define __SETUP_H
|
||||||
|
|
||||||
|
char *setup_init (void);
|
||||||
void save_layout (void);
|
void save_layout (void);
|
||||||
void save_configure (void);
|
void save_configure (void);
|
||||||
void load_setup (void);
|
void load_setup (void);
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
1999-03-30 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* vfs.c (vfs_add_current_stamps): Only do stamping of the panels
|
||||||
|
if they exist.
|
||||||
|
|
||||||
|
* mcserv.c: #include <sys/wait.h>
|
||||||
|
(get_client): Put `#ifdef __EMX__' around an otherwise-unused
|
||||||
|
variable.
|
||||||
|
|
||||||
|
* utilvfs.c (vfs_split_url): Fix NULL <-> 0 confusion when
|
||||||
|
comparing characters.
|
||||||
|
|
||||||
|
* ftpfs.c (retrieve_dir): Removed unused variable dot_dot_found.
|
||||||
|
|
||||||
|
* extfs.c (extfs_init): Assign `key' to c, not `&key'.
|
||||||
|
|
||||||
Sun Mar 28 23:50:47 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
|
Sun Mar 28 23:50:47 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||||
|
|
||||||
* vfs.h (vfs_translate_url): Fixed the macro which is used when
|
* vfs.h (vfs_translate_url): Fixed the macro which is used when
|
||||||
|
@ -918,12 +918,12 @@ static int extfs_init (vfs *me)
|
|||||||
|
|
||||||
if ((c = strchr (key, '\n'))){
|
if ((c = strchr (key, '\n'))){
|
||||||
*c = 0;
|
*c = 0;
|
||||||
c = &key [strlen (key)-1];
|
c = &key [strlen (key) - 1];
|
||||||
} else {
|
} else {
|
||||||
c = &key;
|
c = key;
|
||||||
}
|
}
|
||||||
extfs_need_archive [extfs_no] = !(*c==':');
|
extfs_need_archive [extfs_no] = !(*c == ':');
|
||||||
if (*c==':')
|
if (*c == ':')
|
||||||
*c = 0;
|
*c = 0;
|
||||||
if (!(*key))
|
if (!(*key))
|
||||||
continue;
|
continue;
|
||||||
|
@ -1292,7 +1292,6 @@ retrieve_dir(struct connection *bucket, char *remote_path, int resolve_symlinks)
|
|||||||
struct dir *dcache;
|
struct dir *dcache;
|
||||||
int got_intr = 0;
|
int got_intr = 0;
|
||||||
int dot_found = 0;
|
int dot_found = 0;
|
||||||
int dot_dot_found = 0;
|
|
||||||
int has_spaces = (strchr (remote_path, ' ') != NULL);
|
int has_spaces = (strchr (remote_path, ' ') != NULL);
|
||||||
|
|
||||||
canonicalize_pathname (remote_path);
|
canonicalize_pathname (remote_path);
|
||||||
|
@ -63,6 +63,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#ifdef SCO_FLAVOR
|
#ifdef SCO_FLAVOR
|
||||||
@ -1109,7 +1110,9 @@ char *get_client (int portnum)
|
|||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
char hostname [255];
|
char hostname [255];
|
||||||
int yes = 1;
|
int yes = 1;
|
||||||
|
#ifdef __EMX__
|
||||||
char *me;
|
char *me;
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((sock = socket (AF_INET, SOCK_STREAM, 0)) < 0)
|
if ((sock = socket (AF_INET, SOCK_STREAM, 0)) < 0)
|
||||||
return "Can't create socket";
|
return "Can't create socket";
|
||||||
|
@ -102,7 +102,7 @@ char *vfs_split_url (char *path, char **host, char **user, int *port, char **pas
|
|||||||
else
|
else
|
||||||
*pass = g_strdup (inner_colon);
|
*pass = g_strdup (inner_colon);
|
||||||
}
|
}
|
||||||
if (*pcopy != NULL)
|
if (*pcopy != 0)
|
||||||
*user = g_strdup (pcopy);
|
*user = g_strdup (pcopy);
|
||||||
else
|
else
|
||||||
default_is_anon = 0;
|
default_is_anon = 0;
|
||||||
|
14
vfs/vfs.c
14
vfs/vfs.c
@ -865,10 +865,16 @@ void
|
|||||||
vfs_add_current_stamps (void)
|
vfs_add_current_stamps (void)
|
||||||
{
|
{
|
||||||
vfs_stamp_path (current_dir);
|
vfs_stamp_path (current_dir);
|
||||||
if (get_current_type () == view_listing)
|
|
||||||
vfs_stamp_path (cpanel->cwd);
|
if (cpanel) {
|
||||||
if (get_other_type () == view_listing)
|
if (get_current_type () == view_listing)
|
||||||
vfs_stamp_path (opanel->cwd);
|
vfs_stamp_path (cpanel->cwd);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opanel) {
|
||||||
|
if (get_other_type () == view_listing)
|
||||||
|
vfs_stamp_path (opanel->cwd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user