diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2023-07-17 10:54:28 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2023-07-17 13:40:29 +0200 |
commit | e43d5776fee7c89029389fcc3b8011d041033108 (patch) | |
tree | 4e61c8c51722049870241319fddc2c020380243a /extensions | |
parent | a4af5432753408c4eea8a8d56c2f48202160c5fe (diff) |
tdf#74934: remove Install button and related
Change-Id: I7866f11e744f4159f1ff5fb5175ee7fe87bbf4a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154515
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/inc/helpids.h | 1 | ||||
-rw-r--r-- | extensions/inc/strings.hrc | 3 | ||||
-rw-r--r-- | extensions/source/update/check/actionlistener.hxx | 1 | ||||
-rw-r--r-- | extensions/source/update/check/updatecheck.cxx | 109 | ||||
-rw-r--r-- | extensions/source/update/check/updatecheck.hxx | 1 | ||||
-rw-r--r-- | extensions/source/update/check/updatehdl.cxx | 32 | ||||
-rw-r--r-- | extensions/source/update/check/updatehdl.hxx | 5 |
7 files changed, 0 insertions, 152 deletions
diff --git a/extensions/inc/helpids.h b/extensions/inc/helpids.h index b16b8506d161..6f989407a135 100644 --- a/extensions/inc/helpids.h +++ b/extensions/inc/helpids.h @@ -317,7 +317,6 @@ inline constexpr OUStringLiteral HID_PROP_INACTIVESELECTIONTEXTCOLOR = u"EXTENSI #define HID_CHECK_FOR_UPD_RESUME "EXTENSIONS_HID_CHECK_FOR_UPD_RESUME" #define HID_CHECK_FOR_UPD_DOWNLOAD "EXTENSIONS_HID_CHECK_FOR_UPD_DOWNLOAD" #define HID_CHECK_FOR_UPD_DOWNLOAD2 "EXTENSIONS_HID_CHECK_FOR_UPD_DOWNLOAD2" -#define HID_CHECK_FOR_UPD_INSTALL "EXTENSIONS_HID_CHECK_FOR_UPD_INSTALL" #define HID_CHECK_FOR_UPD_STATUS "EXTENSIONS_HID_CHECK_FOR_UPD_STATUS" #define HID_CHECK_FOR_UPD_DESCRIPTION "EXTENSIONS_HID_CHECK_FOR_UPD_DESCRIPTION" #define HID_CHECK_FOR_UPD_CANCEL "EXTENSIONS_HID_CHECK_FOR_UPD_CANCEL" diff --git a/extensions/inc/strings.hrc b/extensions/inc/strings.hrc index 8d6ed0580256..510afa6d671e 100644 --- a/extensions/inc/strings.hrc +++ b/extensions/inc/strings.hrc @@ -305,8 +305,6 @@ #define RID_UPDATE_STR_DOWNLOADING NC_("RID_UPDATE_STR_DOWNLOADING", "Downloading %PRODUCTNAME %NEXTVERSION...") #define RID_UPDATE_STR_READY_INSTALL NC_("RID_UPDATE_STR_READY_INSTALL", "Download of %PRODUCTNAME %NEXTVERSION completed. Ready for installation.") #define RID_UPDATE_STR_CANCEL_DOWNLOAD NC_("RID_UPDATE_STR_CANCEL_DOWNLOAD", "Do you really want to cancel the download?") -#define RID_UPDATE_STR_BEGIN_INSTALL NC_("RID_UPDATE_STR_BEGIN_INSTALL", "To install the update, %PRODUCTNAME %PRODUCTVERSION needs to be closed. Do you want to install the update now?") -#define RID_UPDATE_STR_INSTALL_ERROR NC_("RID_UPDATE_STR_INSTALL_ERROR", "Could not run the installer application, please run %FILE_NAME in %DOWNLOAD_PATH manually.") #define RID_UPDATE_STR_OVERWRITE_WARNING NC_("RID_UPDATE_STR_OVERWRITE_WARNING", "A file with that name already exists! Do you want to overwrite the existing file?") #define RID_UPDATE_STR_RELOAD_WARNING NC_("RID_UPDATE_STR_RELOAD_WARNING", "A file with the name '%FILENAME' already exists in '%DOWNLOAD_PATH'! Do you want to continue with the download or delete and reload the file?") #define RID_UPDATE_STR_RELOAD_RELOAD NC_("RID_UPDATE_STR_RELOAD_RELOAD", "Reload File") @@ -316,7 +314,6 @@ #define RID_UPDATE_FT_DESCRIPTION NC_("RID_UPDATE_FT_DESCRIPTION", "Description") #define RID_UPDATE_BTN_CLOSE NC_("RID_UPDATE_BTN_CLOSE", "Close") #define RID_UPDATE_BTN_DOWNLOAD NC_("RID_UPDATE_BTN_DOWNLOAD", "~Download") -#define RID_UPDATE_BTN_INSTALL NC_("RID_UPDATE_BTN_INSTALL", "~Install") #define RID_UPDATE_BTN_PAUSE NC_("RID_UPDATE_BTN_PAUSE", "~Pause") #define RID_UPDATE_BTN_RESUME NC_("RID_UPDATE_BTN_RESUME", "~Resume") #define RID_UPDATE_BTN_CANCEL NC_("RID_UPDATE_BTN_CANCEL", "Cancel") diff --git a/extensions/source/update/check/actionlistener.hxx b/extensions/source/update/check/actionlistener.hxx index 8fdfd1565da6..63c5ac1cb019 100644 --- a/extensions/source/update/check/actionlistener.hxx +++ b/extensions/source/update/check/actionlistener.hxx @@ -27,7 +27,6 @@ class IActionListener : public virtual salhelper::SimpleReferenceObject virtual void cancel() = 0; virtual void download() = 0; - virtual void install() = 0; virtual void pause() = 0; virtual void resume() = 0; virtual void closeAfterFailure() = 0; diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index 3bde028f96b1..1cac902eaccb 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -96,16 +96,6 @@ OUString getBuildId() } -#if (defined LINUX || defined __sun) -OUString getBaseInstallation() -{ - OUString aPathVal("$BRAND_BASE_DIR"); - rtl::Bootstrap::expandMacros(aPathVal); - return aPathVal; -} -#endif - - bool isObsoleteUpdateInfo(std::u16string_view rBuildId) { return rBuildId != getBuildId() && !rBuildId.empty(); @@ -325,22 +315,6 @@ private: }; -class ShutdownThread : public osl::Thread -{ -public: - explicit ShutdownThread(const uno::Reference<uno::XComponentContext>& xContext); - - virtual void SAL_CALL run() override; - virtual void SAL_CALL onTerminated() override; - -protected: - virtual ~ShutdownThread() override; - -private: - osl::Condition m_aCondition; - const uno::Reference<uno::XComponentContext> m_xContext; -}; - UpdateCheckThread::UpdateCheckThread( osl::Condition& rCondition, const uno::Reference<uno::XComponentContext>& xContext, @@ -699,45 +673,6 @@ void SAL_CALL DownloadThread::onTerminated() } -ShutdownThread::ShutdownThread( const uno::Reference<uno::XComponentContext>& xContext) : - m_xContext( xContext ) -{ - create(); -} - - -ShutdownThread::~ShutdownThread() -{ -} - - -void SAL_CALL -ShutdownThread::run() -{ - osl_setThreadName("ShutdownThread"); - - TimeValue tv = { 0, 250 }; - - m_aCondition.wait(&tv); - - // Tell QuickStarter not to veto .. - uno::Reference< css::beans::XFastPropertySet > xQuickStarter = css::office::Quickstart::createDefault(m_xContext); - - xQuickStarter->setFastPropertyValue(0, uno::Any(false)); - - // Shutdown the office - uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(m_xContext); - - xDesktop->terminate(); -} - - -void SAL_CALL ShutdownThread::onTerminated() -{ - delete this; -} - - } // anonymous namespace UpdateCheck::UpdateCheck() @@ -908,50 +843,6 @@ UpdateCheck::download() void -UpdateCheck::install() -{ - std::scoped_lock aGuard(m_aMutex); - - const uno::Reference< c3s::XSystemShellExecute > xShellExecute = c3s::SystemShellExecute::create( m_xContext ); - - try { - // Construct install command ?? - - // Store release note for position 3 and 4 - OUString aURL(getReleaseNote(m_aUpdateInfo, 3)); - storeReleaseNote(1, aURL); - - aURL = getReleaseNote(m_aUpdateInfo, 4); - storeReleaseNote(2, aURL); - - OUString aInstallImage(m_aImageName); - osl::FileBase::getSystemPathFromFileURL(aInstallImage, aInstallImage); - - sal_Int32 nFlags; -#if (defined LINUX || defined __sun) - nFlags = 42; - OUString aParameter = getBaseInstallation(); - if( !aParameter.isEmpty() ) - osl::FileBase::getSystemPathFromFileURL(aParameter, aParameter); - - aParameter += " &"; -#else - nFlags = c3s::SystemShellExecuteFlags::DEFAULTS; - OUString const aParameter; -#endif - - rtl::Reference< UpdateCheckConfig > rModel = UpdateCheckConfig::get( m_xContext ); - rModel->clearLocalFileName(); - - xShellExecute->execute(aInstallImage, aParameter, nFlags); - new ShutdownThread( m_xContext ); - } catch(const uno::Exception&) { - m_aUpdateHandler->setErrorMessage( m_aUpdateHandler->getDefaultInstErrMsg() ); - } -} - - -void UpdateCheck::pause() { std::unique_lock aGuard(m_aMutex); diff --git a/extensions/source/update/check/updatecheck.hxx b/extensions/source/update/check/updatecheck.hxx index 546616f574dd..7af355bc41ea 100644 --- a/extensions/source/update/check/updatecheck.hxx +++ b/extensions/source/update/check/updatecheck.hxx @@ -117,7 +117,6 @@ public: // IActionListener void cancel() override; void download() override; - void install() override; void pause() override; void resume() override; void closeAfterFailure() override; diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx index 3b6ae8a860d9..ed2261b4ec14 100644 --- a/extensions/source/update/check/updatehdl.cxx +++ b/extensions/source/update/check/updatehdl.cxx @@ -287,15 +287,6 @@ OUString UpdateHandler::getBubbleTitle( UpdateState eState ) } -OUString UpdateHandler::getDefaultInstErrMsg() -{ - osl::MutexGuard aGuard( maMutex ); - - loadStrings(); - - return substVariables( msInstallError ); -} - // XActionListener void SAL_CALL UpdateHandler::disposing( const lang::EventObject& rEvt ) @@ -350,10 +341,6 @@ void SAL_CALL UpdateHandler::actionPerformed( awt::ActionEvent const & rEvent ) case DOWNLOAD_BUTTON: mxActionListener->download(); break; - case INSTALL_BUTTON: - if ( showWarning( msInstallMessage ) ) - mxActionListener->install(); - break; case PAUSE_BUTTON: mxActionListener->pause(); break; @@ -573,10 +560,8 @@ void UpdateHandler::updateState( UpdateState eState ) break; case UPDATESTATE_DOWNLOAD_AVAIL: showControls( 0 ); - enableControls( (1<<CLOSE_BUTTON) + (1<<INSTALL_BUTTON) ); setControlProperty( TEXT_STATUS, "Text", uno::Any( substVariables(msReady2Install) ) ); setControlProperty( TEXT_DESCRIPTION, "Text", uno::Any( substVariables(msDownloadDescr) ) ); - focusControl( INSTALL_BUTTON ); break; case UPDATESTATE_AUTO_START: case UPDATESTATES_COUNT: @@ -627,8 +612,6 @@ void UpdateHandler::loadStrings() msDownloading = loadString( loc, RID_UPDATE_STR_DOWNLOADING ); msReady2Install = loadString( loc, RID_UPDATE_STR_READY_INSTALL ); msCancelMessage = loadString( loc, RID_UPDATE_STR_CANCEL_DOWNLOAD ); - msInstallMessage = loadString( loc, RID_UPDATE_STR_BEGIN_INSTALL ); - msInstallError = loadString( loc, RID_UPDATE_STR_INSTALL_ERROR ); msOverwriteWarning = loadString( loc, RID_UPDATE_STR_OVERWRITE_WARNING ); msPercent = loadString( loc, RID_UPDATE_STR_PERCENT ); msReloadWarning = loadString( loc, RID_UPDATE_STR_RELOAD_WARNING ); @@ -640,7 +623,6 @@ void UpdateHandler::loadStrings() msClose = loadString( loc, RID_UPDATE_BTN_CLOSE ); msDownload = loadString( loc, RID_UPDATE_BTN_DOWNLOAD ); - msInstall = loadString( loc, RID_UPDATE_BTN_INSTALL ); msPauseBtn = loadString( loc, RID_UPDATE_BTN_PAUSE ); msResumeBtn = loadString( loc, RID_UPDATE_BTN_RESUME ); msCancelBtn = loadString( loc, RID_UPDATE_BTN_CANCEL ); @@ -1193,20 +1175,6 @@ void UpdateHandler::createDialog() awt::Rectangle( CLOSE_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), aProps ); } - { // install button - uno::Sequence< beans::NamedValue > aProps - { - { "DefaultButton", uno::Any( false ) }, - { "Enabled", uno::Any( true ) }, - { "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) }, - { "Label", uno::Any( msInstall ) }, - { "HelpURL", uno::Any(OUString( INET_HID_SCHEME + HID_CHECK_FOR_UPD_INSTALL )) } - }; - - insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[INSTALL_BUTTON], - awt::Rectangle( INSTALL_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ), - aProps ); - } { // download button uno::Sequence< beans::NamedValue > aProps { diff --git a/extensions/source/update/check/updatehdl.hxx b/extensions/source/update/check/updatehdl.hxx index 297cf730ce4b..aa4e16fc765b 100644 --- a/extensions/source/update/check/updatehdl.hxx +++ b/extensions/source/update/check/updatehdl.hxx @@ -46,7 +46,6 @@ enum DialogControls CANCEL_BUTTON = 0, PAUSE_BUTTON, RESUME_BUTTON, - INSTALL_BUTTON, DOWNLOAD_BUTTON, CLOSE_BUTTON, HELP_BUTTON, @@ -111,8 +110,6 @@ private: OUString msDownloading; // RID_UPDATE_STR_DOWNLOADING OUString msReady2Install; // RID_UPDATE_STR_READY_INSTALL OUString msCancelMessage; // RID_UPDATE_STR_CANCEL_DOWNLOAD - OUString msInstallMessage; // RID_UPDATE_STR_BEGIN_INSTALL - OUString msInstallError; // RID_UPDATE_STR_INSTALL_ERROR OUString msOverwriteWarning; // RID_UPDATE_STR_OVERWRITE_WARNING OUString msPercent; // RID_UPDATE_STR_PERCENT OUString msReloadWarning; // RID_UPDATE_STR_OVERWRITE_WARNING @@ -122,7 +119,6 @@ private: OUString msDescription; // RID_UPDATE_FT_DESCRIPTION OUString msClose; // RID_UPDATE_BTN_CLOSE OUString msDownload; // RID_UPDATE_BTN_DOWNLOAD - OUString msInstall; // RID_UPDATE_BTN_INSTALL OUString msPauseBtn; // RID_UPDATE_BTN_PAUSE OUString msResumeBtn; // RID_UPDATE_BTN_RESUME OUString msCancelBtn; // RID_UPDATE_BTN_CANCEL @@ -173,7 +169,6 @@ public: void setState( UpdateState eState ); OUString getBubbleText( UpdateState eState ); OUString getBubbleTitle( UpdateState eState ); - OUString getDefaultInstErrMsg(); bool showWarning( const OUString &rWarning ) const; bool showWarning( const OUString &rWarning, const OUString& rBtnText_1, const OUString& rBtnText_2 ) const; bool showOverwriteWarning( std::u16string_view rFileName ) const; |