From 42eb4dc116cdc239965117276a49ade40fd7ad22 Mon Sep 17 00:00:00 2001 From: Gülşah Köse Date: Thu, 15 Oct 2020 13:43:25 +0300 Subject: Database Wizard: show info label instead of empty list. In Apple Store version or in case --without-java and disable-firebird-sdbc we cannot have Java based HSQLDB or Firebird. Instead of the empty list, there should be a static text label. Change-Id: I6034a749f28a3c29c9c9e50929cb42aa1312a46b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104359 Tested-by: Jenkins Reviewed-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104447 Tested-by: Jenkins CollaboraOffice --- dbaccess/source/ui/dlg/generalpage.cxx | 13 +++++++++++++ dbaccess/source/ui/dlg/generalpage.hxx | 3 +++ 2 files changed, 16 insertions(+) (limited to 'dbaccess/source') diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 31bed5505d5c..492f1b358b18 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -165,6 +165,7 @@ namespace dbaui if( !aMiscOptions.IsExperimentalMode() && sURLPrefix.startsWith("sdbc:embedded:firebird") ) continue; aDisplayedTypes.emplace_back( sURLPrefix, sDisplayName ); + m_bIsDisplayedTypesEmpty = false; } } } @@ -461,8 +462,10 @@ namespace dbaui , m_xFT_HelpText(m_xBuilder->weld_label("helpText")) , m_xLB_DocumentList(new OpenDocumentListBox(m_xBuilder->weld_combo_box("documentList"), "com.sun.star.sdb.OfficeDatabaseDocument")) , m_xPB_OpenDatabase(new OpenDocumentButton(m_xBuilder->weld_button("openDatabase"), "com.sun.star.sdb.OfficeDatabaseDocument")) + , m_xFT_NoEmbeddedDBLabel(m_xBuilder->weld_label("noembeddeddbLabel")) , m_eOriginalCreationMode(eCreateNew) , m_bInitEmbeddedDBList(true) + , m_bIsDisplayedTypesEmpty(true) { // If no driver for embedded DBs is installed, and no dBase driver, then hide the "Create new database" option sal_Int32 nCreateNewDBIndex = m_pCollection->getIndexOf( dbaccess::ODsnTypeCollection::getEmbeddedDatabase() ); @@ -495,6 +498,7 @@ namespace dbaui m_xRB_OpenExistingDatabase->connect_clicked( LINK( this, OGeneralPageWizard, OnSetupModeSelected ) ); m_xLB_DocumentList->connect_changed( LINK( this, OGeneralPageWizard, OnDocumentSelected ) ); m_xPB_OpenDatabase->connect_clicked( LINK( this, OGeneralPageWizard, OnOpenDocument ) ); + m_xFT_NoEmbeddedDBLabel->hide(); pController->SetGeneralPage(this); } @@ -519,6 +523,15 @@ namespace dbaui initializeEmbeddedDBList(); m_xEmbeddedDBType->set_active_text(getEmbeddedDBName(_rSet)); + if(m_bIsDisplayedTypesEmpty) + { + m_xRB_CreateDatabase->set_sensitive(false); + m_xFT_EmbeddedDBLabel->hide(); + m_xEmbeddedDBType->hide(); + m_xFT_NoEmbeddedDBLabel->show(); + m_xRB_OpenExistingDatabase->set_active(true); + } + // first check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) bool bValid, bReadonly; getFlags( _rSet, bValid, bReadonly ); diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index e8af35387728..74598579f962 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -140,6 +140,8 @@ namespace dbaui std::unique_ptr m_xLB_DocumentList; std::unique_ptr m_xPB_OpenDatabase; + std::unique_ptr m_xFT_NoEmbeddedDBLabel; + // state OUString m_aBrowsedDocumentURL; CreationMode m_eOriginalCreationMode; @@ -149,6 +151,7 @@ namespace dbaui Link m_aChooseDocumentHandler; /// to be called when a recent document has been definitely chosen bool m_bInitEmbeddedDBList : 1; + bool m_bIsDisplayedTypesEmpty : 1; void insertEmbeddedDBTypeEntryData( const OUString& _sType, const OUString& sDisplayName ); void EnableControls(); -- cgit v1.2.3