mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-24 18:25:50 +00:00
reviewed by: Darin Adler <darin@eazel.com> and
Robey Pointer <robey@eazel.com> Fix bugs 5528 (oaf command-line options show up in main program section, not a separate section) and 5510 (descriptions of OAF-specific options in --help are not translated). To do this I had to change the way the oaf popt options are processed in all the places that do so. * components/adapter/main.c: (main): * components/hardware/main.c: (main): * components/help/hyperbola-main.c: (main): * components/image-viewer/Nautilus_View_image.oaf.in: * components/image-viewer/nautilus-image-view.c: (init_server_factory): * components/loser/content/main.c: (main): * components/loser/sidebar/main.c: (main): * components/mozilla/main.c: (main): * components/music/main.c: (main): * components/notes/nautilus-notes.c: (main): * components/rpmview/main.c: (main): * components/services/install/command-line/eazel-alt-install-corba. c: (main): * components/services/install/nautilus-view/main.c: (main): * components/services/login/nautilus-view/main.c: (main): * components/services/summary/nautilus-view/main.c: (main): * components/services/time/command-line/main.c: (main): * components/services/time/nautilus-view/main.c: (main): * components/services/trilobite/libtrilobite/trilobite-core-utils.c : (trilobite_init): * components/shell/shell.c: * components/text/Nautilus_View_text.oaf.in: * components/text/main.c: (main): * components/throbber/main.c: (main): * components/tree/main.c: (main): * libnautilus/nautilus-view-standard-main.c: (nautilus_view_standard_main_multi): * src/Nautilus_shell.oaf.in: * src/nautilus-main.c: (main): * test/test-nautilus-mime-actions-set.c: (main): * test/test-nautilus-mime-actions.c: (main): Register oaf options with gnomelib_register_popt_options and move oaf_init call to before gnome_init to fix the aforementioned bugs.
This commit is contained in:
parent
f938b03d68
commit
2fa1795d4a
46
ChangeLog
46
ChangeLog
|
@ -1,3 +1,49 @@
|
|||
2001-02-01 Maciej Stachowiak <mjs@eazel.com>
|
||||
|
||||
reviewed by: Darin Adler <darin@eazel.com> and
|
||||
Robey Pointer <robey@eazel.com>
|
||||
|
||||
Fix bugs 5528 (oaf command-line options show up in main program
|
||||
section, not a separate section) and 5510 (descriptions of
|
||||
OAF-specific options in --help are not translated). To do this I
|
||||
had to change the way the oaf popt options are processed in all
|
||||
the places that do so.
|
||||
|
||||
* components/adapter/main.c: (main):
|
||||
* components/hardware/main.c: (main):
|
||||
* components/help/hyperbola-main.c: (main):
|
||||
* components/image-viewer/Nautilus_View_image.oaf.in:
|
||||
* components/image-viewer/nautilus-image-view.c:
|
||||
(init_server_factory):
|
||||
* components/loser/content/main.c: (main):
|
||||
* components/loser/sidebar/main.c: (main):
|
||||
* components/mozilla/main.c: (main):
|
||||
* components/music/main.c: (main):
|
||||
* components/notes/nautilus-notes.c: (main):
|
||||
* components/rpmview/main.c: (main):
|
||||
* components/services/install/command-line/eazel-alt-install-corba.
|
||||
c: (main):
|
||||
* components/services/install/nautilus-view/main.c: (main):
|
||||
* components/services/login/nautilus-view/main.c: (main):
|
||||
* components/services/summary/nautilus-view/main.c: (main):
|
||||
* components/services/time/command-line/main.c: (main):
|
||||
* components/services/time/nautilus-view/main.c: (main):
|
||||
* components/services/trilobite/libtrilobite/trilobite-core-utils.c
|
||||
: (trilobite_init):
|
||||
* components/shell/shell.c:
|
||||
* components/text/Nautilus_View_text.oaf.in:
|
||||
* components/text/main.c: (main):
|
||||
* components/throbber/main.c: (main):
|
||||
* components/tree/main.c: (main):
|
||||
* libnautilus/nautilus-view-standard-main.c:
|
||||
(nautilus_view_standard_main_multi):
|
||||
* src/Nautilus_shell.oaf.in:
|
||||
* src/nautilus-main.c: (main):
|
||||
* test/test-nautilus-mime-actions-set.c: (main):
|
||||
* test/test-nautilus-mime-actions.c: (main): Register oaf options
|
||||
with gnomelib_register_popt_options and move oaf_init call to
|
||||
before gnome_init to fix the aforementioned bugs.
|
||||
|
||||
2001-02-01 Rebecca Schulman <rebecka@eazel.com>
|
||||
Fixed bug 5648, bad ui in the indexing info
|
||||
dialog.
|
||||
|
|
|
@ -100,12 +100,13 @@ main (int argc, char *argv[])
|
|||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
/* Initialize libraries. */
|
||||
gnome_init_with_popt_table ("nautilus-adapter", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
g_thread_init (NULL);
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
/* Initialize libraries. */
|
||||
gnome_init ("nautilus-adapter", VERSION,
|
||||
argc, argv);
|
||||
g_thread_init (NULL);
|
||||
gnome_vfs_init ();
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
|
|
|
@ -78,12 +78,12 @@ int main(int argc, char *argv[])
|
|||
|
||||
CORBA_exception_init(&ev);
|
||||
|
||||
gnome_init_with_popt_table("nautilus-hardware-view", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
|
||||
gnome_init ("nautilus-hardware-view", VERSION,
|
||||
argc, argv);
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
/* initialize gnome-vfs, etc */
|
||||
|
|
|
@ -56,12 +56,13 @@ main(int argc, char *argv[])
|
|||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
gnome_init_with_popt_table ("hyperbola", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init ("hyperbola", VERSION,
|
||||
argc, argv);
|
||||
|
||||
gdk_rgb_init ();
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
bonobo_init(orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
<oaf_attribute name="repo_ids" type="stringv">
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
<item value="IDL:Bonobo/Unknown:1.0"/>
|
||||
<item value="IDL:Bonobo/PersistStream:1.0"/>
|
||||
<item value="IDL:Bonobo/Zoomable:1.0"/>
|
||||
<item value="IDL:Bonobo/Persist:1.0"/>
|
||||
<item value="IDL:Nautilus/View:1.0"/>
|
||||
<item value="IDL:Bonobo/PersistStream:1.0"/>
|
||||
</oaf_attribute>
|
||||
<oaf_attribute name="name" type="string" _value="Nautilus Image Viewer"/>
|
||||
<oaf_attribute name="description" type="string" _value="Generic Image Viewer"/>
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
<oaf_attribute name="repo_ids" type="stringv">
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
<item value="IDL:Bonobo/Unknown:1.0"/>
|
||||
<item value="IDL:Bonobo/PersistStream:1.0"/>
|
||||
<item value="IDL:Bonobo/Zoomable:1.0"/>
|
||||
<item value="IDL:Bonobo/Persist:1.0"/>
|
||||
<item value="IDL:Nautilus/View:1.0"/>
|
||||
<item value="IDL:Bonobo/PersistStream:1.0"/>
|
||||
</oaf_attribute>
|
||||
<oaf_attribute name="name" type="string" _value="Nautilus Image Viewer"/>
|
||||
<oaf_attribute name="description" type="string" _value="Generic Image Viewer"/>
|
||||
|
|
|
@ -812,13 +812,13 @@ init_server_factory (int argc, char **argv)
|
|||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
gnome_init_with_popt_table("bonobo-image-generic", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
gdk_rgb_init ();
|
||||
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
oaf_init (argc, argv);
|
||||
|
||||
gnome_init ("bonobo-image-generic", VERSION,
|
||||
argc, argv);
|
||||
gdk_rgb_init ();
|
||||
|
||||
if (!bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL))
|
||||
g_error (_("I could not initialize Bonobo"));
|
||||
|
||||
|
|
|
@ -80,12 +80,12 @@ int main(int argc, char *argv[])
|
|||
|
||||
nautilus_content_loser_maybe_fail ("pre-init");
|
||||
|
||||
gnome_init_with_popt_table("nautilus-content-loser", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
|
||||
gnome_init ("nautilus-content-loser", VERSION,
|
||||
argc, argv);
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
nautilus_content_loser_maybe_fail ("post-init");
|
||||
|
|
|
@ -80,11 +80,11 @@ int main(int argc, char *argv[])
|
|||
|
||||
nautilus_sidebar_loser_maybe_fail ("pre-init");
|
||||
|
||||
gnome_init_with_popt_table("nautilus-sidebar-loser", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init ("nautilus-sidebar-loser", VERSION,
|
||||
argc, argv);
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
|
|
|
@ -131,12 +131,12 @@ main (int argc, char *argv[])
|
|||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
gnome_init_with_popt_table ("nautilus-mozilla-content-view", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
gdk_rgb_init ();
|
||||
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init ("nautilus-mozilla-content-view", VERSION,
|
||||
argc, argv);
|
||||
gdk_rgb_init ();
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 Eazel, Inc
|
||||
*
|
||||
|
@ -17,116 +18,28 @@
|
|||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Author: Andy Hertzfeld
|
||||
* Author: Maciej Stachowiak <mjs@eazel.com>
|
||||
*/
|
||||
|
||||
/* main.c - main function and object activation function for the music view component. */
|
||||
/* main.c - Main function and object activation function for music
|
||||
* view component.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "nautilus-music-view.h"
|
||||
#include <libnautilus/nautilus-view-standard-main.h>
|
||||
|
||||
#include <bonobo.h>
|
||||
#include <gnome.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <libnautilus-extensions/nautilus-debug.h>
|
||||
#include <liboaf/liboaf.h>
|
||||
|
||||
static int object_count = 0;
|
||||
|
||||
static void
|
||||
music_view_object_destroyed(GtkObject *obj)
|
||||
{
|
||||
object_count--;
|
||||
if (object_count <= 0) {
|
||||
gtk_main_quit ();
|
||||
}
|
||||
}
|
||||
|
||||
static BonoboObject *
|
||||
music_view_make_object (BonoboGenericFactory *factory,
|
||||
const char *iid,
|
||||
void *closure)
|
||||
{
|
||||
NautilusMusicView *music_view;
|
||||
NautilusView *nautilus_view;
|
||||
|
||||
if (strcmp (iid, "OAFIID:nautilus_music_view:9456b5d2-60a8-407f-a56e-d561e1821391")) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
music_view = NAUTILUS_MUSIC_VIEW (gtk_object_new (NAUTILUS_TYPE_MUSIC_VIEW, NULL));
|
||||
|
||||
object_count++;
|
||||
|
||||
nautilus_view = nautilus_music_view_get_nautilus_view (music_view);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (nautilus_view), "destroy", music_view_object_destroyed, NULL);
|
||||
|
||||
return BONOBO_OBJECT (nautilus_view);
|
||||
}
|
||||
#define FACTORY_IID "OAFIID:nautilus_music_view_factory:1be0c129-87cd-4daa-9d3a-94397de9bce2"
|
||||
#define VIEW_IID "OAFIID:nautilus_music_view:9456b5d2-60a8-407f-a56e-d561e1821391"
|
||||
#define EXECUTABLE_NAME "nautilus-music-view"
|
||||
#define GET_TYPE_FUNCTION nautilus_music_view_get_type
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
BonoboGenericFactory *factory;
|
||||
CORBA_ORB orb;
|
||||
char *registration_id;
|
||||
|
||||
/* Initialize gettext support */
|
||||
#ifdef ENABLE_NLS /* sadly we need this ifdef because otherwise the following get empty statement warnings */
|
||||
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
#endif
|
||||
|
||||
/* Make criticals and warnings stop in the debugger if
|
||||
* NAUTILUS_DEBUG is set. Unfortunately, this has to be done
|
||||
* explicitly for each domain.
|
||||
*/
|
||||
if (g_getenv ("NAUTILUS_DEBUG") != NULL) {
|
||||
nautilus_make_warnings_and_criticals_stop_in_debugger
|
||||
(G_LOG_DOMAIN, g_log_domain_glib,
|
||||
"Bonobo",
|
||||
"Gdk",
|
||||
"GnomeUI",
|
||||
"GnomeVFS",
|
||||
"GnomeVFS-CORBA",
|
||||
"GnomeVFS-pthread",
|
||||
"Gtk",
|
||||
"Nautilus",
|
||||
"Nautilus-Authenticate",
|
||||
"Nautilus-Tree",
|
||||
"ORBit",
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
gnome_init_with_popt_table("nautilus-music-view", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
|
||||
gdk_rgb_init ();
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
/* initialize gnome-vfs, etc */
|
||||
g_thread_init (NULL);
|
||||
gnome_vfs_init ();
|
||||
|
||||
registration_id = oaf_make_registration_id ("OAFIID:nautilus_music_view_factory:1be0c129-87cd-4daa-9d3a-94397de9bce2", getenv ("DISPLAY"));
|
||||
factory = bonobo_generic_factory_new_multi (registration_id,
|
||||
music_view_make_object,
|
||||
NULL);
|
||||
g_free (registration_id);
|
||||
|
||||
|
||||
do {
|
||||
bonobo_main ();
|
||||
} while (object_count > 0);
|
||||
|
||||
gnome_vfs_shutdown ();
|
||||
|
||||
return 0;
|
||||
return nautilus_view_standard_main (EXECUTABLE_NAME, VERSION,
|
||||
argc, argv,
|
||||
FACTORY_IID, VIEW_IID,
|
||||
nautilus_view_create_from_get_type_function,
|
||||
GET_TYPE_FUNCTION);
|
||||
}
|
||||
|
|
|
@ -31,15 +31,6 @@
|
|||
#include "mpg123.h"
|
||||
#include "pixmaps.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include <esd.h>
|
||||
#include <fcntl.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtkadjustment.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <libgnorba/gnorba.h>
|
||||
#include <libnautilus-extensions/nautilus-background.h>
|
||||
#include <libnautilus-extensions/nautilus-directory-background.h>
|
||||
#include <libnautilus-extensions/nautilus-directory-notify.h>
|
||||
|
@ -59,9 +50,20 @@
|
|||
#include <libnautilus-extensions/nautilus-string.h>
|
||||
#include <libnautilus-extensions/nautilus-string.h>
|
||||
#include <libnautilus/libnautilus.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include <gnome.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gtk/gtkadjustment.h>
|
||||
#include <gtk/gtksignal.h>
|
||||
#include <gtk/gtkeventbox.h>
|
||||
#include <esd.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
|
||||
|
||||
typedef enum {
|
||||
|
@ -71,9 +73,9 @@ typedef enum {
|
|||
PLAYER_NEXT
|
||||
} PlayerState;
|
||||
|
||||
struct _NautilusMusicViewDetails {
|
||||
struct NautilusMusicViewDetails {
|
||||
NautilusFile *file;
|
||||
NautilusView *nautilus_view;
|
||||
GtkWidget *event_box;
|
||||
|
||||
int sort_mode;
|
||||
int selected_index;
|
||||
|
@ -169,7 +171,8 @@ static void nautilus_music_view_drag_data_received (GtkWidget
|
|||
int y,
|
||||
GtkSelectionData *selection_data,
|
||||
guint info,
|
||||
guint time);
|
||||
guint time,
|
||||
gpointer user_data);
|
||||
static void nautilus_music_view_initialize_class (NautilusMusicViewClass *klass);
|
||||
static void nautilus_music_view_initialize (NautilusMusicView *view);
|
||||
static void nautilus_music_view_destroy (GtkObject *object);
|
||||
|
@ -205,21 +208,23 @@ static void set_player_state (NautilusMusicView *music_view,
|
|||
PlayerState state);
|
||||
static void sort_list (NautilusMusicView *music_view);
|
||||
|
||||
static void nautilus_music_view_load_uri (NautilusMusicView *view,
|
||||
const char *uri);
|
||||
|
||||
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusMusicView,
|
||||
nautilus_music_view,
|
||||
GTK_TYPE_EVENT_BOX)
|
||||
NAUTILUS_TYPE_VIEW)
|
||||
|
||||
static void
|
||||
nautilus_music_view_initialize_class (NautilusMusicViewClass *klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
object_class = GTK_OBJECT_CLASS (klass);
|
||||
widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
object_class->destroy = nautilus_music_view_destroy;
|
||||
widget_class->drag_data_received = nautilus_music_view_drag_data_received;
|
||||
}
|
||||
|
||||
/* initialize ourselves by connecting to the location change signal and allocating our subviews */
|
||||
|
@ -235,14 +240,23 @@ nautilus_music_view_initialize (NautilusMusicView *music_view)
|
|||
|
||||
music_view->details = g_new0 (NautilusMusicViewDetails, 1);
|
||||
|
||||
music_view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (music_view));
|
||||
music_view->details->event_box = gtk_event_box_new ();
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (music_view->details->event_box),
|
||||
"drag_data_received",
|
||||
nautilus_music_view_drag_data_received,
|
||||
music_view);
|
||||
|
||||
nautilus_view_construct (NAUTILUS_VIEW (music_view),
|
||||
music_view->details->event_box);
|
||||
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (music_view->details->nautilus_view),
|
||||
gtk_signal_connect (GTK_OBJECT (music_view),
|
||||
"load_location",
|
||||
music_view_load_location_callback,
|
||||
music_view);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (nautilus_get_widget_background (GTK_WIDGET (music_view))),
|
||||
gtk_signal_connect (GTK_OBJECT (nautilus_get_widget_background (GTK_WIDGET (music_view->details->event_box))),
|
||||
"appearance_changed",
|
||||
music_view_background_appearance_changed_callback,
|
||||
music_view);
|
||||
|
@ -253,7 +267,7 @@ nautilus_music_view_initialize (NautilusMusicView *music_view)
|
|||
/* allocate a vbox to contain all of the views */
|
||||
music_view->details->album_container = GTK_VBOX (gtk_vbox_new (FALSE, 8));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (music_view->details->album_container), 4);
|
||||
gtk_container_add (GTK_CONTAINER (music_view), GTK_WIDGET (music_view->details->album_container));
|
||||
gtk_container_add (GTK_CONTAINER (music_view->details->event_box), GTK_WIDGET (music_view->details->album_container));
|
||||
|
||||
/* allocate a widget for the album title */
|
||||
music_view->details->album_title = nautilus_label_new ("");
|
||||
|
@ -344,7 +358,7 @@ nautilus_music_view_initialize (NautilusMusicView *music_view)
|
|||
gtk_signal_connect (GTK_OBJECT (button), "clicked", image_button_callback, music_view);
|
||||
|
||||
/* prepare ourselves to receive dropped objects */
|
||||
gtk_drag_dest_set (GTK_WIDGET (music_view),
|
||||
gtk_drag_dest_set (GTK_WIDGET (music_view->details->event_box),
|
||||
GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP,
|
||||
music_dnd_target_table, NAUTILUS_N_ELEMENTS (music_dnd_target_table), GDK_ACTION_COPY);
|
||||
|
||||
|
@ -757,13 +771,6 @@ image_button_callback (GtkWidget * widget, NautilusMusicView *music_view)
|
|||
}
|
||||
}
|
||||
|
||||
/* Component embedding support */
|
||||
NautilusView *
|
||||
nautilus_music_view_get_nautilus_view (NautilusMusicView *music_view)
|
||||
{
|
||||
return music_view->details->nautilus_view;
|
||||
}
|
||||
|
||||
/* here are some utility routines for reading ID3 tags from mp3 files */
|
||||
|
||||
/* initialize a songinfo structure */
|
||||
|
@ -1190,7 +1197,7 @@ play_current_file (NautilusMusicView *music_view, gboolean from_start)
|
|||
"or your sound card is not configured properly. Try quitting any "
|
||||
"applications that may be blocking use of the sound card."),
|
||||
_("Unable to Play File"),
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (&music_view->parent))));
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (&music_view->details->event_box->parent))));
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -1405,7 +1412,7 @@ xpm_label_box (NautilusMusicView *music_view, char * xpm_data[])
|
|||
|
||||
box = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_border_width (GTK_CONTAINER (box), 2);
|
||||
style = gtk_widget_get_style (GTK_WIDGET (music_view));
|
||||
style = gtk_widget_get_style (GTK_WIDGET (music_view->details->event_box));
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **)xpm_data);
|
||||
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, GDK_PIXBUF_ALPHA_FULL);
|
||||
|
@ -1434,7 +1441,7 @@ xpm_dual_label_box (NautilusMusicView *music_view, char * xpm_data[],
|
|||
box = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_border_width (GTK_CONTAINER (box), 2);
|
||||
|
||||
style = gtk_widget_get_style (GTK_WIDGET (music_view));
|
||||
style = gtk_widget_get_style (GTK_WIDGET (music_view->details->event_box));
|
||||
|
||||
/* create the main pixwidget */
|
||||
pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **)xpm_data);
|
||||
|
@ -1708,7 +1715,7 @@ nautilus_music_view_update (NautilusMusicView *music_view)
|
|||
image_count = 0;
|
||||
|
||||
/* connect the music view background to directory metadata */
|
||||
nautilus_connect_background_to_file_metadata_by_uri (GTK_WIDGET (music_view), uri);
|
||||
nautilus_connect_background_to_file_metadata_by_uri (GTK_WIDGET (music_view->details->event_box), uri);
|
||||
|
||||
/* iterate through the directory, collecting mp3 files and extracting id3 data if present */
|
||||
result = gnome_vfs_directory_list_load (&list, uri,
|
||||
|
@ -1718,7 +1725,7 @@ nautilus_music_view_update (NautilusMusicView *music_view)
|
|||
path = gnome_vfs_get_local_path_from_uri (uri);
|
||||
message = g_strdup_printf (_("Sorry, but there was an error reading %s."), path);
|
||||
nautilus_show_error_dialog (message, _("Can't Read Folder"),
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (music_view))));
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (music_view->details->event_box))));
|
||||
g_free (path);
|
||||
g_free (message);
|
||||
g_free (uri);
|
||||
|
@ -1842,7 +1849,7 @@ nautilus_music_view_update (NautilusMusicView *music_view)
|
|||
|
||||
/* allocate the play controls if necessary */
|
||||
if (music_view->details->play_control_box == NULL) {
|
||||
add_play_controls(music_view);
|
||||
add_play_controls (music_view);
|
||||
}
|
||||
|
||||
music_view_set_selected_song_title (music_view, 0);
|
||||
|
@ -1876,7 +1883,7 @@ nautilus_music_view_load_uri (NautilusMusicView *music_view, const char *uri)
|
|||
nautilus_music_view_update (music_view);
|
||||
|
||||
/* show all the widgets now, since they weren't shown during initialization */
|
||||
gtk_widget_show_all (GTK_WIDGET (music_view));
|
||||
gtk_widget_show_all (GTK_WIDGET (music_view->details->event_box));
|
||||
|
||||
update_play_controls_status (music_view, get_player_state (music_view));
|
||||
|
||||
|
@ -1912,20 +1919,22 @@ music_view_load_location_callback (NautilusView *view,
|
|||
const char *location,
|
||||
NautilusMusicView *music_view)
|
||||
{
|
||||
nautilus_view_report_load_underway (music_view->details->nautilus_view);
|
||||
nautilus_view_report_load_underway (NAUTILUS_VIEW (music_view));
|
||||
nautilus_music_view_load_uri (music_view, location);
|
||||
nautilus_view_report_load_complete (music_view->details->nautilus_view);
|
||||
nautilus_view_report_load_complete (NAUTILUS_VIEW (music_view));
|
||||
}
|
||||
|
||||
/* handle receiving dropped objects */
|
||||
static void
|
||||
nautilus_music_view_drag_data_received (GtkWidget *widget, GdkDragContext *context,
|
||||
int x, int y,
|
||||
GtkSelectionData *selection_data, guint info, guint time)
|
||||
int x, int y,
|
||||
GtkSelectionData *selection_data,
|
||||
guint info, guint time,
|
||||
gpointer user_data)
|
||||
{
|
||||
char **uris;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_MUSIC_VIEW (widget));
|
||||
g_return_if_fail (NAUTILUS_IS_MUSIC_VIEW (user_data));
|
||||
|
||||
uris = g_strsplit (selection_data->data, "\r\n", 0);
|
||||
|
||||
|
|
|
@ -26,11 +26,10 @@
|
|||
#define NAUTILUS_MUSIC_VIEW_H
|
||||
|
||||
#include <libnautilus/nautilus-view.h>
|
||||
#include <gtk/gtkeventbox.h>
|
||||
|
||||
|
||||
typedef struct _NautilusMusicView NautilusMusicView;
|
||||
typedef struct _NautilusMusicViewClass NautilusMusicViewClass;
|
||||
typedef struct NautilusMusicView NautilusMusicView;
|
||||
typedef struct NautilusMusicViewClass NautilusMusicViewClass;
|
||||
|
||||
#define NAUTILUS_TYPE_MUSIC_VIEW (nautilus_music_view_get_type ())
|
||||
#define NAUTILUS_MUSIC_VIEW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_MUSIC_VIEW, NautilusMusicView))
|
||||
|
@ -38,15 +37,15 @@ typedef struct _NautilusMusicViewClass NautilusMusicViewClass;
|
|||
#define NAUTILUS_IS_MUSIC_VIEW(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_MUSIC_VIEW))
|
||||
#define NAUTILUS_IS_MUSIC_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_MUSIC_VIEW))
|
||||
|
||||
typedef struct _NautilusMusicViewDetails NautilusMusicViewDetails;
|
||||
typedef struct NautilusMusicViewDetails NautilusMusicViewDetails;
|
||||
|
||||
struct _NautilusMusicView {
|
||||
GtkEventBox parent;
|
||||
struct NautilusMusicView {
|
||||
NautilusView base;
|
||||
NautilusMusicViewDetails *details;
|
||||
};
|
||||
|
||||
struct _NautilusMusicViewClass {
|
||||
GtkEventBoxClass parent_class;
|
||||
struct NautilusMusicViewClass {
|
||||
NautilusViewClass base;
|
||||
};
|
||||
|
||||
|
||||
|
@ -54,11 +53,4 @@ struct _NautilusMusicViewClass {
|
|||
/* GtkObject support */
|
||||
GtkType nautilus_music_view_get_type (void);
|
||||
|
||||
/* Component embedding support */
|
||||
NautilusView *nautilus_music_view_get_nautilus_view (NautilusMusicView *view);
|
||||
|
||||
/* URI handling */
|
||||
void nautilus_music_view_load_uri (NautilusMusicView *view,
|
||||
const char *uri);
|
||||
|
||||
#endif /* NAUTILUS_MUSIC_VIEW_H */
|
||||
|
|
|
@ -241,12 +241,12 @@ main(int argc, char *argv[])
|
|||
gnome_client_disable_master_connection ();
|
||||
|
||||
/* initialize CORBA and Bonobo */
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init_with_popt_table("nautilus-notes", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
gnome_init ("nautilus-notes", VERSION,
|
||||
argc, argv);
|
||||
gdk_rgb_init ();
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
|
|
|
@ -77,11 +77,10 @@ int main(int argc, char *argv[])
|
|||
textdomain (PACKAGE);
|
||||
#endif
|
||||
|
||||
gnome_init_with_popt_table("nautilus-rpm-view", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
gnome_init ("nautilus-rpm-view", VERSION,
|
||||
argc, argv);
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
|
|
|
@ -79,12 +79,13 @@ main (int argc, char *argv[])
|
|||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
gnome_init_with_popt_table ("nautilus-service-install-view", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init ("nautilus-service-install-view", VERSION,
|
||||
argc, argv);
|
||||
gdk_rgb_init ();
|
||||
|
||||
orb = oaf_init (argc, argv);
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
gconf_init (argc, argv, NULL);
|
||||
|
||||
|
|
|
@ -717,8 +717,9 @@ int main(int argc, char *argv[]) {
|
|||
not having gnome_init called, dies in a
|
||||
X call, yech */
|
||||
#if 0
|
||||
gnome_init_with_popt_table ("Eazel Install", "1.0", argc, argv, options, 0, &ctxt);
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
gnome_init_with_popt_table ("Eazel Install", "1.0", argc, argv, options, 0, &ctxt);
|
||||
if (!bonobo_init (NULL, NULL, NULL)) {
|
||||
g_error ("Could not init bonobo");
|
||||
}
|
||||
|
|
|
@ -79,12 +79,13 @@ main (int argc, char *argv[])
|
|||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
gnome_init_with_popt_table ("nautilus-service-install-view", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init ("nautilus-service-install-view", VERSION,
|
||||
argc, argv);
|
||||
gdk_rgb_init ();
|
||||
|
||||
orb = oaf_init (argc, argv);
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
gconf_init (argc, argv, NULL);
|
||||
|
||||
|
|
|
@ -72,7 +72,6 @@ main (int argc,
|
|||
{ "info", 'i', POPT_ARG_NONE, &info, 0, N_("Display information about current inventory settings."), NULL },
|
||||
{ "upload", 'u', POPT_ARG_NONE, &upload, 0, N_("Upload inventory now, if not up to date."), NULL },
|
||||
/* FIXME bugzilla.eazel.com 5510: These OAF options don't get translated for some reason. */
|
||||
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, &oaf_popt_options, 0, NULL, NULL },
|
||||
{ NULL, '\0', 0, NULL, 0, NULL, NULL }
|
||||
};
|
||||
|
||||
|
|
|
@ -83,12 +83,13 @@ main (int argc, char *argv[])
|
|||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
gnome_init_with_popt_table ("nautilus-change-password-view", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init ("nautilus-change-password-view", VERSION,
|
||||
argc, argv);
|
||||
|
||||
gdk_rgb_init ();
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
|
|
|
@ -86,12 +86,13 @@ main (int argc, char *argv[])
|
|||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
gnome_init_with_popt_table ("nautilus-summary-view", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init ("nautilus-summary-view", VERSION,
|
||||
argc, argv);
|
||||
|
||||
gdk_rgb_init ();
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
|
|
|
@ -86,12 +86,13 @@ main (int argc, char *argv[])
|
|||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
gnome_init_with_popt_table ("nautilus-summary-view", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init ("nautilus-summary-view", VERSION,
|
||||
argc, argv);
|
||||
|
||||
gdk_rgb_init ();
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
|
|
|
@ -74,9 +74,9 @@ int main(int argc, char *argv[]) {
|
|||
TrilobiteRootClient *root_client;
|
||||
|
||||
CORBA_exception_init (&ev);
|
||||
gnomelib_register_popt_table (oaf_popt_options, "OAF options");
|
||||
gnome_init_with_popt_table ("trilobite-eazel-time-service-cli", "1.0",argc, argv, options, 0, NULL);
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
gnome_init_with_popt_table ("trilobite-eazel-time-service-cli", "1.0",argc, argv, options, 0, NULL);
|
||||
|
||||
if (!bonobo_init (NULL, NULL, NULL)) {
|
||||
g_error ("Could not init bonobo");
|
||||
|
|
|
@ -90,12 +90,12 @@ int main(int argc, char *argv[])
|
|||
|
||||
g_message ("In component.");
|
||||
|
||||
gnome_init_with_popt_table("trilobite-eazel-time-view", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init ("trilobite-eazel-time-view", VERSION,
|
||||
argc, argv);
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -175,21 +175,26 @@ trilobite_init (const char *service_name, const char *version_name, const char *
|
|||
CORBA_ORB orb;
|
||||
FILE *logf;
|
||||
char *real_log_filename;
|
||||
const struct poptOption *pass_options;
|
||||
|
||||
pass_options = (options != NULL) ? options : oaf_popt_options;
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
#ifdef TRILOBITE_USE_X
|
||||
gnome_init_with_popt_table (service_name, version_name, argc, argv, pass_options, 0, NULL);
|
||||
if (options) {
|
||||
gnome_init_with_popt_table (service_name, version_name, argc, argv, pass_options, 0, NULL);
|
||||
} else {
|
||||
gnome_init (service_name, version_name, argc, argv);
|
||||
}
|
||||
trilobite_popt = NULL;
|
||||
#else
|
||||
gtk_type_init ();
|
||||
gtk_signal_init ();
|
||||
gnomelib_init (service_name, version_name);
|
||||
gnomelib_register_popt_table (pass_options, service_name);
|
||||
if (options != NULL) {
|
||||
gnomelib_register_popt_table (options, service_name);
|
||||
}
|
||||
trilobite_popt = gnomelib_parse_args (argc, argv, 0);
|
||||
#endif
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
if (!bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL)) {
|
||||
g_error (_("Could not initialize Bonobo"));
|
||||
|
|
|
@ -57,12 +57,13 @@ init_bonobo (int argc, char **argv)
|
|||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
gnome_init_with_popt_table ("xterm-control-factory", "0.0",
|
||||
argc, argv, oaf_popt_options, 0, NULL);
|
||||
gdk_rgb_init ();
|
||||
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init_with_popt_table ("xterm-control-factory", "0.0",
|
||||
argc, argv);
|
||||
gdk_rgb_init ();
|
||||
|
||||
if (!bonobo_init (orb, NULL, NULL))
|
||||
g_error (_("Could not initialize Bonobo"));
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<item value="IDL:Bonobo/Unknown:1.0"/>
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
<item value="IDL:Nautilus/View:1.0"/>
|
||||
<item value="IDL:Bonobo/Zoomable:1.0"/>
|
||||
</oaf_attribute>
|
||||
<oaf_attribute name="name" type="string" _value="Text view"/>
|
||||
<oaf_attribute name="description" type="string" _value="Text view"/>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<item value="IDL:Bonobo/Unknown:1.0"/>
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
<item value="IDL:Nautilus/View:1.0"/>
|
||||
<item value="IDL:Bonobo/Zoomable:1.0"/>
|
||||
</oaf_attribute>
|
||||
<oaf_attribute name="name" type="string" _value="Text view"/>
|
||||
<oaf_attribute name="description" type="string" _value="Text view"/>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<item value="IDL:Bonobo/Unknown:1.0"/>
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
<item value="IDL:Nautilus/View:1.0"/>
|
||||
<item value="IDL:Bonobo/Zoomable:1.0"/>
|
||||
</oaf_attribute>
|
||||
<oaf_attribute name="name" type="string" _value="Text view"/>
|
||||
<oaf_attribute name="description" type="string" _value="Text view"/>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 Eazel, Inc
|
||||
*
|
||||
|
@ -17,116 +18,28 @@
|
|||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Author: Andy Hertzfeld
|
||||
* Author: Maciej Stachowiak <mjs@eazel.com>
|
||||
*/
|
||||
|
||||
/* main.c - main function and object activation function for the text view component. */
|
||||
/* main.c - Main function and object activation function for text
|
||||
* view component.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "nautilus-text-view.h"
|
||||
#include <libnautilus/nautilus-view-standard-main.h>
|
||||
|
||||
#include <bonobo.h>
|
||||
#include <gnome.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <libnautilus-extensions/nautilus-debug.h>
|
||||
#include <liboaf/liboaf.h>
|
||||
|
||||
static int object_count = 0;
|
||||
|
||||
static void
|
||||
text_view_object_destroyed(GtkObject *obj)
|
||||
{
|
||||
object_count--;
|
||||
if (object_count <= 0) {
|
||||
gtk_main_quit ();
|
||||
}
|
||||
}
|
||||
|
||||
static BonoboObject *
|
||||
text_view_make_object (BonoboGenericFactory *factory,
|
||||
const char *iid,
|
||||
void *closure)
|
||||
{
|
||||
NautilusTextView *text_view;
|
||||
NautilusView *nautilus_view;
|
||||
|
||||
if (strcmp (iid, "OAFIID:nautilus_text_view:fa466311-17c1-435c-8231-c9fc434b6437")) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
text_view = NAUTILUS_TEXT_VIEW (gtk_object_new (NAUTILUS_TYPE_TEXT_VIEW, NULL));
|
||||
|
||||
object_count++;
|
||||
|
||||
nautilus_view = nautilus_text_view_get_nautilus_view (text_view);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (nautilus_view), "destroy", text_view_object_destroyed, NULL);
|
||||
|
||||
return BONOBO_OBJECT (nautilus_view);
|
||||
}
|
||||
#define FACTORY_IID "OAFIID:nautilus_text_view_factory:124ae209-d356-418f-8757-54e071cb3a21"
|
||||
#define VIEW_IID "OAFIID:nautilus_text_view:fa466311-17c1-435c-8231-c9fc434b6437"
|
||||
#define EXECUTABLE_NAME "nautilus-text-view"
|
||||
#define GET_TYPE_FUNCTION nautilus_text_view_get_type
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
BonoboGenericFactory *factory;
|
||||
CORBA_ORB orb;
|
||||
char *registration_id;
|
||||
|
||||
/* Initialize gettext support */
|
||||
#ifdef ENABLE_NLS /* sadly we need this ifdef because otherwise the following get empty statement warnings */
|
||||
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
#endif
|
||||
|
||||
/* Make criticals and warnings stop in the debugger if
|
||||
* NAUTILUS_DEBUG is set. Unfortunately, this has to be done
|
||||
* explicitly for each domain.
|
||||
*/
|
||||
if (g_getenv ("NAUTILUS_DEBUG") != NULL) {
|
||||
nautilus_make_warnings_and_criticals_stop_in_debugger
|
||||
(G_LOG_DOMAIN, g_log_domain_glib,
|
||||
"Bonobo",
|
||||
"Gdk",
|
||||
"GnomeUI",
|
||||
"GnomeVFS",
|
||||
"GnomeVFS-CORBA",
|
||||
"GnomeVFS-pthread",
|
||||
"Gtk",
|
||||
"Nautilus",
|
||||
"Nautilus-Authenticate",
|
||||
"Nautilus-Tree",
|
||||
"ORBit",
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
gnome_init_with_popt_table("nautilus-text-view", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
gdk_rgb_init ();
|
||||
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
/* initialize gnome-vfs, etc */
|
||||
g_thread_init (NULL);
|
||||
gnome_vfs_init ();
|
||||
|
||||
registration_id = oaf_make_registration_id ("OAFIID:nautilus_text_view_factory:124ae209-d356-418f-8757-54e071cb3a21", getenv ("DISPLAY"));
|
||||
factory = bonobo_generic_factory_new_multi (registration_id,
|
||||
text_view_make_object,
|
||||
NULL);
|
||||
g_free (registration_id);
|
||||
|
||||
|
||||
do {
|
||||
bonobo_main ();
|
||||
} while (object_count > 0);
|
||||
|
||||
gnome_vfs_shutdown ();
|
||||
|
||||
return 0;
|
||||
return nautilus_view_standard_main (EXECUTABLE_NAME, VERSION,
|
||||
argc, argv,
|
||||
FACTORY_IID, VIEW_IID,
|
||||
nautilus_view_create_from_get_type_function,
|
||||
GET_TYPE_FUNCTION);
|
||||
}
|
||||
|
|
|
@ -48,19 +48,20 @@
|
|||
#include <libnautilus-extensions/nautilus-stock-dialogs.h>
|
||||
|
||||
#include <gnome.h>
|
||||
#include <gtk/gtkeventbox.h>
|
||||
#include <libgnomevfs/gnome-vfs.h>
|
||||
#include <libgnorba/gnorba.h>
|
||||
#include <ghttp.h>
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include <ghttp.h>
|
||||
|
||||
#define MAX_SERVICE_ITEMS 32
|
||||
#define TEXT_VIEW_CHUNK_SIZE 65536
|
||||
#define MAX_FILE_SIZE 1024*1024
|
||||
|
||||
struct _NautilusTextViewDetails {
|
||||
struct NautilusTextViewDetails {
|
||||
NautilusFile *file;
|
||||
NautilusView *nautilus_view;
|
||||
GtkWidget *event_box;
|
||||
GnomeVFSAsyncHandle *file_handle;
|
||||
char *buffer;
|
||||
|
||||
|
@ -116,9 +117,13 @@ static void zoomable_zoom_out_callback (BonoboZoomable *zoomable,
|
|||
static void zoomable_zoom_to_fit_callback (BonoboZoomable *zoomable,
|
||||
NautilusTextView *directory_view);
|
||||
|
||||
static void nautilus_text_view_load_uri (NautilusTextView *view,
|
||||
const char *uri);
|
||||
|
||||
|
||||
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusTextView,
|
||||
nautilus_text_view,
|
||||
GTK_TYPE_EVENT_BOX)
|
||||
NAUTILUS_TYPE_VIEW)
|
||||
|
||||
static float text_view_preferred_zoom_levels[] = { .25, .50, .75, 1.0, 1.5, 2.0, 4.0 };
|
||||
static int text_view_preferred_font_sizes[] = { 9, 10, 12, 14, 18, 24, 36 };
|
||||
|
@ -130,10 +135,8 @@ static void
|
|||
nautilus_text_view_initialize_class (NautilusTextViewClass *klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
object_class = GTK_OBJECT_CLASS (klass);
|
||||
widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
object_class->destroy = nautilus_text_view_destroy;
|
||||
}
|
||||
|
@ -147,7 +150,9 @@ nautilus_text_view_initialize (NautilusTextView *text_view)
|
|||
|
||||
text_view->details = g_new0 (NautilusTextViewDetails, 1);
|
||||
|
||||
text_view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (text_view));
|
||||
text_view->details->event_box = gtk_event_box_new ();
|
||||
|
||||
nautilus_view_construct (NAUTILUS_VIEW (text_view), text_view->details->event_box);
|
||||
|
||||
/* set up the zoomable interface */
|
||||
text_view->details->zoomable = bonobo_zoomable_new ();
|
||||
|
@ -167,23 +172,24 @@ nautilus_text_view_initialize (NautilusTextView *text_view)
|
|||
text_view_preferred_zoom_levels, NULL,
|
||||
NAUTILUS_N_ELEMENTS (text_view_preferred_zoom_levels));
|
||||
|
||||
bonobo_object_add_interface (BONOBO_OBJECT (text_view->details->nautilus_view),
|
||||
bonobo_object_add_interface (BONOBO_OBJECT (text_view),
|
||||
BONOBO_OBJECT (text_view->details->zoomable));
|
||||
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (text_view->details->nautilus_view),
|
||||
gtk_signal_connect (GTK_OBJECT (text_view),
|
||||
"load_location",
|
||||
text_view_load_location_callback,
|
||||
text_view);
|
||||
|
||||
/* FIXME: eventually, get this from preferences */
|
||||
/* set up the default font */
|
||||
text_view->details->font_name = g_strdup ("helvetica"); /* eventually, get this from preferences */
|
||||
text_view->details->font_name = g_strdup ("helvetica");
|
||||
|
||||
/* allocate a vbox to contain the text widget */
|
||||
|
||||
text_view->details->container = gtk_vbox_new (FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (text_view->details->container), 0);
|
||||
gtk_container_add (GTK_CONTAINER (text_view), GTK_WIDGET (text_view->details->container));
|
||||
gtk_container_add (GTK_CONTAINER (text_view->details->event_box), GTK_WIDGET (text_view->details->container));
|
||||
|
||||
/* allocate the text object */
|
||||
text_view->details->text_display = gtk_text_new (NULL, NULL);
|
||||
|
@ -211,13 +217,13 @@ nautilus_text_view_initialize (NautilusTextView *text_view)
|
|||
|
||||
/* get notified when we are activated so we can merge in our menu items */
|
||||
gtk_signal_connect (GTK_OBJECT (nautilus_view_get_bonobo_control
|
||||
(text_view->details->nautilus_view)),
|
||||
(NAUTILUS_VIEW (text_view))),
|
||||
"activate",
|
||||
merge_bonobo_menu_items,
|
||||
text_view);
|
||||
|
||||
/* finally, we can show everything */
|
||||
gtk_widget_show_all (GTK_WIDGET (text_view));
|
||||
gtk_widget_show_all (GTK_WIDGET (text_view->details->event_box));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -251,13 +257,6 @@ nautilus_text_view_destroy (GtkObject *object)
|
|||
}
|
||||
|
||||
|
||||
/* Component embedding support */
|
||||
NautilusView *
|
||||
nautilus_text_view_get_nautilus_view (NautilusTextView *text_view)
|
||||
{
|
||||
return text_view->details->nautilus_view;
|
||||
}
|
||||
|
||||
/* this routine is called when we're finished reading to deallocate the buffer and
|
||||
* put up an error message if necessary
|
||||
*/
|
||||
|
@ -383,8 +382,9 @@ nautilus_text_view_update (NautilusTextView *text_view)
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
nautilus_text_view_load_uri (NautilusTextView *text_view, const char *uri)
|
||||
static void
|
||||
nautilus_text_view_load_uri (NautilusTextView *text_view,
|
||||
const char *uri)
|
||||
{
|
||||
|
||||
detach_file (text_view);
|
||||
|
@ -398,9 +398,9 @@ text_view_load_location_callback (NautilusView *view,
|
|||
const char *location,
|
||||
NautilusTextView *text_view)
|
||||
{
|
||||
nautilus_view_report_load_underway (text_view->details->nautilus_view);
|
||||
nautilus_view_report_load_underway (NAUTILUS_VIEW (text_view));
|
||||
nautilus_text_view_load_uri (text_view, location);
|
||||
nautilus_view_report_load_complete (text_view->details->nautilus_view);
|
||||
nautilus_view_report_load_complete (NAUTILUS_VIEW (text_view));
|
||||
}
|
||||
|
||||
/* update the font and redraw */
|
||||
|
@ -475,7 +475,7 @@ handle_service_menu_item (BonoboUIComponent *ui, gpointer user_data, const char
|
|||
uri = g_strdup_printf (parameters->service_template, mapped_text);
|
||||
|
||||
/* goto the url */
|
||||
nautilus_view_open_location_in_this_window (parameters->text_view->details->nautilus_view, uri);
|
||||
nautilus_view_open_location_in_this_window (NAUTILUS_VIEW (parameters->text_view), uri);
|
||||
|
||||
g_free (uri);
|
||||
g_free (selected_text);
|
||||
|
@ -692,7 +692,7 @@ update_service_menu_items (GtkWidget *widget, GdkEventButton *event, gpointer *u
|
|||
int index;
|
||||
|
||||
text_view = NAUTILUS_TEXT_VIEW (user_data);
|
||||
control = nautilus_view_get_bonobo_control (text_view->details->nautilus_view);
|
||||
control = nautilus_view_get_bonobo_control (NAUTILUS_VIEW (text_view));
|
||||
ui = bonobo_control_get_ui_component (control);
|
||||
|
||||
/* determine if there is a selection */
|
||||
|
@ -729,7 +729,7 @@ merge_bonobo_menu_items (BonoboControl *control, gboolean state, gpointer user_d
|
|||
text_view = NAUTILUS_TEXT_VIEW (user_data);
|
||||
|
||||
if (state) {
|
||||
nautilus_view_set_up_ui (text_view->details->nautilus_view,
|
||||
nautilus_view_set_up_ui (NAUTILUS_VIEW (text_view),
|
||||
DATADIR,
|
||||
"nautilus-text-view-ui.xml",
|
||||
"nautilus-text-view");
|
||||
|
|
|
@ -22,13 +22,14 @@
|
|||
|
||||
/* header file for the text view component */
|
||||
|
||||
#ifndef NAUTILUS_MUSIC_VIEW_H
|
||||
#define NAUTILUS_MUSIC_VIEW_H
|
||||
#ifndef NAUTILUS_TEXT_VIEW_H
|
||||
#define NAUTILUS_TEXT_VIEW_H
|
||||
|
||||
#include <libnautilus/nautilus-view.h>
|
||||
#include <gtk/gtkeventbox.h>
|
||||
typedef struct _NautilusTextView NautilusTextView;
|
||||
typedef struct _NautilusTextViewClass NautilusTextViewClass;
|
||||
|
||||
|
||||
typedef struct NautilusTextView NautilusTextView;
|
||||
typedef struct NautilusTextViewClass NautilusTextViewClass;
|
||||
|
||||
#define NAUTILUS_TYPE_TEXT_VIEW (nautilus_text_view_get_type ())
|
||||
#define NAUTILUS_TEXT_VIEW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_TEXT_VIEW, NautilusTextView))
|
||||
|
@ -36,15 +37,15 @@ typedef struct _NautilusTextViewClass NautilusTextViewClass;
|
|||
#define NAUTILUS_IS_TEXT_VIEW(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_TEXT_VIEW))
|
||||
#define NAUTILUS_IS_TEXT_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_TEXT_VIEW))
|
||||
|
||||
typedef struct _NautilusTextViewDetails NautilusTextViewDetails;
|
||||
typedef struct NautilusTextViewDetails NautilusTextViewDetails;
|
||||
|
||||
struct _NautilusTextView {
|
||||
GtkEventBox parent;
|
||||
struct NautilusTextView {
|
||||
NautilusView base;
|
||||
NautilusTextViewDetails *details;
|
||||
};
|
||||
|
||||
struct _NautilusTextViewClass {
|
||||
GtkEventBoxClass parent_class;
|
||||
struct NautilusTextViewClass {
|
||||
NautilusViewClass base;
|
||||
};
|
||||
|
||||
|
||||
|
@ -52,11 +53,5 @@ struct _NautilusTextViewClass {
|
|||
/* GtkObject support */
|
||||
GtkType nautilus_text_view_get_type (void);
|
||||
|
||||
/* Component embedding support */
|
||||
NautilusView *nautilus_text_view_get_nautilus_view (NautilusTextView *view);
|
||||
|
||||
/* URI handling */
|
||||
void nautilus_text_view_load_uri (NautilusTextView *view,
|
||||
const char *uri);
|
||||
|
||||
#endif /* NAUTILUS_TEXT_VIEW_H */
|
||||
|
|
|
@ -97,14 +97,14 @@ main (int argc, char *argv[])
|
|||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
gnome_init_with_popt_table("nautilus-throbber", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init ("nautilus-throbber", VERSION,
|
||||
argc, argv);
|
||||
|
||||
gdk_rgb_init ();
|
||||
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
/* initialize gnome-vfs, etc */
|
||||
|
|
|
@ -104,13 +104,13 @@ main (int argc, char *argv[])
|
|||
|
||||
g_thread_init (NULL);
|
||||
|
||||
gnome_init_with_popt_table("nautilus-tree-view", VERSION,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
gdk_rgb_init ();
|
||||
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init_with_popt_table("nautilus-tree-view", VERSION,
|
||||
argc, argv);
|
||||
gdk_rgb_init ();
|
||||
|
||||
gnome_vfs_init ();
|
||||
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
|
|
@ -113,12 +113,13 @@ nautilus_view_standard_main_multi (const char *executable_name,
|
|||
/* Disable session manager connection */
|
||||
gnome_client_disable_master_connection ();
|
||||
|
||||
/* Initialize libraries. */
|
||||
gnome_init_with_popt_table (executable_name, version,
|
||||
argc, argv,
|
||||
oaf_popt_options, 0, NULL);
|
||||
gdk_rgb_init ();
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
/* Initialize libraries. */
|
||||
gnome_init (executable_name, version,
|
||||
argc, argv);
|
||||
gdk_rgb_init ();
|
||||
gnome_vfs_init ();
|
||||
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
<item value="IDL:Bonobo/Unknown:1.0"/>
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
<item value="IDL:Nautilus/View:1.0"/>
|
||||
<item value="IDL:Bonobo/Zoomable: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"/>
|
||||
|
@ -42,6 +43,7 @@
|
|||
<item value="IDL:Bonobo/Unknown:1.0"/>
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
<item value="IDL:Nautilus/View:1.0"/>
|
||||
<item value="IDL:Bonobo/Zoomable:1.0"/>
|
||||
</oaf_attribute>
|
||||
<oaf_attribute name="name" type="string" _value="Nautilus file manager list view"/>
|
||||
<oaf_attribute name="description" type="string" _value="Nautilus file manager component that shows a scrollable list"/>
|
||||
|
@ -61,6 +63,7 @@
|
|||
<item value="IDL:Bonobo/Unknown:1.0"/>
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
<item value="IDL:Nautilus/View:1.0"/>
|
||||
<item value="IDL:Bonobo/Zoomable:1.0"/>
|
||||
</oaf_attribute>
|
||||
<oaf_attribute name="name" type="string" _value="Nautilus file manager search results list view"/>
|
||||
<oaf_attribute name="description" type="string" _value="Nautilus file manager component that shows a scrollable list for search results"/>
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
<item value="IDL:Bonobo/Unknown:1.0"/>
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
<item value="IDL:Nautilus/View:1.0"/>
|
||||
<item value="IDL:Bonobo/Zoomable: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"/>
|
||||
|
@ -42,6 +43,7 @@
|
|||
<item value="IDL:Bonobo/Unknown:1.0"/>
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
<item value="IDL:Nautilus/View:1.0"/>
|
||||
<item value="IDL:Bonobo/Zoomable:1.0"/>
|
||||
</oaf_attribute>
|
||||
<oaf_attribute name="name" type="string" _value="Nautilus file manager list view"/>
|
||||
<oaf_attribute name="description" type="string" _value="Nautilus file manager component that shows a scrollable list"/>
|
||||
|
@ -61,6 +63,7 @@
|
|||
<item value="IDL:Bonobo/Unknown:1.0"/>
|
||||
<item value="IDL:Bonobo/Control:1.0"/>
|
||||
<item value="IDL:Nautilus/View:1.0"/>
|
||||
<item value="IDL:Bonobo/Zoomable:1.0"/>
|
||||
</oaf_attribute>
|
||||
<oaf_attribute name="name" type="string" _value="Nautilus file manager search results list view"/>
|
||||
<oaf_attribute name="description" type="string" _value="Nautilus file manager component that shows a scrollable list for search results"/>
|
||||
|
|
|
@ -150,10 +150,6 @@ main (int argc, char *argv[])
|
|||
N_("Quit Nautilus."), NULL },
|
||||
{ "restart", '\0', POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN, &restart_shell, 0,
|
||||
N_("Restart Nautilus."), NULL },
|
||||
/* FIXME bugzilla.eazel.com 5228: The help for these OAF options
|
||||
* should be in a separate section.
|
||||
*/
|
||||
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, &oaf_popt_options, 0, NULL, NULL },
|
||||
{ NULL, '\0', 0, NULL, 0, NULL, NULL }
|
||||
};
|
||||
|
||||
|
@ -195,6 +191,11 @@ main (int argc, char *argv[])
|
|||
no_default_window = FALSE;
|
||||
perform_self_check = FALSE;
|
||||
restart_shell = FALSE;
|
||||
|
||||
gnomelib_register_popt_table (oaf_popt_options,
|
||||
oaf_get_popt_table_name ());
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
gnome_init_with_popt_table ("nautilus", VERSION,
|
||||
argc, argv, options, 0,
|
||||
&popt_context);
|
||||
|
@ -227,7 +228,7 @@ main (int argc, char *argv[])
|
|||
LIBXML_TEST_VERSION
|
||||
g_atexit (xmlCleanupParser);
|
||||
g_thread_init (NULL);
|
||||
orb = oaf_init (argc, argv);
|
||||
|
||||
if (g_getenv ("NAUTILUS_ENABLE_TEST_COMPONENTS") != NULL) {
|
||||
oaf_set_test_components_enabled (TRUE);
|
||||
}
|
||||
|
|
|
@ -110,8 +110,10 @@ main (int argc, char **argv)
|
|||
NautilusFile *file;
|
||||
GList *attributes;
|
||||
|
||||
g_thread_init (NULL);
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
oaf_init (argc, argv);
|
||||
|
||||
g_thread_init (NULL);
|
||||
gnome_vfs_init ();
|
||||
gnome_init ("test-nautilus-mime-actions-set", "0.0",
|
||||
argc, argv);
|
||||
|
|
|
@ -155,8 +155,10 @@ main (int argc, char **argv)
|
|||
GList *attributes;
|
||||
|
||||
g_thread_init (NULL);
|
||||
oaf_init (argc, argv);
|
||||
gnome_vfs_init ();
|
||||
|
||||
gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
|
||||
oaf_init (argc, argv);
|
||||
gnome_init("test-nautilus-mime-actions", "0.0",
|
||||
argc, argv);
|
||||
|
||||
|
|
Loading…
Reference in a new issue