View | Details | Raw Unified | Return to issue 118519
Collapse All | Expand All

(-)a/configure.in (-2 / +4 lines)
Lines 5797-5804 if test "$test_gtk" = "yes"; then Link Here
5797
      BUILD_TYPE="$BUILD_TYPE GTK"
5797
      BUILD_TYPE="$BUILD_TYPE GTK"
5798
5798
5799
      if test "x$enable_systray" = "xyes"; then
5799
      if test "x$enable_systray" = "xyes"; then
5800
         ENABLE_SYSTRAY_GTK="TRUE"
5800
         PKG_CHECK_MODULES(GTK_2_16,gtk+-2.0 >= 2.16.0,
5801
         BUILD_TYPE="$BUILD_TYPE SYSTRAY_GTK"
5801
                           [ENABLE_SYSTRAY_GTK="TRUE"
5802
                            BUILD_TYPE="$BUILD_TYPE SYSTRAY_GTK"],
5803
                           [ENABLE_SYSTRAY_GTK=""])
5802
      fi
5804
      fi
5803
5805
5804
      AC_MSG_CHECKING([whether to enable DBUS support])
5806
      AC_MSG_CHECKING([whether to enable DBUS support])
(-)a/desktop/source/app/app.cxx (-1 / +13 lines)
Lines 132-137 Link Here
132
#include <unotools/syslocaleoptions.hxx>
132
#include <unotools/syslocaleoptions.hxx>
133
#include <unotools/syslocale.hxx>
133
#include <unotools/syslocale.hxx>
134
#include <svl/folderrestriction.hxx>
134
#include <svl/folderrestriction.hxx>
135
#include <svl/eitem.hxx>
136
#include <svl/itemset.hxx>
135
#include <unotools/tempfile.hxx>
137
#include <unotools/tempfile.hxx>
136
#include <rtl/logfile.hxx>
138
#include <rtl/logfile.hxx>
137
#include <rtl/ustrbuf.hxx>
139
#include <rtl/ustrbuf.hxx>
Lines 145-150 Link Here
145
#include <vcl/stdtext.hxx>
147
#include <vcl/stdtext.hxx>
146
#include <vcl/msgbox.hxx>
148
#include <vcl/msgbox.hxx>
147
#include <sfx2/sfx.hrc>
149
#include <sfx2/sfx.hrc>
150
#include <sfx2/app.hxx>
148
#include <ucbhelper/contentbroker.hxx>
151
#include <ucbhelper/contentbroker.hxx>
149
#include <unotools/bootstrap.hxx>
152
#include <unotools/bootstrap.hxx>
150
#include <cppuhelper/bootstrap.hxx>
153
#include <cppuhelper/bootstrap.hxx>
Lines 2118-2129 sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r Link Here
2118
        RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) createInstance com.sun.star.office.Quickstart" );
2121
        RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) createInstance com.sun.star.office.Quickstart" );
2119
2122
2120
        sal_Bool bQuickstart = GetCommandLineArgs()->IsQuickstart();
2123
        sal_Bool bQuickstart = GetCommandLineArgs()->IsQuickstart();
2124
        if ( !bQuickstart )
2125
        {
2126
            SfxItemSet aOptSet( SFX_APP()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER );
2127
            SFX_APP()->GetOptions(aOptSet);
2128
            const SfxPoolItem* pItem;
2129
            if ( SFX_ITEM_SET == aOptSet.GetItemState( SID_ATTR_QUICKLAUNCHER, sal_False, &pItem ) )
2130
                bQuickstart = ((const SfxBoolItem*)pItem)->GetValue();
2131
        }
2132
2121
        Sequence< Any > aSeq( 1 );
2133
        Sequence< Any > aSeq( 1 );
2122
        aSeq[0] <<= bQuickstart;
2134
        aSeq[0] <<= bQuickstart;
2123
2135
2124
        // Try to instanciate quickstart service. This service is not mandatory, so
2136
        // Try to instanciate quickstart service. This service is not mandatory, so
2125
        // do nothing if service is not available
2137
        // do nothing if service is not available
2126
        
2138
2127
        // #i105753# the following if was invented for performance
2139
        // #i105753# the following if was invented for performance
2128
        // unfortunately this broke the QUARTZ behavior which is to always run
2140
        // unfortunately this broke the QUARTZ behavior which is to always run
2129
        // in quickstart mode since Mac applications do not usually quit
2141
        // in quickstart mode since Mac applications do not usually quit
(-)a/desktop/source/app/cmdlineargs.cxx (-1 / +1 lines)
Lines 422-428 sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& Link Here
422
    }
422
    }
423
    else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart" )) == sal_True )
423
    else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart" )) == sal_True )
424
    {
424
    {
425
#if defined(WNT) || defined(OS2) || defined(QUARTZ)
425
#if defined(ENABLE_QUICKSTART_APPLET)
426
        SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_True );
426
        SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_True );
427
#endif
427
#endif
428
        SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_False );
428
        SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_False );
(-)a/desktop/source/app/makefile.mk (+4 lines)
Lines 41-46 ENABLE_EXCEPTIONS=TRUE Link Here
41
CFLAGS+=-DGNOME_VFS_ENABLED
41
CFLAGS+=-DGNOME_VFS_ENABLED
42
.ENDIF
42
.ENDIF
43
43
44
.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2" || "$(GUIBASE)"=="aqua" || "$(ENABLE_SYSTRAY_GTK)"=="TRUE"
45
CFLAGS+=-DENABLE_QUICKSTART_APPLET
46
.ENDIF
47
44
# .IF "$(OS)" == "WNT"
48
# .IF "$(OS)" == "WNT"
45
# .IF "$(COM)" == "GCC"
49
# .IF "$(COM)" == "GCC"
46
# DEPLOYMENTMISCLIB = -ldeploymentmisc$(DLLPOSTFIX)
50
# DEPLOYMENTMISCLIB = -ldeploymentmisc$(DLLPOSTFIX)
(-)a/scp2/source/ooo/common_brand.scp (-11 / +11 lines)
Lines 98-104 Module gid_Module_Root_Brand Link Here
98
             gid_Brand_File_Share_Xdg_JavaFilter,
98
             gid_Brand_File_Share_Xdg_JavaFilter,
99
             gid_Brand_File_Share_Xdg_Math,
99
             gid_Brand_File_Share_Xdg_Math,
100
             gid_Brand_File_Share_Xdg_Printeradmin,
100
             gid_Brand_File_Share_Xdg_Printeradmin,
101
//             gid_Brand_File_Share_Xdg_QStart,
101
             gid_Brand_File_Share_Xdg_QStart,
102
             gid_Brand_File_Share_Xdg_StartCenter,
102
             gid_Brand_File_Share_Xdg_StartCenter,
103
             gid_Brand_File_Share_Xdg_Writer,
103
             gid_Brand_File_Share_Xdg_Writer,
104
             gid_Brand_File_Txt_Package);
104
             gid_Brand_File_Txt_Package);
Lines 738-753 File gid_Brand_File_Share_Xdg_Printeradmin Link Here
738
End
738
End
739
#endif
739
#endif
740
740
741
//#if defined UNX && ! defined MACOSX
741
#if defined UNX && ! defined MACOSX
742
//#ifdef ENABLE_GTK
742
#ifdef ENABLE_GTK
743
//File gid_Brand_File_Share_Xdg_QStart
743
File gid_Brand_File_Share_Xdg_QStart
744
//    TXT_FILE_BODY;
744
    TXT_FILE_BODY;
745
//    Dir = gid_Brand_Dir_Share_Xdg;
745
    Dir = gid_Brand_Dir_Share_Xdg;
746
//    Styles = (PACKED,SCPZIP_REPLACE);
746
    Styles = (PACKED,SCPZIP_REPLACE);
747
//    Name = "qstart.desktop";
747
    Name = "qstart.desktop";
748
//End
748
End
749
//#endif
749
#endif
750
//#endif
750
#endif
751
751
752
#if defined UNX && ! defined MACOSX
752
#if defined UNX && ! defined MACOSX
753
File gid_Brand_File_Share_Xdg_Writer
753
File gid_Brand_File_Share_Xdg_Writer
(-)a/scp2/source/ooo/file_library_ooo.scp (-19 / +12 lines)
Lines 208-232 End Link Here
208
208
209
#endif
209
#endif
210
210
211
//#ifdef UNX
211
#ifdef UNX
212
//#ifdef ENABLE_GTK
212
#ifdef ENABLE_GTK
213
//#ifdef ENABLE_SYSTRAY_GTK
213
#ifdef ENABLE_SYSTRAY_GTK
214
//File gid_File_Lib_Egg_Tray
214
File gid_File_Lib_QStart_Gtk
215
// TXT_FILE_BODY;
215
    Name = LIBNAME(qstart_gtk);
216
// Styles = (PACKED);
216
    TXT_FILE_BODY;
217
// Dir = SCP2_OOO_BIN_DIR;
217
    Styles = (PACKED);
218
// Name = STRING(CONCAT3(libeggtray,DLLPOSTFIX,UNXSUFFIX));
218
    Dir = SCP2_OOO_BIN_DIR;
219
//End
219
End
220
//
220
#endif
221
//File gid_File_Lib_QStart_Gtk
221
#endif
222
//    Name = LIBNAME(qstart_gtk);
222
#endif
223
//    TXT_FILE_BODY;
224
//    Styles = (PACKED);
225
//    Dir = SCP2_OOO_BIN_DIR;
226
//End
227
//#endif
228
//#endif
229
//#endif
230
223
231
STD_LIB_FILE( gid_File_Lib_Dba, dba)
224
STD_LIB_FILE( gid_File_Lib_Dba, dba)
232
225
(-)a/sfx2/Library_sfx.mk (+8 lines)
Lines 273-278 $(eval $(call gb_Library_set_defs,sfx,\ Link Here
273
))
273
))
274
endif
274
endif
275
275
276
ifeq ($(ENABLE_SYSTRAY_GTK),TRUE)
277
$(eval $(call gb_Library_set_defs,sfx,\
278
	$$(DEFS) \
279
	-DENABLE_QUICKSTART_APPLET \
280
	-DENABLE_SYSTRAY_GTK \
281
))
282
endif
283
276
ifeq ($(OS),OS2)
284
ifeq ($(OS),OS2)
277
$(eval $(call gb_Library_add_exception_objects,sfx,\
285
$(eval $(call gb_Library_add_exception_objects,sfx,\
278
    sfx2/source/appl/shutdowniconOs2.ob \
286
    sfx2/source/appl/shutdowniconOs2.ob \
(-)a/sfx2/source/appl/shutdownicon.cxx (-2 / +10 lines)
Lines 62-67 Link Here
62
#include <osl/security.hxx>
62
#include <osl/security.hxx>
63
#include <osl/file.hxx>
63
#include <osl/file.hxx>
64
#include <rtl/bootstrap.hxx>
64
#include <rtl/bootstrap.hxx>
65
#include <rtl/ustrbuf.hxx>
65
#include <tools/link.hxx>
66
#include <tools/link.hxx>
66
#ifdef UNX // need symlink
67
#ifdef UNX // need symlink
67
#include <unistd.h>
68
#include <unistd.h>
Lines 826-833 rtl::OUString ShutdownIcon::getShortcutName() Link Here
826
	aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\" ) );
827
	aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\" ) );
827
	aShortcut += aShortcutName;
828
	aShortcut += aShortcutName;
828
#else // UNX
829
#else // UNX
829
	OUString aShortcut = getDotAutostart();
830
    OUStringBuffer aStrBuff( getDotAutostart() );
830
	aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "/qstart.desktop" ) );
831
    aStrBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( "/" ) );
832
    if ( sal_Int32 len = aShortcutName.getLength() )
833
        aStrBuff.append( aShortcutName.getStr(), len );
834
    else
835
        aStrBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( "qstart" ) );
836
    aStrBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( ".desktop" ) );
837
838
    OUString aShortcut( aStrBuff.makeStringAndClear() );
831
#endif // UNX
839
#endif // UNX
832
	return aShortcut;
840
	return aShortcut;
833
#endif // ENABLE_QUICKSTART_APPLET
841
#endif // ENABLE_QUICKSTART_APPLET
(-)a/sfx2/source/appl/shutdowniconunx.cxx (-82 / +40 lines)
Lines 2-13 Link Here
2
#ifdef ENABLE_QUICKSTART_APPLET
2
#ifdef ENABLE_QUICKSTART_APPLET
3
3
4
#include <unotools/moduleoptions.hxx>
4
#include <unotools/moduleoptions.hxx>
5
6
#include <unotools/dynamicmenuoptions.hxx>
5
#include <unotools/dynamicmenuoptions.hxx>
7
6
8
#include <gtk/gtk.h>
7
#include <gtk/gtk.h>
9
#include <glib.h>
8
#include <glib.h>
10
#include <eggtray/eggtrayicon.h>
11
#include <vos/mutex.hxx>
9
#include <vos/mutex.hxx>
12
#include <vcl/bitmapex.hxx>
10
#include <vcl/bitmapex.hxx>
13
#include <vcl/bmpacc.hxx>
11
#include <vcl/bmpacc.hxx>
Lines 21-26 Link Here
21
#endif
19
#endif
22
20
23
// Cut/paste from vcl/inc/svids.hrc
21
// Cut/paste from vcl/inc/svids.hrc
22
#define SV_ICON_LARGE_START                 24000
24
#define SV_ICON_SMALL_START                 25000
23
#define SV_ICON_SMALL_START                 25000
25
24
26
#define SV_ICON_ID_OFFICE                       1
25
#define SV_ICON_ID_OFFICE                       1
Lines 36-44 using namespace ::rtl; Link Here
36
using namespace ::osl;
35
using namespace ::osl;
37
36
38
static ResMgr *pVCLResMgr;
37
static ResMgr *pVCLResMgr;
39
static EggTrayIcon *pTrayIcon;
38
static GtkStatusIcon *pTrayIcon;
40
static GtkWidget *pExitMenuItem = NULL;
39
static GtkWidget *pExitMenuItem = NULL;
41
static GtkWidget *pOpenMenuItem = NULL;
40
static GtkWidget *pOpenMenuItem = NULL;
41
static GtkWidget *pDisableMenuItem = NULL;
42
42
43
static void open_url_cb( GtkWidget *, gpointer data )
43
static void open_url_cb( GtkWidget *, gpointer data )
44
{
44
{
Lines 66-72 static void systray_disable_cb() Link Here
66
66
67
static void exit_quickstarter_cb( GtkWidget * )
67
static void exit_quickstarter_cb( GtkWidget * )
68
{
68
{
69
	egg_tray_icon_cancel_message (pTrayIcon, 1 );
70
	ShutdownIcon::getInstance()->terminateDesktop();
69
	ShutdownIcon::getInstance()->terminateDesktop();
71
	plugin_shutdown_sys_tray();
70
	plugin_shutdown_sys_tray();
72
}
71
}
Lines 78-84 static void menu_deactivate_cb( GtkWidget *pMenu ) Link Here
78
77
79
static GdkPixbuf * ResIdToPixbuf( sal_uInt16 nResId )
78
static GdkPixbuf * ResIdToPixbuf( sal_uInt16 nResId )
80
{
79
{
81
	ResId aResId( SV_ICON_SMALL_START + nResId, *pVCLResMgr );
80
	ResId aResId( nResId, *pVCLResMgr );
82
	BitmapEx aIcon( aResId );
81
	BitmapEx aIcon( aResId );
83
	Bitmap pInSalBitmap = aIcon.GetBitmap();
82
	Bitmap pInSalBitmap = aIcon.GetBitmap();
84
	AlphaMask pInSalAlpha = aIcon.GetAlpha();
83
	AlphaMask pInSalAlpha = aIcon.GetAlpha();
Lines 152-160 static void add_item( GtkMenuShell *pMenuShell, const char *pAsciiURL, Link Here
152
									RTL_TEXTENCODING_UTF8);
151
									RTL_TEXTENCODING_UTF8);
153
	}
152
	}
154
153
155
	GdkPixbuf *pPixbuf= ResIdToPixbuf( nResId );
154
    GdkPixbuf *pPixbuf= ResIdToPixbuf( SV_ICON_SMALL_START + nResId );
156
	GtkWidget *pImage = gtk_image_new_from_pixbuf( pPixbuf );
155
    GtkWidget *pImage = gtk_image_new_from_pixbuf( pPixbuf );
157
	g_object_unref( G_OBJECT( pPixbuf ) );
156
    g_object_unref( G_OBJECT( pPixbuf ) );
158
157
159
	GtkWidget *pMenuItem = gtk_image_menu_item_new_with_label( aLabel );
158
	GtkWidget *pMenuItem = gtk_image_menu_item_new_with_label( aLabel );
160
	gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM( pMenuItem ), pImage );
159
	gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM( pMenuItem ), pImage );
Lines 262-271 static void populate_menu( GtkWidget *pMenu ) Link Here
262
		 pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ),
261
		 pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ),
263
		 G_CALLBACK( open_file_cb ));
262
		 G_CALLBACK( open_file_cb ));
264
263
264
265
	pMenuItem = gtk_separator_menu_item_new();
265
	pMenuItem = gtk_separator_menu_item_new();
266
	gtk_menu_shell_append( pMenuShell, pMenuItem );
266
	gtk_menu_shell_append( pMenuShell, pMenuItem );
267
267
268
	(void) add_image_menu_item
268
	pDisableMenuItem = add_image_menu_item
269
        ( pMenuShell, GTK_STOCK_CLOSE,
269
        ( pMenuShell, GTK_STOCK_CLOSE,
270
		  pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH_UNX ),
270
		  pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH_UNX ),
271
		  G_CALLBACK( systray_disable_cb ) );
271
		  G_CALLBACK( systray_disable_cb ) );
Lines 289-319 static void refresh_menu( GtkWidget *pMenu ) Link Here
289
	bool bModal = ShutdownIcon::bModalMode;
289
	bool bModal = ShutdownIcon::bModalMode;
290
	gtk_widget_set_sensitive( pExitMenuItem, !bModal);
290
	gtk_widget_set_sensitive( pExitMenuItem, !bModal);
291
	gtk_widget_set_sensitive( pOpenMenuItem, !bModal);
291
	gtk_widget_set_sensitive( pOpenMenuItem, !bModal);
292
    gtk_widget_set_sensitive( pDisableMenuItem, !bModal);
292
}
293
}
293
294
294
extern "C" {
295
static void
296
layout_menu( GtkMenu *menu,
297
			 gint *x, gint *y, gboolean *push_in,
298
			 gpointer )
299
{
300
	GtkRequisition req;
301
	GtkWidget *ebox = GTK_BIN( pTrayIcon )->child;
302
303
	gtk_widget_size_request( GTK_WIDGET( menu ), &req );
304
	gdk_window_get_origin( ebox->window, x, y );
305
306
	(*x) += ebox->allocation.x;
307
	(*y) += ebox->allocation.y;
308
309
	if (*y >= gdk_screen_get_height (gtk_widget_get_screen (ebox)) / 2)
310
		(*y) -= req.height;
311
	else
312
		(*y) += ebox->allocation.height;
313
314
	*push_in = sal_True;
315
}
316
}
317
295
318
static gboolean display_menu_cb( GtkWidget *,
296
static gboolean display_menu_cb( GtkWidget *,
319
								 GdkEventButton *event, GtkWidget *pMenu )
297
								 GdkEventButton *event, GtkWidget *pMenu )
Lines 321-356 static gboolean display_menu_cb( GtkWidget *, Link Here
321
	if (event->button == 2)
299
	if (event->button == 2)
322
		return sal_False;
300
		return sal_False;
323
301
324
#ifdef TEMPLATE_DIALOG_MORE_POLISHED
325
	if (event->button == 1 &&
326
		event->type == GDK_2BUTTON_PRESS)
327
	{
328
		open_template_cb( NULL );
329
		return sal_True;
330
	}
331
	if (event->button == 3)
332
	{
333
		... as below ...
334
#endif
335
336
	refresh_menu( pMenu );
302
	refresh_menu( pMenu );
337
303
338
	gtk_menu_popup( GTK_MENU( pMenu ), NULL, NULL,
304
	gtk_menu_popup( GTK_MENU( pMenu ), NULL, NULL,
339
					layout_menu, NULL, 0, event->time );
305
                    gtk_status_icon_position_menu,
306
                    pTrayIcon, 0, event->time );
340
307
341
	return sal_True;
308
	return sal_True;
342
}
309
}
343
310
344
extern "C" {
345
	static gboolean
346
	show_at_idle( gpointer )
347
	{
348
		::vos::OGuard aGuard( Application::GetSolarMutex() );
349
		gtk_widget_show_all( GTK_WIDGET( pTrayIcon ) );
350
		return sal_False;
351
	}
352
}
353
354
void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray()
311
void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray()
355
{
312
{
356
	::vos::OGuard aGuard( Application::GetSolarMutex() );
313
	::vos::OGuard aGuard( Application::GetSolarMutex() );
Lines 358-398 void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray() Link Here
358
	if( !g_type_from_name( "GdkDisplay" ) )
315
	if( !g_type_from_name( "GdkDisplay" ) )
359
		return;
316
		return;
360
317
318
    ShutdownIcon *pShutdownIcon = ShutdownIcon::getInstance();
319
    if ( !pShutdownIcon )
320
        return;
321
322
    pTrayIcon = gtk_status_icon_new();
323
    pVCLResMgr = CREATEVERSIONRESMGR( vcl );
324
325
    if ( !pTrayIcon || !pVCLResMgr )
326
        return;
327
328
    // disable shutdown
329
    pShutdownIcon->SetVeto( true );
330
    pShutdownIcon->addTerminateListener();
331
361
	OString aLabel;
332
	OString aLabel;
362
	ShutdownIcon *pShutdownIcon = ShutdownIcon::getInstance();
363
333
364
	aLabel = rtl::OUStringToOString (
334
	aLabel = rtl::OUStringToOString (
365
			pShutdownIcon->GetResString( STR_QUICKSTART_TIP ),
335
			pShutdownIcon->GetResString( STR_QUICKSTART_TIP ),
366
			RTL_TEXTENCODING_UTF8 );
336
			RTL_TEXTENCODING_UTF8 );
367
337
368
	pTrayIcon = egg_tray_icon_new( aLabel );
338
	GdkPixbuf *pPixbuf = ResIdToPixbuf( SV_ICON_LARGE_START + SV_ICON_ID_OFFICE );
369
339
    g_object_set( G_OBJECT( pTrayIcon ),
370
	GtkWidget *pParent = gtk_event_box_new();
340
                  "pixbuf", pPixbuf,
371
	GtkTooltips *pTooltips = gtk_tooltips_new();
341
                  "title", aLabel.getStr(),
372
	gtk_tooltips_set_tip( GTK_TOOLTIPS( pTooltips ), pParent, aLabel, NULL );
342
                  NULL );
343
	g_object_unref( pPixbuf );
373
344
374
	GtkWidget *pIconImage = gtk_image_new();
345
    gtk_status_icon_set_tooltip_text( pTrayIcon, aLabel.getStr() );
375
	gtk_container_add( GTK_CONTAINER( pParent ), pIconImage );
376
346
377
	pVCLResMgr = CREATEVERSIONRESMGR( vcl );
347
	GtkWidget *pMenu = gtk_menu_new();
378
348
379
	GdkPixbuf *pPixbuf = ResIdToPixbuf( SV_ICON_ID_OFFICE );
349
    g_signal_connect( pTrayIcon, "button-press-event",
380
	gtk_image_set_from_pixbuf( GTK_IMAGE( pIconImage ), pPixbuf );
350
                      G_CALLBACK( display_menu_cb ), pMenu );
381
	g_object_unref( pPixbuf );
382
351
383
	GtkWidget *pMenu = gtk_menu_new();
352
    g_signal_connect( pMenu, "deactivate",
384
	g_signal_connect (pMenu, "deactivate",
353
                      G_CALLBACK (menu_deactivate_cb), NULL);
385
					  G_CALLBACK (menu_deactivate_cb), NULL);
386
	g_signal_connect( pParent, "button_press_event",
387
					  G_CALLBACK( display_menu_cb ), pMenu );
388
	gtk_container_add( GTK_CONTAINER( pTrayIcon ), pParent );
389
390
	// Show at idle to avoid artefacts at startup
391
	g_idle_add (show_at_idle, (gpointer) pTrayIcon);
392
393
	// disable shutdown
394
	pShutdownIcon->SetVeto( true );
395
	pShutdownIcon->addTerminateListener();
396
}
354
}
397
355
398
void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray()
356
void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray()
Lines 400-409 void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray() Link Here
400
	::vos::OGuard aGuard( Application::GetSolarMutex() );
358
	::vos::OGuard aGuard( Application::GetSolarMutex() );
401
	if( !pTrayIcon )
359
	if( !pTrayIcon )
402
		return;
360
		return;
403
	gtk_widget_destroy( GTK_WIDGET( pTrayIcon ) );
361
	g_object_unref( pTrayIcon );
404
	pTrayIcon = NULL;
362
	pTrayIcon = NULL;
405
	pExitMenuItem = NULL;
363
	pExitMenuItem = NULL;
406
	pOpenMenuItem = NULL;
364
	pOpenMenuItem = NULL;
365
    pDisableMenuItem = NULL;
407
}
366
}
408
367
409
#endif // ENABLE_QUICKSTART_APPLET
368
#endif // ENABLE_QUICKSTART_APPLET
410
- 

Return to issue 118519