summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.in6
-rw-r--r--desktop/source/app/app.cxx12
-rw-r--r--desktop/source/app/cmdlineargs.cxx2
-rw-r--r--desktop/source/app/makefile.mk4
-rw-r--r--scp2/source/ooo/common_brand.scp22
-rwxr-xr-xscp2/source/ooo/file_library_ooo.scp31
-rwxr-xr-xsfx2/Library_sfx.mk8
-rw-r--r--sfx2/source/appl/shutdownicon.cxx12
-rw-r--r--sfx2/source/appl/shutdowniconunx.cxx113
9 files changed, 98 insertions, 112 deletions
diff --git a/configure.in b/configure.in
index d8f2c4df1d4d..55b104e70e49 100644
--- a/configure.in
+++ b/configure.in
@@ -5797,8 +5797,10 @@ if test "$test_gtk" = "yes"; then
BUILD_TYPE="$BUILD_TYPE GTK"
if test "x$enable_systray" = "xyes"; then
- ENABLE_SYSTRAY_GTK="TRUE"
- BUILD_TYPE="$BUILD_TYPE SYSTRAY_GTK"
+ PKG_CHECK_MODULES(GTK_2_16,gtk+-2.0 >= 2.16.0,
+ [ENABLE_SYSTRAY_GTK="TRUE"
+ BUILD_TYPE="$BUILD_TYPE SYSTRAY_GTK"],
+ [ENABLE_SYSTRAY_GTK=""])
fi
AC_MSG_CHECKING([whether to enable DBUS support])
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index f37f67e3c931..ae52fcd4ef56 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -132,6 +132,8 @@
#include <unotools/syslocaleoptions.hxx>
#include <unotools/syslocale.hxx>
#include <svl/folderrestriction.hxx>
+#include <svl/eitem.hxx>
+#include <svl/itemset.hxx>
#include <unotools/tempfile.hxx>
#include <rtl/logfile.hxx>
#include <rtl/ustrbuf.hxx>
@@ -145,6 +147,7 @@
#include <vcl/stdtext.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/sfx.hrc>
+#include <sfx2/app.hxx>
#include <ucbhelper/contentbroker.hxx>
#include <unotools/bootstrap.hxx>
#include <cppuhelper/bootstrap.hxx>
@@ -2118,6 +2121,15 @@ sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r
RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) createInstance com.sun.star.office.Quickstart" );
sal_Bool bQuickstart = GetCommandLineArgs()->IsQuickstart();
+ if ( !bQuickstart )
+ {
+ SfxItemSet aOptSet( SFX_APP()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER );
+ SFX_APP()->GetOptions(aOptSet);
+ const SfxPoolItem* pItem;
+ if ( SFX_ITEM_SET == aOptSet.GetItemState( SID_ATTR_QUICKLAUNCHER, sal_False, &pItem ) )
+ bQuickstart = ((const SfxBoolItem*)pItem)->GetValue();
+ }
+
Sequence< Any > aSeq( 1 );
aSeq[0] <<= bQuickstart;
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 14b4fd1d6ddc..2a441490ecfa 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -422,7 +422,7 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
}
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart" )) == sal_True )
{
-#if defined(WNT) || defined(OS2) || defined(QUARTZ)
+#if defined(ENABLE_QUICKSTART_APPLET)
SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_True );
#endif
SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_False );
diff --git a/desktop/source/app/makefile.mk b/desktop/source/app/makefile.mk
index 085d8520e7ad..aac11f204e34 100644
--- a/desktop/source/app/makefile.mk
+++ b/desktop/source/app/makefile.mk
@@ -41,6 +41,10 @@ ENABLE_EXCEPTIONS=TRUE
CFLAGS+=-DGNOME_VFS_ENABLED
.ENDIF
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2" || "$(GUIBASE)"=="aqua" || "$(ENABLE_SYSTRAY_GTK)"=="TRUE"
+CFLAGS+=-DENABLE_QUICKSTART_APPLET
+.ENDIF
+
# .IF "$(OS)" == "WNT"
# .IF "$(COM)" == "GCC"
# DEPLOYMENTMISCLIB = -ldeploymentmisc$(DLLPOSTFIX)
diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp
index 88807d27a599..5af86803ea87 100644
--- a/scp2/source/ooo/common_brand.scp
+++ b/scp2/source/ooo/common_brand.scp
@@ -98,7 +98,7 @@ Module gid_Module_Root_Brand
gid_Brand_File_Share_Xdg_JavaFilter,
gid_Brand_File_Share_Xdg_Math,
gid_Brand_File_Share_Xdg_Printeradmin,
-// gid_Brand_File_Share_Xdg_QStart,
+ gid_Brand_File_Share_Xdg_QStart,
gid_Brand_File_Share_Xdg_StartCenter,
gid_Brand_File_Share_Xdg_Writer,
gid_Brand_File_Txt_Package);
@@ -738,16 +738,16 @@ File gid_Brand_File_Share_Xdg_Printeradmin
End
#endif
-//#if defined UNX && ! defined MACOSX
-//#ifdef ENABLE_GTK
-//File gid_Brand_File_Share_Xdg_QStart
-// TXT_FILE_BODY;
-// Dir = gid_Brand_Dir_Share_Xdg;
-// Styles = (PACKED,SCPZIP_REPLACE);
-// Name = "qstart.desktop";
-//End
-//#endif
-//#endif
+#if defined UNX && ! defined MACOSX
+#ifdef ENABLE_GTK
+File gid_Brand_File_Share_Xdg_QStart
+ TXT_FILE_BODY;
+ Dir = gid_Brand_Dir_Share_Xdg;
+ Styles = (PACKED,SCPZIP_REPLACE);
+ Name = "qstart.desktop";
+End
+#endif
+#endif
#if defined UNX && ! defined MACOSX
File gid_Brand_File_Share_Xdg_Writer
diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp
index 52a7d62a0584..808fdf2cdefd 100755
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -208,25 +208,18 @@ End
#endif
-//#ifdef UNX
-//#ifdef ENABLE_GTK
-//#ifdef ENABLE_SYSTRAY_GTK
-//File gid_File_Lib_Egg_Tray
-// TXT_FILE_BODY;
-// Styles = (PACKED);
-// Dir = SCP2_OOO_BIN_DIR;
-// Name = STRING(CONCAT3(libeggtray,DLLPOSTFIX,UNXSUFFIX));
-//End
-//
-//File gid_File_Lib_QStart_Gtk
-// Name = LIBNAME(qstart_gtk);
-// TXT_FILE_BODY;
-// Styles = (PACKED);
-// Dir = SCP2_OOO_BIN_DIR;
-//End
-//#endif
-//#endif
-//#endif
+#ifdef UNX
+#ifdef ENABLE_GTK
+#ifdef ENABLE_SYSTRAY_GTK
+File gid_File_Lib_QStart_Gtk
+ Name = LIBNAME(qstart_gtk);
+ TXT_FILE_BODY;
+ Styles = (PACKED);
+ Dir = SCP2_OOO_BIN_DIR;
+End
+#endif
+#endif
+#endif
STD_LIB_FILE( gid_File_Lib_Dba, dba)
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index e251e7a7d70b..9f0ac7572b3a 100755
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -273,6 +273,14 @@ $(eval $(call gb_Library_set_defs,sfx,\
))
endif
+ifeq ($(ENABLE_SYSTRAY_GTK),TRUE)
+$(eval $(call gb_Library_set_defs,sfx,\
+ $$(DEFS) \
+ -DENABLE_QUICKSTART_APPLET \
+ -DENABLE_SYSTRAY_GTK \
+))
+endif
+
ifeq ($(OS),OS2)
$(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/appl/shutdowniconOs2.ob \
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index a96dc4a4c9e2..00baae59b486 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -62,6 +62,7 @@
#include <osl/security.hxx>
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
+#include <rtl/ustrbuf.hxx>
#include <tools/link.hxx>
#ifdef UNX // need symlink
#include <unistd.h>
@@ -826,8 +827,15 @@ rtl::OUString ShutdownIcon::getShortcutName()
aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\" ) );
aShortcut += aShortcutName;
#else // UNX
- OUString aShortcut = getDotAutostart();
- aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "/qstart.desktop" ) );
+ OUStringBuffer aStrBuff( getDotAutostart() );
+ aStrBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( "/" ) );
+ if ( sal_Int32 len = aShortcutName.getLength() )
+ aStrBuff.append( aShortcutName.getStr(), len );
+ else
+ aStrBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( "qstart" ) );
+ aStrBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( ".desktop" ) );
+
+ OUString aShortcut( aStrBuff.makeStringAndClear() );
#endif // UNX
return aShortcut;
#endif // ENABLE_QUICKSTART_APPLET
diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx
index c9c9e06ae248..e6a2fe5bf661 100644
--- a/sfx2/source/appl/shutdowniconunx.cxx
+++ b/sfx2/source/appl/shutdowniconunx.cxx
@@ -2,12 +2,10 @@
#ifdef ENABLE_QUICKSTART_APPLET
#include <unotools/moduleoptions.hxx>
-
#include <unotools/dynamicmenuoptions.hxx>
#include <gtk/gtk.h>
#include <glib.h>
-#include <eggtray/eggtrayicon.h>
#include <vos/mutex.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/bmpacc.hxx>
@@ -21,6 +19,7 @@
#endif
// Cut/paste from vcl/inc/svids.hrc
+#define SV_ICON_LARGE_START 24000
#define SV_ICON_SMALL_START 25000
#define SV_ICON_ID_OFFICE 1
@@ -36,9 +35,10 @@ using namespace ::rtl;
using namespace ::osl;
static ResMgr *pVCLResMgr;
-static EggTrayIcon *pTrayIcon;
+static GtkStatusIcon *pTrayIcon;
static GtkWidget *pExitMenuItem = NULL;
static GtkWidget *pOpenMenuItem = NULL;
+static GtkWidget *pDisableMenuItem = NULL;
static void open_url_cb( GtkWidget *, gpointer data )
{
@@ -66,7 +66,6 @@ static void systray_disable_cb()
static void exit_quickstarter_cb( GtkWidget * )
{
- egg_tray_icon_cancel_message (pTrayIcon, 1 );
ShutdownIcon::getInstance()->terminateDesktop();
plugin_shutdown_sys_tray();
}
@@ -78,7 +77,7 @@ static void menu_deactivate_cb( GtkWidget *pMenu )
static GdkPixbuf * ResIdToPixbuf( sal_uInt16 nResId )
{
- ResId aResId( SV_ICON_SMALL_START + nResId, *pVCLResMgr );
+ ResId aResId( nResId, *pVCLResMgr );
BitmapEx aIcon( aResId );
Bitmap pInSalBitmap = aIcon.GetBitmap();
AlphaMask pInSalAlpha = aIcon.GetAlpha();
@@ -152,7 +151,7 @@ static void add_item( GtkMenuShell *pMenuShell, const char *pAsciiURL,
RTL_TEXTENCODING_UTF8);
}
- GdkPixbuf *pPixbuf= ResIdToPixbuf( nResId );
+ GdkPixbuf *pPixbuf= ResIdToPixbuf( SV_ICON_SMALL_START + nResId );
GtkWidget *pImage = gtk_image_new_from_pixbuf( pPixbuf );
g_object_unref( G_OBJECT( pPixbuf ) );
@@ -262,10 +261,11 @@ static void populate_menu( GtkWidget *pMenu )
pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ),
G_CALLBACK( open_file_cb ));
+
pMenuItem = gtk_separator_menu_item_new();
gtk_menu_shell_append( pMenuShell, pMenuItem );
- (void) add_image_menu_item
+ pDisableMenuItem = add_image_menu_item
( pMenuShell, GTK_STOCK_CLOSE,
pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH_UNX ),
G_CALLBACK( systray_disable_cb ) );
@@ -289,31 +289,9 @@ static void refresh_menu( GtkWidget *pMenu )
bool bModal = ShutdownIcon::bModalMode;
gtk_widget_set_sensitive( pExitMenuItem, !bModal);
gtk_widget_set_sensitive( pOpenMenuItem, !bModal);
+ gtk_widget_set_sensitive( pDisableMenuItem, !bModal);
}
-extern "C" {
-static void
-layout_menu( GtkMenu *menu,
- gint *x, gint *y, gboolean *push_in,
- gpointer )
-{
- GtkRequisition req;
- GtkWidget *ebox = GTK_BIN( pTrayIcon )->child;
-
- gtk_widget_size_request( GTK_WIDGET( menu ), &req );
- gdk_window_get_origin( ebox->window, x, y );
-
- (*x) += ebox->allocation.x;
- (*y) += ebox->allocation.y;
-
- if (*y >= gdk_screen_get_height (gtk_widget_get_screen (ebox)) / 2)
- (*y) -= req.height;
- else
- (*y) += ebox->allocation.height;
-
- *push_in = sal_True;
-}
-}
static gboolean display_menu_cb( GtkWidget *,
GdkEventButton *event, GtkWidget *pMenu )
@@ -321,36 +299,15 @@ static gboolean display_menu_cb( GtkWidget *,
if (event->button == 2)
return sal_False;
-#ifdef TEMPLATE_DIALOG_MORE_POLISHED
- if (event->button == 1 &&
- event->type == GDK_2BUTTON_PRESS)
- {
- open_template_cb( NULL );
- return sal_True;
- }
- if (event->button == 3)
- {
- ... as below ...
-#endif
-
refresh_menu( pMenu );
gtk_menu_popup( GTK_MENU( pMenu ), NULL, NULL,
- layout_menu, NULL, 0, event->time );
+ gtk_status_icon_position_menu,
+ pTrayIcon, 0, event->time );
return sal_True;
}
-extern "C" {
- static gboolean
- show_at_idle( gpointer )
- {
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- gtk_widget_show_all( GTK_WIDGET( pTrayIcon ) );
- return sal_False;
- }
-}
-
void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray()
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
@@ -358,41 +315,42 @@ void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray()
if( !g_type_from_name( "GdkDisplay" ) )
return;
- OString aLabel;
ShutdownIcon *pShutdownIcon = ShutdownIcon::getInstance();
+ if ( !pShutdownIcon )
+ return;
- aLabel = rtl::OUStringToOString (
- pShutdownIcon->GetResString( STR_QUICKSTART_TIP ),
- RTL_TEXTENCODING_UTF8 );
+ pTrayIcon = gtk_status_icon_new();
+ pVCLResMgr = CREATEVERSIONRESMGR( vcl );
- pTrayIcon = egg_tray_icon_new( aLabel );
+ if ( !pTrayIcon || !pVCLResMgr )
+ return;
- GtkWidget *pParent = gtk_event_box_new();
- GtkTooltips *pTooltips = gtk_tooltips_new();
- gtk_tooltips_set_tip( GTK_TOOLTIPS( pTooltips ), pParent, aLabel, NULL );
+ // disable shutdown
+ pShutdownIcon->SetVeto( true );
+ pShutdownIcon->addTerminateListener();
- GtkWidget *pIconImage = gtk_image_new();
- gtk_container_add( GTK_CONTAINER( pParent ), pIconImage );
+ OString aLabel;
- pVCLResMgr = CREATEVERSIONRESMGR( vcl );
+ aLabel = rtl::OUStringToOString (
+ pShutdownIcon->GetResString( STR_QUICKSTART_TIP ),
+ RTL_TEXTENCODING_UTF8 );
- GdkPixbuf *pPixbuf = ResIdToPixbuf( SV_ICON_ID_OFFICE );
- gtk_image_set_from_pixbuf( GTK_IMAGE( pIconImage ), pPixbuf );
+ GdkPixbuf *pPixbuf = ResIdToPixbuf( SV_ICON_LARGE_START + SV_ICON_ID_OFFICE );
+ g_object_set( G_OBJECT( pTrayIcon ),
+ "pixbuf", pPixbuf,
+ "title", aLabel.getStr(),
+ NULL );
g_object_unref( pPixbuf );
+ gtk_status_icon_set_tooltip_text( pTrayIcon, aLabel.getStr() );
+
GtkWidget *pMenu = gtk_menu_new();
- g_signal_connect (pMenu, "deactivate",
- G_CALLBACK (menu_deactivate_cb), NULL);
- g_signal_connect( pParent, "button_press_event",
- G_CALLBACK( display_menu_cb ), pMenu );
- gtk_container_add( GTK_CONTAINER( pTrayIcon ), pParent );
- // Show at idle to avoid artefacts at startup
- g_idle_add (show_at_idle, (gpointer) pTrayIcon);
+ g_signal_connect( pTrayIcon, "button-press-event",
+ G_CALLBACK( display_menu_cb ), pMenu );
- // disable shutdown
- pShutdownIcon->SetVeto( true );
- pShutdownIcon->addTerminateListener();
+ g_signal_connect( pMenu, "deactivate",
+ G_CALLBACK (menu_deactivate_cb), NULL);
}
void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray()
@@ -400,10 +358,11 @@ void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray()
::vos::OGuard aGuard( Application::GetSolarMutex() );
if( !pTrayIcon )
return;
- gtk_widget_destroy( GTK_WIDGET( pTrayIcon ) );
+ g_object_unref( pTrayIcon );
pTrayIcon = NULL;
pExitMenuItem = NULL;
pOpenMenuItem = NULL;
+ pDisableMenuItem = NULL;
}
#endif // ENABLE_QUICKSTART_APPLET