Commit fddfc8e8 authored by Mike Engber's avatar Mike Engber
Browse files

First half of putting a quit menu item on the desktop's right-click menu.


	* src/file-manager/Makefile.am:
	* src/file-manager/fm-desktop-icon-view.c:
	(fm_desktop_icon_view_initialize_class),
	(fm_desktop_icon_view_initialize),
	(fm_desktop_icon_view_quit_menu_item_callback),
	(fm_desktop_icon_view_create_background_context_menu_items):
	* src/file-manager/fm-desktop-icon-view.h:
	* src/nautilus-application.c: (manufactures), (create_object):
	* src/nautilus-application.h:
	* src/nautilus-window-manage-views.c:
	(nautilus_window_load_content_view):
	* src/nautilus.oafinfo:
	First half of putting a quit menu item on the desktop's
	right-click menu. Still need to hook up the quit item.
parent 882f6f9e
2000-07-10 Michael Engber <engber@eazel.com>
* src/file-manager/Makefile.am:
* src/file-manager/fm-desktop-icon-view.c:
(fm_desktop_icon_view_initialize_class),
(fm_desktop_icon_view_initialize),
(fm_desktop_icon_view_quit_menu_item_callback),
(fm_desktop_icon_view_create_background_context_menu_items):
* src/file-manager/fm-desktop-icon-view.h:
* src/nautilus-application.c: (manufactures), (create_object):
* src/nautilus-application.h:
* src/nautilus-window-manage-views.c:
(nautilus_window_load_content_view):
* src/nautilus.oafinfo:
First half of putting a quit menu item on the desktop's
right-click menu. Still need to hook up the quit item.
2000-07-10 Gene Z. Ragan <gzr@eazel.com>
Fixed bug 971, enable undo in file editing part of
......
......@@ -23,6 +23,16 @@
<oaf_attribute name="nautilus:view_as_name" type="string" value="Icons"/>
</oaf_server>
<oaf_server iid="OAFIID:nautilus_file_manager_desktop_icon_view:8d8121b1-0f1e-400b-bf0d-5b0f4555f5e1" type="factory" location="OAFIID:nautilus_factory:bd1e1862-92d7-4391-963e-37583f0daef3">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/Unknown:1.0"/>
<item value="IDL:Bonobo/Control:1.0"/>
<item value="IDL:Nautilus/View:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" value="Nautilus file manager desktop icon view"/>
<oaf_attribute name="description" type="string" value="Nautilus file manager component that shows icons on the the desktop"/>
</oaf_server>
<oaf_server iid="OAFIID:nautilus_file_manager_list_view:521e489d-0662-4ad7-ac3a-832deabe111c" type="factory" location="OAFIID:nautilus_factory:bd1e1862-92d7-4391-963e-37583f0daef3">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/Unknown:1.0"/>
......
......@@ -23,6 +23,16 @@
<oaf_attribute name="nautilus:view_as_name" type="string" value="Icons"/>
</oaf_server>
<oaf_server iid="OAFIID:nautilus_file_manager_desktop_icon_view:8d8121b1-0f1e-400b-bf0d-5b0f4555f5e1" type="factory" location="OAFIID:nautilus_factory:bd1e1862-92d7-4391-963e-37583f0daef3">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/Unknown:1.0"/>
<item value="IDL:Bonobo/Control:1.0"/>
<item value="IDL:Nautilus/View:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" value="Nautilus file manager desktop icon view"/>
<oaf_attribute name="description" type="string" value="Nautilus file manager component that shows icons on the the desktop"/>
</oaf_server>
<oaf_server iid="OAFIID:nautilus_file_manager_list_view:521e489d-0662-4ad7-ac3a-832deabe111c" type="factory" location="OAFIID:nautilus_factory:bd1e1862-92d7-4391-963e-37583f0daef3">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/Unknown:1.0"/>
......
......@@ -31,6 +31,8 @@ libntl_file_manager_la_SOURCES= \
dfos-xfer.h \
dfos.c \
dfos.h \
fm-desktop-icon-view.c \
fm-desktop-icon-view.h \
fm-directory-view.c \
fm-directory-view.h \
fm-error-reporting.c \
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* fm-desktop-icon-view.c - implementation of icon view for managing the desktop.
Copyright (C) 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Mike Engber <engber@eazel.com>
*/
#include <config.h>
#include "fm-desktop-icon-view.h"
#include "fm-icon-view.h"
#include <gnome.h>
#include <libnautilus-extensions/nautilus-gtk-macros.h>
static void fm_desktop_icon_view_initialize (FMDesktopIconView *desktop_icon_view);
static void fm_desktop_icon_view_initialize_class (FMDesktopIconViewClass *klass);
static void fm_desktop_icon_view_create_background_context_menu_items (FMDirectoryView *view, GtkMenu *menu);
NAUTILUS_DEFINE_CLASS_BOILERPLATE (FMDesktopIconView, fm_desktop_icon_view, FM_TYPE_ICON_VIEW);
static void
fm_desktop_icon_view_initialize_class (FMDesktopIconViewClass *klass)
{
GtkObjectClass *object_class;
FMDirectoryViewClass *fm_directory_view_class;
FMIconViewClass *fm_icon_view_class;
object_class = GTK_OBJECT_CLASS (klass);
fm_directory_view_class = FM_DIRECTORY_VIEW_CLASS (klass);
fm_icon_view_class = FM_ICON_VIEW_CLASS (klass);
fm_directory_view_class->create_background_context_menu_items = fm_desktop_icon_view_create_background_context_menu_items;
}
static void
fm_desktop_icon_view_initialize (FMDesktopIconView *desktop_icon_view)
{
}
static void
fm_desktop_icon_view_quit_menu_item_callback (GtkMenuItem *item, gpointer callback_data)
{
/* FIXME bugzilla.eazel.com 1050:
* need to define an interface to tell nautilus to quit, and call it here.
*/
}
static void
fm_desktop_icon_view_create_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,
create_background_context_menu_items,
(view, menu));
menu_item = gtk_menu_item_new_with_label (_("Quit Nautilus"));
gtk_signal_connect (GTK_OBJECT (menu_item),
"activate",
GTK_SIGNAL_FUNC (fm_desktop_icon_view_quit_menu_item_callback),
NULL);
gtk_widget_show (menu_item);
gtk_menu_append (menu, menu_item);
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* fm-icon-view.h - interface for icon view of directory.
Copyright (C) 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Mike Engber <engber@eazel.com>
*/
#ifndef FM_DESKSTOP_ICON_VIEW_H
#define FM_DESKSTOP_ICON_VIEW_H
#include "fm-directory-view.h"
typedef struct FMDesktopIconView FMDesktopIconView;
typedef struct FMDesktopIconViewClass FMDesktopIconViewClass;
#define FM_TYPE_DESKSTOP_ICON_VIEW (fm_desktop_icon_view_get_type ())
#define FM_DESKSTOP_ICON_VIEW(obj) (GTK_CHECK_CAST ((obj), FM_TYPE_DESKSTOP_ICON_VIEW, FMDesktopIconView))
#define FM_DESKSTOP_ICON_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), FM_TYPE_DESKSTOP_ICON_VIEW, FMDesktopIconViewClass))
#define FM_IS_DESKSTOP_ICON_VIEW(obj) (GTK_CHECK_TYPE ((obj), FM_TYPE_DESKSTOP_ICON_VIEW))
#define FM_IS_DESKSTOP_ICON_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), FM_TYPE_DESKSTOP_ICON_VIEW))
typedef struct FMDesktopIconViewDetails FMDesktopIconViewDetails;
struct FMDesktopIconView {
FMDirectoryView parent;
FMDesktopIconViewDetails *details;
};
struct FMDesktopIconViewClass {
FMDirectoryViewClass parent_class;
};
/* GtkObject support */
GtkType fm_desktop_icon_view_get_type (void);
#endif /* FM_DESKSTOP_ICON_VIEW_H */
......@@ -34,6 +34,7 @@
#define nautilus_view_component_H
#include "file-manager/fm-icon-view.h"
#include "file-manager/fm-desktop-icon-view.h"
#include "file-manager/fm-list-view.h"
#include "nautilus-desktop-window.h"
#include "nautilus-first-time-druid.h"
......@@ -48,10 +49,10 @@
#include <libnautilus-extensions/nautilus-undo-manager.h>
#include <liboaf/liboaf.h>
#define FACTORY_IID "OAFIID:nautilus_factory:bd1e1862-92d7-4391-963e-37583f0daef3"
#define ICON_VIEW_IID "OAFIID:nautilus_file_manager_icon_view:42681b21-d5ca-4837-87d2-394d88ecc058"
#define LIST_VIEW_IID "OAFIID:nautilus_file_manager_list_view:521e489d-0662-4ad7-ac3a-832deabe111c"
#define SHELL_IID "OAFIID:nautilus_shell:cd5183b2-3913-4b74-9b8e-10528b0de08d"
#define FACTORY_IID "OAFIID:nautilus_factory:bd1e1862-92d7-4391-963e-37583f0daef3"
#define ICON_VIEW_IID "OAFIID:nautilus_file_manager_icon_view:42681b21-d5ca-4837-87d2-394d88ecc058"
#define LIST_VIEW_IID "OAFIID:nautilus_file_manager_list_view:521e489d-0662-4ad7-ac3a-832deabe111c"
#define SHELL_IID "OAFIID:nautilus_shell:cd5183b2-3913-4b74-9b8e-10528b0de08d"
static CORBA_boolean manufactures (PortableServer_Servant servant,
const CORBA_char *iid,
......@@ -84,6 +85,7 @@ manufactures (PortableServer_Servant servant,
CORBA_Environment *ev)
{
return strcmp (iid, ICON_VIEW_IID) == 0
|| strcmp (iid, NAUTILUS_DESKTOP_ICON_VIEW_IID) == 0
|| strcmp (iid, LIST_VIEW_IID) == 0
|| strcmp (iid, SHELL_IID) == 0;
}
......@@ -102,6 +104,9 @@ create_object (PortableServer_Servant servant,
if (strcmp (iid, ICON_VIEW_IID) == 0) {
directory_view = FM_DIRECTORY_VIEW (gtk_object_new (fm_icon_view_get_type (), NULL));
object = BONOBO_OBJECT (fm_directory_view_get_nautilus_view (directory_view));
} else if (strcmp (iid, NAUTILUS_DESKTOP_ICON_VIEW_IID) == 0) {
directory_view = FM_DIRECTORY_VIEW (gtk_object_new (fm_desktop_icon_view_get_type (), NULL));
object = BONOBO_OBJECT (fm_directory_view_get_nautilus_view (directory_view));
} else if (strcmp (iid, LIST_VIEW_IID) == 0) {
directory_view = FM_DIRECTORY_VIEW (gtk_object_new (fm_list_view_get_type (), NULL));
object = BONOBO_OBJECT (fm_directory_view_get_nautilus_view (directory_view));
......
......@@ -30,6 +30,8 @@ extern "C" {
#pragma }
#endif /* __cplusplus */
#define NAUTILUS_DESKTOP_ICON_VIEW_IID "OAFIID:nautilus_file_manager_desktop_icon_view:8d8121b1-0f1e-400b-bf0d-5b0f4555f5e1"
#define NAUTILUS_TYPE_APPLICATION (nautilus_application_get_type ())
#define NAUTILUS_APPLICATION(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_APPLICATION, NautilusApplication))
#define NAUTILUS_APPLICATION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_APPLICATION, NautilusApplicationClass))
......
......@@ -719,7 +719,22 @@ nautilus_window_load_content_view (NautilusWindow *window,
NautilusViewFrame *content_view;
NautilusViewFrame *new_view;
g_return_val_if_fail(id, NULL);
char *iid;
/* FIXME bugzilla.eazel.com 1243:
* We should use inheritance instead of these special cases
* for the desktop window.
*/
if (NAUTILUS_IS_DESKTOP_WINDOW (window)) {
/* We force the desktop to use a desktop_icon_view. It's simpler
* to do fix it here than trying to make it pick the right view
* in the first place.
*/
iid = NAUTILUS_DESKTOP_ICON_VIEW_IID;
} else {
g_return_val_if_fail(id, NULL);
iid = id->iid;
}
/* Assume new content is not zoomable. When/if it sends a zoom_level_changed
* the zoom_control will get shown.
......@@ -728,7 +743,7 @@ nautilus_window_load_content_view (NautilusWindow *window,
content_view = window->content_view;
if (!NAUTILUS_IS_VIEW_FRAME (content_view)
|| strcmp (nautilus_view_frame_get_iid (content_view), id->iid) != 0) {
|| strcmp (nautilus_view_frame_get_iid (content_view), iid) != 0) {
if (requesting_view != NULL && *requesting_view == window->content_view) {
/* If we are going to be zapping the old view,
......@@ -742,7 +757,7 @@ nautilus_window_load_content_view (NautilusWindow *window,
window->application->undo_manager);
nautilus_window_connect_view (window, new_view);
if (!nautilus_view_frame_load_client (new_view, id->iid)) {
if (!nautilus_view_frame_load_client (new_view, iid)) {
gtk_widget_unref (GTK_WIDGET(new_view));
new_view = NULL;
}
......
......@@ -23,6 +23,16 @@
<oaf_attribute name="nautilus:view_as_name" type="string" value="Icons"/>
</oaf_server>
<oaf_server iid="OAFIID:nautilus_file_manager_desktop_icon_view:8d8121b1-0f1e-400b-bf0d-5b0f4555f5e1" type="factory" location="OAFIID:nautilus_factory:bd1e1862-92d7-4391-963e-37583f0daef3">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/Unknown:1.0"/>
<item value="IDL:Bonobo/Control:1.0"/>
<item value="IDL:Nautilus/View:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" value="Nautilus file manager desktop icon view"/>
<oaf_attribute name="description" type="string" value="Nautilus file manager component that shows icons on the the desktop"/>
</oaf_server>
<oaf_server iid="OAFIID:nautilus_file_manager_list_view:521e489d-0662-4ad7-ac3a-832deabe111c" type="factory" location="OAFIID:nautilus_factory:bd1e1862-92d7-4391-963e-37583f0daef3">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/Unknown:1.0"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment