From 5f40ceece43f2cfd79e94a947f27b91eb768cd1f Mon Sep 17 00:00:00 2001 From: Akshay Deep Date: Fri, 17 Jun 2016 13:41:00 +0530 Subject: [PATCH] tdf#75369 Start Center: Non-installed applications aren't greyed out Change-Id: I52de5d7062bebe816e90ba39f559cd57dfc1067c Reviewed-on: https://gerrit.libreoffice.org/26406 Reviewed-by: Samuel Mehrbrodt Tested-by: Samuel Mehrbrodt Gbp-Pq: Name startcenter-grey-out-not-installed.diff --- sfx2/source/dialog/backingwindow.cxx | 20 ++++++++++++++++++++ sfx2/source/dialog/backingwindow.hxx | 2 ++ 2 files changed, 22 insertions(+) diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index 6cbd43bbaaf..b2ed9e83c4c 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -278,6 +279,8 @@ void BackingWindow::initControls() setupButton( mpImpressAllButton ); setupButton( mpMathAllButton ); + checkInstalledModules(); + mpExtensionsButton->SetClickHdl(LINK(this, BackingWindow, ExtLinkClickHdl)); // setup nice colors @@ -356,6 +359,23 @@ void BackingWindow::setupButton( MenuButton* pButton ) pButton->SetSelectHdl(LINK(this, BackingWindow, MenuSelectHdl)); } +void BackingWindow::checkInstalledModules() +{ + SvtModuleOptions aModuleOpt; + + mpWriterAllButton->Enable( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER )); + + mpCalcAllButton->Enable( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) ); + + mpImpressAllButton->Enable( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) ); + + mpDrawAllButton->Enable( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) ); + + mpMathAllButton->Enable(aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::MATH )); + + mpDBAllButton->Enable(aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::DATABASE )); +} + void BackingWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) { Resize(); diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx index 199302f2e50..e04c5e74314 100644 --- a/sfx2/source/dialog/backingwindow.hxx +++ b/sfx2/source/dialog/backingwindow.hxx @@ -111,6 +111,8 @@ class BackingWindow : public vcl::Window, public VclBuilderContainer void initializeLocalView(); + void checkInstalledModules(); + public: explicit BackingWindow(vcl::Window* pParent); virtual ~BackingWindow(); -- 2.30.2