From e932500e2342752106140c642203f97b592c7a9c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 25 Aug 2014 13:55:03 +0100 Subject: convert RID_QUERYBOX_INSTALL_FOR_ALL with custom buttons to .ui Change-Id: If7ac491cb6f256af22b48f681590adb1484350d0 --- desktop/UIConfig_deployment.mk | 1 + desktop/source/deployment/gui/dp_gui.hrc | 3 - desktop/source/deployment/gui/dp_gui_dialog.src | 10 --- desktop/source/deployment/gui/dp_gui_dialog2.cxx | 21 +----- desktop/source/deployment/gui/dp_gui_dialog2.src | 7 -- desktop/uiconfig/ui/installforalldialog.ui | 83 ++++++++++++++++++++++++ 6 files changed, 87 insertions(+), 38 deletions(-) create mode 100644 desktop/uiconfig/ui/installforalldialog.ui (limited to 'desktop') diff --git a/desktop/UIConfig_deployment.mk b/desktop/UIConfig_deployment.mk index 4bc03a552436..d5cb72c10910 100644 --- a/desktop/UIConfig_deployment.mk +++ b/desktop/UIConfig_deployment.mk @@ -13,6 +13,7 @@ $(eval $(call gb_UIConfig_add_uifiles,desktop,\ desktop/uiconfig/ui/cmdlinehelp \ desktop/uiconfig/ui/dependenciesdialog \ desktop/uiconfig/ui/extensionmanager \ + desktop/uiconfig/ui/installforalldialog \ desktop/uiconfig/ui/licensedialog \ desktop/uiconfig/ui/showlicensedialog \ desktop/uiconfig/ui/updatedialog \ diff --git a/desktop/source/deployment/gui/dp_gui.hrc b/desktop/source/deployment/gui/dp_gui.hrc index 134df341bd21..a9e469dc67d9 100644 --- a/desktop/source/deployment/gui/dp_gui.hrc +++ b/desktop/source/deployment/gui/dp_gui.hrc @@ -23,7 +23,6 @@ #include "deployment.hrc" #include "helpid.hrc" -#define RID_QUERYBOX_INSTALL_FOR_ALL (RID_DEPLOYMENT_GUI_START + 2) #define RID_WARNINGBOX_VERSION_LESS (RID_DEPLOYMENT_GUI_START + 3) #define RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES (RID_DEPLOYMENT_GUI_START + 4) #define RID_WARNINGBOX_VERSION_EQUAL (RID_DEPLOYMENT_GUI_START + 5) @@ -77,8 +76,6 @@ #define RID_STR_DISABLING_PACKAGES (RID_DEPLOYMENT_GUI_START+88) #define RID_STR_ACCEPT_LICENSE (RID_DEPLOYMENT_GUI_START+89) -#define RID_STR_INSTALL_FOR_ALL (RID_DEPLOYMENT_GUI_START+90) -#define RID_STR_INSTALL_FOR_ME (RID_DEPLOYMENT_GUI_START+91) #define RID_STR_ERROR_UNKNOWN_STATUS (RID_DEPLOYMENT_GUI_START+92) #define RID_STR_CLOSE_BTN (RID_DEPLOYMENT_GUI_START+93) #define RID_STR_EXIT_BTN (RID_DEPLOYMENT_GUI_START+94) diff --git a/desktop/source/deployment/gui/dp_gui_dialog.src b/desktop/source/deployment/gui/dp_gui_dialog.src index caa23d282f9d..e328acee0de7 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog.src +++ b/desktop/source/deployment/gui/dp_gui_dialog.src @@ -74,16 +74,6 @@ String RID_STR_ACCEPT_LICENSE Text [ en-US ] = "Accept license for %EXTENSION_NAME"; }; -String RID_STR_INSTALL_FOR_ALL -{ - Text [ en-US ] = "~For all users"; -}; - -String RID_STR_INSTALL_FOR_ME -{ - Text [ en-US ] = "~Only for me"; -}; - String RID_STR_ERROR_UNKNOWN_STATUS { Text [ en-US ] = "Error: The status of this extension is unknown"; diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 385614056750..37769f9b93e9 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -643,35 +643,20 @@ bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const return ( RET_OK == aInfo.Execute() ); } - bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const { const SolarMutexGuard guard; - QueryBox aQuery( m_pVCLWindow, getResId( RID_QUERYBOX_INSTALL_FOR_ALL ) ); - - OUString sMsgText(aQuery.GetMessText()); - sMsgText = sMsgText.replaceAll( - "%PRODUCTNAME", utl::ConfigManager::getProductName()); - aQuery.SetMessText(sMsgText); - - sal_uInt16 nYesBtnID = aQuery.GetButtonId( 0 ); - sal_uInt16 nNoBtnID = aQuery.GetButtonId( 1 ); - - if ( nYesBtnID != BUTTONDIALOG_BUTTON_NOTFOUND ) - aQuery.SetButtonText( nYesBtnID, getResourceString( RID_STR_INSTALL_FOR_ME ) ); - if ( nNoBtnID != BUTTONDIALOG_BUTTON_NOTFOUND ) - aQuery.SetButtonText( nNoBtnID, getResourceString( RID_STR_INSTALL_FOR_ALL ) ); + MessageDialog aQuery(m_pVCLWindow, "InstallForAllDialog", + "desktop/ui/installforalldialog.ui"); short nRet = aQuery.Execute(); - - if ( nRet == RET_CANCEL ) + if (nRet == RET_CANCEL) return false; bInstallForAll = ( nRet == RET_NO ); return true; } - void DialogHelper::PostUserEvent( const Link& rLink, void* pCaller ) { if ( m_nEventID ) diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.src b/desktop/source/deployment/gui/dp_gui_dialog2.src index ca6e0af18ee7..a399c22146d5 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.src +++ b/desktop/source/deployment/gui/dp_gui_dialog2.src @@ -40,11 +40,4 @@ Image RID_IMG_EXTENSION ImageBitmap = Bitmap { File = "extension_32.png"; }; }; -QueryBox RID_QUERYBOX_INSTALL_FOR_ALL -{ - Buttons = WB_YES_NO_CANCEL; - DefButton = WB_DEF_YES; - Message[en-US] = "Make sure that no further users are working with the same %PRODUCTNAME, when installing an extension for all users in a multi user environment.\n\nFor whom do you want to install the extension?\n"; -}; - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/uiconfig/ui/installforalldialog.ui b/desktop/uiconfig/ui/installforalldialog.ui new file mode 100644 index 000000000000..99dbaf236b8e --- /dev/null +++ b/desktop/uiconfig/ui/installforalldialog.ui @@ -0,0 +1,83 @@ + + + + + + False + 12 + False + dialog + True + question + For whom do you want to install the extension? + Make sure that no further users are working with the same %PRODUCTNAME, when installing an extension for all users in a multi user environment. + + + False + vertical + 24 + + + False + end + + + _For all users + True + True + True + True + + + False + True + 0 + + + + + _Only for me + True + True + True + True + True + True + + + False + True + 1 + + + + + gtk-cancel + True + True + True + True + + + False + True + 2 + + + + + False + True + end + 0 + + + + + + no + yes + cancel + + + -- cgit