diff options
author | Andreas Proschofsky <suka@gentoo.org> | 2005-01-16 15:05:34 +0000 |
---|---|---|
committer | Andreas Proschofsky <suka@gentoo.org> | 2005-01-16 15:05:34 +0000 |
commit | f99d55b266d61b07d6c5854e245d821c45a455a5 (patch) | |
tree | 01b18824b420634c1279f627d0e9c6fed7022ecc /app-office/ooqstart-gnome | |
parent | update changelog (diff) | |
download | historical-f99d55b266d61b07d6c5854e245d821c45a455a5.tar.gz historical-f99d55b266d61b07d6c5854e245d821c45a455a5.tar.bz2 historical-f99d55b266d61b07d6c5854e245d821c45a455a5.zip |
Initial commit
Package-Manager: portage-2.0.51-r13
Diffstat (limited to 'app-office/ooqstart-gnome')
-rw-r--r-- | app-office/ooqstart-gnome/ChangeLog | 9 | ||||
-rw-r--r-- | app-office/ooqstart-gnome/Manifest | 6 | ||||
-rw-r--r-- | app-office/ooqstart-gnome/files/digest-ooqstart-gnome-0.8.3 | 1 | ||||
-rw-r--r-- | app-office/ooqstart-gnome/files/gnome-ooqstart.png | bin | 0 -> 3962 bytes | |||
-rw-r--r-- | app-office/ooqstart-gnome/files/gnome2update.patch | 861 | ||||
-rw-r--r-- | app-office/ooqstart-gnome/metadata.xml | 6 | ||||
-rw-r--r-- | app-office/ooqstart-gnome/ooqstart-gnome-0.8.3.ebuild | 46 |
7 files changed, 929 insertions, 0 deletions
diff --git a/app-office/ooqstart-gnome/ChangeLog b/app-office/ooqstart-gnome/ChangeLog new file mode 100644 index 000000000000..d81b8d5159f1 --- /dev/null +++ b/app-office/ooqstart-gnome/ChangeLog @@ -0,0 +1,9 @@ +# ChangeLog for app-office/ooqstart-gnome +# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-office/ooqstart-gnome/ChangeLog,v 1.1 2005/01/16 15:05:34 suka Exp $ + + 16 Jan 2005; Andreas Proschofsky <suka@gentoo.org> + +files/gnome-ooqstart.png, +files/gnome2update.patch: + Initial commit, ebuild and patch done by myself, based on the work of Debian + and Novell + diff --git a/app-office/ooqstart-gnome/Manifest b/app-office/ooqstart-gnome/Manifest new file mode 100644 index 000000000000..3cb9e08dd702 --- /dev/null +++ b/app-office/ooqstart-gnome/Manifest @@ -0,0 +1,6 @@ +MD5 34d36a1f62d06ad8b85cd169750d3973 ChangeLog 423 +MD5 6e27642eb774b668fe48a47e475f2495 metadata.xml 400 +MD5 9904d9708aab588e2a66aa1d28103847 ooqstart-gnome-0.8.3.ebuild 1118 +MD5 0cfd93a44ae5d8dac0041e60de7caec5 files/gnome2update.patch 30265 +MD5 b8e5e4d8a4016a754ab52481fc66a00d files/gnome-ooqstart.png 3962 +MD5 d262aad066c0dd58486d7a8a095b598d files/digest-ooqstart-gnome-0.8.3 62 diff --git a/app-office/ooqstart-gnome/files/digest-ooqstart-gnome-0.8.3 b/app-office/ooqstart-gnome/files/digest-ooqstart-gnome-0.8.3 new file mode 100644 index 000000000000..e67ad0f13bcd --- /dev/null +++ b/app-office/ooqstart-gnome/files/digest-ooqstart-gnome-0.8.3 @@ -0,0 +1 @@ +MD5 f3c15a29e8bbd7780972e69f11f564a4 ooqstart-0.8.3.tgz 72272 diff --git a/app-office/ooqstart-gnome/files/gnome-ooqstart.png b/app-office/ooqstart-gnome/files/gnome-ooqstart.png Binary files differnew file mode 100644 index 000000000000..e9b00c5b722e --- /dev/null +++ b/app-office/ooqstart-gnome/files/gnome-ooqstart.png diff --git a/app-office/ooqstart-gnome/files/gnome2update.patch b/app-office/ooqstart-gnome/files/gnome2update.patch new file mode 100644 index 000000000000..0305208bf1ba --- /dev/null +++ b/app-office/ooqstart-gnome/files/gnome2update.patch @@ -0,0 +1,861 @@ +--- ooqstart-0.8.3.orig/Makefile ++++ ooqstart-0.8.3/Makefile +@@ -38,7 +38,7 @@ + $(CXX) -o $@ $^ + + $(GNOME_TARGET) : $(GNOME_OBJECTS) +- $(CXX) -o $@ $^ `gnome-config --libs applets gdk_pixbuf` ++ $(CXX) -o $@ $^ `pkg-config --libs libpanelapplet-2.0` + + $(KDE_TARGET) : $(KDE_OBJECTS) + $(CXX) -o $@ $^ +@@ -53,7 +53,7 @@ + $(CXX) $(CFLAGS) -O2 -o $@ -c $< + + gnome.o : gnome/gnome.cxx +- $(CXX) $(CFLAGS) `gnome-config --cflags gnomeui gnorba gdk_pixbuf` -O2 -o $@ -c $< ++ $(CXX) $(CFLAGS) `pkg-config --cflags libpanelapplet-2.0` -O2 -o $@ -c $< + + %.o : %.cxx + $(CXX) $(CFLAGS) -O2 -o $@ -c $< +@@ -64,20 +64,14 @@ + ##################################################################### + ROOT= + PREFIX=$(ROOT)/usr +-BIN=$(PREFIX)/bin + SHARE=$(PREFIX)/share +-ETC=$(ROOT)/etc ++LIB=$(PREFIX)/lib ++LIBEXEC=$(PREFIX)/libexec + + install-gnome: +- install -D -s -m 755 $(GNOME_TARGET) $(BIN)/$(GNOME_TARGET) +- install -D -m 644 gnome/ooqstart_applet.desktop \ +- $(SHARE)/applets/Utility/ooqstart_applet.desktop +- install -D -m 644 ooqstart.png \ +- $(SHARE)/pixmaps/gnome-ooqstart.png +- install -D -m 644 gnome/ooqstart_applet.gnorba \ +- $(ETC)/CORBA/servers/ooqstart_applet.gnorba +- mkdir -p $(SHARE)/gnome/help/ooqstart_applet/C +- install -D -m 644 help/* $(SHARE)/gnome/help/ooqstart_applet/C ++ install -D -s -m 0755 $(GNOME_TARGET) $(LIBEXEC)/ooqstart_applet2 ++ install -D -m 0644 gnome/GNOME_OOQStartApplet.server \ ++ $(LIB)/bonobo/servers/GNOME_OOQStartApplet.server + + + ##################################################################### +--- ooqstart-0.8.3.orig/console/console.cxx ++++ ooqstart-0.8.3/console/console.cxx +@@ -26,12 +26,12 @@ + ========================================================================*/ + int main (int argc, char **argv) { + if (argc != 2) { +- printf("usage: ooqstart OPENOFFICE_BASE_DIR\n"); ++ printf ("usage: ooqstart OPENOFFICE_PROGRAM_PATH\n"); + return 1; + } + + Model model; +- model.setOpenOfficeDir(argv[1]); ++ model.setOpenOfficeProgram (argv[1]); + if (!model.isValid()) { + printf("error: Open Office executable not found in %s\n", argv[1]); + return 1; +--- ooqstart-0.8.3.orig/gnome/gnome.cxx ++++ ooqstart-0.8.3/gnome/gnome.cxx +@@ -15,7 +15,8 @@ + | INCLUDES + ========================================================================*/ + extern "C" { +-#include <applet-widget.h> ++#include <panel-applet.h> ++#include <gnome.h> + #include <gdk-pixbuf/gdk-pixbuf.h> + #include <X11/SM/SMlib.h> + } +@@ -25,12 +26,18 @@ + #include "ooqstart-wait.xpm" + #include "ooqstart-off.xpm" + +- + /*========================================================================= + | CONSTANTS + ========================================================================*/ +-#define PACKAGE "gnome-applets" ++#define PACKAGE "ooqstart" ++#define GETTEXT_PACKAGE "ooqstart" ++ ++#define OOFFICE_DEFAULT_PATH "/usr/bin/ooffice" + ++#define GC_PROG_PATH "/ooqstart-applet/paths/program" ++#define GC_APPLET_ENABLE "/ooqstart-applet/prefs/enable" ++ ++#define oq_debug(format, args...) + + /*========================================================================= + | STATIC GLOBALS +@@ -38,7 +38,6 @@ + static GtkWidget *propwindow; + static GtkWidget *applet; + static GtkWidget *entry; +-static GtkWidget *checkbox; + + static GtkWidget *tile; + static GtkWidget *tilepixmap; +@@ -51,21 +58,30 @@ + enum IconState { ICON_NONE, ICON_OFF, ICON_WAIT, ICON_ON }; + static IconState iconState = ICON_NONE; + ++static Model model; + + /*========================================================================= + | LAUNCHERS + ========================================================================*/ +-static void startWriter (AppletWidget *, gpointer pModel) { +- ((Model *)pModel)->startWriter(); +-} +-static void startCalc (AppletWidget *, gpointer pModel) { +- ((Model *)pModel)->startCalc(); +-} +-static void startDraw (AppletWidget *, gpointer pModel) { +- ((Model *)pModel)->startDraw(); +-} +-static void startImpress (AppletWidget *, gpointer pModel) { +- ((Model *)pModel)->startImpress(); ++static void startWriter (PanelApplet*) { ++ oq_debug ("Starting oowriter\n"); ++ //((Model *)pModel)->startWriter(); ++ model.startWriter(); ++} ++static void startCalc (PanelApplet*) { ++ oq_debug ("Starting oocalc\n"); ++ //((Model *)pModel)->startCalc(); ++ model.startCalc(); ++} ++static void startDraw (PanelApplet*) { ++ oq_debug ("Starting oodraw\n"); ++ //((Model *)pModel)->startDraw(); ++ model.startDraw(); ++} ++static void startImpress (PanelApplet*) { ++ oq_debug ("Starting ooimpress\n"); ++ //((Model *)pModel)->startImpress(); ++ model.startImpress(); + } + + +@@ -108,29 +124,30 @@ + /*========================================================================= + | GUI UPDATE + ========================================================================*/ +-static void updateGUI (Model *model) { ++static void ++updateGUI (Model* pModel) { + IconState state = ICON_OFF; + +- switch (model->getStatus()) { ++ switch (pModel->getStatus()) { + case MODEL_OFFICE_STOPPED: state = ICON_OFF; break; + case MODEL_OFFICE_STARTING: state = ICON_WAIT; break; + case MODEL_OFFICE_RUNNING: state = ICON_ON; break; + } + + if (state != iconState) { +- int panelPixelSize = +- applet_widget_get_panel_pixel_size(APPLET_WIDGET(applet)); ++ int panelPixelSize = panel_applet_get_size (PANEL_APPLET(applet)); + gtk_widget_set_usize(tile, panelPixelSize, panelPixelSize); + ++/* FIXME + bool en = (state == ICON_ON); +- applet_widget_callback_set_sensitive(APPLET_WIDGET(applet), "sw", en); +- applet_widget_callback_set_sensitive(APPLET_WIDGET(applet), "sc", en); +- applet_widget_callback_set_sensitive(APPLET_WIDGET(applet), "si", en); +- applet_widget_callback_set_sensitive(APPLET_WIDGET(applet), "sd", en); ++ applet_widget_callback_set_sensitive(PANEL_APPLET(applet), "sw", en); ++ applet_widget_callback_set_sensitive(PANEL_APPLET(applet), "sc", en); ++ applet_widget_callback_set_sensitive(PANEL_APPLET(applet), "si", en); ++ applet_widget_callback_set_sensitive(PANEL_APPLET(applet), "sd", en); ++*/ + +- if (tilepixmap) gtk_container_remove(GTK_CONTAINER(tile), tilepixmap); ++ //if (tilepixmap) gtk_container_remove(GTK_CONTAINER(tile), tilepixmap); + tilepixmap = 0; +- + char **pixmapData = 0; + switch (state) { + case ICON_OFF: pixmapData = ooqstart_off_xpm; break; +@@ -143,12 +160,13 @@ + tilepixmap = create_pixmap(GTK_WIDGET(tile), pixmapData, + panelPixelSize, panelPixelSize); + } +- ++ ++/* + if (tilepixmap) { + gtk_widget_show(tilepixmap); + gtk_container_add(GTK_CONTAINER(tile), tilepixmap); + } +- ++*/ + iconState = state; + } + } +@@ -264,8 +282,8 @@ + gtk_idle_add(makeRequest, data); + } + +- +-static void disableSessionManagement (Model *model) { ++static void ++disableSessionManagement (Model* pModel) { + // This is tricky because the X11 SM works on a callback + // basis. Essentially, what this function does is + // request all of the session manager's properties. +@@ -278,8 +296,13 @@ + // session management for the program. + SmProp *props[1]; + props[0] = mkSmProp(GsmCommand, GsmSelectClientEvents); ++ // MECHANIX: g_usleep (G_USEC_PER_SEC * 10); + SmcSetProperties((SmcConn)client->smc_conn, 1, &props[0]); +- gtk_idle_add(makeRequest, model); ++ /* MECHANIX: if (true) { ++ g_printerr ("debug return\n"); ++ return; ++ }*/ ++ gtk_idle_add (makeRequest, pModel); + } + + static gint makeRequest (gpointer data) { +@@ -291,23 +290,14 @@ + /*========================================================================= + | LOAD / SAVE CONFIGURATION + ========================================================================*/ +-static void loadConfig (char *cfgpath, Model *model) { +- gnome_config_push_prefix(cfgpath); +- +- model->setOpenOfficeDir(gnome_config_get_string("ooqstart/openoffice")); +- if (gnome_config_get_bool("ooqstart/enable=false")) +- model->enable(); +- else +- model->disable(); +- +- gnome_config_pop_prefix(); ++static void ++loadConfig (Model* pModel) { ++ pModel->setOpenOfficeProgram (gnome_config_get_string (GC_PROG_PATH "=" OOFFICE_DEFAULT_PATH)); + } + +-static void saveConfig (char *cfgpath, Model *model) { +- gnome_config_push_prefix(cfgpath); +- gnome_config_set_string("ooqstart/openoffice", model->getOpenOfficeDir()); +- gnome_config_set_bool("ooqstart/enable", model->getEnabled()); +- gnome_config_pop_prefix(); ++static void ++saveConfig (Model* pModel) { ++ gnome_config_set_string (GC_PROG_PATH, pModel->getOpenOfficeProgram()); + + gnome_config_sync(); + } +@@ -320,64 +310,55 @@ + { + if (propwindow == 0) return; + +- Model *model = (Model *)data; ++ Model* pModel = (Model*) data; + +- // Get the status of the checkbox +- bool enable = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox)); +- + // Check to see if the given path is valid +- model->setOpenOfficeDir(gtk_entry_get_text(GTK_ENTRY(entry))); +- if (!model->isValid()) { +- GtkWidget *dialog = gnome_message_box_new +- (_("Open Office was not found in the given path.\n" +- "The QuickStarter applet will be disabled.\n"), +- GNOME_MESSAGE_BOX_WARNING, +- GNOME_STOCK_BUTTON_OK, +- 0); +- gnome_dialog_run(GNOME_DIALOG(dialog)); ++ pModel->setOpenOfficeProgram (gtk_entry_get_text (GTK_ENTRY (entry))); ++ if (!pModel->isValid()) { ++ GtkWidget* dialog = gtk_message_dialog_new (NULL, ++ GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_WARNING, ++ GTK_BUTTONS_CLOSE, ++ _("OpenOffice.org was not found in the given path.\n" ++ "The QuickStarter applet will be disabled.\n")); ++ gtk_dialog_run (GTK_DIALOG (dialog)); ++ gtk_widget_destroy (dialog); + +- // Disable the quick starter +- enable = false; + } + +- if (enable) +- model->enable(); +- else +- model->disable(); +- +- saveConfig(APPLET_WIDGET(applet)->privcfgpath, model); +- applet_widget_sync_config(APPLET_WIDGET(applet)); ++ saveConfig (pModel); ++/* FIXME: applet_widget_sync_config(PANEL_APPLET(applet)); */ + propwindow = 0; + } + +-static void showHelp (AppletWidget *, gpointer) { +- GnomeHelpMenuEntry entry = { "ooqstart_applet", "index.html" }; +- gnome_help_display(0, &entry); +-} + + static gint propDestroy (GtkWidget *, gpointer) { + return 0; + } + +-static void properties (AppletWidget *, gpointer pModel) { +- Model *model = (Model *)pModel; +- +- propwindow = gnome_property_box_new(); +- gtk_window_set_title +- (GTK_WINDOW(&GNOME_PROPERTY_BOX(propwindow)->dialog.window), +- _("Open Office QuickStarter Applet Settings")); ++static void ++properties (PanelApplet*) { ++ Model* pModel = (Model*) &model; ++ ++ if (!pModel) { ++ return; ++ } ++ ++ propwindow = gnome_property_box_new(); ++ gtk_window_set_title (GTK_WINDOW (&GNOME_PROPERTY_BOX (propwindow)->dialog.window), ++ _("OpenOffice.org QuickStarter Settings")); + + GtkWidget *vbox = gtk_vbox_new(FALSE, GNOME_PAD_SMALL); + gtk_container_set_border_width(GTK_CONTAINER(vbox), GNOME_PAD_SMALL); + + GtkWidget *label = gtk_label_new +- (_("Full path to Open Office or Star Office base directory:")); ++ (_("Full path to the OpenOffice.org or StarOffice application:")); + gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); + gtk_widget_show(label); + + entry = gtk_entry_new(); +- gtk_entry_set_text(GTK_ENTRY(entry), model->getOpenOfficeDir()); ++ const gchar* prog = pModel->getOpenOfficeProgram(); ++ gtk_entry_set_text (GTK_ENTRY (entry), prog); + gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 0); + GTK_WIDGET_SET_FLAGS(entry, GTK_CAN_FOCUS); + gtk_signal_connect_object +@@ -391,17 +375,6 @@ + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); + gtk_widget_show(label); + +- checkbox = gtk_check_button_new_with_label +- (_("Enable QuickStarter")); +- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox), +- model->getEnabled()); +- gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0); +- gtk_signal_connect_object +- (GTK_OBJECT(checkbox), "clicked", +- GTK_SIGNAL_FUNC(gnome_property_box_changed), +- GTK_OBJECT(propwindow)); +- gtk_widget_show(checkbox); +- + label = gtk_label_new(_("General")); + gnome_property_box_append_page + (GNOME_PROPERTY_BOX(propwindow), vbox, label); +@@ -404,27 +404,29 @@ + GTK_SIGNAL_FUNC(propApply), pModel); + gtk_signal_connect(GTK_OBJECT(propwindow), "destroy", + GTK_SIGNAL_FUNC(propDestroy), 0); +- gtk_signal_connect(GTK_OBJECT(propwindow), "help", +- GTK_SIGNAL_FUNC(showHelp), 0); + gtk_widget_show_all(propwindow); + } + +-static void about (AppletWidget *, gpointer) { ++static void about (PanelApplet*, gpointer) { + static GtkWidget *about = 0; + + if (about == 0) { + const gchar *authors[4]; + authors[0] = _("Kumaran Santhanam <kumaran@alumni.stanford.org>"); +- authors[1] = 0; ++ authors[1] = _("Filip Van Raemdonck <mechanix@debian.org>"); ++ authors[2] = 0; + + about = gnome_about_new + ( _("Open Office QuickStarter Applet"), VERSION, +- _("(C) 2002 Kumaran Santhanam"), authors, ++ _("(C) 2002 Kumaran Santhanam\n 2003 Filip Van Raemdonck"), + _("Quick starter launch applet for Open Office 641C+ " + "and Star Office 6.0+.\n" + "Right-click on the applet icon for a context menu.\n" + " \n" + "Released under the GNU General Public License v2."), ++ authors, ++ NULL, /* documenters */ ++ NULL, /* translators */ + 0); + + gtk_signal_connect(GTK_OBJECT(about), "destroy", +@@ -445,33 +471,14 @@ + + + /*========================================================================= +-| MENUS +- ========================================================================*/ +-static void menuItem (GtkWidget *applet, +- char *name, char *text, char *stock, +- void (*func) (AppletWidget *, gpointer), +- Model *model) +-{ +- if (stock == 0) +- applet_widget_register_callback +- (APPLET_WIDGET(applet), name, _(text), func, model); +- else +- applet_widget_register_stock_callback +- (APPLET_WIDGET(applet), name, stock, _(text), func, model); +-} +- +-static void tileClicked (GtkWidget *w, gpointer data) { +- about((AppletWidget *)data, 0); +-} +- +- +-/*========================================================================= + | BACKGROUND TIMER + ========================================================================*/ +-static gint timeoutFunc (gpointer pModel) { +- Model *model = (Model *)pModel; +- model->process(); +- updateGUI(model); ++static gint ++timeoutFunc (gpointer data) { ++ g_assert (data); ++ Model* pModel = (Model*) data; ++ pModel->process(); ++ updateGUI (pModel); + return TRUE; + } + +@@ -484,10 +491,11 @@ + updateGUI((Model *)data); + } + +-static gint saveSession (GtkWidget *applet, gchar *privcfgpath, ++static gint saveSession (GtkWidget *applet, + gchar *globcfgpath, gpointer data) + { +- saveConfig(privcfgpath, (Model *)data); ++ oq_debug ("saveSession (..., globcfgpath = %s, ...)\n", globcfgpath); ++ saveConfig((Model *)data); + gnome_config_drop_all(); + return FALSE; + } +@@ -507,77 +489,96 @@ + + + /*========================================================================= +-| MAIN PROGRAM ++| MENUS + ========================================================================*/ +-int main (int argc, char **argv) +-{ +- // Initialize the i18n stuff +- (void)bindtextdomain(PACKAGE, GNOMELOCALEDIR); +- (void)textdomain(PACKAGE); +- +- // intialize, this will basically set up the applet, corba and +- // call gnome_init +- applet_widget_init("ooqstart_applet", VERSION, argc, argv, NULL, 0, NULL); +- +- // create a new applet_widget +- applet = applet_widget_new("ooqstart_applet"); +- +- // in the rare case that the communication with the panel +- // failed, error out +- if (!applet) g_error("Can't create applet!\n"); ++static void tileClicked (GtkWidget *w, gpointer data) { ++ about((PanelApplet*)data, 0); ++} + +- // Get a GNOME client connected to the session manager +- client = gnome_client_new(); +- gnome_client_connect(client); ++static const gchar ooqstart_menu_xml [] = ++ "<popup name=\"button3\">\n" ++ " <menuitem name=\"sw\" verb=\"OOQStartWriter\" _label=\"New _Text Document\"\n" ++ " pixtype=\"filename\" pixname=\"/usr/share/pixmaps/ximian-openoffice-writer.png\"/>" ++ " <menuitem name=\"sc\" verb=\"OOQStartCalc\" _label=\"New _Spreadsheet\"\n" ++ " pixtype=\"filename\" pixname=\"/usr/share/pixmaps/ximian-openoffice-calc.png\"/>" ++ " <menuitem name=\"si\" verb=\"OOQStartImpress\" _label=\"New _Presentation\"\n" ++ " pixtype=\"filename\" pixname=\"/usr/share/pixmaps/ximian-openoffice-impress.png\"/>" ++ " <menuitem name=\"sd\" verb=\"OOQStartDraw\" _label=\"New _Drawing\"\n" ++ " pixtype=\"filename\" pixname=\"/usr/share/pixmaps/ximian-openoffice-draw.png\"/>" ++ " <menuitem name=\"props\" verb=\"OOQPrefs\" _label=\"Pre_ferences\"\n" ++ " pixtype=\"stock\" pixname=\"gtk-properties\"/>\n" ++ " <menuitem name=\"about\" verb=\"OOQAbout\" _label=\"_About\"\n" ++ " pixtype=\"stock\" pixname=\"gnome-stock-about\"/>\n" ++ "</popup>\n"; + +- // create the widget we are going to put on the applet +- tile = gtk_button_new(); +- gtk_button_set_relief(GTK_BUTTON(tile), GTK_RELIEF_NONE); +- GTK_WIDGET_UNSET_FLAGS(tile, GTK_CAN_FOCUS); +- gtk_widget_show(tile); +- gtk_signal_connect(GTK_OBJECT(tile), "clicked", +- GTK_SIGNAL_FUNC(tileClicked), applet); +- +- // add the widget to the applet-widget, and thereby actually +- // putting it "onto" the panel +- applet_widget_add(APPLET_WIDGET(applet), tile); +- gtk_widget_show(applet); ++/*========================================================================= ++| MAIN PROGRAM ++ ========================================================================*/ ++static gboolean ++ooqstart_applet_new (PanelApplet* papplet) { ++ oq_debug ("Creating new applet"); ++ ++ ++ applet = GTK_WIDGET (papplet); ++ ++ GtkWidget* img = gtk_image_new_from_file ("/usr/share/pixmaps/gnome-ooqstart.png"); ++ tile = gtk_event_box_new(); ++ gtk_container_add (GTK_CONTAINER (tile), img); ++ gtk_container_add (GTK_CONTAINER (applet), tile); ++ ++ gtk_widget_show_all(applet); ++ ++ const BonoboUIVerb ooqstart_menu_verbs[] = { ++ BONOBO_UI_UNSAFE_VERB ("OOQStartWriter", startWriter), ++ BONOBO_UI_UNSAFE_VERB ("OOQStartCalc", startCalc), ++ BONOBO_UI_UNSAFE_VERB ("OOQStartImpress", startImpress), ++ BONOBO_UI_UNSAFE_VERB ("OOQStartDraw", startDraw), ++ BONOBO_UI_UNSAFE_VERB ("OOQPrefs", properties), ++ BONOBO_UI_UNSAFE_VERB ("OOQAbout", about), ++ BONOBO_UI_VERB_END ++ }; + +- // initialize the model +- Model model; ++ panel_applet_setup_menu (PANEL_APPLET (applet), ooqstart_menu_xml, ooqstart_menu_verbs, tile); + + // connect the applet callbacks +- gtk_signal_connect(GTK_OBJECT(applet), "change_pixel_size", +- GTK_SIGNAL_FUNC(resizeApplet), &model); +- gtk_signal_connect(GTK_OBJECT(applet), "save_session", +- GTK_SIGNAL_FUNC(saveSession), &model); +- gtk_signal_connect(GTK_OBJECT(applet), "destroy", +- GTK_SIGNAL_FUNC(destroyApplet), &model); +- +- // add the items to the applet menu +- menuItem(applet, "props", "Properties...", +- GNOME_STOCK_PIXMAP_PROPERTIES, +- properties, &model); +- menuItem(applet, "about", "About...", +- GNOME_STOCK_PIXMAP_ABOUT, +- about, 0); +- menuItem(applet, "help", "Help", +- GNOME_STOCK_PIXMAP_HELP, +- showHelp, 0); +- +- char *icon = 0; +- menuItem(applet, "sw", "New Text Document", icon, startWriter, &model); +- menuItem(applet, "sc", "New Spreadsheet", icon, startCalc, &model); +- menuItem(applet, "si", "New Presentation", icon, startImpress, &model); +- menuItem(applet, "sd", "New Drawing", icon, startDraw, &model); ++ if (false) { ++ g_signal_connect (G_OBJECT (tile), "clicked", G_CALLBACK (tileClicked), applet); ++ g_signal_connect (G_OBJECT (applet), "change_pixel_size", G_CALLBACK (resizeApplet), &model); ++ g_signal_connect (G_OBJECT (applet), "save_session", G_CALLBACK (saveSession), &model); ++ g_signal_connect (G_OBJECT (applet), "destroy", G_CALLBACK (destroyApplet), &model); ++ } ++ ++ loadConfig (&model); ++ oq_debug ("%s\n", model.getOpenOfficeProgram()); + +- loadConfig(APPLET_WIDGET(applet)->privcfgpath, &model); ++ // Get a GNOME client connected to the session manager ++ client = gnome_client_new(); ++ gnome_client_connect(client); ++ gnome_client_flush(client); + + // install appropriate handlers +- disableSessionManagement(&model); +- timeout = gtk_timeout_add(250, timeoutFunc, (gpointer)&model); ++ disableSessionManagement (&model); ++ timeout = gtk_timeout_add (250, timeoutFunc, (gpointer) &model); + +- // special corba main loop +- applet_widget_gtk_main(); +- return 0; ++ return TRUE; + } ++ ++static gboolean ++ooqstart_applet_factory (PanelApplet* papplet, ++ const gchar* iid, gpointer data) { ++ oq_debug ("Factory called"); ++ ++ if (strcmp (iid, "OAFIID:GNOME_OOQStartApplet")) { ++ g_printerr ("Returning FALSE"); ++ return FALSE; ++ } ++ ++ return ooqstart_applet_new (papplet); ++} ++ ++PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_OOQStartApplet_Factory", ++ PANEL_TYPE_APPLET, ++ "OOoQStartApplet", ++ "0", ++ ooqstart_applet_factory, ++ NULL) + +--- ooqstart-0.8.3.orig/gnome/GNOME_OOQStartApplet.server ++++ ooqstart-0.8.3/gnome/GNOME_OOQStartApplet.server +@@ -0,0 +1,35 @@ ++<oaf_info> ++ ++<oaf_server iid="OAFIID:GNOME_OOQStartApplet_Factory" ++ type="exe" ++ location="/usr/libexec/ooqstart_applet2"> ++ ++ <oaf_attribute name="repo_ids" type="stringv"> ++ <item value="IDL:Bonobo/GenericFactory:1.0"/> ++ <item value="IDL:Bonobo/Unknown:1.0"/> ++ </oaf_attribute> ++ <oaf_attribute name="name" type="string" value="OOoQStartApplet"/> ++ <oaf_attribute name="description" type="string" value="Factory for OpenOffice.org quickstart applet"/> ++ ++</oaf_server> ++ ++<oaf_server iid="OAFIID:GNOME_OOQStartApplet" ++ type="factory" ++ location="OAFIID:GNOME_OOQStartApplet_Factory"> ++ ++ <oaf_attribute name="repo_ids" type="stringv"> ++ <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/> ++ <item value="IDL:Bonobo/Control:1.0"/> ++ <item value="IDL:Bonobo/Unknown:1.0"/> ++ </oaf_attribute> ++ <oaf_attribute name="name" type="string" value="OpenOffice.org QuickStarter"/> ++ <oaf_attribute name="name-nl" type="string" value="OpenOffice.org SnelStarter"/> ++ <oaf_attribute name="description" type="string" value="Preload OpenOffice.org for rapid launching"/> ++ <oaf_attribute name="description-nl" type="string" value="Laad OpenOffice.org vast in om het snel te starten"/> ++ <oaf_attribute name="panel:category" type="string" value="Accessories"/> ++ <oaf_attribute name="panel:category-nl" type="string" value="Accessoires"/> ++ <oaf_attribute name="panel:icon" type="string" value="gnome-ooqstart.png"/> ++ ++</oaf_server> ++ ++</oaf_info> +--- ooqstart-0.8.3.orig/help/index.html ++++ ooqstart-0.8.3/help/index.html +@@ -25,7 +25,7 @@ + Public License v2, though any later version of the license + may be used at your option. + +-<p> For more information, please see the <a href="license.txt">full ++<p> For more information, please see the <a href="/usr/share/common-licenses/GPL">full + text</a> of the license. Further details can be found at the + <a href="http://www.gnu.org/">GNU Project Homepage</a>. + +--- ooqstart-0.8.3.orig/model.cxx ++++ ooqstart-0.8.3/model.cxx +@@ -2,6 +2,7 @@ + | Open Office QuickStarter + |-------------------------------------------------------------------------- + | (c) 2002 Kumaran Santhanam <kumaran@alumni.stanford.org> ++| 2003 Filip Van Raemdonck <mechanix@debian.org> + | + | This project is released under the GNU General Public License. + | Please see the file COPYING for more details. +@@ -18,7 +19,6 @@ + static const int MIN_TIME = 2; // seconds + + static const char *BIN_SH = "/bin/sh"; +-static const char *SOFFICE = "program/soffice"; + static const char *SWRITER = "private:factory/swriter"; + static const char *SCALC = "private:factory/scalc"; + static const char *SDRAW = "private:factory/sdraw"; +@@ -66,7 +66,10 @@ + signal(SIGCHLD, sigchld); + + // Fork and return the child's process ID +- if ((pid = fork()) != 0) return pid; ++ if ((pid = fork()) != 0) { ++ //fprintf (stderr, "fork pid %d\n", pid); ++ return pid; ++ } + + // Child process execution point + execl(path, path, arg1, arg2, arg3, 0); +@@ -72,7 +72,7 @@ + } + + // Child process execution point +- execl(path, path, arg1, arg2, arg3, 0); ++ execlp(arg1,arg1, arg2, arg3, 0); + + // Execution should never reach this point. + // If it does, there was an error. +@@ -95,17 +95,15 @@ + | CONSTRUCTOR / DESTRUCTOR + ========================================================================*/ + Model::Model () { +- _enabled = false; ++ _enabled = true; + _daemonPID = 0; + _tick = 0; + _status = MODEL_OFFICE_STOPPED; +- _sofficeDir = 0; + _soffice = 0; + } + + Model::~Model () { + stopProcess(_daemonPID); +- if (_sofficeDir) free(_sofficeDir); + if (_soffice) free(_soffice); + } + +@@ -113,32 +114,25 @@ + /*========================================================================= + | OPEN OFFICE DIRECTORY + ========================================================================*/ +-// Sets the open office directory if the path is valid +-void Model::setOpenOfficeDir (const char *dir) { +- char path[1024]; +- +- if (dir == 0) dir = ""; +- sprintf(path, "%s/%s", dir, SOFFICE); +- +- // Free the memory used by the previous path +- if (_soffice) free(_soffice); +- _soffice = 0; +- ++/* Sets the OpenOffice.org location if the path is valid */ ++void ++Model::setOpenOfficeProgram (const char* path) { + // Stat the path to see if it really exists ++ fprintf (stderr, "_soffice: %s\nnew path: %s\n", _soffice, path); + struct stat buf; + stat(path, &buf); + if (S_ISREG(buf.st_mode)) { ++ if (_soffice) { ++ free (_soffice); ++ } + _soffice = strdup(path); +- } ++ fprintf (stderr, "_soffice: %s\n", _soffice); + +- // Save away the directory +- if (_sofficeDir) free(_sofficeDir); +- _sofficeDir = strdup(dir); +- +- // Make sure to stop the current running process +- stopProcess(_daemonPID); +- _daemonPID = 0; +- _tick = time(0); ++ /* Make sure to stop the current running process */ ++ stopProcess (_daemonPID); ++ _daemonPID = 0; ++ _tick = time (0); ++ } + } + + +@@ -171,6 +165,7 @@ + _status = MODEL_OFFICE_STARTING; + _tick = time(0); + } ++ //fprintf (stderr, "started _daemonPID %d\n", _daemonPID); + } + + // If the quickstarter is disabled, terminate the +@@ -186,11 +181,24 @@ + /*========================================================================= + | LAUNCHERS + ========================================================================*/ +-#define START_APP(app) \ +- if (isRunning(_daemonPID) && _soffice != 0) \ +- { startProcess(BIN_SH, _soffice, app, 0); } +- +-void Model::startWriter () const { START_APP(SWRITER); } +-void Model::startCalc () const { START_APP(SCALC); } +-void Model::startDraw () const { START_APP(SDRAW); } +-void Model::startImpress () const { START_APP(SIMPRESS); } ++void ++Model::startApp (const char* app) { ++ fprintf (stderr, "starting app %s\n", app); ++ ++ if (_daemonPID) { ++ fprintf (stderr, "checking _daemonPID %d\n", _daemonPID); ++ int result = waitpid (_daemonPID, 0, WNOHANG); ++ if (result < 0 && errno == ECHILD) { ++ fprintf (stderr, "_daemonPid %d, waitpid %d, ECHILD %d\n", _daemonPID, result, (errno == ECHILD)); ++ return; ++ } else if (_soffice) { ++ startProcess (BIN_SH, _soffice, app, 0); ++ } ++ } ++} ++ ++void Model::startWriter (void) { startApp (SWRITER); } ++void Model::startCalc (void) { startApp (SCALC); } ++void Model::startDraw (void) { startApp (SDRAW); } ++void Model::startImpress (void) { startApp (SIMPRESS); } ++ +--- ooqstart-0.8.3.orig/model.h ++++ ooqstart-0.8.3/model.h +@@ -2,6 +2,7 @@ + | Open Office QuickStarter + |-------------------------------------------------------------------------- + | (c) 2002 Kumaran Santhanam <kumaran@alumni.stanford.org> ++| 2003 Filip Van Raemdonck <mechanix@debian.org> + | + | This project is released under the GNU General Public License. + | Please see the file COPYING for more details. +@@ -39,10 +40,7 @@ + Model (); + ~Model (); + +- void setOpenOfficeDir (const char *dir); +- const char *getOpenOfficeDir () const { +- return _sofficeDir; +- } ++ void setOpenOfficeProgram (const char*); + const char *getOpenOfficeProgram () const { + return _soffice; + } +@@ -57,11 +55,12 @@ + void process (); + ModelStatus getStatus () const { return _status; } + +- void startWriter () const; +- void startCalc () const; +- void startDraw () const; +- void startImpress () const; ++ void startApp (const char*); + ++ void startWriter (void); ++ void startCalc (void); ++ void startDraw (void); ++ void startImpress (void); + + private: + bool _enabled; +@@ -69,9 +68,7 @@ + time_t _tick; + ModelStatus _status; + +- char *_sofficeDir; + char *_soffice; + }; + +- + #endif diff --git a/app-office/ooqstart-gnome/metadata.xml b/app-office/ooqstart-gnome/metadata.xml new file mode 100644 index 000000000000..f10a9dd6cdf6 --- /dev/null +++ b/app-office/ooqstart-gnome/metadata.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>openoffice</herd> + <longdescription>ooqstart-gnome is an OpenOffice.org Quickstarter Applet for the Gnome 2.x Panel. For it to do something useful you will have to install one of the different flavours of OpenOffice.org Gentoo provides</longdescription> +</pkgmetadata> diff --git a/app-office/ooqstart-gnome/ooqstart-gnome-0.8.3.ebuild b/app-office/ooqstart-gnome/ooqstart-gnome-0.8.3.ebuild new file mode 100644 index 000000000000..489a303e3f56 --- /dev/null +++ b/app-office/ooqstart-gnome/ooqstart-gnome-0.8.3.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-office/ooqstart-gnome/ooqstart-gnome-0.8.3.ebuild,v 1.1 2005/01/16 15:05:34 suka Exp $ + +inherit gnome2 eutils + +DESCRIPTION="OpenOffice.org Quickstarter Applet for Gnome 2.x" +HOMEPAGE="http://ooqstart.sourceforge.net/" +SRC_URI="mirror://sourceforge/ooqstart/ooqstart-${PV}.tgz" +S=${WORKDIR}/ooqstart-${PV} + +LICENSE="GPL-2" +KEYWORDS="~x86" +IUSE="" +SLOT="0" + +RDEPEND=">=gnome-base/libgnome-2 + >=gnome-base/libgnomeui-2 + >=gnome-base/gnome-panel-2 + >=dev-libs/glib-2 + >=x11-libs/gtk+-2" + +DEPEND="${RDEPEND} + dev-util/pkgconfig" + +src_unpack() { + unpack ${A} + cd ${S} + epatch ${FILESDIR}/gnome2update.patch +} + +src_compile() { + make DESTDIR=${D} || die "make failed" +} + +src_install() { + make ROOT=${D} install-gnome || die + insinto /usr/share/pixmaps + doins ${FILESDIR}/gnome-ooqstart.png +} + +pkg_postinst() { + einfo "If you are you using openoffice-ximian please correct" + einfo "the path in the preferences of the applet to" + einfo "'/usr/bin/xooffice' after the first start" +} |