tdf#75369 Start Center: Non-installed applications aren't greyed out
authorAkshay Deep <akshaydeepiitr@gmail.com>
Fri, 17 Jun 2016 08:11:00 +0000 (13:41 +0530)
committerRaspbian forward porter <root@raspbian.org>
Thu, 15 Feb 2018 00:33:12 +0000 (00:33 +0000)
Change-Id: I52de5d7062bebe816e90ba39f559cd57dfc1067c
Reviewed-on: https://gerrit.libreoffice.org/26406
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Gbp-Pq: Name startcenter-grey-out-not-installed.diff

sfx2/source/dialog/backingwindow.cxx
sfx2/source/dialog/backingwindow.hxx

index 6cbd43bbaafb9d94f5f849a686b7e97b435b74f5..b2ed9e83c4c2c65c7e322c801fff7ae3f82b412f 100644 (file)
@@ -25,6 +25,7 @@
 #include <vcl/virdev.hxx>
 
 #include <unotools/dynamicmenuoptions.hxx>
+#include <unotools/moduleoptions.hxx>
 #include <svtools/openfiledroptargetlistener.hxx>
 #include <svtools/colorcfg.hxx>
 #include <svtools/langhelp.hxx>
@@ -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();
index 199302f2e5004bc3c91fc94177857ef9abe3c32b..e04c5e7431475d1d63ac32380facedb94c6d80f7 100644 (file)
@@ -111,6 +111,8 @@ class BackingWindow : public vcl::Window, public VclBuilderContainer
 
     void initializeLocalView();
 
+    void checkInstalledModules();
+
 public:
     explicit BackingWindow(vcl::Window* pParent);
     virtual ~BackingWindow();