diff options
author | Rene Engelhard <rene@rene-engelhard.de> | 2018-05-18 14:31:35 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-05-23 12:02:59 +0200 |
commit | 3e9c908b73f0fe0978c9980750a06bbc9e02295e (patch) | |
tree | 01601c826307aeb4ee3e4a50525a8039e59de443 | |
parent | 5c6c6ebd121a50b293e015d0aa6c0f1e4dc416ae (diff) |
remove Linux ("UNX") systray "Quickstarter"
Change-Id: Ie0e8b8b7ad59ee640d6b195dfae1a7cf745056fd
Reviewed-on: https://gerrit.libreoffice.org/54543
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
-rw-r--r-- | Repository.mk | 1 | ||||
-rw-r--r-- | config_host.mk.in | 1 | ||||
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | desktop/Library_sofficeapp.mk | 1 | ||||
-rw-r--r-- | distro-configs/LibreOfficeAndroid.conf | 1 | ||||
-rw-r--r-- | distro-configs/LibreOfficeAndroidAarch64.conf | 1 | ||||
-rw-r--r-- | distro-configs/LibreOfficeAndroidX86.conf | 1 | ||||
-rw-r--r-- | distro-configs/LibreOfficeiOS.conf | 1 | ||||
-rw-r--r-- | scp2/InstallModule_ooo.mk | 1 | ||||
-rw-r--r-- | scp2/source/ooo/common_brand.scp | 11 | ||||
-rw-r--r-- | sfx2/Library_qstart_gtk.mk | 67 | ||||
-rw-r--r-- | sfx2/Library_sfx.mk | 8 | ||||
-rw-r--r-- | sfx2/Module_sfx2.mk | 8 | ||||
-rw-r--r-- | sfx2/source/appl/shutdownicon.cxx | 117 | ||||
-rw-r--r-- | sfx2/source/appl/shutdowniconunx.cxx | 388 | ||||
-rw-r--r-- | sysui/CustomTarget_share.mk | 4 | ||||
-rw-r--r-- | sysui/desktop/menus/qstart.desktop | 28 |
17 files changed, 13 insertions, 638 deletions
diff --git a/Repository.mk b/Repository.mk index 7a019e2d311b..b69650c0d62b 100644 --- a/Repository.mk +++ b/Repository.mk @@ -289,7 +289,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,gnome, \ $(if $(ENABLE_EVOAB2),evoab) \ $(if $(ENABLE_GTK),vclplug_gtk) \ $(if $(ENABLE_GTK3),vclplug_gtk3) \ - $(if $(ENABLE_SYSTRAY_GTK),qstart_gtk) \ $(if $(ENABLE_GIO),losessioninstall) \ $(if $(ENABLE_GIO),ucpgio1) \ )) diff --git a/config_host.mk.in b/config_host.mk.in index 70f0ecb02893..4a864c745424 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -171,7 +171,6 @@ export ENABLE_SDREMOTE=@ENABLE_SDREMOTE@ export ENABLE_SDREMOTE_BLUETOOTH=@ENABLE_SDREMOTE_BLUETOOTH@ export ENABLE_SILENT_MSI=@ENABLE_SILENT_MSI@ export ENABLE_SYMBOLS=@ENABLE_SYMBOLS@ -export ENABLE_SYSTRAY_GTK=@ENABLE_SYSTRAY_GTK@ export ENABLE_VALGRIND=@ENABLE_VALGRIND@ export ENABLE_VLC=@ENABLE_VLC@ export ENABLE_WERROR=@ENABLE_WERROR@ diff --git a/configure.ac b/configure.ac index 95e2865017a8..1d7770709b32 100644 --- a/configure.ac +++ b/configure.ac @@ -672,7 +672,6 @@ darwin*) # Mac OS X or iOS INSTROOTCONTENTSUFFIX=/Contents SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK fi - enable_systray=no # See comment above the case "$host_os" LINKFLAGSSHL="-dynamiclib -single_module" @@ -1197,11 +1196,6 @@ libo_FUZZ_ARG_ENABLE(gtk3, [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]), ,test "${enable_gtk3+set}" = set || enable_gtk3=yes) -libo_FUZZ_ARG_ENABLE(systray, - AS_HELP_STRING([--disable-systray], - [Determines whether to build the systray quickstarter.]), -,test "${enable_systray+set}" = set || enable_systray=yes) - AC_ARG_ENABLE(split-app-modules, AS_HELP_STRING([--enable-split-app-modules], [Split file lists for app modules, e.g. base, calc. @@ -10111,7 +10105,6 @@ dnl =================================================================== GTK_CFLAGS="" GTK_LIBS="" -ENABLE_SYSTRAY_GTK="" if test "$test_gtk" = "yes"; then if test "$ENABLE_GTK" = "TRUE"; then @@ -10125,10 +10118,6 @@ if test "$test_gtk" = "yes"; then FilterLibs "${GTHREAD_LIBS}" GTHREAD_LIBS="${filteredlibs}" - if test "x$enable_systray" = "xyes"; then - ENABLE_SYSTRAY_GTK="TRUE" - fi - AC_MSG_CHECKING([whether to enable Gtk print dialog support]) PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0], [ENABLE_GTK_PRINT="TRUE"], @@ -10156,7 +10145,6 @@ fi AC_SUBST(ENABLE_GIO) AC_SUBST(GIO_CFLAGS) AC_SUBST(GIO_LIBS) -AC_SUBST(ENABLE_SYSTRAY_GTK) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) AC_SUBST(GTHREAD_CFLAGS) diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk index 53496f2c1544..288e26d47726 100644 --- a/desktop/Library_sofficeapp.mk +++ b/desktop/Library_sofficeapp.mk @@ -49,7 +49,6 @@ $(eval $(call gb_Library_add_defs,sofficeapp,\ -DDESKTOP_DLLIMPLEMENTATION \ $(if $(filter WNT,$(OS)),-DENABLE_QUICKSTART_APPLET) \ $(if $(filter MACOSX,$(OS)),-DENABLE_QUICKSTART_APPLET) \ - $(if $(filter TRUE,$(ENABLE_SYSTRAY_GTK)),-DENABLE_QUICKSTART_APPLET) \ )) $(eval $(call gb_Library_set_precompiled_header,sofficeapp,$(SRCDIR)/desktop/inc/pch/precompiled_sofficeapp)) diff --git a/distro-configs/LibreOfficeAndroid.conf b/distro-configs/LibreOfficeAndroid.conf index 9cc574909d66..cc82b0df393b 100644 --- a/distro-configs/LibreOfficeAndroid.conf +++ b/distro-configs/LibreOfficeAndroid.conf @@ -4,7 +4,6 @@ --disable-gstreamer-0-10 --disable-gstreamer-1-0 --disable-randr ---disable-systray --without-export-validation --without-helppack-integration --without-junit diff --git a/distro-configs/LibreOfficeAndroidAarch64.conf b/distro-configs/LibreOfficeAndroidAarch64.conf index 4f3d2f44c5fc..7a8c6416d500 100644 --- a/distro-configs/LibreOfficeAndroidAarch64.conf +++ b/distro-configs/LibreOfficeAndroidAarch64.conf @@ -4,7 +4,6 @@ --disable-gstreamer-0-10 --disable-gstreamer-1-0 --disable-randr ---disable-systray --without-export-validation --without-helppack-integration --without-junit diff --git a/distro-configs/LibreOfficeAndroidX86.conf b/distro-configs/LibreOfficeAndroidX86.conf index 7a2586989391..d66b1b87ed27 100644 --- a/distro-configs/LibreOfficeAndroidX86.conf +++ b/distro-configs/LibreOfficeAndroidX86.conf @@ -4,7 +4,6 @@ --disable-gstreamer-0-10 --disable-gstreamer-1-0 --disable-randr ---disable-systray --without-export-validation --without-helppack-integration --without-junit diff --git a/distro-configs/LibreOfficeiOS.conf b/distro-configs/LibreOfficeiOS.conf index 57080907e3d1..b87327d97a35 100644 --- a/distro-configs/LibreOfficeiOS.conf +++ b/distro-configs/LibreOfficeiOS.conf @@ -1,7 +1,6 @@ --disable-breakpad --disable-firebird-sdbc --disable-online-update ---disable-systray --without-export-validation --without-helppack-integration diff --git a/scp2/InstallModule_ooo.mk b/scp2/InstallModule_ooo.mk index a832cb20f665..f7f3c80867b2 100644 --- a/scp2/InstallModule_ooo.mk +++ b/scp2/InstallModule_ooo.mk @@ -21,7 +21,6 @@ $(eval $(call gb_InstallModule_use_auto_install_libs,scp2/ooo,\ )) $(eval $(call gb_InstallModule_define_if_set,scp2/ooo,\ - ENABLE_SYSTRAY_GTK \ ENABLE_MACOSX_SANDBOX \ ENABLE_ONLINE_UPDATE \ SYSTEM_CURL \ diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp index 1eef7833f2d0..08e3b43df660 100644 --- a/scp2/source/ooo/common_brand.scp +++ b/scp2/source/ooo/common_brand.scp @@ -237,17 +237,6 @@ End #endif #if defined UNX && ! defined MACOSX -#ifdef ENABLE_SYSTRAY_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 TXT_FILE_BODY; Dir = gid_Brand_Dir_Share_Xdg; diff --git a/sfx2/Library_qstart_gtk.mk b/sfx2/Library_qstart_gtk.mk deleted file mode 100644 index 82a23111eaa6..000000000000 --- a/sfx2/Library_qstart_gtk.mk +++ /dev/null @@ -1,67 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - - -$(eval $(call gb_Library_Library,qstart_gtk)) - -$(eval $(call gb_Library_set_include,qstart_gtk,\ - $$(INCLUDE) \ - -I$(SRCDIR)/sfx2/inc \ -)) - -$(eval $(call gb_Library_use_sdk_api,qstart_gtk)) - -$(eval $(call gb_Library_add_defs,qstart_gtk,-DENABLE_QUICKSTART_APPLET)) - -ifeq ($(ENABLE_SYSTRAY_GTK),TRUE) -$(eval $(call gb_Library_add_defs,qstart_gtk,-DENABLE_SYSTRAY_GTK)) -endif - -$(eval $(call gb_Library_use_libraries,qstart_gtk,\ - comphelper \ - cppu \ - cppuhelper \ - fwe \ - i18nlangtag \ - sal \ - sax \ - sb \ - sot \ - svl \ - svt \ - tk \ - tl \ - ucbhelper \ - utl \ - vcl \ - sfx \ -)) - -$(eval $(call gb_Library_use_externals,qstart_gtk,\ - boost_headers \ - gio \ - gtk \ - libxml2 \ -)) - -$(eval $(call gb_Library_add_exception_objects,qstart_gtk,\ - sfx2/source/appl/shutdowniconunx \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index 2e2d6513319f..2cfa3b5dcf21 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -44,14 +44,6 @@ $(eval $(call gb_Library_add_defs,sfx,\ $(if $(filter TRUE,$(ENABLE_CUPS)),-DENABLE_CUPS) \ )) -ifeq ($(ENABLE_SYSTRAY_GTK),TRUE) -$(eval $(call gb_Library_add_defs,sfx,\ - -DENABLE_QUICKSTART_APPLET \ - -DENABLE_SYSTRAY_GTK \ - -DPLUGIN_NAME=libqstart_gtk$(gb_Library_OOOEXT) \ -)) -endif - $(eval $(call gb_Library_use_libraries,sfx,\ basegfx \ comphelper \ diff --git a/sfx2/Module_sfx2.mk b/sfx2/Module_sfx2.mk index 89b5aa419aa8..b3a1f061b853 100644 --- a/sfx2/Module_sfx2.mk +++ b/sfx2/Module_sfx2.mk @@ -51,14 +51,6 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sfx2,\ )) endif -ifneq (,$(filter LINUX DRAGONFLY OPENBSD FREEBSD NETBSD SOLARIS, $(OS))) -ifeq ($(ENABLE_SYSTRAY_GTK),TRUE) -$(eval $(call gb_Module_add_targets,sfx2,\ - Library_qstart_gtk \ -)) -endif -endif - #todo: clean up quickstarter stuff in both libraries #todo: move standard pool to svl diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 0e9548dbcbec..8f420d84395d 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -78,12 +78,6 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star::ui::dialogs; using namespace ::sfx2; -#ifdef ENABLE_QUICKSTART_APPLET -# if !defined(_WIN32) && !defined(MACOSX) -extern "C" { static void thisModule() {} } -# endif -#endif - class SfxNotificationListener_Impl : public cppu::WeakImplHelper< XDispatchResultListener > { public: @@ -143,27 +137,7 @@ bool LoadModule() pInitSystray = aqua_init_systray; pDeInitSystray = aqua_shutdown_systray; loaded = true; -# else // UNX - osl::Module plugin; - oslGenericFunction pTmpInit = nullptr; - oslGenericFunction pTmpDeInit = nullptr; - if ( plugin.loadRelative( &thisModule, "libqstart_gtklo.so" ) ) - { - pTmpInit = plugin.getFunctionSymbol( "plugin_init_sys_tray" ); - pTmpDeInit = plugin.getFunctionSymbol( "plugin_shutdown_sys_tray" ); - } - if ( !pTmpInit || !pTmpDeInit ) - { - loaded = false; - } - else - { - plugin.release(); - pInitSystray = pTmpInit; - pDeInitSystray = pTmpDeInit; - loaded = true; - } -# endif // UNX +# endif // MACOSX #endif // ENABLE_QUICKSTART_APPLET } assert(!boost::logic::indeterminate(loaded)); @@ -637,56 +611,15 @@ void ShutdownIcon::LeaveModalMode() #else bool ShutdownIcon::IsQuickstarterInstalled() { -#ifndef ENABLE_QUICKSTART_APPLET return false; -#else // !ENABLE_QUICKSTART_APPLET -#ifdef UNX - return LoadModule(); -#endif // UNX -#endif // !ENABLE_QUICKSTART_APPLET -} -#endif // !WNT - - -#if defined (ENABLE_QUICKSTART_APPLET) && defined (UNX) -/** -* Return the XDG autostart directory. -* http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html -* Available in Unix and with Quickstart enabled. -* @param bCreate Create the directory if it does not exist yet. -* @return OUString containing the autostart directory path. -*/ -static OUString getAutostartDir( bool bCreate ) -{ - OUString aShortcut; - const char *pConfigHome; - if( (pConfigHome = getenv("XDG_CONFIG_HOME") ) ) - aShortcut = OStringToOUString( OString( pConfigHome ), - RTL_TEXTENCODING_UTF8 ); - else - { - OUString aHomeURL; - osl::Security().getHomeDir( aHomeURL ); - ::osl::File::getSystemPathFromFileURL( aHomeURL, aShortcut ); - aShortcut += "/.config"; - } - aShortcut += "/autostart"; - if (bCreate) - { - OUString aShortcutUrl; - osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl ); - osl::Directory::createPath( aShortcutUrl ); - } - return aShortcut; } #endif + +#ifdef ENABLE_QUICKSTART_APPLET +#ifndef MACOSX OUString ShutdownIcon::getShortcutName() { -#ifndef ENABLE_QUICKSTART_APPLET - return OUString(); -#else - #ifdef _WIN32 OUString aShortcutName(SfxResId(STR_QUICKSTART_LNKNAME)); aShortcutName += ".lnk"; @@ -694,13 +627,11 @@ OUString ShutdownIcon::getShortcutName() OUString aShortcut(GetAutostartFolderNameW32()); aShortcut += "\\"; aShortcut += aShortcutName; -#else // UNX - OUString aShortcut = getAutostartDir(false); - aShortcut += "/qstart.desktop"; -#endif // UNX return aShortcut; -#endif // ENABLE_QUICKSTART_APPLET +#endif // _WIN32 } +#endif +#endif bool ShutdownIcon::GetAutostart( ) { @@ -727,48 +658,22 @@ bool ShutdownIcon::GetAutostart( ) void ShutdownIcon::SetAutostart( bool bActivate ) { #ifdef ENABLE_QUICKSTART_APPLET +#ifndef MACOSX OUString aShortcut( getShortcutName() ); +#endif if( bActivate && IsQuickstarterInstalled() ) { #ifdef _WIN32 EnableAutostartW32( aShortcut ); -#else // UNX - getAutostartDir( true ); - - OUString aPath( "${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/xdg/qstart.desktop" ); - rtl::Bootstrap::expandMacros( aPath ); - - OUString aDesktopFile; - ::osl::File::getSystemPathFromFileURL( aPath, aDesktopFile ); - - OString aDesktopFileUnx = OUStringToOString( aDesktopFile, - osl_getThreadTextEncoding() ); - OString aShortcutUnx = OUStringToOString( aShortcut, - osl_getThreadTextEncoding() ); - if ((0 != symlink(aDesktopFileUnx.getStr(), aShortcutUnx.getStr())) && (errno == EEXIST)) - { - unlink(aShortcutUnx.getStr()); - (void) symlink(aDesktopFileUnx.getStr(), aShortcutUnx.getStr()); - //deliberately ignore return value, it's non-critical if it fails - } - - ShutdownIcon *pIcon = ShutdownIcon::createInstance(); - if( pIcon ) - pIcon->initSystray(); -#endif // UNX +#endif } else { +#ifndef MACOSX OUString aShortcutUrl; ::osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl ); ::osl::File::remove( aShortcutUrl ); -#ifdef UNX - if (pShutdownIcon) - { - ShutdownIcon *pIcon = getInstance(); - pIcon->deInitSystray(); - } #endif } #else diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx deleted file mode 100644 index 25c35f86a35c..000000000000 --- a/sfx2/source/appl/shutdowniconunx.cxx +++ /dev/null @@ -1,388 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifdef ENABLE_QUICKSTART_APPLET - -#include <unotools/moduleoptions.hxx> - -#include <unotools/dynamicmenuoptions.hxx> - -#include <gtk/gtk.h> -#include <glib.h> -#include <osl/module.hxx> -#include <sfx2/app.hxx> -#include <sfx2/sfxresid.hxx> -#include <sfx2/strings.hrc> -#include "shutdownicon.hxx" - -#include <config_gio.h> - -#if ENABLE_GIO -#include <gio/gio.h> -#endif - -// Cut/paste from vcl/inc/svids.hrc -#define SV_ICON_ID_TEXT 2 -#define SV_ICON_ID_SPREADSHEET 4 -#define SV_ICON_ID_DRAWING 6 -#define SV_ICON_ID_PRESENTATION 8 -#define SV_ICON_ID_TEMPLATE 11 -#define SV_ICON_ID_DATABASE 12 -#define SV_ICON_ID_FORMULA 13 - -using namespace ::osl; - -static GtkStatusIcon* pTrayIcon; -static GtkWidget *pExitMenuItem = nullptr; -static GtkWidget *pOpenMenuItem = nullptr; -static GtkWidget *pDisableMenuItem = nullptr; -#if ENABLE_GIO -static GFileMonitor* pMonitor = nullptr; -#endif - -static void open_url_cb( GtkWidget *, gpointer data ) -{ - ShutdownIcon::OpenURL( *static_cast<OUString *>(data), - "_default" ); -} - -static void open_file_cb( GtkWidget * ) -{ - if ( !ShutdownIcon::bModalMode ) - ShutdownIcon::FileOpen(); -} - -static void open_template_cb( GtkWidget * ) -{ - if ( !ShutdownIcon::bModalMode ) - ShutdownIcon::FromTemplate(); -} - -static void systray_disable_cb() -{ - ShutdownIcon::SetAutostart( false ); - ShutdownIcon::terminateDesktop(); -} - -static void exit_quickstarter_cb( GtkWidget * ) -{ - plugin_shutdown_sys_tray(); - //terminate may cause this .so to be unloaded. So we must be hands off - //all calls into this .so after this call - ShutdownIcon::terminateDesktop(); -} - -static void menu_deactivate_cb( GtkWidget *pMenu ) -{ - gtk_menu_popdown( GTK_MENU( pMenu ) ); -} - -extern "C" { -static void oustring_delete (gpointer data, - GClosure * /* closure */) -{ - OUString *pURL = static_cast<OUString *>(data); - delete pURL; -} -} - -static void add_item( GtkMenuShell *pMenuShell, const char *pAsciiURL, - OUString const *pOverrideLabel, - sal_uInt16 nResId, GCallback pFnCallback ) -{ - OUString *pURL = new OUString (OStringToOUString( pAsciiURL, - RTL_TEXTENCODING_UTF8 )); - OString aLabel; - if (pOverrideLabel) - aLabel = OUStringToOString (*pOverrideLabel, RTL_TEXTENCODING_UTF8); - else - { - aLabel = OUStringToOString (ShutdownIcon::GetUrlDescription( *pURL ), - RTL_TEXTENCODING_UTF8); - } - - gchar* appicon; - - if (nResId == SV_ICON_ID_TEXT) - appicon = g_strdup ("libreoffice-writer"); - else if (nResId == SV_ICON_ID_SPREADSHEET) - appicon = g_strdup ("libreoffice-calc"); - else if (nResId == SV_ICON_ID_DRAWING) - appicon = g_strdup ("libreoffice-draw"); - else if (nResId == SV_ICON_ID_PRESENTATION) - appicon = g_strdup ("libreoffice-impress"); - else if (nResId == SV_ICON_ID_DATABASE) - appicon = g_strdup ("libreoffice-base"); - else if (nResId == SV_ICON_ID_FORMULA) - appicon = g_strdup ("libreoffice-math"); - else - appicon = g_strdup ("libreoffice-startcenter"); - - GtkWidget *pImage = gtk_image_new_from_icon_name (appicon, GTK_ICON_SIZE_MENU); - GtkWidget *pMenuItem = gtk_image_menu_item_new_with_label( aLabel.getStr() ); - gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM( pMenuItem ), pImage ); - g_signal_connect_data( pMenuItem, "activate", pFnCallback, pURL, - oustring_delete, GConnectFlags(0)); - - gtk_menu_shell_append( pMenuShell, pMenuItem ); -} - -// Unbelievably nasty -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::task; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::beans; - -static void add_ugly_db_item( GtkMenuShell *pMenuShell, const char *pAsciiURL, - sal_uInt16 nResId, GCallback pFnCallback ) -{ - SvtDynamicMenuOptions aOpt; - Sequence < Sequence < PropertyValue > > aMenu = aOpt.GetMenu( EDynamicMenuType::NewMenu ); - for ( sal_Int32 n=0; n<aMenu.getLength(); n++ ) - { - OUString aURL; - OUString aDescription; - Sequence < PropertyValue >& aEntry = aMenu[n]; - for ( sal_Int32 m=0; m<aEntry.getLength(); m++ ) - { - if ( aEntry[m].Name == "URL" ) - aEntry[m].Value >>= aURL; - if ( aEntry[m].Name == "Title" ) - aEntry[m].Value >>= aDescription; - } - - if ( aURL == BASE_URL && !aDescription.isEmpty() ) - { - add_item (pMenuShell, pAsciiURL, &aDescription, nResId, pFnCallback); - break; - } - } -} - -static GtkWidget * -add_image_menu_item( GtkMenuShell *pMenuShell, - const gchar *stock_id, - const OUString& aLabel, - GCallback activate_cb ) -{ - OString aUtfLabel = OUStringToOString (aLabel, RTL_TEXTENCODING_UTF8 ); - - GtkWidget *pImage; - pImage = gtk_image_new_from_stock( stock_id, GTK_ICON_SIZE_MENU ); - - GtkWidget *pMenuItem; - pMenuItem = gtk_image_menu_item_new_with_label( aUtfLabel.getStr() ); - gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM( pMenuItem ), pImage ); - - gtk_menu_shell_append( pMenuShell, pMenuItem ); - g_signal_connect( pMenuItem, "activate", activate_cb, nullptr); - - return pMenuItem; -} - -static void populate_menu( GtkWidget *pMenu ) -{ - GtkMenuShell *pMenuShell = GTK_MENU_SHELL( pMenu ); - SvtModuleOptions aModuleOptions; - - if ( aModuleOptions.IsWriter() ) - add_item (pMenuShell, WRITER_URL, nullptr, - SV_ICON_ID_TEXT, G_CALLBACK( open_url_cb )); - - if ( aModuleOptions.IsCalc() ) - add_item (pMenuShell, CALC_URL, nullptr, - SV_ICON_ID_SPREADSHEET, G_CALLBACK( open_url_cb )); - - if ( aModuleOptions.IsImpress() ) - add_item (pMenuShell, IMPRESS_URL, nullptr, - SV_ICON_ID_PRESENTATION, G_CALLBACK( open_url_cb )); - - if ( aModuleOptions.IsDraw() ) - add_item (pMenuShell, DRAW_URL, nullptr, - SV_ICON_ID_DRAWING, G_CALLBACK( open_url_cb )); - - if ( aModuleOptions.IsDataBase() ) - add_ugly_db_item (pMenuShell, BASE_URL, - SV_ICON_ID_DATABASE, G_CALLBACK( open_url_cb )); - - if ( aModuleOptions.IsMath() ) - add_item (pMenuShell, MATH_URL, nullptr, - SV_ICON_ID_FORMULA, G_CALLBACK( open_url_cb )); - - OUString aULabel = SfxResId(STR_QUICKSTART_FROMTEMPLATE); - add_item (pMenuShell, "dummy", &aULabel, - SV_ICON_ID_TEMPLATE, G_CALLBACK( open_template_cb )); - - GtkWidget *pMenuItem; - - pMenuItem = gtk_separator_menu_item_new(); - gtk_menu_shell_append( pMenuShell, pMenuItem ); - - pOpenMenuItem = add_image_menu_item - (pMenuShell, GTK_STOCK_OPEN, - SfxResId(STR_QUICKSTART_FILEOPEN), - G_CALLBACK( open_file_cb )); - - - pMenuItem = gtk_separator_menu_item_new(); - gtk_menu_shell_append( pMenuShell, pMenuItem ); - - pDisableMenuItem = add_image_menu_item - ( pMenuShell, GTK_STOCK_CLOSE, - SfxResId(STR_QUICKSTART_PRELAUNCH_UNX), - G_CALLBACK( systray_disable_cb ) ); - - pMenuItem = gtk_separator_menu_item_new(); - gtk_menu_shell_append( pMenuShell, pMenuItem ); - - pExitMenuItem = add_image_menu_item - ( pMenuShell, GTK_STOCK_QUIT, - SfxResId(STR_QUICKSTART_EXIT), - G_CALLBACK( exit_quickstarter_cb ) ); - - gtk_widget_show_all( pMenu ); -} - -static void refresh_menu( GtkWidget *pMenu ) -{ - if (!pExitMenuItem) - populate_menu( pMenu ); - - bool bModal = ShutdownIcon::bModalMode; - gtk_widget_set_sensitive( pExitMenuItem, !bModal); - gtk_widget_set_sensitive( pOpenMenuItem, !bModal); - gtk_widget_set_sensitive( pDisableMenuItem, !bModal); -} - -static gboolean display_menu_cb( GtkWidget *, - GdkEventButton *event, GtkWidget *pMenu ) -{ - if (event->button == 2) - return false; - - refresh_menu( pMenu ); - - gtk_menu_popup( GTK_MENU( pMenu ), nullptr, nullptr, - gtk_status_icon_position_menu, pTrayIcon, - 0, event->time ); - - return true; -} - -#if ENABLE_GIO -/* - * If the quickstarter is running, then LibreOffice is - * upgraded, then the old quickstarter is still running, but is now unreliable - * as the old install has been deleted. A fairly intractable problem but we - * can avoid much of the pain if we turn off the quickstarter if we detect - * that it has been physically deleted or overwritten -*/ -static void notify_file_changed(GFileMonitor * /*gfilemonitor*/, GFile * /*arg1*/, - GFile * /*arg2*/, GFileMonitorEvent event_type, gpointer /*user_data*/) -{ - //Shutdown the quick starter if anything has happened to make it unsafe - //to remain running, e.g. rpm --erased and all libs deleted, or - //rpm --upgrade and libs being overwritten - switch (event_type) - { - case G_FILE_MONITOR_EVENT_DELETED: - case G_FILE_MONITOR_EVENT_CREATED: - case G_FILE_MONITOR_EVENT_PRE_UNMOUNT: - case G_FILE_MONITOR_EVENT_UNMOUNTED: - exit_quickstarter_cb(GTK_WIDGET(pTrayIcon)); - break; - default: - break; - } -} -#endif - -void plugin_init_sys_tray() -{ - ::SolarMutexGuard aGuard; - - /* we need the vcl plugin and mainloop initialized */ - if (!g_type_from_name( "GdkDisplay" )) - return; - - OString aLabel; - ShutdownIcon *pShutdownIcon = ShutdownIcon::getInstance(); - - aLabel = OUStringToOString ( - SfxResId(STR_QUICKSTART_TIP), - RTL_TEXTENCODING_UTF8 ); - - pTrayIcon = gtk_status_icon_new_from_icon_name ("libreoffice-startcenter"); - - g_object_set (pTrayIcon, "title", aLabel.getStr(), - "tooltip_text", aLabel.getStr(), nullptr); - - GtkWidget *pMenu = gtk_menu_new(); - g_signal_connect(pTrayIcon, "button-press-event", - G_CALLBACK(display_menu_cb), pMenu); - g_signal_connect (pMenu, "deactivate", - G_CALLBACK (menu_deactivate_cb), nullptr); - - // disable shutdown - pShutdownIcon->SetVeto( true ); - ShutdownIcon::addTerminateListener(); - -#if ENABLE_GIO - GFile* pFile = nullptr; - OUString sLibraryFileUrl; - if (osl::Module::getUrlFromAddress(plugin_init_sys_tray, sLibraryFileUrl)) - pFile = g_file_new_for_uri(OUStringToOString(sLibraryFileUrl, RTL_TEXTENCODING_UTF8).getStr()); - - if (pFile) - { - if ((pMonitor = g_file_monitor_file(pFile, G_FILE_MONITOR_NONE, nullptr, nullptr))) - g_signal_connect(pMonitor, "changed", reinterpret_cast<GCallback>(notify_file_changed), nullptr); - g_object_unref(pFile); - } -#endif -} - -void plugin_shutdown_sys_tray() -{ - ::SolarMutexGuard aGuard; - if( !pTrayIcon ) - return; - -#if ENABLE_GIO - if (pMonitor) - { - g_signal_handlers_disconnect_by_func(pMonitor, - reinterpret_cast<gpointer>(¬ify_file_changed), pMonitor); - g_file_monitor_cancel(pMonitor); - g_object_unref(pMonitor); - pMonitor = nullptr; - } -#endif - - g_object_unref(pTrayIcon); - pTrayIcon = nullptr; - - pExitMenuItem = nullptr; - pOpenMenuItem = nullptr; - pDisableMenuItem = nullptr; -} - -#endif // ENABLE_QUICKSTART_APPLET - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sysui/CustomTarget_share.mk b/sysui/CustomTarget_share.mk index ebbd713c45b5..d4f24b5f8e60 100644 --- a/sysui/CustomTarget_share.mk +++ b/sysui/CustomTarget_share.mk @@ -26,7 +26,7 @@ share_SRCDIR := $(SRCDIR)/sysui/desktop share_TRANSLATE := $(SRCDIR)/solenv/bin/desktop-translate.pl LAUNCHERLIST_APPS := writer calc draw impress math base startcenter -LAUNCHERLIST := $(LAUNCHERLIST_APPS) qstart xsltfilter +LAUNCHERLIST := $(LAUNCHERLIST_APPS) xsltfilter LAUNCHERS := $(foreach launcher,$(LAUNCHERLIST),$(share_SRCDIR)/menus/$(launcher).desktop) MIMELIST := \ @@ -177,7 +177,7 @@ $(share_WORKDIR)/%/create_tree.sh: $(share_SRCDIR)/share/create_tree.sh \ $(share_WORKDIR)/%/launcherlist: $(LAUNCHERS) mkdir -p $(dir $@) $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1) - echo "$(addsuffix .desktop,$(filter-out qstart,$(LAUNCHERLIST)))" > $@ + echo "$(addsuffix .desktop,$(LAUNCHERLIST))" > $@ $(share_WORKDIR)/%/openoffice.applications: $(share_SRCDIR)/mimetypes/openoffice.applications diff --git a/sysui/desktop/menus/qstart.desktop b/sysui/desktop/menus/qstart.desktop deleted file mode 100644 index fc62b3215b8c..000000000000 --- a/sysui/desktop/menus/qstart.desktop +++ /dev/null @@ -1,28 +0,0 @@ -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# -[Desktop Entry] -Version=1.0 -Terminal=false -Type=Application -Categories=Office; -Exec=${UNIXBASISROOTNAME} --quickstart --nologo --nodefault -NoDisplay=true -Name=%PRODUCTNAME Quickstarter -Comment=Hook for quickstarter startup -X-GIO-NoFuse=true -X-KDE-Protocols=file,http,ftp,webdav,webdavs |