summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2020-10-15 13:43:25 +0300
committerAndras Timar <andras.timar@collabora.com>2020-10-16 22:36:25 +0200
commitc6d12d44a890e969ab4463fa26403da02552654c (patch)
tree9055986692d62c853f835ee2ec7e9f7b242fb35b /dbaccess
parent254c26f1c69e2eb23f66a79349b0ea78a5d467d3 (diff)
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 <andras.timar@collabora.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx13
-rw-r--r--dbaccess/source/ui/dlg/generalpage.hxx3
-rw-r--r--dbaccess/uiconfig/ui/generalpagewizard.ui26
3 files changed, 35 insertions, 7 deletions
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 5361fc2d0907..1ad3e8272595 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -160,6 +160,7 @@ namespace dbaui
if( !aMiscOptions.IsExperimentalMode() && sURLPrefix.startsWith("sdbc:embedded:firebird") )
continue;
aDisplayedTypes.emplace_back( sURLPrefix, sDisplayName );
+ m_bIsDisplayedTypesEmpty = false;
}
}
}
@@ -454,8 +455,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() );
@@ -488,6 +491,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);
}
@@ -512,6 +516,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 a5f854260fbf..68e7a90cbfa0 100644
--- a/dbaccess/source/ui/dlg/generalpage.hxx
+++ b/dbaccess/source/ui/dlg/generalpage.hxx
@@ -139,6 +139,8 @@ namespace dbaui
std::unique_ptr<OpenDocumentListBox> m_xLB_DocumentList;
std::unique_ptr<OpenDocumentButton> m_xPB_OpenDatabase;
+ std::unique_ptr<weld::Label> m_xFT_NoEmbeddedDBLabel;
+
// state
OUString m_aBrowsedDocumentURL;
CreationMode m_eOriginalCreationMode;
@@ -148,6 +150,7 @@ namespace dbaui
Link<OGeneralPageWizard&,void> 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();
diff --git a/dbaccess/uiconfig/ui/generalpagewizard.ui b/dbaccess/uiconfig/ui/generalpagewizard.ui
index 029fc1adf94d..81bd085df0c5 100644
--- a/dbaccess/uiconfig/ui/generalpagewizard.ui
+++ b/dbaccess/uiconfig/ui/generalpagewizard.ui
@@ -107,7 +107,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">5</property>
</packing>
</child>
<child>
@@ -125,7 +125,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">6</property>
</packing>
</child>
<child>
@@ -164,7 +164,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">6</property>
+ <property name="top_attach">7</property>
</packing>
</child>
<child>
@@ -179,7 +179,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">7</property>
+ <property name="top_attach">8</property>
</packing>
</child>
<child>
@@ -197,7 +197,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">8</property>
+ <property name="top_attach">9</property>
</packing>
</child>
<child>
@@ -209,7 +209,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">9</property>
+ <property name="top_attach">10</property>
</packing>
</child>
<child>
@@ -219,7 +219,19 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">10</property>
+ <property name="top_attach">11</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="noembeddeddbLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="generalpagewizard|noembeddeddbLabel">It is not possible to create a new database, because neither HSQLDB, nor Firebird is
+available in this setup.</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
</packing>
</child>
</object>