Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index



Hi!

https://bugs.freedesktop.org/show_bug.cgi?id=33043

I added a new button to Start Center. It exits LibreOffice. I used the attached picture for 
testing, I'm not a designer :)
For testing (or if someone makes a new image if this gets pushed) put the attached image (or the 
final image) called application_exit.png into:
 icon-themes/galaxy/framework/res
 icon-themes/human/framework/res
 icon-themes/tango/framework/res

and 'make' the appropriate modules (I did a 'make debug=true' in root (core) because i don't know 
which specific modules I had to rebuild).

Szabolcs
                                          
From b5e71d6cc1e02947463d0e607b7435a74619b5b1 Mon Sep 17 00:00:00 2001
From: Szabolcs Dezsi <dezsiszabi@hotmail.com>
Date: Sun, 4 Mar 2012 17:52:54 +0100
Subject: [PATCH] Start Center exit button

---
 framework/inc/framework.hrc                 |    2 ++
 framework/source/services/backingwindow.cxx |   10 ++++++++++
 framework/source/services/backingwindow.hxx |    1 +
 framework/source/services/fwk_services.src  |    9 +++++++++
 4 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/framework/inc/framework.hrc b/framework/inc/framework.hrc
index e92e50b..43677a8 100644
--- a/framework/inc/framework.hrc
+++ b/framework/inc/framework.hrc
@@ -54,6 +54,7 @@
 #define STR_BACKING_EXTHELP                 6
 #define STR_BACKING_INFOHELP                7
 #define STR_BACKING_TPLREP                  8
+#define STR_BACKING_EXITHELP               9
 
 #define RES_BACKING_IMAGES                  (DLG_BACKING+1)
 
@@ -68,6 +69,7 @@
 #define BMP_BACKING_FORMULA                 15
 #define BMP_BACKING_OPENFILE                16
 #define BMP_BACKING_OPENTEMPLATE            17
+#define BMP_BACKING_EXIT                   18
 
 // Ids of TabWindow
 #define WIN_TABWINDOW                       (RID_FWK_DIALOG_START_CORRECT+101)
diff --git a/framework/source/services/backingwindow.cxx 
b/framework/source/services/backingwindow.cxx
index 0b89769..ffbe00d 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -191,6 +191,7 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
     String aExtHelpText( FwkResId( STR_BACKING_EXTHELP ) );
     String aInfoHelpText( FwkResId( STR_BACKING_INFOHELP ) );
     String aTplRepHelpText( FwkResId( STR_BACKING_TPLREP ) );
+    String aExitHelpText( FwkResId( STR_BACKING_EXITHELP ) );
 
     // clean up resource stack
     FreeResource();
@@ -223,6 +224,11 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
     maToolbox.SetItemCommand( nItemId_Info, String( RTL_CONSTASCII_USTRINGPARAM( 
".HelpId:StartCenter:Info" ) ) );
     maToolbox.ShowItem( nItemId_Info );
 
+    maToolbox.InsertItem( nItemId_Exit, Image() );
+    maToolbox.SetItemText( nItemId_Exit, aExitHelpText );
+    maToolbox.SetQuickHelpText( nItemId_Exit, aExitHelpText );
+    maToolbox.ShowItem( nItemId_Exit );
+
     // get dispatch provider
     mxDesktop = Reference<XDesktop>( 
comphelper::getProcessServiceFactory()->createInstance(SERVICENAME_DESKTOP ),UNO_QUERY );
     if( mxDesktop.is() )
@@ -437,6 +443,7 @@ void BackingWindow::initBackground()
     maToolbox.SetItemImage( nItemId_Extensions, BitmapEx( FwkResId( BMP_BACKING_EXT ) ) );
     maToolbox.SetItemImage( nItemId_Info, BitmapEx( FwkResId( BMP_BACKING_INFO ) ) );
     maToolbox.SetItemImage( nItemId_TplRep, BitmapEx( FwkResId( BMP_BACKING_TPLREP ) ) );
+    maToolbox.SetItemImage( nItemId_Exit, BitmapEx( FwkResId( BMP_BACKING_EXIT ) ) );
 
     maWelcome.SetControlForeground( maWelcomeTextColor );
     maWelcome.SetBackground();
@@ -912,6 +919,9 @@ IMPL_LINK_NOARG(BackingWindow, ToolboxHdl)
         pNodePath = "/org.openoffice.Office.Common/Help/StartCenter";
         pNode = "TemplateRepositoryURL";
         break;
+    case nItemId_Exit:
+        Application::Quit();
+        break;
     default:
         break;
     }
diff --git a/framework/source/services/backingwindow.hxx 
b/framework/source/services/backingwindow.hxx
index 179a632..c0b03cb 100644
--- a/framework/source/services/backingwindow.hxx
+++ b/framework/source/services/backingwindow.hxx
@@ -137,6 +137,7 @@ namespace framework
         static const int nItemId_Extensions = 1;
         static const int nItemId_Info = 3;
         static const int nItemId_TplRep = 4;
+        static const int nItemId_Exit = 5;
         static const int nShadowTop = 32;
         static const int nShadowLeft = 35;
         static const int nShadowRight = 45;
diff --git a/framework/source/services/fwk_services.src b/framework/source/services/fwk_services.src
index 536b3d7..f3ac032 100644
--- a/framework/source/services/fwk_services.src
+++ b/framework/source/services/fwk_services.src
@@ -65,6 +65,11 @@ Window DLG_BACKING
     {
         Text [ en-US ] = "Get more templates for %PRODUCTNAME";
     };
+
+    String STR_BACKING_EXITHELP
+    {
+       Text [ en-US ] = "Exit %PRODUCTNAME";
+    };
 };
 
 Resource RES_BACKING_IMAGES
@@ -81,6 +86,10 @@ Resource RES_BACKING_IMAGES
     {
         File = "addtemplate_32.png";
     };
+    Bitmap BMP_BACKING_EXIT
+    {
+       File = "application_exit.png";
+    };
     Bitmap BMP_BACKING_WRITER
     {
         File = "odt_32.png";
-- 
1.7.7

Attachment: application_exit.png
Description: PNG image


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.