mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-11-05 16:04:31 +00:00
New IDL file describing CORBA interface to the undo manager.
2000-05-05 Gene Z. Ragan <gzr@eazel.com> * libnautilus-extensions/nautilus-undo-manager-component.idl: New IDL file describing CORBA interface to the undo manager. * libnautilus-extensions/Makefile.am: Modified to include nautilus-undo-manager-component.idl * libnautilus-extensions/nautilus-undo-manager.c * libnautilus-extensions/nautilus-undo-manager-private.h: (impl_Nautilus_UndoManager__destroy), (impl_Nautilus_UndoManager__create), (impl_Nautilus_UndoManager__begin_transaction), (impl_Nautilus_UndoManager__end_transaction): CORBA/Bonobo functions to access undo manager features. * libnautilus-extensions/nautilus-undo-manager.h: * src/file-manager/fm-list-view.c (fm_list_view_append_background_context_menu_items), (fm_list_view_merge_menus), (fm_list_view_update_menus), (rename_list_item_callback): Began the task of * src/ntl-main.c (main): Removed intialization of undo manager from main, * src/ntl-app.c (nautilus_app_init): Moved initialization of undo manager. A reference to the undo manager is saved for easy access from components.
This commit is contained in:
parent
b858e2ebe7
commit
3324b79c1b
18 changed files with 288 additions and 108 deletions
33
ChangeLog
33
ChangeLog
|
@ -1,3 +1,36 @@
|
|||
2000-05-05 Gene Z. Ragan <gzr@eazel.com>
|
||||
|
||||
* libnautilus-extensions/nautilus-undo-manager-component.idl:
|
||||
New IDL file describing CORBA interface to the undo manager.
|
||||
|
||||
* libnautilus-extensions/Makefile.am:
|
||||
Modified to include nautilus-undo-manager-component.idl
|
||||
|
||||
* libnautilus-extensions/nautilus-undo-manager.c
|
||||
* libnautilus-extensions/nautilus-undo-manager-private.h:
|
||||
(impl_Nautilus_UndoManager__destroy),
|
||||
(impl_Nautilus_UndoManager__create),
|
||||
(impl_Nautilus_UndoManager__begin_transaction),
|
||||
(impl_Nautilus_UndoManager__end_transaction):
|
||||
CORBA/Bonobo functions to access undo manager features.
|
||||
|
||||
* libnautilus-extensions/nautilus-undo-manager.h:
|
||||
* src/file-manager/fm-list-view.c
|
||||
(fm_list_view_append_background_context_menu_items),
|
||||
(fm_list_view_merge_menus), (fm_list_view_update_menus),
|
||||
(rename_list_item_callback):
|
||||
Began the task of
|
||||
|
||||
* src/ntl-main.c
|
||||
(main):
|
||||
Removed intialization of undo manager from main,
|
||||
|
||||
* src/ntl-app.c
|
||||
(nautilus_app_init):
|
||||
Moved initialization of undo manager. A reference to the undo manager
|
||||
is saved for easy access from components.
|
||||
|
||||
|
||||
2000-05-05 Andy Hertzfeld <andy@eazel.com>
|
||||
|
||||
* src/nautilus-property-browser.c:
|
||||
|
|
|
@ -74,7 +74,7 @@ int main(int argc, char *argv[])
|
|||
BonoboGenericFactory *factory;
|
||||
CORBA_ORB orb;
|
||||
CORBA_Environment ev;
|
||||
|
||||
|
||||
CORBA_exception_init(&ev);
|
||||
|
||||
puts ("In component.");
|
||||
|
@ -88,8 +88,8 @@ int main(int argc, char *argv[])
|
|||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
factory = bonobo_generic_factory_new_multi ("OAFIID:nautilus_sample_content_view_factory:3df6b028-be44-4a18-95c3-7720f50ca0c5", sample_make_object, NULL);
|
||||
|
||||
puts ("About to do main loop.");
|
||||
|
||||
puts ("About to do main loop.");
|
||||
|
||||
do {
|
||||
bonobo_main ();
|
||||
|
|
|
@ -21,10 +21,24 @@ libnautilus_extensions_la_LDFLAGS=\
|
|||
$(XML_LIBS) \
|
||||
$(LIBPNG)
|
||||
|
||||
fsextension_idl_sources=fsextension-stubs.c fsextension-skels.c fsextension-common.c fsextension.h
|
||||
BUILT_SOURCES=$(fsextension_idl_sources)
|
||||
fsextension_idl_sources = \
|
||||
fsextension-stubs.c \
|
||||
fsextension-skels.c \
|
||||
fsextension-common.c \
|
||||
fsextension.h
|
||||
|
||||
nautilus_undo_manager_component_idl_sources = \
|
||||
nautilus-undo-manager-component-stubs.c \
|
||||
nautilus-undo-manager-component-skels.c \
|
||||
nautilus-undo-manager-component-common.c \
|
||||
nautilus-undo-manager-component.h
|
||||
|
||||
BUILT_SOURCES = \
|
||||
$(fsextension_idl_sources) \
|
||||
$(nautilus_undo_manager_component_idl_sources)
|
||||
|
||||
libnautilus_extensionsincludedir=$(includedir)/libnautilus-extensions
|
||||
|
||||
libnautilus_extensionsinclude_HEADERS= \
|
||||
nautilus-background-canvas-group.h \
|
||||
nautilus-file-changes-queue.h \
|
||||
|
@ -122,14 +136,19 @@ libnautilus_extensions_la_SOURCES = \
|
|||
nautilus-undoable.c \
|
||||
nautilus-xml-extensions.c \
|
||||
$(fsextension_idl_sources) \
|
||||
$(nautilus_undo_manager_component_idl_sources) \
|
||||
$(NULL)
|
||||
|
||||
$(fsextension_idl_sources): fsextension_idl_stamp
|
||||
|
||||
fsextension_idl_stamp: $(top_srcdir)/idl/fsextension.idl
|
||||
orbit-idl -I${datadir}/idl `gnome-config --cflags idl` $(top_srcdir)/idl/fsextension.idl
|
||||
touch fsextension_idl_stamp
|
||||
|
||||
CLEANFILES = fsextension_idl_stamp
|
||||
$(nautilus_undo_manager_component_idl_sources): nautilus_undo_manager_component_idl_stamp
|
||||
nautilus_undo_manager_component_idl_stamp: nautilus-undo-manager-component.idl
|
||||
orbit-idl -I${datadir}/idl `gnome-config --cflags idl` $(srcdir)/nautilus-undo-manager-component.idl
|
||||
touch nautilus_undo_manager_component_idl_stamp
|
||||
|
||||
CLEANFILES = fsextension_idl_stamp nautilus_undo_manager_component_idl_stamp
|
||||
|
||||
EXTRA_DIST = $(top_srcdir)/idl/fsextension.idl $(top_srcdir)/idl/GNOME_Desktop_FileOperationService.idl
|
||||
|
|
12
libnautilus-extensions/nautilus-undo-manager-component.idl
Normal file
12
libnautilus-extensions/nautilus-undo-manager-component.idl
Normal file
|
@ -0,0 +1,12 @@
|
|||
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */
|
||||
|
||||
#include <gnome-factory.idl>
|
||||
#include <Bonobo.idl>
|
||||
|
||||
module Nautilus {
|
||||
|
||||
interface UndoManager : ::Bonobo::Unknown {
|
||||
boolean begin_transaction (in string name);
|
||||
boolean end_transaction ();
|
||||
};
|
||||
};
|
|
@ -26,6 +26,7 @@
|
|||
#define NAUTILUS_UNDO_MANAGER_PRIVATE_H
|
||||
|
||||
#include <glib.h>
|
||||
#include <bonobo.h>
|
||||
|
||||
#include "nautilus-undo-transaction.h"
|
||||
|
||||
|
|
|
@ -21,10 +21,24 @@ libnautilus_extensions_la_LDFLAGS=\
|
|||
$(XML_LIBS) \
|
||||
$(LIBPNG)
|
||||
|
||||
fsextension_idl_sources=fsextension-stubs.c fsextension-skels.c fsextension-common.c fsextension.h
|
||||
BUILT_SOURCES=$(fsextension_idl_sources)
|
||||
fsextension_idl_sources = \
|
||||
fsextension-stubs.c \
|
||||
fsextension-skels.c \
|
||||
fsextension-common.c \
|
||||
fsextension.h
|
||||
|
||||
nautilus_undo_manager_component_idl_sources = \
|
||||
nautilus-undo-manager-component-stubs.c \
|
||||
nautilus-undo-manager-component-skels.c \
|
||||
nautilus-undo-manager-component-common.c \
|
||||
nautilus-undo-manager-component.h
|
||||
|
||||
BUILT_SOURCES = \
|
||||
$(fsextension_idl_sources) \
|
||||
$(nautilus_undo_manager_component_idl_sources)
|
||||
|
||||
libnautilus_extensionsincludedir=$(includedir)/libnautilus-extensions
|
||||
|
||||
libnautilus_extensionsinclude_HEADERS= \
|
||||
nautilus-background-canvas-group.h \
|
||||
nautilus-file-changes-queue.h \
|
||||
|
@ -122,14 +136,19 @@ libnautilus_extensions_la_SOURCES = \
|
|||
nautilus-undoable.c \
|
||||
nautilus-xml-extensions.c \
|
||||
$(fsextension_idl_sources) \
|
||||
$(nautilus_undo_manager_component_idl_sources) \
|
||||
$(NULL)
|
||||
|
||||
$(fsextension_idl_sources): fsextension_idl_stamp
|
||||
|
||||
fsextension_idl_stamp: $(top_srcdir)/idl/fsextension.idl
|
||||
orbit-idl -I${datadir}/idl `gnome-config --cflags idl` $(top_srcdir)/idl/fsextension.idl
|
||||
touch fsextension_idl_stamp
|
||||
|
||||
CLEANFILES = fsextension_idl_stamp
|
||||
$(nautilus_undo_manager_component_idl_sources): nautilus_undo_manager_component_idl_stamp
|
||||
nautilus_undo_manager_component_idl_stamp: nautilus-undo-manager-component.idl
|
||||
orbit-idl -I${datadir}/idl `gnome-config --cflags idl` $(srcdir)/nautilus-undo-manager-component.idl
|
||||
touch nautilus_undo_manager_component_idl_stamp
|
||||
|
||||
CLEANFILES = fsextension_idl_stamp nautilus_undo_manager_component_idl_stamp
|
||||
|
||||
EXTRA_DIST = $(top_srcdir)/idl/fsextension.idl $(top_srcdir)/idl/GNOME_Desktop_FileOperationService.idl
|
||||
|
|
12
libnautilus-private/nautilus-undo-manager-component.idl
Normal file
12
libnautilus-private/nautilus-undo-manager-component.idl
Normal file
|
@ -0,0 +1,12 @@
|
|||
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */
|
||||
|
||||
#include <gnome-factory.idl>
|
||||
#include <Bonobo.idl>
|
||||
|
||||
module Nautilus {
|
||||
|
||||
interface UndoManager : ::Bonobo::Unknown {
|
||||
boolean begin_transaction (in string name);
|
||||
boolean end_transaction ();
|
||||
};
|
||||
};
|
|
@ -26,6 +26,7 @@
|
|||
#define NAUTILUS_UNDO_MANAGER_PRIVATE_H
|
||||
|
||||
#include <glib.h>
|
||||
#include <bonobo.h>
|
||||
|
||||
#include "nautilus-undo-transaction.h"
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include <gtk/gtksignal.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <string.h>
|
||||
#include <bonobo/bonobo-main.h>
|
||||
#include <bonobo/bonobo-control.h>
|
||||
|
||||
#include "nautilus-undo-manager.h"
|
||||
#include "nautilus-undo-manager-private.h"
|
||||
|
@ -41,6 +43,15 @@ enum {
|
|||
};
|
||||
static guint signals[LAST_SIGNAL];
|
||||
|
||||
|
||||
typedef struct {
|
||||
POA_Nautilus_UndoManager servant;
|
||||
gpointer bonobo_object;
|
||||
|
||||
NautilusUndoManager *gtk_object;
|
||||
} impl_POA_Nautilus_UndoManager;
|
||||
|
||||
|
||||
/* GtkObject */
|
||||
static void nautilus_undo_manager_initialize_class (NautilusUndoManagerClass *class);
|
||||
static void nautilus_undo_manager_initialize (NautilusUndoManager *item);
|
||||
|
@ -49,25 +60,113 @@ static void destroy (GtkObject *object);
|
|||
static GList *free_undo_manager_list_data (GList *list);
|
||||
static GList *prune_undo_manager_list (GList *list, gint items);
|
||||
|
||||
/* CORBA/Bonobo */
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusUndoManager, nautilus_undo_manager, GTK_TYPE_OBJECT)
|
||||
static CORBA_boolean impl_Nautilus_UndoManager__begin_transaction (impl_POA_Nautilus_UndoManager *servant,
|
||||
const CORBA_char *name,
|
||||
CORBA_Environment *ev);
|
||||
static void impl_Nautilus_UndoManager__end_transaction (impl_POA_Nautilus_UndoManager *servant,
|
||||
CORBA_Environment *ev);
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE(NautilusUndoManager, nautilus_undo_manager, BONOBO_OBJECT_TYPE)
|
||||
|
||||
POA_Nautilus_UndoManager__epv libnautilus_extensions_Nautilus_UndoManager_epv =
|
||||
{
|
||||
NULL, /* _private */
|
||||
(gpointer) &impl_Nautilus_UndoManager__begin_transaction,
|
||||
(gpointer) &impl_Nautilus_UndoManager__end_transaction,
|
||||
};
|
||||
|
||||
static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
|
||||
|
||||
static POA_Nautilus_UndoManager__vepv impl_Nautilus_UndoManager_vepv =
|
||||
{
|
||||
&base_epv,
|
||||
NULL,
|
||||
&libnautilus_extensions_Nautilus_UndoManager_epv
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
impl_Nautilus_UndoManager__destroy(BonoboObject *obj, impl_POA_Nautilus_UndoManager *servant)
|
||||
{
|
||||
PortableServer_ObjectId *objid;
|
||||
CORBA_Environment ev;
|
||||
void (*servant_destroy_func) (PortableServer_Servant servant, CORBA_Environment *ev);
|
||||
|
||||
CORBA_exception_init(&ev);
|
||||
|
||||
servant_destroy_func = NAUTILUS_UNDO_MANAGER_CLASS (GTK_OBJECT (servant->gtk_object)->klass)->servant_destroy_func;
|
||||
objid = PortableServer_POA_servant_to_id (bonobo_poa (), servant, &ev);
|
||||
PortableServer_POA_deactivate_object (bonobo_poa (), objid, &ev);
|
||||
CORBA_free (objid);
|
||||
obj->servant = NULL;
|
||||
|
||||
servant_destroy_func ((PortableServer_Servant) servant, &ev);
|
||||
g_free (servant);
|
||||
CORBA_exception_free(&ev);
|
||||
}
|
||||
|
||||
static Nautilus_UndoManager
|
||||
impl_Nautilus_UndoManager__create(NautilusUndoManager *manager, CORBA_Environment * ev)
|
||||
{
|
||||
Nautilus_UndoManager retval;
|
||||
impl_POA_Nautilus_UndoManager *servant;
|
||||
void (*servant_init_func) (PortableServer_Servant servant, CORBA_Environment *ev);
|
||||
|
||||
NautilusUndoManagerClass *undo_class = NAUTILUS_UNDO_MANAGER_CLASS (GTK_OBJECT(manager)->klass);
|
||||
|
||||
servant_init_func = undo_class->servant_init_func;
|
||||
servant = g_new0 (impl_POA_Nautilus_UndoManager, 1);
|
||||
servant->servant.vepv = undo_class->vepv;
|
||||
if (!servant->servant.vepv->Bonobo_Unknown_epv)
|
||||
servant->servant.vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
|
||||
servant_init_func ((PortableServer_Servant) servant, ev);
|
||||
|
||||
servant->gtk_object = manager;
|
||||
|
||||
retval = bonobo_object_activate_servant (BONOBO_OBJECT (manager), servant);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (manager), "destroy", GTK_SIGNAL_FUNC (impl_Nautilus_UndoManager__destroy), servant);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static CORBA_boolean
|
||||
impl_Nautilus_UndoManager__begin_transaction (impl_POA_Nautilus_UndoManager *servant,
|
||||
const CORBA_char *name,
|
||||
CORBA_Environment *ev)
|
||||
{
|
||||
return nautilus_undo_manager_begin_transaction (name);
|
||||
}
|
||||
|
||||
static void
|
||||
impl_Nautilus_UndoManager__end_transaction (impl_POA_Nautilus_UndoManager *servant,
|
||||
CORBA_Environment *ev)
|
||||
{
|
||||
nautilus_undo_manager_end_transaction ();
|
||||
}
|
||||
|
||||
|
||||
/* nautilus_undo_manager_new */
|
||||
GtkObject *
|
||||
NautilusUndoManager *
|
||||
nautilus_undo_manager_new (void)
|
||||
{
|
||||
GtkObject *new_object;
|
||||
NautilusUndoManager *manager;
|
||||
|
||||
manager = gtk_type_new (nautilus_undo_manager_get_type ());
|
||||
|
||||
new_object = gtk_type_new (nautilus_undo_manager_get_type ());
|
||||
|
||||
return new_object;
|
||||
return manager;
|
||||
}
|
||||
|
||||
|
||||
/* Object initialization function for the NautilusUndoManager */
|
||||
void
|
||||
static void
|
||||
nautilus_undo_manager_initialize (NautilusUndoManager *manager)
|
||||
{
|
||||
CORBA_Environment ev;
|
||||
CORBA_exception_init(&ev);
|
||||
|
||||
manager->details = g_new0 (NautilusUndoManagerDetails, 1);
|
||||
|
||||
/* Init transaction to none */
|
||||
|
@ -85,6 +184,10 @@ nautilus_undo_manager_initialize (NautilusUndoManager *manager)
|
|||
|
||||
/* No transaction is in progress */
|
||||
manager->details->transaction_in_progress = FALSE;
|
||||
|
||||
bonobo_object_construct (BONOBO_OBJECT (manager), impl_Nautilus_UndoManager__create (manager, &ev));
|
||||
|
||||
CORBA_exception_free(&ev);
|
||||
}
|
||||
|
||||
|
||||
|
@ -98,6 +201,10 @@ nautilus_undo_manager_initialize_class (NautilusUndoManagerClass *klass)
|
|||
|
||||
object_class->destroy = destroy;
|
||||
|
||||
klass->servant_init_func = POA_Nautilus_UndoManager__init;
|
||||
klass->servant_destroy_func = POA_Nautilus_UndoManager__fini;
|
||||
klass->vepv = &impl_Nautilus_UndoManager_vepv;
|
||||
|
||||
/* Setup signals */
|
||||
signals[UNDO_TRANSACTION_OCCURED]
|
||||
= gtk_signal_new ("undo_transaction_occurred",
|
||||
|
@ -403,8 +510,12 @@ nautilus_undo_manager_unregister_object (GtkObject *object)
|
|||
/* nautilus_undo_manager_can_undo */
|
||||
gboolean
|
||||
nautilus_undo_manager_can_undo (void)
|
||||
{
|
||||
return (g_list_length(global_undo_manager->details->undo_list) > 0);
|
||||
{
|
||||
if (global_undo_manager != NULL) {
|
||||
return (g_list_length(global_undo_manager->details->undo_list) > 0);
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* nautilus_undo_manager_can_redo */
|
||||
|
@ -412,7 +523,11 @@ gboolean
|
|||
nautilus_undo_manager_can_redo (void)
|
||||
{
|
||||
if (global_undo_manager->details->enable_redo) {
|
||||
return (g_list_length(global_undo_manager->details->redo_list) > 0);
|
||||
if (global_undo_manager != NULL) {
|
||||
return (g_list_length(global_undo_manager->details->redo_list) > 0);
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -516,7 +631,7 @@ destroy (GtkObject *object)
|
|||
}
|
||||
|
||||
|
||||
/* Initialize Nautilus global*/
|
||||
/* Initialize Nautilus global undo manager */
|
||||
gboolean
|
||||
nautilus_undo_manager_initialize_global_manager (void)
|
||||
{
|
||||
|
@ -524,8 +639,9 @@ nautilus_undo_manager_initialize_global_manager (void)
|
|||
g_warning("A global undo manager has already been created.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
global_undo_manager = NAUTILUS_UNDO_MANAGER(nautilus_undo_manager_new());
|
||||
|
||||
global_undo_manager = nautilus_undo_manager_new();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
#ifndef NAUTILUS_UNDO_MANAGER_H
|
||||
#define NAUTILUS_UNDO_MANAGER_H
|
||||
|
||||
#include <bonobo/bonobo-object.h>
|
||||
#include <libnautilus-extensions/nautilus-undo-manager-component.h>
|
||||
#include <bonobo/bonobo-persist.h>
|
||||
#include "nautilus-undo-transaction.h"
|
||||
|
||||
#define NAUTILUS_TYPE_UNDO_MANAGER \
|
||||
|
@ -42,19 +45,22 @@ typedef struct NautilusUndoManagerClass NautilusUndoManagerClass;
|
|||
typedef struct NautilusUndoManagerDetails NautilusUndoManagerDetails;
|
||||
|
||||
struct NautilusUndoManager {
|
||||
GtkObject parent;
|
||||
BonoboPersist parent;
|
||||
NautilusUndoManagerDetails *details;
|
||||
};
|
||||
|
||||
struct NautilusUndoManagerClass {
|
||||
GtkObjectClass parent_class;
|
||||
BonoboPersistClass parent_class;
|
||||
|
||||
void (* undo_transaction_occurred) (GtkObject *object, gpointer data);
|
||||
|
||||
gpointer servant_init_func, servant_destroy_func, vepv;
|
||||
};
|
||||
|
||||
|
||||
/* GtkObject */
|
||||
GtkType nautilus_undo_manager_get_type (void);
|
||||
GtkObject *nautilus_undo_manager_new (void);
|
||||
GtkType nautilus_undo_manager_get_type (void);
|
||||
NautilusUndoManager *nautilus_undo_manager_new (void);
|
||||
|
||||
/* Prototypes */
|
||||
gboolean nautilus_undo_manager_initialize_global_manager (void);
|
||||
|
|
|
@ -106,3 +106,4 @@ module Nautilus {
|
|||
ViewWindow new_view_window ();
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -848,25 +848,12 @@ fm_list_view_sort_items (FMListView *list_view,
|
|||
static void
|
||||
fm_list_view_append_background_context_menu_items (FMDirectoryView *view, GtkMenu *menu)
|
||||
{
|
||||
//GtkWidget *menu_item;
|
||||
|
||||
g_assert (FM_IS_DIRECTORY_VIEW (view));
|
||||
g_assert (GTK_IS_MENU (menu));
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (FM_DIRECTORY_VIEW_CLASS,
|
||||
append_background_context_menu_items,
|
||||
(view, menu));
|
||||
|
||||
/* Put a separator before this item, since previous items are
|
||||
* window-specific and this one is global.
|
||||
*/
|
||||
/*menu_item = gtk_menu_item_new ();
|
||||
gtk_widget_show (menu_item);
|
||||
gtk_menu_append (menu, menu_item);
|
||||
|
||||
append_one_context_menu_item (FM_LIST_VIEW (view), menu, NULL,
|
||||
MENU_PATH_CUSTOMIZE_ICON_TEXT,
|
||||
GTK_SIGNAL_FUNC (customize_icon_text_callback));*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -924,48 +911,14 @@ fm_list_view_merge_menus (FMDirectoryView *view)
|
|||
(BonoboUIHandlerCallbackFunc) rename_list_item_callback,
|
||||
view);
|
||||
|
||||
/* Add Undo menu item at top of Edit menu */
|
||||
/*bonobo_ui_handler_menu_new_item (ui_handler,
|
||||
MENU_PATH_UNDO,
|
||||
_("Undo"),
|
||||
_("Undo Rename"),
|
||||
0,
|
||||
BONOBO_UI_HANDLER_PIXMAP_NONE,
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
(BonoboUIHandlerCallbackFunc) undo_rename_list_item_callback,
|
||||
view);*/
|
||||
|
||||
nautilus_file_list_free (selection);
|
||||
|
||||
/*FM_LIST_VIEW (view)->details->menus_ready = TRUE;*/
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
fm_list_view_update_menus (FMDirectoryView *view)
|
||||
{
|
||||
//GList *selection;
|
||||
//BonoboUIHandler *ui_handler;
|
||||
//int count;
|
||||
|
||||
NAUTILUS_CALL_PARENT_CLASS (FM_DIRECTORY_VIEW_CLASS, update_menus, (view));
|
||||
|
||||
/*ui_handler = fm_directory_view_get_bonobo_ui_handler (view);
|
||||
selection = fm_directory_view_get_selection (view);
|
||||
count = g_list_length (selection);
|
||||
|
||||
update_bonobo_menu_item (FM_LIST_VIEW (view), ui_handler, selection,
|
||||
MENU_PATH_STRETCH_ICON);
|
||||
update_bonobo_menu_item (FM_LIST_VIEW (view), ui_handler, selection,
|
||||
MENU_PATH_RESTORE_STRETCHED_ICONS);
|
||||
update_bonobo_menu_item (FM_LIST_VIEW (view), ui_handler, selection,
|
||||
MENU_PATH_RENAME);
|
||||
update_bonobo_menu_item (FM_LIST_VIEW (view), ui_handler, selection,
|
||||
MENU_PATH_UNDO);
|
||||
|
||||
nautilus_file_list_free (selection);*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -978,9 +931,6 @@ rename_list_item_callback (gpointer ignored, gpointer view)
|
|||
{
|
||||
g_assert (FM_IS_LIST_VIEW (view));
|
||||
|
||||
/*nautilus_icon_container_start_renaming_selected_item (
|
||||
get_icon_container (FM_ICON_VIEW (view)));*/
|
||||
|
||||
fm_directory_view_update_menus (FM_DIRECTORY_VIEW (view));
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "file-manager/fm-icon-view.h"
|
||||
#include "file-manager/fm-list-view.h"
|
||||
#include <libnautilus-extensions/nautilus-global-preferences.h>
|
||||
#include <libnautilus-extensions/nautilus-undo-manager.h>
|
||||
|
||||
typedef struct {
|
||||
POA_Nautilus_Application servant;
|
||||
|
@ -232,16 +233,21 @@ nautilus_app_class_init (NautilusAppClass *klass)
|
|||
static void
|
||||
nautilus_app_init (NautilusApp *app)
|
||||
{
|
||||
CORBA_Environment ev;
|
||||
CORBA_Object objref;
|
||||
CORBA_Environment ev;
|
||||
CORBA_Object objref;
|
||||
|
||||
CORBA_exception_init(&ev);
|
||||
objref = impl_Nautilus_Application__create(bonobo_poa(), app, &ev);
|
||||
|
||||
CORBA_exception_init(&ev);
|
||||
objref = impl_Nautilus_Application__create(bonobo_poa(), app, &ev);
|
||||
oaf_active_server_register("OAFIID:ntl_file_manager_factory:bd1e1862-92d7-4391-963e-37583f0daef3", objref);
|
||||
|
||||
oaf_active_server_register("OAFIID:ntl_file_manager_factory:bd1e1862-92d7-4391-963e-37583f0daef3", objref);
|
||||
bonobo_object_construct(BONOBO_OBJECT(app), objref);
|
||||
|
||||
bonobo_object_construct(BONOBO_OBJECT(app), objref);
|
||||
CORBA_exception_free(&ev);
|
||||
/* Init undo manager */
|
||||
nautilus_undo_manager_initialize_global_manager ();
|
||||
app->undo_manager = BONOBO_OBJECT (nautilus_undo_manager_get_undo_manager());
|
||||
|
||||
CORBA_exception_free(&ev);
|
||||
}
|
||||
|
||||
GtkObject *
|
||||
|
@ -269,12 +275,12 @@ nautilus_app_destroy(GtkObject *object)
|
|||
void
|
||||
nautilus_app_startup(NautilusApp *app, const char *initial_url)
|
||||
{
|
||||
NautilusWindow *mainwin;
|
||||
NautilusWindow *mainwin;
|
||||
|
||||
/* Set default configuration */
|
||||
mainwin = nautilus_app_create_window(app);
|
||||
bonobo_activate();
|
||||
nautilus_window_set_initial_state(mainwin, initial_url);
|
||||
/* Set default configuration */
|
||||
mainwin = nautilus_app_create_window(app);
|
||||
bonobo_activate();
|
||||
nautilus_window_set_initial_state(mainwin, initial_url);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -35,6 +35,7 @@ extern "C" {
|
|||
typedef struct {
|
||||
BonoboObject parent;
|
||||
GSList *windows;
|
||||
BonoboObject *undo_manager;
|
||||
} NautilusApp;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include <libnautilus-extensions/nautilus-debug.h>
|
||||
#include <libnautilus-extensions/nautilus-lib-self-check-functions.h>
|
||||
#include <libnautilus-extensions/nautilus-self-checks.h>
|
||||
#include <libnautilus-extensions/nautilus-undo-manager.h>
|
||||
#include <nautilus-widgets/nautilus-widgets-self-check-functions.h>
|
||||
#include <nautilus-widgets/nautilus-preferences.h>
|
||||
#include <libgnomevfs/gnome-vfs-init.h>
|
||||
|
@ -93,8 +92,7 @@ main(int argc, char *argv[])
|
|||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
g_thread_init (NULL);
|
||||
gnome_vfs_init ();
|
||||
nautilus_undo_manager_initialize_global_manager ();
|
||||
|
||||
|
||||
args = poptGetArgs (ctx);
|
||||
|
||||
#if !defined (NAUTILUS_OMIT_SELF_CHECK)
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "file-manager/fm-icon-view.h"
|
||||
#include "file-manager/fm-list-view.h"
|
||||
#include <libnautilus-extensions/nautilus-global-preferences.h>
|
||||
#include <libnautilus-extensions/nautilus-undo-manager.h>
|
||||
|
||||
typedef struct {
|
||||
POA_Nautilus_Application servant;
|
||||
|
@ -232,16 +233,21 @@ nautilus_app_class_init (NautilusAppClass *klass)
|
|||
static void
|
||||
nautilus_app_init (NautilusApp *app)
|
||||
{
|
||||
CORBA_Environment ev;
|
||||
CORBA_Object objref;
|
||||
CORBA_Environment ev;
|
||||
CORBA_Object objref;
|
||||
|
||||
CORBA_exception_init(&ev);
|
||||
objref = impl_Nautilus_Application__create(bonobo_poa(), app, &ev);
|
||||
|
||||
CORBA_exception_init(&ev);
|
||||
objref = impl_Nautilus_Application__create(bonobo_poa(), app, &ev);
|
||||
oaf_active_server_register("OAFIID:ntl_file_manager_factory:bd1e1862-92d7-4391-963e-37583f0daef3", objref);
|
||||
|
||||
oaf_active_server_register("OAFIID:ntl_file_manager_factory:bd1e1862-92d7-4391-963e-37583f0daef3", objref);
|
||||
bonobo_object_construct(BONOBO_OBJECT(app), objref);
|
||||
|
||||
bonobo_object_construct(BONOBO_OBJECT(app), objref);
|
||||
CORBA_exception_free(&ev);
|
||||
/* Init undo manager */
|
||||
nautilus_undo_manager_initialize_global_manager ();
|
||||
app->undo_manager = BONOBO_OBJECT (nautilus_undo_manager_get_undo_manager());
|
||||
|
||||
CORBA_exception_free(&ev);
|
||||
}
|
||||
|
||||
GtkObject *
|
||||
|
@ -269,12 +275,12 @@ nautilus_app_destroy(GtkObject *object)
|
|||
void
|
||||
nautilus_app_startup(NautilusApp *app, const char *initial_url)
|
||||
{
|
||||
NautilusWindow *mainwin;
|
||||
NautilusWindow *mainwin;
|
||||
|
||||
/* Set default configuration */
|
||||
mainwin = nautilus_app_create_window(app);
|
||||
bonobo_activate();
|
||||
nautilus_window_set_initial_state(mainwin, initial_url);
|
||||
/* Set default configuration */
|
||||
mainwin = nautilus_app_create_window(app);
|
||||
bonobo_activate();
|
||||
nautilus_window_set_initial_state(mainwin, initial_url);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -35,6 +35,7 @@ extern "C" {
|
|||
typedef struct {
|
||||
BonoboObject parent;
|
||||
GSList *windows;
|
||||
BonoboObject *undo_manager;
|
||||
} NautilusApp;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include <libnautilus-extensions/nautilus-debug.h>
|
||||
#include <libnautilus-extensions/nautilus-lib-self-check-functions.h>
|
||||
#include <libnautilus-extensions/nautilus-self-checks.h>
|
||||
#include <libnautilus-extensions/nautilus-undo-manager.h>
|
||||
#include <nautilus-widgets/nautilus-widgets-self-check-functions.h>
|
||||
#include <nautilus-widgets/nautilus-preferences.h>
|
||||
#include <libgnomevfs/gnome-vfs-init.h>
|
||||
|
@ -93,8 +92,7 @@ main(int argc, char *argv[])
|
|||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
g_thread_init (NULL);
|
||||
gnome_vfs_init ();
|
||||
nautilus_undo_manager_initialize_global_manager ();
|
||||
|
||||
|
||||
args = poptGetArgs (ctx);
|
||||
|
||||
#if !defined (NAUTILUS_OMIT_SELF_CHECK)
|
||||
|
|
Loading…
Reference in a new issue