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-18 12:59:40 +0200
commit42eb4dc116cdc239965117276a49ade40fd7ad22 (patch)
tree5a5d941353e5b337f9265f1d5c7b24f97f3d9546 /dbaccess
parent5e8cf811c97799151df2a5a40a5ee979fa90a346 (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104447 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.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 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<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;
@@ -149,6 +151,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>