extensions/source/dbpilots/commonpagesdbp.cxx | 181 +++----- extensions/source/dbpilots/commonpagesdbp.hxx | 67 +-- extensions/source/dbpilots/controlwizard.cxx | 110 +---- extensions/source/dbpilots/controlwizard.hxx | 35 - extensions/source/dbpilots/gridwizard.cxx | 169 +++----- extensions/source/dbpilots/gridwizard.hxx | 37 - extensions/source/dbpilots/groupboxwiz.cxx | 230 ++++------- extensions/source/dbpilots/groupboxwiz.hxx | 48 +- extensions/source/dbpilots/listcombowizard.cxx | 177 +++----- extensions/source/dbpilots/listcombowizard.hxx | 42 -- extensions/source/dbpilots/unoautopilot.hxx | 5 extensions/uiconfig/sabpilot/ui/contentfieldpage.ui | 56 ++ extensions/uiconfig/sabpilot/ui/contenttablepage.ui | 86 ++-- extensions/uiconfig/sabpilot/ui/defaultfieldselectionpage.ui | 8 extensions/uiconfig/sabpilot/ui/fieldlinkpage.ui | 23 - extensions/uiconfig/sabpilot/ui/gridfieldsselectionpage.ui | 108 +++-- extensions/uiconfig/sabpilot/ui/groupradioselectionpage.ui | 104 ++-- extensions/uiconfig/sabpilot/ui/optiondbfieldpage.ui | 30 - extensions/uiconfig/sabpilot/ui/optionsfinalpage.ui | 11 extensions/uiconfig/sabpilot/ui/optionvaluespage.ui | 65 ++- extensions/uiconfig/sabpilot/ui/tableselectionpage.ui | 105 ++++- include/vcl/roadmapwizard.hxx | 1 include/vcl/wizardmachine.hxx | 16 include/vcl/wizdlg.hxx | 2 vcl/source/app/salvtables.cxx | 2 vcl/source/control/roadmapwizard.cxx | 6 vcl/source/control/wizardmachine.cxx | 44 ++ vcl/source/control/wizdlg.cxx | 44 +- vcl/unx/gtk3/gtk3gtkinst.cxx | 8 29 files changed, 933 insertions(+), 887 deletions(-)
New commits: commit 4a95ae505d48e6d1096889150a01f5c756889752 Author: Caolán McNamara <[email protected]> AuthorDate: Sat Aug 31 14:23:41 2019 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Sep 2 10:12:04 2019 +0200 weld cluster of database form wizards Change-Id: If40eec5ec00ad96088c0dda96c4733d2a1134f68 Reviewed-on: https://gerrit.libreoffice.org/78368 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx index 4b94cfff0256..37d9fd53acb8 100644 --- a/extensions/source/dbpilots/commonpagesdbp.cxx +++ b/extensions/source/dbpilots/commonpagesdbp.cxx @@ -56,69 +56,55 @@ namespace dbp using namespace ::com::sun::star::task; using namespace ::comphelper; - OTableSelectionPage::OTableSelectionPage(OControlWizard* _pParent) - :OControlWizardPage(_pParent, "TableSelectionPage", "modules/sabpilot/ui/tableselectionpage.ui") + OTableSelectionPage::OTableSelectionPage(OControlWizard* pParent, TabPageParent pPageParent) + : OControlWizardPage(pParent, pPageParent, "modules/sabpilot/ui/tableselectionpage.ui", "TableSelectionPage") + , m_xTable(m_xBuilder->weld_tree_view("table")) + , m_xDatasource(m_xBuilder->weld_tree_view("datasource")) + , m_xDatasourceLabel(m_xBuilder->weld_label("datasourcelabel")) + , m_xSearchDatabase(m_xBuilder->weld_button("search")) + , m_xSourceBox(m_xBuilder->weld_container("sourcebox")) { - get(m_pTable,"table"); - get(m_pDatasource, "datasource"); - get(m_pDatasourceLabel, "datasourcelabel"); - get(m_pSearchDatabase, "search"); - try { m_xDSContext = getContext().xDatasourceContext; if (m_xDSContext.is()) - fillListBox(*m_pDatasource, m_xDSContext->getElementNames()); + fillListBox(*m_xDatasource, m_xDSContext->getElementNames()); } catch (const Exception&) { OSL_FAIL("OTableSelectionPage::OTableSelectionPage: could not collect the data source names!"); } - m_pDatasource->SetSelectHdl(LINK(this, OTableSelectionPage, OnListboxSelection)); - m_pTable->SetSelectHdl(LINK(this, OTableSelectionPage, OnListboxSelection)); - m_pTable->SetDoubleClickHdl(LINK(this, OTableSelectionPage, OnListboxDoubleClicked)); - m_pSearchDatabase->SetClickHdl(LINK(this, OTableSelectionPage, OnSearchClicked)); - - m_pDatasource->SetDropDownLineCount(10); + m_xDatasource->connect_changed(LINK(this, OTableSelectionPage, OnListboxSelection)); + m_xTable->connect_changed(LINK(this, OTableSelectionPage, OnListboxSelection)); + m_xTable->connect_row_activated(LINK(this, OTableSelectionPage, OnListboxDoubleClicked)); + m_xSearchDatabase->connect_clicked(LINK(this, OTableSelectionPage, OnSearchClicked)); } OTableSelectionPage::~OTableSelectionPage() { - disposeOnce(); - } - - void OTableSelectionPage::dispose() - { - m_pDatasourceLabel.clear(); - m_pDatasource.clear(); - m_pSearchDatabase.clear(); - m_pTable.clear(); - OControlWizardPage::dispose(); } void OTableSelectionPage::ActivatePage() { OControlWizardPage::ActivatePage(); - m_pDatasource->GrabFocus(); + m_xDatasource->grab_focus(); } - bool OTableSelectionPage::canAdvance() const { if (!OControlWizardPage::canAdvance()) return false; - if (0 == m_pDatasource->GetSelectedEntryCount()) + if (0 == m_xDatasource->count_selected_rows()) return false; - if (0 == m_pTable->GetSelectedEntryCount()) + if (0 == m_xTable->count_selected_rows()) return false; return true; } - void OTableSelectionPage::initializePage() { OControlWizardPage::initializePage(); @@ -133,11 +119,10 @@ namespace dbp bool bEmbedded = ::dbtools::isEmbeddedInDatabase( rContext.xForm, xConnection ); if ( bEmbedded ) { - VclVBox *_pSourceBox = get<VclVBox>("sourcebox"); - _pSourceBox->Hide(); - m_pDatasource->InsertEntry(sDataSourceName); + m_xSourceBox->hide(); + m_xDatasource->append_text(sDataSourceName); } - m_pDatasource->SelectEntry(sDataSourceName); + m_xDatasource->select_text(sDataSourceName); implFillTables(xConnection); @@ -147,13 +132,13 @@ namespace dbp OSL_VERIFY( rContext.xForm->getPropertyValue("CommandType") >>= nCommandType ); // search the entry of the given type with the given name - for ( sal_Int32 nLookup = 0; nLookup < m_pTable->GetEntryCount(); ++nLookup ) + for (sal_Int32 nLookup = 0; nLookup < m_xTable->n_children(); ++nLookup) { - if (sCommand == m_pTable->GetEntry(nLookup)) + if (sCommand == m_xTable->get_text(nLookup)) { - if ( reinterpret_cast< sal_IntPtr >( m_pTable->GetEntryData( nLookup ) ) == nCommandType ) + if (m_xTable->get_id(nLookup).toInt32() == nCommandType) { - m_pTable->SelectEntryPos( nLookup ); + m_xTable->select( nLookup ); break; } } @@ -165,7 +150,6 @@ namespace dbp } } - bool OTableSelectionPage::commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) { if (!OControlWizardPage::commitPage(_eReason)) @@ -179,11 +163,11 @@ namespace dbp { xOldConn = getFormConnection(); - OUString sDataSource = m_pDatasource->GetSelectedEntry(); + OUString sDataSource = m_xDatasource->get_selected_text(); rContext.xForm->setPropertyValue("DataSourceName", makeAny( sDataSource ) ); } - OUString sCommand = m_pTable->GetSelectedEntry(); - sal_Int32 nCommandType = reinterpret_cast< sal_IntPtr >( m_pTable->GetSelectedEntryData() ); + OUString sCommand = m_xTable->get_selected_text(); + sal_Int32 nCommandType = m_xTable->get_selected_id().toInt32(); rContext.xForm->setPropertyValue("Command", makeAny( sCommand ) ); rContext.xForm->setPropertyValue("CommandType", makeAny( nCommandType ) ); @@ -202,8 +186,7 @@ namespace dbp return true; } - - IMPL_LINK_NOARG( OTableSelectionPage, OnSearchClicked, Button*, void ) + IMPL_LINK_NOARG( OTableSelectionPage, OnSearchClicked, weld::Button&, void ) { ::sfx2::FileDialogHelper aFileDlg( ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, @@ -222,22 +205,21 @@ namespace dbp OUString sDataSourceName = aFileDlg.GetPath(); ::svt::OFileNotation aFileNotation(sDataSourceName); sDataSourceName = aFileNotation.get(::svt::OFileNotation::N_SYSTEM); - m_pDatasource->InsertEntry(sDataSourceName); - m_pDatasource->SelectEntry(sDataSourceName); - LINK(this, OTableSelectionPage, OnListboxSelection).Call(*m_pDatasource); + m_xDatasource->append_text(sDataSourceName); + m_xDatasource->select_text(sDataSourceName); + LINK(this, OTableSelectionPage, OnListboxSelection).Call(*m_xDatasource); } } - IMPL_LINK( OTableSelectionPage, OnListboxDoubleClicked, ListBox&, _rBox, void ) + IMPL_LINK(OTableSelectionPage, OnListboxDoubleClicked, weld::TreeView&, _rBox, void) { - if (_rBox.GetSelectedEntryCount()) + if (_rBox.count_selected_rows()) getDialog()->travelNext(); } - - IMPL_LINK( OTableSelectionPage, OnListboxSelection, ListBox&, _rBox, void ) + IMPL_LINK(OTableSelectionPage, OnListboxSelection, weld::TreeView&, _rBox, void) { - if (m_pDatasource == &_rBox) + if (m_xDatasource.get() == &_rBox) { // new data source selected implFillTables(); } @@ -245,23 +227,20 @@ namespace dbp updateDialogTravelUI(); } - namespace { - void lcl_fillEntries( ListBox& _rListBox, const Sequence< OUString >& _rNames, const Image& _rImage, sal_Int32 _nCommandType ) + void lcl_fillEntries(weld::TreeView& rListBox, const Sequence<OUString>& rNames, const OUString& rImage, sal_Int32 nCommandType) { - for ( auto const & name : _rNames ) + for (auto const & name : rNames) { - const sal_Int32 nPos = _rListBox.InsertEntry( name, _rImage ); - _rListBox.SetEntryData( nPos, reinterpret_cast< void* >( _nCommandType ) ); + rListBox.append(OUString::number(nCommandType), name, rImage); } } } - void OTableSelectionPage::implFillTables(const Reference< XConnection >& _rxConn) { - m_pTable->Clear(); + m_xTable->clear(); WaitObject aWaitCursor(this); @@ -279,7 +258,7 @@ namespace dbp // connect to the data source try { - OUString sCurrentDatasource = m_pDatasource->GetSelectedEntry(); + OUString sCurrentDatasource = m_xDatasource->get_selected_text(); if (!sCurrentDatasource.isEmpty()) { // obtain the DS object @@ -362,112 +341,84 @@ namespace dbp return; } - Image aTableImage(StockImage::Yes, BMP_TABLE); - Image aQueryImage(StockImage::Yes, BMP_QUERY); - - lcl_fillEntries( *m_pTable, aTableNames, aTableImage, CommandType::TABLE ); - lcl_fillEntries( *m_pTable, aQueryNames, aQueryImage, CommandType::QUERY ); + lcl_fillEntries(*m_xTable, aTableNames, BMP_TABLE, CommandType::TABLE); + lcl_fillEntries(*m_xTable, aQueryNames, BMP_QUERY, CommandType::QUERY); } - - OMaybeListSelectionPage::OMaybeListSelectionPage( OControlWizard* _pParent, const OString& _rID, const OUString& _rUIXMLDescription ) - :OControlWizardPage(_pParent, _rID, _rUIXMLDescription) - ,m_pYes(nullptr) - ,m_pNo(nullptr) - ,m_pList(nullptr) + OMaybeListSelectionPage::OMaybeListSelectionPage(OControlWizard* pParent, TabPageParent pPageParent, const OUString& rUIXMLDescription, const OString& rID) + : OControlWizardPage(pParent, pPageParent, rUIXMLDescription, rID) + , m_pYes(nullptr) + , m_pNo(nullptr) + , m_pList(nullptr) { } OMaybeListSelectionPage::~OMaybeListSelectionPage() { - disposeOnce(); - } - - void OMaybeListSelectionPage::dispose() - { - m_pYes.clear(); - m_pNo.clear(); - m_pList.clear(); - OControlWizardPage::dispose(); } - void OMaybeListSelectionPage::announceControls(RadioButton& _rYesButton, RadioButton& _rNoButton, ListBox& _rSelection) + void OMaybeListSelectionPage::announceControls(weld::RadioButton& _rYesButton, weld::RadioButton& _rNoButton, weld::ComboBox& _rSelection) { m_pYes = &_rYesButton; m_pNo = &_rNoButton; m_pList = &_rSelection; - m_pYes->SetClickHdl(LINK(this, OMaybeListSelectionPage, OnRadioSelected)); - m_pNo->SetClickHdl(LINK(this, OMaybeListSelectionPage, OnRadioSelected)); + m_pYes->connect_clicked(LINK(this, OMaybeListSelectionPage, OnRadioSelected)); + m_pNo->connect_clicked(LINK(this, OMaybeListSelectionPage, OnRadioSelected)); implEnableWindows(); } - IMPL_LINK_NOARG( OMaybeListSelectionPage, OnRadioSelected, Button*, void ) + IMPL_LINK_NOARG( OMaybeListSelectionPage, OnRadioSelected, weld::Button&, void ) { implEnableWindows(); } - void OMaybeListSelectionPage::implInitialize(const OUString& _rSelection) { DBG_ASSERT(m_pYes, "OMaybeListSelectionPage::implInitialize: no controls announced!"); bool bIsSelection = ! _rSelection.isEmpty(); - m_pYes->Check(bIsSelection); - m_pNo->Check(!bIsSelection); - m_pList->Enable(bIsSelection); + m_pYes->set_active(bIsSelection); + m_pNo->set_active(!bIsSelection); + m_pList->set_sensitive(bIsSelection); - m_pList->SelectEntry(bIsSelection ? _rSelection : OUString()); + m_pList->set_active_text(bIsSelection ? _rSelection : OUString()); } - void OMaybeListSelectionPage::implCommit(OUString& _rSelection) { - _rSelection = m_pYes->IsChecked() ? m_pList->GetSelectedEntry() : OUString(); + _rSelection = m_pYes->get_active() ? m_pList->get_active_text() : OUString(); } - void OMaybeListSelectionPage::implEnableWindows() { - m_pList->Enable(m_pYes->IsChecked()); + m_pList->set_sensitive(m_pYes->get_active()); } - void OMaybeListSelectionPage::ActivatePage() { OControlWizardPage::ActivatePage(); DBG_ASSERT(m_pYes, "OMaybeListSelectionPage::ActivatePage: no controls announced!"); - if (m_pYes->IsChecked()) - m_pList->GrabFocus(); + if (m_pYes->get_active()) + m_pList->grab_focus(); else - m_pNo->GrabFocus(); + m_pNo->grab_focus(); } - ODBFieldPage::ODBFieldPage( OControlWizard* _pParent ) - :OMaybeListSelectionPage(_pParent, "OptionDBField", "modules/sabpilot/ui/optiondbfieldpage.ui") + ODBFieldPage::ODBFieldPage(OControlWizard* pParent, TabPageParent pPageParent) + : OMaybeListSelectionPage(pParent, pPageParent, "modules/sabpilot/ui/optiondbfieldpage.ui", "OptionDBField") + , m_xDescription(m_xBuilder->weld_label("explLabel")) + , m_xStoreYes(m_xBuilder->weld_radio_button("yesRadiobutton")) + , m_xStoreNo(m_xBuilder->weld_radio_button("noRadiobutton")) + , m_xStoreWhere(m_xBuilder->weld_combo_box("storeInFieldCombobox")) { - get(m_pDescription, "explLabel"); - get(m_pStoreYes, "yesRadiobutton"); - get(m_pStoreNo, "noRadiobutton"); - get(m_pStoreWhere, "storeInFieldCombobox"); SetText(compmodule::ModuleRes(RID_STR_OPTION_DB_FIELD_TITLE)); - announceControls(*m_pStoreYes, *m_pStoreNo, *m_pStoreWhere); - m_pStoreWhere->SetDropDownLineCount(10); + announceControls(*m_xStoreYes, *m_xStoreNo, *m_xStoreWhere); } ODBFieldPage::~ODBFieldPage() { - disposeOnce(); - } - - void ODBFieldPage::dispose() - { - m_pDescription.clear(); - m_pStoreYes.clear(); - m_pStoreNo.clear(); - m_pStoreWhere.clear(); - OMaybeListSelectionPage::dispose(); } void ODBFieldPage::initializePage() @@ -475,7 +426,7 @@ namespace dbp OMaybeListSelectionPage::initializePage(); // fill the fields page - fillListBox(*m_pStoreWhere, getContext().aFieldNames); + fillListBox(*m_xStoreWhere, getContext().aFieldNames); implInitialize(getDBFieldSetting()); } diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx index 23a36aad9774..66a9ea48a832 100644 --- a/extensions/source/dbpilots/commonpagesdbp.hxx +++ b/extensions/source/dbpilots/commonpagesdbp.hxx @@ -21,28 +21,25 @@ #define INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_COMMONPAGESDBP_HXX #include "controlwizard.hxx" -#include <vcl/fixed.hxx> -#include <vcl/lstbox.hxx> +#include <vcl/weld.hxx> #include <com/sun/star/sdb/XDatabaseContext.hpp> - namespace dbp { - class OTableSelectionPage final : public OControlWizardPage { - VclPtr<FixedText> m_pDatasourceLabel; - VclPtr<ListBox> m_pDatasource; - VclPtr<PushButton> m_pSearchDatabase; - VclPtr<ListBox> m_pTable; + std::unique_ptr<weld::TreeView> m_xTable; + std::unique_ptr<weld::TreeView> m_xDatasource; + std::unique_ptr<weld::Label> m_xDatasourceLabel; + std::unique_ptr<weld::Button> m_xSearchDatabase; + std::unique_ptr<weld::Container> m_xSourceBox; css::uno::Reference< css::sdb::XDatabaseContext > m_xDSContext; public: - explicit OTableSelectionPage(OControlWizard* _pParent); + explicit OTableSelectionPage(OControlWizard* pParent, TabPageParent pPageParent); virtual ~OTableSelectionPage() override; - virtual void dispose() override; private: // TabPage overridables @@ -52,9 +49,9 @@ namespace dbp virtual void initializePage() override; virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override; - DECL_LINK( OnListboxSelection, ListBox&, void ); - DECL_LINK( OnListboxDoubleClicked, ListBox&, void ); - DECL_LINK( OnSearchClicked, Button*, void ); + DECL_LINK( OnListboxSelection, weld::TreeView&, void ); + DECL_LINK( OnListboxDoubleClicked, weld::TreeView&, void ); + DECL_LINK( OnSearchClicked, weld::Button&, void ); void implFillTables(const css::uno::Reference< css::sdbc::XConnection >& _rxConn = css::uno::Reference< css::sdbc::XConnection >()); @@ -65,26 +62,25 @@ namespace dbp class OMaybeListSelectionPage : public OControlWizardPage { - VclPtr<RadioButton> m_pYes; - VclPtr<RadioButton> m_pNo; - VclPtr<ListBox> m_pList; + weld::RadioButton* m_pYes; + weld::RadioButton* m_pNo; + weld::ComboBox* m_pList; public: - OMaybeListSelectionPage( OControlWizard* _pParent, const OString& _rID, const OUString& _rUIXMLDescription ); + OMaybeListSelectionPage(OControlWizard* pParent, TabPageParent pPageParent, const OUString& rUIXMLDescription, const OString& rID); virtual ~OMaybeListSelectionPage() override; - virtual void dispose() override; protected: - DECL_LINK( OnRadioSelected, Button*, void ); + DECL_LINK( OnRadioSelected, weld::Button&, void ); // TabPage overridables void ActivatePage() override; // own helper void announceControls( - RadioButton& _rYesButton, - RadioButton& _rNoButton, - ListBox& _rSelection); + weld::RadioButton& _rYesButton, + weld::RadioButton& _rNoButton, + weld::ComboBox& _rSelection); void implEnableWindows(); @@ -95,34 +91,19 @@ namespace dbp class ODBFieldPage : public OMaybeListSelectionPage { protected: - VclPtr<FixedText> m_pDescription; - VclPtr<RadioButton> m_pStoreYes; - VclPtr<RadioButton> m_pStoreNo; - VclPtr<ListBox> m_pStoreWhere; + std::unique_ptr<weld::Label> m_xDescription; + std::unique_ptr<weld::RadioButton> m_xStoreYes; + std::unique_ptr<weld::RadioButton> m_xStoreNo; + std::unique_ptr<weld::ComboBox> m_xStoreWhere; public: - explicit ODBFieldPage( OControlWizard* _pParent ); + explicit ODBFieldPage(OControlWizard* pParent, TabPageParent pPageParent); virtual ~ODBFieldPage() override; - virtual void dispose() override; protected: void setDescriptionText(const OUString& rDesc) { - m_pDescription->set_width_request(-1); - m_pDescription->set_height_request(-1); - - auto nWidthAvail = GetParent()->GetSizePixel().Width(); - - m_pDescription->SetText(rDesc); - - //tdf#122307 wrap based on current wizard width - Size aPrefSize(m_pDescription->get_preferred_size()); - Size aSize(m_pDescription->CalcMinimumSize(nWidthAvail)); - if (aSize.Height() > aPrefSize.Height()) - { - m_pDescription->set_width_request(aSize.Width()); - m_pDescription->set_height_request(aSize.Height()); - } + m_xDescription->set_label(rDesc); } // OWizardPage overridables diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index e02dbbfb2c24..c21e6240ab8a 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -74,127 +74,97 @@ namespace dbp OAccessRegulator() { } }; - OControlWizardPage::OControlWizardPage( vcl::Window* _pParent, const OString& rID, const OUString& rUIXMLDescription ) - :OControlWizardPage_Base( _pParent, rID, rUIXMLDescription ) - ,m_pFormDatasourceLabel(nullptr) - ,m_pFormDatasource(nullptr) - ,m_pFormContentTypeLabel(nullptr) - ,m_pFormContentType(nullptr) - ,m_pFormTableLabel(nullptr) - ,m_pFormTable(nullptr) + OControlWizardPage::OControlWizardPage(OControlWizard* pDialog, TabPageParent pPageParent, const OUString& rUIXMLDescription, const OString& rID) + : OControlWizardPage_Base(pPageParent, rUIXMLDescription, rID) + , m_pDialog(pDialog) { + ::Size aPageSize(LogicToPixel(::Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MapMode(MapUnit::MapAppFont))); + m_xContainer->set_size_request(aPageSize.Width(), aPageSize.Height()); } OControlWizardPage::~OControlWizardPage() { - disposeOnce(); - } - - void OControlWizardPage::dispose() - { - m_pFormDatasourceLabel.clear(); - m_pFormDatasource.clear(); - m_pFormContentTypeLabel.clear(); - m_pFormContentType.clear(); - m_pFormTableLabel.clear(); - m_pFormTable.clear(); - OControlWizardPage_Base::dispose(); } OControlWizard* OControlWizardPage::getDialog() { - return static_cast< OControlWizard* >(GetParent()); + return m_pDialog; } const OControlWizard* OControlWizardPage::getDialog() const { - return static_cast< OControlWizard* >(GetParent()); + return m_pDialog; } - bool OControlWizardPage::updateContext() { - return getDialog()->updateContext(OAccessRegulator()); + return m_pDialog->updateContext(OAccessRegulator()); } - Reference< XConnection > OControlWizardPage::getFormConnection() const { - return getDialog()->getFormConnection(OAccessRegulator()); + return m_pDialog->getFormConnection(OAccessRegulator()); } - void OControlWizardPage::setFormConnection( const Reference< XConnection >& _rxConn, bool _bAutoDispose ) { - getDialog()->setFormConnection( OAccessRegulator(), _rxConn, _bAutoDispose ); + m_pDialog->setFormConnection( OAccessRegulator(), _rxConn, _bAutoDispose ); } - const OControlWizardContext& OControlWizardPage::getContext() { - return getDialog()->getContext(); + return m_pDialog->getContext(); } - - void OControlWizardPage::fillListBox(ListBox& _rList, const Sequence< OUString >& _rItems) + void OControlWizardPage::fillListBox(weld::TreeView& _rList, const Sequence< OUString >& _rItems) { - _rList.Clear(); + _rList.clear(); const OUString* pItems = _rItems.getConstArray(); const OUString* pEnd = pItems + _rItems.getLength(); - ::vcl::WizardTypes::WizardState nPos; sal_Int32 nIndex = 0; for (;pItems < pEnd; ++pItems, ++nIndex) { - nPos = _rList.InsertEntry(*pItems); - _rList.SetEntryData(nPos, reinterpret_cast<void*>(nIndex)); + _rList.append(OUString::number(nIndex), *pItems); } } - - void OControlWizardPage::fillListBox(ComboBox& _rList, const Sequence< OUString >& _rItems) + void OControlWizardPage::fillListBox(weld::ComboBox& _rList, const Sequence< OUString >& _rItems) { - _rList.Clear(); + _rList.clear(); const OUString* pItems = _rItems.getConstArray(); const OUString* pEnd = pItems + _rItems.getLength(); - ::vcl::WizardTypes::WizardState nPos; for (;pItems < pEnd; ++pItems) { - nPos = _rList.InsertEntry(*pItems); - _rList.SetEntryData(nPos, nullptr); + _rList.append_text(*pItems); } } - void OControlWizardPage::enableFormDatasourceDisplay() { - if (m_pFormContentType) + if (m_xFormContentType) // nothing to do return; - VclFrame *_pFrame = get<VclFrame>("sourceframe"); - _pFrame->Show(); - get(m_pFormContentType,"contenttype"); - get(m_pFormContentTypeLabel,"contenttypelabel"); - get(m_pFormDatasource, "datasource"); - get(m_pFormDatasourceLabel, "datasourcelabel"); - get(m_pFormTable,"formtable"); - get(m_pFormTableLabel,"formtablelabel"); + m_xFrame = m_xBuilder->weld_frame("sourceframe"); + m_xFrame->show(); + m_xFormContentType = m_xBuilder->weld_label("contenttype"); + m_xFormContentTypeLabel = m_xBuilder->weld_label("contenttypelabel"); + m_xFormDatasource = m_xBuilder->weld_label("datasource"); + m_xFormDatasourceLabel = m_xBuilder->weld_label("datasourcelabel"); + m_xFormTable = m_xBuilder->weld_label("formtable"); + m_xFormTableLabel = m_xBuilder->weld_label("formtablelabel"); const OControlWizardContext& rContext = getContext(); if ( rContext.bEmbedded ) { - m_pFormDatasourceLabel->Hide(); - m_pFormDatasource->Hide(); - m_pFormContentTypeLabel->SetPosPixel(m_pFormDatasourceLabel->GetPosPixel()); - m_pFormContentType->SetPosPixel(m_pFormDatasource->GetPosPixel()); - m_pFormTableLabel->SetPosPixel(::Point(m_pFormDatasourceLabel->GetPosPixel().X(),m_pFormTableLabel->GetPosPixel().Y())); - m_pFormTable->SetPosPixel(::Point(m_pFormDatasource->GetPosPixel().X(),m_pFormTable->GetPosPixel().Y())); + m_xFormDatasourceLabel->hide(); + m_xFormDatasource->hide(); } } void OControlWizardPage::initializePage() { - if (m_pFormDatasource && m_pFormContentTypeLabel && m_pFormTable) + if (m_xFormDatasource && m_xFormContentTypeLabel && m_xFormTable) { const OControlWizardContext& rContext = getContext(); OUString sDataSource; @@ -214,8 +184,8 @@ namespace dbp INetURLObject aURL( sDataSource ); if( aURL.GetProtocol() != INetProtocol::NotValid ) sDataSource = aURL.GetLastName(INetURLObject::DecodeMechanism::WithCharset); - m_pFormDatasource->SetText(sDataSource); - m_pFormTable->SetText(sCommand); + m_xFormDatasource->set_label(sDataSource); + m_xFormTable->set_label(sCommand); const char* pCommandTypeResourceId = nullptr; switch (nCommandType) @@ -232,21 +202,20 @@ namespace dbp pCommandTypeResourceId = RID_STR_TYPE_COMMAND; break; } - m_pFormContentType->SetText(compmodule::ModuleRes(pCommandTypeResourceId)); + m_xFormContentType->set_label(compmodule::ModuleRes(pCommandTypeResourceId)); } OControlWizardPage_Base::initializePage(); } - OControlWizard::OControlWizard( vcl::Window* _pParent, + OControlWizard::OControlWizard(weld::Window* _pParent, const Reference< XPropertySet >& _rxObjectModel, const Reference< XComponentContext >& _rxContext ) - :OWizardMachine(_pParent, WizardButtonFlags::CANCEL | WizardButtonFlags::PREVIOUS | WizardButtonFlags::NEXT | WizardButtonFlags::FINISH) - ,m_xContext(_rxContext) + : WizardMachine(_pParent, WizardButtonFlags::CANCEL | WizardButtonFlags::PREVIOUS | WizardButtonFlags::NEXT | WizardButtonFlags::FINISH) + , m_xContext(_rxContext) { m_aContext.xObjectModel = _rxObjectModel; initContext(); - SetPageSizePixel(LogicToPixel(::Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MapMode(MapUnit::MapAppFont))); defaultButton(WizardButtonFlags::NEXT); enableButtons(WizardButtonFlags::FINISH, false); } @@ -255,7 +224,7 @@ namespace dbp { } - short OControlWizard::Execute() + short OControlWizard::run() { // get the class id of the control we're dealing with sal_Int16 nClassId = FormComponentType::CONTROL; @@ -275,9 +244,10 @@ namespace dbp ActivatePage(); - return OControlWizard_Base::Execute(); - } + m_xAssistant->set_current_page(0); + return OControlWizard_Base::run(); + } void OControlWizard::implDetermineShape() { @@ -612,7 +582,7 @@ namespace dbp aContext.NextException = aSQLException; // create an interaction handler to display this exception - Reference< XInteractionHandler > xHandler = getInteractionHandler(GetFrameWeld()); + Reference< XInteractionHandler > xHandler = getInteractionHandler(m_xAssistant.get()); if ( !xHandler.is() ) return false; diff --git a/extensions/source/dbpilots/controlwizard.hxx b/extensions/source/dbpilots/controlwizard.hxx index 68b0551d1780..8fb62b9bc2b2 100644 --- a/extensions/source/dbpilots/controlwizard.hxx +++ b/extensions/source/dbpilots/controlwizard.hxx @@ -20,17 +20,12 @@ #ifndef INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_CONTROLWIZARD_HXX #define INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_CONTROLWIZARD_HXX -#include <vcl/wizardmachine.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/form/FormComponentType.hpp> #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> -#include <vcl/fixed.hxx> -#include <vcl/edit.hxx> -#include <vcl/button.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/combobox.hxx> #include <vcl/weld.hxx> +#include <vcl/wizardmachine.hxx> #include "dbptypes.hxx" #include <strings.hrc> #include <componentmodule.hxx> @@ -49,12 +44,14 @@ namespace dbp typedef ::vcl::OWizardPage OControlWizardPage_Base; class OControlWizardPage : public OControlWizardPage_Base { - VclPtr<FixedText> m_pFormDatasourceLabel; - VclPtr<FixedText> m_pFormDatasource; - VclPtr<FixedText> m_pFormContentTypeLabel; - VclPtr<FixedText> m_pFormContentType; - VclPtr<FixedText> m_pFormTableLabel; - VclPtr<FixedText> m_pFormTable; + OControlWizard* m_pDialog; + std::unique_ptr<weld::Label> m_xFormDatasourceLabel; + std::unique_ptr<weld::Label> m_xFormDatasource; + std::unique_ptr<weld::Label> m_xFormContentTypeLabel; + std::unique_ptr<weld::Label> m_xFormContentType; + std::unique_ptr<weld::Label> m_xFormTableLabel; + std::unique_ptr<weld::Label> m_xFormTable; + std::unique_ptr<weld::Frame> m_xFrame; protected: OControlWizard* getDialog(); @@ -65,16 +62,15 @@ namespace dbp css::uno::Reference< css::sdbc::XConnection > getFormConnection() const; public: - OControlWizardPage( vcl::Window* _pParent, const OString& rID, const OUString& rUIXMLDescription ); + OControlWizardPage(OControlWizard* pDialog, TabPageParent pPageParent, const OUString& rUIXMLDescription, const OString& rID); virtual ~OControlWizardPage() override; - virtual void dispose() override; protected: static void fillListBox( - ListBox& _rList, + weld::TreeView& _rList, const css::uno::Sequence< OUString >& _rItems); static void fillListBox( - ComboBox& _rList, + weld::ComboBox& _rList, const css::uno::Sequence< OUString >& _rItems); protected: @@ -87,7 +83,7 @@ namespace dbp struct OAccessRegulator; - typedef ::vcl::OWizardMachine OControlWizard_Base; + typedef ::vcl::WizardMachine OControlWizard_Base; class OControlWizard : public OControlWizard_Base { private: @@ -97,7 +93,7 @@ namespace dbp public: OControlWizard( - vcl::Window* _pParent, + weld::Window* _pParent, const css::uno::Reference< css::beans::XPropertySet >& _rxObjectModel, const css::uno::Reference< css::uno::XComponentContext >& _rxContext ); @@ -135,8 +131,7 @@ namespace dbp virtual bool approveControl(sal_Int16 _nClassId) = 0; - // ModalDialog overridables - virtual short Execute() override; + virtual short run() override; private: bool initContext(); diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index cdacbd4d644e..7da39e065439 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -49,17 +49,17 @@ namespace dbp using namespace ::com::sun::star::awt; using namespace ::svt; - OGridWizard::OGridWizard( vcl::Window* _pParent, + OGridWizard::OGridWizard(weld::Window* _pParent, const Reference< XPropertySet >& _rxObjectModel, const Reference< XComponentContext >& _rxContext ) - :OControlWizard(_pParent, _rxObjectModel, _rxContext) - ,m_bHadDataSelection(true) + : OControlWizard(_pParent, _rxObjectModel, _rxContext) + , m_bHadDataSelection(true) { initControlSettings(&m_aSettings); - m_pPrevPage->SetHelpId(HID_GRIDWIZARD_PREVIOUS); - m_pNextPage->SetHelpId(HID_GRIDWIZARD_NEXT); - m_pCancel->SetHelpId(HID_GRIDWIZARD_CANCEL); - m_pFinish->SetHelpId(HID_GRIDWIZARD_FINISH); + m_xPrevPage->set_help_id(HID_GRIDWIZARD_PREVIOUS); + m_xNextPage->set_help_id(HID_GRIDWIZARD_NEXT); + m_xCancel->set_help_id(HID_GRIDWIZARD_CANCEL); + m_xFinish->set_help_id(HID_GRIDWIZARD_FINISH); setTitleBase(compmodule::ModuleRes(RID_STR_GRIDWIZARD_TITLE)); // if we do not need the data source selection page ... @@ -70,7 +70,6 @@ namespace dbp } } - bool OGridWizard::approveControl(sal_Int16 _nClassId) { if (FormComponentType::GRIDCONTROL != _nClassId) @@ -80,7 +79,6 @@ namespace dbp return xColumnFactory.is(); } - void OGridWizard::implApplySettings() { const OControlWizardContext& rContext = getContext(); @@ -220,13 +218,19 @@ namespace dbp VclPtr<TabPage> OGridWizard::createPage(WizardState _nState) { + OString sIdent(OString::number(_nState)); + weld::Container* pPageContainer = m_xAssistant->append_page(sIdent); + // TODO eventually pass DialogController as distinct argument instead of bundling into TabPageParent + TabPageParent aParent(pPageContainer, this); + switch (_nState) { case GW_STATE_DATASOURCE_SELECTION: - return VclPtr<OTableSelectionPage>::Create(this); + return VclPtr<OTableSelectionPage>::Create(this, aParent); case GW_STATE_FIELDSELECTION: - return VclPtr<OGridFieldsSelection>::Create(this); + return VclPtr<OGridFieldsSelection>::Create(this, aParent); } + return VclPtr<TabPage>(); } @@ -279,191 +283,168 @@ namespace dbp return true; } - OGridFieldsSelection::OGridFieldsSelection( OGridWizard* _pParent ) - :OGridPage(_pParent, "GridFieldsSelection", "modules/sabpilot/ui/gridfieldsselectionpage.ui") + OGridFieldsSelection::OGridFieldsSelection(OGridWizard* pParent, TabPageParent pPageParent) + : OGridPage(pParent, pPageParent, "modules/sabpilot/ui/gridfieldsselectionpage.ui", "GridFieldsSelection") + , m_xExistFields(m_xBuilder->weld_tree_view("existingfields")) + , m_xSelectOne(m_xBuilder->weld_button("fieldright")) + , m_xSelectAll(m_xBuilder->weld_button("allfieldsright")) + , m_xDeselectOne(m_xBuilder->weld_button("fieldleft")) + , m_xDeselectAll(m_xBuilder->weld_button("allfieldsleft")) + , m_xSelFields(m_xBuilder->weld_tree_view("selectedfields")) { - get(m_pExistFields,"existingfields"); - get(m_pSelectOne,"fieldright"); - get(m_pSelectAll,"allfieldsright"); - get(m_pDeselectOne,"fieldleft"); - get(m_pDeselectAll,"allfieldsleft"); - get(m_pSelFields,"selectedfields"); - enableFormDatasourceDisplay(); - m_pSelectOne->SetClickHdl(LINK(this, OGridFieldsSelection, OnMoveOneEntry)); - m_pSelectAll->SetClickHdl(LINK(this, OGridFieldsSelection, OnMoveAllEntries)); - m_pDeselectOne->SetClickHdl(LINK(this, OGridFieldsSelection, OnMoveOneEntry)); - m_pDeselectAll->SetClickHdl(LINK(this, OGridFieldsSelection, OnMoveAllEntries)); + m_xSelectOne->connect_clicked(LINK(this, OGridFieldsSelection, OnMoveOneEntry)); + m_xSelectAll->connect_clicked(LINK(this, OGridFieldsSelection, OnMoveAllEntries)); + m_xDeselectOne->connect_clicked(LINK(this, OGridFieldsSelection, OnMoveOneEntry)); + m_xDeselectAll->connect_clicked(LINK(this, OGridFieldsSelection, OnMoveAllEntries)); - m_pExistFields->SetSelectHdl(LINK(this, OGridFieldsSelection, OnEntrySelected)); - m_pSelFields->SetSelectHdl(LINK(this, OGridFieldsSelection, OnEntrySelected)); - m_pExistFields->SetDoubleClickHdl(LINK(this, OGridFieldsSelection, OnEntryDoubleClicked)); - m_pSelFields->SetDoubleClickHdl(LINK(this, OGridFieldsSelection, OnEntryDoubleClicked)); + m_xExistFields->connect_changed(LINK(this, OGridFieldsSelection, OnEntrySelected)); + m_xSelFields->connect_changed(LINK(this, OGridFieldsSelection, OnEntrySelected)); + m_xExistFields->connect_row_activated(LINK(this, OGridFieldsSelection, OnEntryDoubleClicked)); + m_xSelFields->connect_row_activated(LINK(this, OGridFieldsSelection, OnEntryDoubleClicked)); } OGridFieldsSelection::~OGridFieldsSelection() { - disposeOnce(); - } - - void OGridFieldsSelection::dispose() - { - m_pExistFields.clear(); - m_pSelectOne.clear(); - m_pSelectAll.clear(); - m_pDeselectOne.clear(); - m_pDeselectAll.clear(); - m_pSelFields.clear(); - OGridPage::dispose(); } void OGridFieldsSelection::ActivatePage() { OGridPage::ActivatePage(); - m_pExistFields->GrabFocus(); + m_xExistFields->grab_focus(); } - bool OGridFieldsSelection::canAdvance() const { return false; // we're the last page in our wizard } - void OGridFieldsSelection::initializePage() { OGridPage::initializePage(); const OControlWizardContext& rContext = getContext(); - fillListBox(*m_pExistFields, rContext.aFieldNames); + fillListBox(*m_xExistFields, rContext.aFieldNames); - m_pSelFields->Clear(); + m_xSelFields->clear(); const OGridSettings& rSettings = getSettings(); const OUString* pSelected = rSettings.aSelectedFields.getConstArray(); const OUString* pEnd = pSelected + rSettings.aSelectedFields.getLength(); for (; pSelected < pEnd; ++pSelected) { - m_pSelFields->InsertEntry(*pSelected); - m_pExistFields->RemoveEntry(*pSelected); + m_xSelFields->append_text(*pSelected); + m_xExistFields->remove_text(*pSelected); } implCheckButtons(); } - bool OGridFieldsSelection::commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) { if (!OGridPage::commitPage(_eReason)) return false; OGridSettings& rSettings = getSettings(); - const sal_Int32 nSelected = m_pSelFields->GetEntryCount(); + const sal_Int32 nSelected = m_xSelFields->n_children(); rSettings.aSelectedFields.realloc(nSelected); OUString* pSelected = rSettings.aSelectedFields.getArray(); for (sal_Int32 i=0; i<nSelected; ++i, ++pSelected) - *pSelected = m_pSelFields->GetEntry(i); + *pSelected = m_xSelFields->get_text(i); return true; } - void OGridFieldsSelection::implCheckButtons() { - m_pSelectOne->Enable(m_pExistFields->GetSelectedEntryCount() != 0); - m_pSelectAll->Enable(m_pExistFields->GetEntryCount() != 0); + m_xSelectOne->set_sensitive(m_xExistFields->count_selected_rows() != 0); + m_xSelectAll->set_sensitive(m_xExistFields->n_children() != 0); - m_pDeselectOne->Enable(m_pSelFields->GetSelectedEntryCount() != 0); - m_pDeselectAll->Enable(m_pSelFields->GetEntryCount() != 0); + m_xDeselectOne->set_sensitive(m_xSelFields->count_selected_rows() != 0); + m_xDeselectAll->set_sensitive(m_xSelFields->n_children() != 0); - getDialog()->enableButtons(WizardButtonFlags::FINISH, 0 != m_pSelFields->GetEntryCount()); + getDialog()->enableButtons(WizardButtonFlags::FINISH, 0 != m_xSelFields->n_children()); } - - IMPL_LINK(OGridFieldsSelection, OnEntryDoubleClicked, ListBox&, _rList, void) + IMPL_LINK(OGridFieldsSelection, OnEntryDoubleClicked, weld::TreeView&, rList, void) { - PushButton* pSimulateButton = m_pExistFields == &_rList ? m_pSelectOne.get() : m_pDeselectOne.get(); - if (pSimulateButton->IsEnabled()) + weld::Button* pSimulateButton = m_xExistFields.get() == &rList ? m_xSelectOne.get() : m_xDeselectOne.get(); + if (pSimulateButton->get_sensitive()) { - OnMoveOneEntry( pSimulateButton ); + OnMoveOneEntry(*pSimulateButton); } } - - IMPL_LINK_NOARG(OGridFieldsSelection, OnEntrySelected, ListBox&, void) + IMPL_LINK_NOARG(OGridFieldsSelection, OnEntrySelected, weld::TreeView&, void) { implCheckButtons(); } - - IMPL_LINK(OGridFieldsSelection, OnMoveOneEntry, Button*, _pButton, void) + IMPL_LINK(OGridFieldsSelection, OnMoveOneEntry, weld::Button&, rButton, void) { - bool bMoveRight = (m_pSelectOne == _pButton); - ListBox& rMoveTo = bMoveRight ? *m_pSelFields : *m_pExistFields; + bool bMoveRight = (m_xSelectOne.get() == &rButton); + weld::TreeView& rMoveTo = bMoveRight ? *m_xSelFields : *m_xExistFields; // the index of the selected entry - const sal_Int32 nSelected = bMoveRight ? m_pExistFields->GetSelectedEntryPos() : m_pSelFields->GetSelectedEntryPos(); + const sal_Int32 nSelected = bMoveRight ? m_xExistFields->get_selected_index() : m_xSelFields->get_selected_index(); // the (original) relative position of the entry - sal_IntPtr nRelativeIndex = reinterpret_cast<sal_IntPtr>(bMoveRight ? m_pExistFields->GetEntryData(nSelected) : m_pSelFields->GetEntryData(nSelected)); + int nRelativeIndex = bMoveRight ? m_xExistFields->get_id(nSelected).toInt32() : m_xSelFields->get_id(nSelected).toInt32(); - sal_Int32 nInsertPos = LISTBOX_APPEND; + sal_Int32 nInsertPos = -1; if (!bMoveRight) { // need to determine an insert pos which reflects the original nInsertPos = 0; - while (nInsertPos < rMoveTo.GetEntryCount()) + while (nInsertPos < rMoveTo.n_children()) { - if (reinterpret_cast<sal_IntPtr>(rMoveTo.GetEntryData(nInsertPos)) > nRelativeIndex) + if (rMoveTo.get_id(nInsertPos).toInt32() > nRelativeIndex) break; ++nInsertPos; } } // the text of the entry to move - OUString sMovingEntry = bMoveRight ? m_pExistFields->GetEntry(nSelected) : m_pSelFields->GetEntry(nSelected); + OUString sMovingEntry = bMoveRight ? m_xExistFields->get_text(nSelected) : m_xSelFields->get_text(nSelected); - // insert the entry - nInsertPos = rMoveTo.InsertEntry(sMovingEntry, nInsertPos); - // preserve it's "relative position" entry data - rMoveTo.SetEntryData(nInsertPos, reinterpret_cast<void*>(nRelativeIndex)); + // insert the entry preserving it's "relative position" entry data + OUString sId(OUString::number(nRelativeIndex)); + rMoveTo.insert(nullptr, nInsertPos, &sMovingEntry, &sId, nullptr, nullptr, nullptr, false, nullptr); // remove the entry from its old list if (bMoveRight) { - sal_Int32 nSelectPos = m_pExistFields->GetSelectedEntryPos(); - m_pExistFields->RemoveEntry(nSelected); - if ((LISTBOX_ENTRY_NOTFOUND != nSelectPos) && (nSelectPos < m_pExistFields->GetEntryCount())) - m_pExistFields->SelectEntryPos(nSelectPos); + sal_Int32 nSelectPos = m_xExistFields->get_selected_index(); + m_xExistFields->remove(nSelected); + if ((nSelectPos != -1) && (nSelectPos < m_xExistFields->n_children())) + m_xExistFields->select(nSelectPos); - m_pExistFields->GrabFocus(); + m_xExistFields->grab_focus(); } else { - sal_Int32 nSelectPos = m_pSelFields->GetSelectedEntryPos(); - m_pSelFields->RemoveEntry(nSelected); - if ((LISTBOX_ENTRY_NOTFOUND != nSelectPos) && (nSelectPos < m_pSelFields->GetEntryCount())) - m_pSelFields->SelectEntryPos(nSelectPos); + sal_Int32 nSelectPos = m_xSelFields->get_selected_index(); + m_xSelFields->remove(nSelected); + if ((nSelectPos != -1) && (nSelectPos < m_xSelFields->n_children())) + m_xSelFields->select(nSelectPos); - m_pSelFields->GrabFocus(); + m_xSelFields->grab_focus(); } implCheckButtons(); } - - IMPL_LINK(OGridFieldsSelection, OnMoveAllEntries, Button*, _pButton, void) + IMPL_LINK(OGridFieldsSelection, OnMoveAllEntries, weld::Button&, rButton, void) { - bool bMoveRight = (m_pSelectAll == _pButton); - m_pExistFields->Clear(); - m_pSelFields->Clear(); - fillListBox(bMoveRight ? *m_pSelFields : *m_pExistFields, getContext().aFieldNames); + bool bMoveRight = (m_xSelectAll.get() == &rButton); + m_xExistFields->clear(); + m_xSelFields->clear(); + fillListBox(bMoveRight ? *m_xSelFields : *m_xExistFields, getContext().aFieldNames); implCheckButtons(); } - } // namespace dbp diff --git a/extensions/source/dbpilots/gridwizard.hxx b/extensions/source/dbpilots/gridwizard.hxx index 496c77467ce7..b38d58f9192e 100644 --- a/extensions/source/dbpilots/gridwizard.hxx +++ b/extensions/source/dbpilots/gridwizard.hxx @@ -37,11 +37,9 @@ namespace dbp bool m_bHadDataSelection : 1; public: - OGridWizard( - vcl::Window* _pParent, + OGridWizard(weld::Window* _pParent, const css::uno::Reference< css::beans::XPropertySet >& _rxObjectModel, - const css::uno::Reference< css::uno::XComponentContext >& _rxContext - ); + const css::uno::Reference< css::uno::XComponentContext >& _rxContext); OGridSettings& getSettings() { return m_aSettings; } @@ -61,25 +59,26 @@ namespace dbp class OGridPage : public OControlWizardPage { public: - OGridPage( OGridWizard* _pParent, const OString& _rID, const OUString& _rUIXMLDescription ) : OControlWizardPage(_pParent, _rID, _rUIXMLDescription) { } - + OGridPage(OGridWizard* pParent, TabPageParent pPageParent, const OUString& rUIXMLDescription, const OString& rID) + : OControlWizardPage(pParent, pPageParent, rUIXMLDescription, rID) + { + } protected: OGridSettings& getSettings() { return static_cast<OGridWizard*>(getDialog())->getSettings(); } }; class OGridFieldsSelection final : public OGridPage { - VclPtr<ListBox> m_pExistFields; - VclPtr<PushButton> m_pSelectOne; - VclPtr<PushButton> m_pSelectAll; - VclPtr<PushButton> m_pDeselectOne; - VclPtr<PushButton> m_pDeselectAll; - VclPtr<ListBox> m_pSelFields; + std::unique_ptr<weld::TreeView> m_xExistFields; + std::unique_ptr<weld::Button> m_xSelectOne; + std::unique_ptr<weld::Button> m_xSelectAll; + std::unique_ptr<weld::Button> m_xDeselectOne; + std::unique_ptr<weld::Button> m_xDeselectAll; + std::unique_ptr<weld::TreeView> m_xSelFields; public: - explicit OGridFieldsSelection( OGridWizard* _pParent ); + explicit OGridFieldsSelection(OGridWizard* pParent, TabPageParent pPageParent); virtual ~OGridFieldsSelection() override; - virtual void dispose() override; private: // TabPage overridables @@ -90,15 +89,13 @@ namespace dbp virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override; virtual bool canAdvance() const override; - DECL_LINK(OnMoveOneEntry, Button*, void); - DECL_LINK(OnMoveAllEntries, Button*, void); - DECL_LINK(OnEntrySelected, ListBox&, void); - DECL_LINK(OnEntryDoubleClicked, ListBox&, void); + DECL_LINK(OnMoveOneEntry, weld::Button&, void); + DECL_LINK(OnMoveAllEntries, weld::Button&, void); + DECL_LINK(OnEntrySelected, weld::TreeView&, void); + DECL_LINK(OnEntryDoubleClicked, weld::TreeView&, void); void implCheckButtons(); }; - - } // namespace dbp diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx index 73aea6009cfc..3a8ca305e443 100644 --- a/extensions/source/dbpilots/groupboxwiz.cxx +++ b/extensions/source/dbpilots/groupboxwiz.cxx @@ -32,63 +32,62 @@ #define GBW_STATE_DBFIELD 3 #define GBW_STATE_FINALIZE 4 - namespace dbp { - - using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::form; using namespace ::svt; - OGroupBoxWizard::OGroupBoxWizard( vcl::Window* _pParent, + OGroupBoxWizard::OGroupBoxWizard(weld::Window* _pParent, const Reference< XPropertySet >& _rxObjectModel, const Reference< XComponentContext >& _rxContext ) - :OControlWizard(_pParent, _rxObjectModel, _rxContext) - ,m_bVisitedDefault(false) - ,m_bVisitedDB(false) + : OControlWizard(_pParent, _rxObjectModel, _rxContext) + , m_bVisitedDefault(false) + , m_bVisitedDB(false) { initControlSettings(&m_aSettings); - m_pPrevPage->SetHelpId(HID_GROUPWIZARD_PREVIOUS); - m_pNextPage->SetHelpId(HID_GROUPWIZARD_NEXT); - m_pCancel->SetHelpId(HID_GROUPWIZARD_CANCEL); - m_pFinish->SetHelpId(HID_GROUPWIZARD_FINISH); + m_xPrevPage->set_help_id(HID_GROUPWIZARD_PREVIOUS); + m_xNextPage->set_help_id(HID_GROUPWIZARD_NEXT); + m_xCancel->set_help_id(HID_GROUPWIZARD_CANCEL); + m_xFinish->set_help_id(HID_GROUPWIZARD_FINISH); setTitleBase(compmodule::ModuleRes(RID_STR_GROUPWIZARD_TITLE)); } - bool OGroupBoxWizard::approveControl(sal_Int16 _nClassId) { return FormComponentType::GROUPBOX == _nClassId; } - VclPtr<TabPage> OGroupBoxWizard::createPage(::vcl::WizardTypes::WizardState _nState) { + OString sIdent(OString::number(_nState)); + weld::Container* pPageContainer = m_xAssistant->append_page(sIdent); + // TODO eventually pass DialogController as distinct argument instead of bundling into TabPageParent + TabPageParent aParent(pPageContainer, this); + switch (_nState) { case GBW_STATE_OPTIONLIST: - return VclPtr<ORadioSelectionPage>::Create(this); + return VclPtr<ORadioSelectionPage>::Create(this, aParent); case GBW_STATE_DEFAULTOPTION: - return VclPtr<ODefaultFieldSelectionPage>::Create(this); + return VclPtr<ODefaultFieldSelectionPage>::Create(this, aParent); case GBW_STATE_OPTIONVALUES: - return VclPtr<OOptionValuesPage>::Create(this); + return VclPtr<OOptionValuesPage>::Create(this, aParent); case GBW_STATE_DBFIELD: - return VclPtr<OOptionDBFieldPage>::Create(this); + return VclPtr<OOptionDBFieldPage>::Create(this, aParent); case GBW_STATE_FINALIZE: - return VclPtr<OFinalizeGBWPage>::Create(this); + return VclPtr<OFinalizeGBWPage>::Create(this, aParent); } return nullptr; } - vcl::WizardTypes::WizardState OGroupBoxWizard::determineNextState( ::vcl::WizardTypes::WizardState _nCurrentState ) const { switch (_nCurrentState) @@ -112,7 +111,6 @@ namespace dbp return WZS_INVALID_STATE; } - void OGroupBoxWizard::enterState(::vcl::WizardTypes::WizardState _nState) { // some stuff to do before calling the base class (modifying our settings) @@ -152,7 +150,6 @@ namespace dbp OControlWizard::enterState(_nState); } - bool OGroupBoxWizard::onFinish() { // commit the basic control settings @@ -172,56 +169,44 @@ namespace dbp return OControlWizard::onFinish(); } - ORadioSelectionPage::ORadioSelectionPage( OControlWizard* _pParent ) - :OGBWPage(_pParent, "GroupRadioSelectionPage", "modules/sabpilot/ui/groupradioselectionpage.ui") + ORadioSelectionPage::ORadioSelectionPage(OControlWizard* pParent, TabPageParent pPageParent) + : OGBWPage(pParent, pPageParent, "modules/sabpilot/ui/groupradioselectionpage.ui", "GroupRadioSelectionPage") + , m_xRadioName(m_xBuilder->weld_entry("radiolabels")) + , m_xMoveRight(m_xBuilder->weld_button("toright")) + , m_xMoveLeft(m_xBuilder->weld_button("toleft")) + , m_xExistingRadios(m_xBuilder->weld_tree_view("radiobuttons")) { - get(m_pRadioName, "radiolabels"); - get(m_pMoveRight, "toright"); - get(m_pMoveLeft, "toleft"); - get(m_pExistingRadios, "radiobuttons"); - if (getContext().aFieldNames.hasElements()) { enableFormDatasourceDisplay(); } - m_pMoveLeft->SetClickHdl(LINK(this, ORadioSelectionPage, OnMoveEntry)); - m_pMoveRight->SetClickHdl(LINK(this, ORadioSelectionPage, OnMoveEntry)); - m_pRadioName->SetModifyHdl(LINK(this, ORadioSelectionPage, OnNameModified)); - m_pExistingRadios->SetSelectHdl(LINK(this, ORadioSelectionPage, OnEntrySelected)); + m_xMoveLeft->connect_clicked(LINK(this, ORadioSelectionPage, OnMoveEntry)); + m_xMoveRight->connect_clicked(LINK(this, ORadioSelectionPage, OnMoveEntry)); + m_xRadioName->connect_changed(LINK(this, ORadioSelectionPage, OnNameModified)); + m_xExistingRadios->connect_changed(LINK(this, ORadioSelectionPage, OnEntrySelected)); implCheckMoveButtons(); - m_pExistingRadios->EnableMultiSelection(true); + m_xExistingRadios->set_selection_mode(SelectionMode::Multiple); - getDialog()->defaultButton(m_pMoveRight.get()); + getDialog()->defaultButton(m_xMoveRight.get()); } ORadioSelectionPage::~ORadioSelectionPage() { - disposeOnce(); - } - - void ORadioSelectionPage::dispose() - { - m_pRadioName.clear(); - m_pMoveRight.clear(); - m_pMoveLeft.clear(); - m_pExistingRadios.clear(); - OGBWPage::dispose(); } void ORadioSelectionPage::ActivatePage() { OGBWPage::ActivatePage(); - m_pRadioName->GrabFocus(); + m_xRadioName->grab_focus(); } - void ORadioSelectionPage::initializePage() { OGBWPage::initializePage(); - m_pRadioName->SetText(""); + m_xRadioName->set_text(""); // no need to initialize the list of radios here // (we're the only one affecting this special setting, so it will be in the same state as last time this @@ -230,7 +215,6 @@ namespace dbp implCheckMoveButtons(); } - bool ORadioSelectionPage::commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) { if (!OGBWPage::commitPage(_eReason)) @@ -241,106 +225,89 @@ namespace dbp OOptionGroupSettings& rSettings = getSettings(); rSettings.aLabels.clear(); rSettings.aValues.clear(); - rSettings.aLabels.reserve(m_pExistingRadios->GetEntryCount()); - rSettings.aValues.reserve(m_pExistingRadios->GetEntryCount()); - for (sal_Int32 i=0; i<m_pExistingRadios->GetEntryCount(); ++i) + rSettings.aLabels.reserve(m_xExistingRadios->n_children()); + rSettings.aValues.reserve(m_xExistingRadios->n_children()); + for (sal_Int32 i=0; i<m_xExistingRadios->n_children(); ++i) { - rSettings.aLabels.push_back(m_pExistingRadios->GetEntry(i)); + rSettings.aLabels.push_back(m_xExistingRadios->get_text(i)); rSettings.aValues.push_back(OUString::number((i + 1))); } return true; } - - IMPL_LINK( ORadioSelectionPage, OnMoveEntry, Button*, _pButton, void ) + IMPL_LINK( ORadioSelectionPage, OnMoveEntry, weld::Button&, rButton, void ) { - bool bMoveLeft = (m_pMoveLeft == _pButton); + bool bMoveLeft = (m_xMoveLeft.get() == &rButton); if (bMoveLeft) { - while (m_pExistingRadios->GetSelectedEntryCount()) - m_pExistingRadios->RemoveEntry(m_pExistingRadios->GetSelectedEntryPos()); + while (m_xExistingRadios->count_selected_rows()) + m_xExistingRadios->remove(m_xExistingRadios->get_selected_index()); } else { - m_pExistingRadios->InsertEntry(m_pRadioName->GetText()); - m_pRadioName->SetText(""); + m_xExistingRadios->append_text(m_xRadioName->get_text()); + m_xRadioName->set_text(""); } implCheckMoveButtons(); //adjust the focus if (bMoveLeft) - m_pExistingRadios->GrabFocus(); + m_xExistingRadios->grab_focus(); else - m_pRadioName->GrabFocus(); + m_xRadioName->grab_focus(); } - - IMPL_LINK_NOARG( ORadioSelectionPage, OnEntrySelected, ListBox&, void ) + IMPL_LINK_NOARG( ORadioSelectionPage, OnEntrySelected, weld::TreeView&, void ) { implCheckMoveButtons(); } - - IMPL_LINK_NOARG( ORadioSelectionPage, OnNameModified, Edit&, void ) + IMPL_LINK_NOARG( ORadioSelectionPage, OnNameModified, weld::Entry&, void ) { implCheckMoveButtons(); } - bool ORadioSelectionPage::canAdvance() const { - return 0 != m_pExistingRadios->GetEntryCount(); + return 0 != m_xExistingRadios->n_children(); } - void ORadioSelectionPage::implCheckMoveButtons() { - bool bHaveSome = (0 != m_pExistingRadios->GetEntryCount()); - bool bSelectedSome = (0 != m_pExistingRadios->GetSelectedEntryCount()); - bool bUnfinishedInput = !m_pRadioName->GetText().isEmpty(); + bool bHaveSome = (0 != m_xExistingRadios->n_children()); + bool bSelectedSome = (0 != m_xExistingRadios->count_selected_rows()); + bool bUnfinishedInput = !m_xRadioName->get_text().isEmpty(); - m_pMoveLeft->Enable(bSelectedSome); - m_pMoveRight->Enable(bUnfinishedInput); + m_xMoveLeft->set_sensitive(bSelectedSome); + m_xMoveRight->set_sensitive(bUnfinishedInput); getDialog()->enableButtons(WizardButtonFlags::NEXT, bHaveSome); if (bUnfinishedInput) { - if (0 == (m_pMoveRight->GetStyle() & WB_DEFBUTTON)) - getDialog()->defaultButton(m_pMoveRight.get()); + if (!m_xMoveRight->get_has_default()) + getDialog()->defaultButton(m_xMoveRight.get()); } else { - if (WB_DEFBUTTON == (m_pMoveRight->GetStyle() & WB_DEFBUTTON)) + if (m_xMoveRight->get_has_default()) getDialog()->defaultButton(WizardButtonFlags::NEXT); } } - ODefaultFieldSelectionPage::ODefaultFieldSelectionPage( OControlWizard* _pParent ) - :OMaybeListSelectionPage(_pParent, "DefaultFieldSelectionPage", "modules/sabpilot/ui/defaultfieldselectionpage.ui") + ODefaultFieldSelectionPage::ODefaultFieldSelectionPage(OControlWizard* pParent, TabPageParent pPageParent) + : OMaybeListSelectionPage(pParent, pPageParent, "modules/sabpilot/ui/defaultfieldselectionpage.ui", "DefaultFieldSelectionPage") + , m_xDefSelYes(m_xBuilder->weld_radio_button("defaultselectionyes")) + , m_xDefSelNo(m_xBuilder->weld_radio_button("defaultselectionno")) + , m_xDefSelection(m_xBuilder->weld_combo_box("defselectionfield")) { - get(m_pDefSelYes, "defaultselectionyes"); - get(m_pDefSelNo, "defaultselectionno"); - get(m_pDefSelection, "defselectionfield"); - - announceControls(*m_pDefSelYes, *m_pDefSelNo, *m_pDefSelection); - m_pDefSelection->SetDropDownLineCount(10); - m_pDefSelection->SetStyle(WB_DROPDOWN); + announceControls(*m_xDefSelYes, *m_xDefSelNo, *m_xDefSelection); } ODefaultFieldSelectionPage::~ODefaultFieldSelectionPage() { - disposeOnce(); - } - - void ODefaultFieldSelectionPage::dispose() - { - m_pDefSelYes.clear(); - m_pDefSelNo.clear(); - m_pDefSelection.clear(); - OMaybeListSelectionPage::dispose(); } void ODefaultFieldSelectionPage::initializePage() @@ -350,15 +317,13 @@ namespace dbp const OOptionGroupSettings& rSettings = getSettings(); // fill the listbox - m_pDefSelection->Clear(); + m_xDefSelection->clear(); for (auto const& label : rSettings.aLabels) - m_pDefSelection->InsertEntry(label); - + m_xDefSelection->append_text(label); implInitialize(rSettings.sDefaultField); } - bool ODefaultFieldSelectionPage::commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) { if (!OMaybeListSelectionPage::commitPage(_eReason)) @@ -370,56 +335,44 @@ namespace dbp return true; } - OOptionValuesPage::OOptionValuesPage( OControlWizard* _pParent ) - :OGBWPage(_pParent, "OptionValuesPage", "modules/sabpilot/ui/optionvaluespage.ui") - ,m_nLastSelection(::vcl::WizardTypes::WizardState(-1)) + OOptionValuesPage::OOptionValuesPage(OControlWizard* pParent, TabPageParent pPageParent) + : OGBWPage(pParent, pPageParent, "modules/sabpilot/ui/optionvaluespage.ui", "OptionValuesPage") + , m_xValue(m_xBuilder->weld_entry("optionvalue")) + , m_xOptions(m_xBuilder->weld_tree_view("radiobuttons")) + , m_nLastSelection(::vcl::WizardTypes::WizardState(-1)) { - get(m_pValue, "optionvalue"); - get(m_pOptions, "radiobuttons"); - - m_pOptions->SetSelectHdl(LINK(this, OOptionValuesPage, OnOptionSelected)); + m_xOptions->connect_changed(LINK(this, OOptionValuesPage, OnOptionSelected)); } OOptionValuesPage::~OOptionValuesPage() { - disposeOnce(); } - void OOptionValuesPage::dispose() - { - m_pValue.clear(); - m_pOptions.clear(); - OGBWPage::dispose(); - } - - IMPL_LINK_NOARG( OOptionValuesPage, OnOptionSelected, ListBox&, void ) + IMPL_LINK_NOARG( OOptionValuesPage, OnOptionSelected, weld::TreeView&, void ) { implTraveledOptions(); } - void OOptionValuesPage::ActivatePage() { OGBWPage::ActivatePage(); - m_pValue->GrabFocus(); + m_xValue->grab_focus(); } - void OOptionValuesPage::implTraveledOptions() { if (::vcl::WizardTypes::WizardState(-1) != m_nLastSelection) { // save the value for the last option DBG_ASSERT(static_cast<size_t>(m_nLastSelection) < m_aUncommittedValues.size(), "OOptionValuesPage::implTraveledOptions: invalid previous selection index!"); - m_aUncommittedValues[m_nLastSelection] = m_pValue->GetText(); + m_aUncommittedValues[m_nLastSelection] = m_xValue->get_text(); } - m_nLastSelection = m_pOptions->GetSelectedEntryPos(); + m_nLastSelection = m_xOptions->get_selected_index(); DBG_ASSERT(static_cast<size_t>(m_nLastSelection) < m_aUncommittedValues.size(), "OOptionValuesPage::implTraveledOptions: invalid new selection index!"); - m_pValue->SetText(m_aUncommittedValues[m_nLastSelection]); + m_xValue->set_text(m_aUncommittedValues[m_nLastSelection]); } - void OOptionValuesPage::initializePage() { OGBWPage::initializePage(); @@ -429,21 +382,20 @@ namespace dbp DBG_ASSERT(rSettings.aLabels.size() == rSettings.aValues.size(), "OOptionValuesPage::initializePage: inconsistent data!"); // fill the list with all available options - m_pOptions->Clear(); + m_xOptions->clear(); m_nLastSelection = -1; for (auto const& label : rSettings.aLabels) - m_pOptions->InsertEntry(label); + m_xOptions->append_text(label); // remember the values ... can't set them directly in the settings without the explicit commit call // so we need have a copy of the values m_aUncommittedValues = rSettings.aValues; // select the first entry - m_pOptions->SelectEntryPos(0); + m_xOptions->select(0); implTraveledOptions(); } - bool OOptionValuesPage::commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) { if (!OGBWPage::commitPage(_eReason)) @@ -459,68 +411,56 @@ namespace dbp return true; } - OOptionDBFieldPage::OOptionDBFieldPage( OControlWizard* _pParent ) - :ODBFieldPage(_pParent) + OOptionDBFieldPage::OOptionDBFieldPage(OControlWizard* pParent, TabPageParent pPageParent) + : ODBFieldPage(pParent, pPageParent) { setDescriptionText(compmodule::ModuleRes(RID_STR_GROUPWIZ_DBFIELD)); } - OUString& OOptionDBFieldPage::getDBFieldSetting() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings().sDBField; } - OFinalizeGBWPage::OFinalizeGBWPage( OControlWizard* _pParent ) - :OGBWPage(_pParent, "OptionsFinalPage", "modules/sabpilot/ui/optionsfinalpage.ui") + OFinalizeGBWPage::OFinalizeGBWPage(OControlWizard* pParent, TabPageParent pPageParent) + : OGBWPage(pParent, pPageParent, "modules/sabpilot/ui/optionsfinalpage.ui", "OptionsFinalPage") + , m_xName(m_xBuilder->weld_entry("nameit")) { - get(m_pName, "nameit"); } OFinalizeGBWPage::~OFinalizeGBWPage() { - disposeOnce(); - } - - void OFinalizeGBWPage::dispose() - { - m_pName.clear(); - OGBWPage::dispose(); } void OFinalizeGBWPage::ActivatePage() { OGBWPage::ActivatePage(); - m_pName->GrabFocus(); + m_xName->grab_focus(); } - bool OFinalizeGBWPage::canAdvance() const { return false; } - void OFinalizeGBWPage::initializePage() { OGBWPage::initializePage(); const OOptionGroupSettings& rSettings = getSettings(); - m_pName->SetText(rSettings.sControlLabel); + m_xName->set_text(rSettings.sControlLabel); } - bool OFinalizeGBWPage::commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) { if (!OGBWPage::commitPage(_eReason)) return false; - getSettings().sControlLabel = m_pName->GetText(); + getSettings().sControlLabel = m_xName->get_text(); return true; } - } // namespace dbp diff --git a/extensions/source/dbpilots/groupboxwiz.hxx b/extensions/source/dbpilots/groupboxwiz.hxx index 5325c0e28529..01db8750545f 100644 --- a/extensions/source/dbpilots/groupboxwiz.hxx +++ b/extensions/source/dbpilots/groupboxwiz.hxx @@ -44,7 +44,7 @@ namespace dbp public: OGroupBoxWizard( - vcl::Window* _pParent, + weld::Window* _pParent, const css::uno::Reference< css::beans::XPropertySet >& _rxObjectModel, const css::uno::Reference< css::uno::XComponentContext >& _rxContext ); @@ -64,8 +64,8 @@ namespace dbp class OGBWPage : public OControlWizardPage { public: - OGBWPage(OControlWizard* _pParent, const OString& _rID, const OUString& _rUIXMLDescription) - : OControlWizardPage(_pParent, _rID, _rUIXMLDescription) + OGBWPage(OControlWizard* pParent, TabPageParent pPageParent, const OUString& rUIXMLDescription, const OString& rID) + : OControlWizardPage(pParent, pPageParent, rUIXMLDescription, rID) { } @@ -75,15 +75,14 @@ namespace dbp class ORadioSelectionPage final : public OGBWPage { - VclPtr<Edit> m_pRadioName; - VclPtr<PushButton> m_pMoveRight; - VclPtr<PushButton> m_pMoveLeft; - VclPtr<ListBox> m_pExistingRadios; + std::unique_ptr<weld::Entry> m_xRadioName; + std::unique_ptr<weld::Button> m_xMoveRight; + std::unique_ptr<weld::Button> m_xMoveLeft; + std::unique_ptr<weld::TreeView> m_xExistingRadios; public: - explicit ORadioSelectionPage( OControlWizard* _pParent ); + explicit ORadioSelectionPage(OControlWizard* pParent, TabPageParent pPageParent); virtual ~ORadioSelectionPage() override; - virtual void dispose() override; private: // TabPage overridables @@ -94,23 +93,22 @@ namespace dbp virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override; virtual bool canAdvance() const override; - DECL_LINK( OnMoveEntry, Button*, void ); - DECL_LINK( OnEntrySelected, ListBox&, void ); - DECL_LINK( OnNameModified, Edit&, void ); + DECL_LINK( OnMoveEntry, weld::Button&, void ); + DECL_LINK( OnEntrySelected, weld::TreeView&, void ); + DECL_LINK( OnNameModified, weld::Entry&, void ); void implCheckMoveButtons(); }; class ODefaultFieldSelectionPage final : public OMaybeListSelectionPage { - VclPtr<RadioButton> m_pDefSelYes; - VclPtr<RadioButton> m_pDefSelNo; - VclPtr<ListBox> m_pDefSelection; + std::unique_ptr<weld::RadioButton> m_xDefSelYes; + std::unique_ptr<weld::RadioButton> m_xDefSelNo; + std::unique_ptr<weld::ComboBox> m_xDefSelection; public: - explicit ODefaultFieldSelectionPage( OControlWizard* _pParent ); + explicit ODefaultFieldSelectionPage(OControlWizard* pParent, TabPageParent pPageParent); virtual ~ODefaultFieldSelectionPage() override; - virtual void dispose() override; private: // OWizardPage overridables @@ -122,17 +120,16 @@ namespace dbp class OOptionValuesPage final : public OGBWPage { - VclPtr<Edit> m_pValue; - VclPtr<ListBox> m_pOptions; + std::unique_ptr<weld::Entry> m_xValue; + std::unique_ptr<weld::TreeView> m_xOptions; std::vector<OUString> m_aUncommittedValues; ::vcl::WizardTypes::WizardState m_nLastSelection; public: - explicit OOptionValuesPage( OControlWizard* _pParent ); + explicit OOptionValuesPage(OControlWizard* pParent, TabPageParent pPageParent); virtual ~OOptionValuesPage() override; - virtual void dispose() override; private: // TabPage overridables @@ -144,13 +141,13 @@ namespace dbp void implTraveledOptions(); - DECL_LINK( OnOptionSelected, ListBox&, void ); + DECL_LINK( OnOptionSelected, weld::TreeView&, void ); }; class OOptionDBFieldPage : public ODBFieldPage { public: - explicit OOptionDBFieldPage( OControlWizard* _pParent ); + explicit OOptionDBFieldPage(OControlWizard* pParent, TabPageParent pPageParent); protected: // ODBFieldPage overridables @@ -159,12 +156,11 @@ namespace dbp class OFinalizeGBWPage final : public OGBWPage { - VclPtr<Edit> m_pName; + std::unique_ptr<weld::Entry> m_xName; public: - explicit OFinalizeGBWPage( OControlWizard* _pParent ); + explicit OFinalizeGBWPage(OControlWizard* pParent, TabPageParent pPageParent); virtual ~OFinalizeGBWPage() override; - virtual void dispose() override; private: // TabPage overridables diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index e8e902b419fd..0c0957b41764 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -46,18 +46,18 @@ namespace dbp using namespace ::svt; using namespace ::dbtools; - OListComboWizard::OListComboWizard( vcl::Window* _pParent, + OListComboWizard::OListComboWizard(weld::Window* _pParent, const Reference< XPropertySet >& _rxObjectModel, const Reference< XComponentContext >& _rxContext ) - :OControlWizard(_pParent, _rxObjectModel, _rxContext) - ,m_bListBox(false) - ,m_bHadDataSelection(true) + : OControlWizard(_pParent, _rxObjectModel, _rxContext) + , m_bListBox(false) + , m_bHadDataSelection(true) { initControlSettings(&m_aSettings); - m_pPrevPage->SetHelpId(HID_LISTWIZARD_PREVIOUS); - m_pNextPage->SetHelpId(HID_LISTWIZARD_NEXT); - m_pCancel->SetHelpId(HID_LISTWIZARD_CANCEL); - m_pFinish->SetHelpId(HID_LISTWIZARD_FINISH); + m_xPrevPage->set_help_id(HID_LISTWIZARD_PREVIOUS); + m_xNextPage->set_help_id(HID_LISTWIZARD_NEXT); + m_xCancel->set_help_id(HID_LISTWIZARD_CANCEL); + m_xFinish->set_help_id(HID_LISTWIZARD_FINISH); // if we do not need the data source selection page ... if (!needDatasourceSelection()) @@ -67,7 +67,6 @@ namespace dbp } } - bool OListComboWizard::approveControl(sal_Int16 _nClassId) { switch (_nClassId) @@ -84,21 +83,25 @@ namespace dbp return false; } - VclPtr<TabPage> OListComboWizard::createPage(WizardState _nState) { + OString sIdent(OString::number(_nState)); + weld::Container* pPageContainer = m_xAssistant->append_page(sIdent); + // TODO eventually pass DialogController as distinct argument instead of bundling into TabPageParent + TabPageParent aParent(pPageContainer, this); + switch (_nState) { case LCW_STATE_DATASOURCE_SELECTION: - return VclPtr<OTableSelectionPage>::Create(this); + return VclPtr<OTableSelectionPage>::Create(this, aParent); case LCW_STATE_TABLESELECTION: - return VclPtr<OContentTableSelection>::Create(this); + return VclPtr<OContentTableSelection>::Create(this, aParent); case LCW_STATE_FIELDSELECTION: - return VclPtr<OContentFieldSelection>::Create(this); + return VclPtr<OContentFieldSelection>::Create(this, aParent); case LCW_STATE_FIELDLINK: - return VclPtr<OLinkFieldsPage>::Create(this); + return VclPtr<OLinkFieldsPage>::Create(this, aParent); case LCW_STATE_COMBODBFIELD: - return VclPtr<OComboDBFieldPage>::Create(this); + return VclPtr<OComboDBFieldPage>::Create(this, aParent); } return VclPtr<TabPage>(); @@ -259,77 +262,65 @@ namespace dbp return aColumnNames; } - OContentTableSelection::OContentTableSelection( OListComboWizard* _pParent ) - :OLCPage(_pParent, "TableSelectionPage", "modules/sabpilot/ui/contenttablepage.ui") + OContentTableSelection::OContentTableSelection(OListComboWizard* pParent, TabPageParent pPageParent) + : OLCPage(pParent, pPageParent, "modules/sabpilot/ui/contenttablepage.ui", "TableSelectionPage") + , m_xSelectTable(m_xBuilder->weld_tree_view("table")) { - get(m_pSelectTable, "table"); - enableFormDatasourceDisplay(); - m_pSelectTable->SetDoubleClickHdl(LINK(this, OContentTableSelection, OnTableDoubleClicked)); - m_pSelectTable->SetSelectHdl(LINK(this, OContentTableSelection, OnTableSelected)); + m_xSelectTable->connect_row_activated(LINK(this, OContentTableSelection, OnTableDoubleClicked)); + m_xSelectTable->connect_changed(LINK(this, OContentTableSelection, OnTableSelected)); } OContentTableSelection::~OContentTableSelection() { - disposeOnce(); - } - - void OContentTableSelection::dispose() - { - m_pSelectTable.clear(); - OLCPage::dispose(); } void OContentTableSelection::ActivatePage() { OLCPage::ActivatePage(); - m_pSelectTable->GrabFocus(); + m_xSelectTable->grab_focus(); } - bool OContentTableSelection::canAdvance() const { if (!OLCPage::canAdvance()) return false; - return 0 != m_pSelectTable->GetSelectedEntryCount(); + return 0 != m_xSelectTable->count_selected_rows(); } - - IMPL_LINK_NOARG( OContentTableSelection, OnTableSelected, ListBox&, void ) + IMPL_LINK_NOARG( OContentTableSelection, OnTableSelected, weld::TreeView&, void ) { updateDialogTravelUI(); } - - IMPL_LINK( OContentTableSelection, OnTableDoubleClicked, ListBox&, _rListBox, void ) + IMPL_LINK( OContentTableSelection, OnTableDoubleClicked, weld::TreeView&, _rListBox, void ) { - if (_rListBox.GetSelectedEntryCount()) + if (_rListBox.count_selected_rows()) getDialog()->travelNext(); } - void OContentTableSelection::initializePage() { OLCPage::initializePage(); // fill the list with the table name - m_pSelectTable->Clear(); + m_xSelectTable->clear(); try { Reference< XNameAccess > xTables = getTables(); Sequence< OUString > aTableNames; if (xTables.is()) aTableNames = xTables->getElementNames(); - fillListBox(*m_pSelectTable, aTableNames); + fillListBox(*m_xSelectTable, aTableNames); } catch(const Exception&) { OSL_FAIL("OContentTableSelection::initializePage: could not retrieve the table names!"); } - m_pSelectTable->SelectEntry(getSettings().sListContentTable); + m_xSelectTable->select_text(getSettings().sListContentTable); } @@ -339,7 +330,7 @@ namespace dbp return false; OListComboSettings& rSettings = getSettings(); - rSettings.sListContentTable = m_pSelectTable->GetSelectedEntry(); + rSettings.sListContentTable = m_xSelectTable->get_selected_text(); if (rSettings.sListContentTable.isEmpty() && (::vcl::WizardTypes::eTravelBackward != _eReason)) // need to select a table return false; @@ -347,145 +338,111 @@ namespace dbp return true; } - OContentFieldSelection::OContentFieldSelection( OListComboWizard* _pParent ) - :OLCPage(_pParent, "FieldSelectionPage", "modules/sabpilot/ui/contentfieldpage.ui") + OContentFieldSelection::OContentFieldSelection(OListComboWizard* pParent, TabPageParent pPageParent) + : OLCPage(pParent, pPageParent, "modules/sabpilot/ui/contentfieldpage.ui", "FieldSelectionPage") + , m_xSelectTableField(m_xBuilder->weld_tree_view("selectfield")) + , m_xDisplayedField(m_xBuilder->weld_entry("displayfield")) + , m_xInfo(m_xBuilder->weld_label("info")) { - get(m_pSelectTableField, "selectfield"); - get(m_pDisplayedField, "displayfield"); - get(m_pInfo, "info"); - m_pInfo->SetText(compmodule::ModuleRes( isListBox() ? RID_STR_FIELDINFO_LISTBOX : RID_STR_FIELDINFO_COMBOBOX)); - m_pSelectTableField->SetSelectHdl(LINK(this, OContentFieldSelection, OnFieldSelected)); - m_pSelectTableField->SetDoubleClickHdl(LINK(this, OContentFieldSelection, OnTableDoubleClicked)); + m_xInfo->set_label(compmodule::ModuleRes( isListBox() ? RID_STR_FIELDINFO_LISTBOX : RID_STR_FIELDINFO_COMBOBOX)); + m_xSelectTableField->connect_changed(LINK(this, OContentFieldSelection, OnFieldSelected)); + m_xSelectTableField->connect_row_activated(LINK(this, OContentFieldSelection, OnTableDoubleClicked)); } OContentFieldSelection::~OContentFieldSelection() { - disposeOnce(); - } - - void OContentFieldSelection::dispose() - { - m_pSelectTableField.clear(); - m_pDisplayedField.clear(); - m_pInfo.clear(); - OLCPage::dispose(); } - void OContentFieldSelection::initializePage() { OLCPage::initializePage(); // fill the list of fields - fillListBox(*m_pSelectTableField, getTableFields()); + fillListBox(*m_xSelectTableField, getTableFields()); - m_pSelectTableField->SelectEntry(getSettings().sListContentField); - m_pDisplayedField->SetText(getSettings().sListContentField); + m_xSelectTableField->select_text(getSettings().sListContentField); + m_xDisplayedField->set_text(getSettings().sListContentField); } - bool OContentFieldSelection::canAdvance() const { if (!OLCPage::canAdvance()) return false; - return 0 != m_pSelectTableField->GetSelectedEntryCount(); + return 0 != m_xSelectTableField->count_selected_rows(); } - - IMPL_LINK_NOARG( OContentFieldSelection, OnTableDoubleClicked, ListBox&, void ) + IMPL_LINK_NOARG( OContentFieldSelection, OnTableDoubleClicked, weld::TreeView&, void ) { - if (m_pSelectTableField->GetSelectedEntryCount()) + if (m_xSelectTableField->count_selected_rows()) getDialog()->travelNext(); } - - IMPL_LINK_NOARG( OContentFieldSelection, OnFieldSelected, ListBox&, void ) + IMPL_LINK_NOARG( OContentFieldSelection, OnFieldSelected, weld::TreeView&, void ) { updateDialogTravelUI(); - m_pDisplayedField->SetText(m_pSelectTableField->GetSelectedEntry()); + m_xDisplayedField->set_text(m_xSelectTableField->get_selected_text()); } - bool OContentFieldSelection::commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) { if (!OLCPage::commitPage(_eReason)) return false; - getSettings().sListContentField = m_pSelectTableField->GetSelectedEntry(); + getSettings().sListContentField = m_xSelectTableField->get_selected_text(); return true; } - OLinkFieldsPage::OLinkFieldsPage( OListComboWizard* _pParent ) - :OLCPage(_pParent, "FieldLinkPage", "modules/sabpilot/ui/fieldlinkpage.ui") + OLinkFieldsPage::OLinkFieldsPage(OListComboWizard* pParent, TabPageParent pPageParent) + : OLCPage(pParent, pPageParent, "modules/sabpilot/ui/fieldlinkpage.ui", "FieldLinkPage") + , m_xValueListField(m_xBuilder->weld_combo_box("valuefield")) + , m_xTableField(m_xBuilder->weld_combo_box("listtable")) { - get(m_pValueListField, "valuefield"); - get(m_pTableField, "listtable"); - - m_pValueListField->SetModifyHdl(LINK(this, OLinkFieldsPage, OnSelectionModified)); - m_pTableField->SetModifyHdl(LINK(this, OLinkFieldsPage, OnSelectionModified)); - m_pValueListField->SetSelectHdl(LINK(this, OLinkFieldsPage, OnSelectionModifiedCombBox)); - m_pTableField->SetSelectHdl(LINK(this, OLinkFieldsPage, OnSelectionModifiedCombBox)); + m_xValueListField->connect_changed(LINK(this, OLinkFieldsPage, OnSelectionModified)); + m_xTableField->connect_changed(LINK(this, OLinkFieldsPage, OnSelectionModified)); } OLinkFieldsPage::~OLinkFieldsPage() { - disposeOnce(); - } - - void OLinkFieldsPage::dispose() - { - m_pValueListField.clear(); - m_pTableField.clear(); - OLCPage::dispose(); } void OLinkFieldsPage::ActivatePage() { OLCPage::ActivatePage(); - m_pValueListField->GrabFocus(); + m_xValueListField->grab_focus(); } - void OLinkFieldsPage::initializePage() { OLCPage::initializePage(); // fill the value list - fillListBox(*m_pValueListField, getContext().aFieldNames); + fillListBox(*m_xValueListField, getContext().aFieldNames); // fill the table field list - fillListBox(*m_pTableField, getTableFields()); + fillListBox(*m_xTableField, getTableFields()); // the initial selections - m_pValueListField->SetText(getSettings().sLinkedFormField); - m_pTableField->SetText(getSettings().sLinkedListField); + m_xValueListField->set_entry_text(getSettings().sLinkedFormField); + m_xTableField->set_entry_text(getSettings().sLinkedListField); implCheckFinish(); } - bool OLinkFieldsPage::canAdvance() const { // we're on the last page here, no travelNext allowed ... return false; } - void OLinkFieldsPage::implCheckFinish() { - bool bInvalidSelection = (COMBOBOX_ENTRY_NOTFOUND == m_pValueListField->GetEntryPos(m_pValueListField->GetText())); - bInvalidSelection |= (COMBOBOX_ENTRY_NOTFOUND == m_pTableField->GetEntryPos(m_pTableField->GetText())); + bool bInvalidSelection = (-1 == m_xValueListField->find_text(m_xValueListField->get_active_text())); + bInvalidSelection |= (-1 == m_xTableField->find_text(m_xTableField->get_active_text())); getDialog()->enableButtons(WizardButtonFlags::FINISH, !bInvalidSelection); } - - IMPL_LINK_NOARG(OLinkFieldsPage, OnSelectionModified, Edit&, void) - { - implCheckFinish(); - } - - IMPL_LINK_NOARG(OLinkFieldsPage, OnSelectionModifiedCombBox, ComboBox&, void) + IMPL_LINK_NOARG(OLinkFieldsPage, OnSelectionModified, weld::ComboBox&, void) { implCheckFinish(); } @@ -495,14 +452,14 @@ namespace dbp if (!OLCPage::commitPage(_eReason)) return false; - getSettings().sLinkedFormField = m_pValueListField->GetText(); - getSettings().sLinkedListField = m_pTableField->GetText(); + getSettings().sLinkedFormField = m_xValueListField->get_active_text(); + getSettings().sLinkedListField = m_xTableField->get_active_text(); return true; } - OComboDBFieldPage::OComboDBFieldPage( OControlWizard* _pParent ) - :ODBFieldPage(_pParent) + OComboDBFieldPage::OComboDBFieldPage(OControlWizard* pParent, TabPageParent pPageParent) + : ODBFieldPage(pParent, pPageParent) { setDescriptionText(compmodule::ModuleRes(RID_STR_COMBOWIZ_DBFIELD)); } diff --git a/extensions/source/dbpilots/listcombowizard.hxx b/extensions/source/dbpilots/listcombowizard.hxx index 2640c0119fde..400063243255 100644 --- a/extensions/source/dbpilots/listcombowizard.hxx +++ b/extensions/source/dbpilots/listcombowizard.hxx @@ -50,7 +50,7 @@ namespace dbp public: OListComboWizard( - vcl::Window* _pParent, + weld::Window* _pParent, const css::uno::Reference< css::beans::XPropertySet >& _rxObjectModel, const css::uno::Reference< css::uno::XComponentContext >& _rxContext ); @@ -77,8 +77,8 @@ namespace dbp class OLCPage : public OControlWizardPage { public: - OLCPage(OListComboWizard* _pParent, const OString& rID, const OUString& rUIXMLDescription) - : OControlWizardPage(_pParent, rID, rUIXMLDescription) + OLCPage(OListComboWizard* pParent, TabPageParent pPageParent, const OUString& rUIXMLDescription, const OString& rID) + : OControlWizardPage(pParent, pPageParent, rUIXMLDescription, rID) { } @@ -93,12 +93,11 @@ namespace dbp class OContentTableSelection final : public OLCPage { - VclPtr<ListBox> m_pSelectTable; + std::unique_ptr<weld::TreeView> m_xSelectTable; public: - explicit OContentTableSelection( OListComboWizard* _pParent ); + explicit OContentTableSelection(OListComboWizard* pParent, TabPageParent pPageParent); virtual ~OContentTableSelection() override; - virtual void dispose() override; private: // TabPage overridables @@ -109,25 +108,23 @@ namespace dbp virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override; virtual bool canAdvance() const override; - DECL_LINK( OnTableDoubleClicked, ListBox&, void ); - DECL_LINK( OnTableSelected, ListBox&, void ); + DECL_LINK( OnTableDoubleClicked, weld::TreeView&, void ); + DECL_LINK( OnTableSelected, weld::TreeView&, void ); }; class OContentFieldSelection final : public OLCPage { - VclPtr<ListBox> m_pSelectTableField; - VclPtr<Edit> m_pDisplayedField; - VclPtr<FixedText> m_pInfo; - + std::unique_ptr<weld::TreeView> m_xSelectTableField; + std::unique_ptr<weld::Entry> m_xDisplayedField; + std::unique_ptr<weld::Label> m_xInfo; public: - explicit OContentFieldSelection( OListComboWizard* _pParent ); + explicit OContentFieldSelection(OListComboWizard* pParent, TabPageParent pPageParent); virtual ~OContentFieldSelection() override; - virtual void dispose() override; private: - DECL_LINK( OnFieldSelected, ListBox&, void ); - DECL_LINK( OnTableDoubleClicked, ListBox&, void ); + DECL_LINK( OnFieldSelected, weld::TreeView&, void ); + DECL_LINK( OnTableDoubleClicked, weld::TreeView&, void ); // OWizardPage overridables virtual void initializePage() override; @@ -137,14 +134,12 @@ namespace dbp class OLinkFieldsPage final : public OLCPage { - VclPtr<ComboBox> m_pValueListField; - VclPtr<ComboBox> m_pTableField; - + std::unique_ptr<weld::ComboBox> m_xValueListField; + std::unique_ptr<weld::ComboBox> m_xTableField; public: - explicit OLinkFieldsPage( OListComboWizard* _pParent ); + explicit OLinkFieldsPage(OListComboWizard* pParent, TabPageParent pPageParent); virtual ~OLinkFieldsPage() override; - virtual void dispose() override; private: // TabPage overridables @@ -157,14 +152,13 @@ namespace dbp void implCheckFinish(); - DECL_LINK(OnSelectionModified, Edit&, void); - DECL_LINK(OnSelectionModifiedCombBox, ComboBox&, void); + DECL_LINK(OnSelectionModified, weld::ComboBox&, void); }; class OComboDBFieldPage : public ODBFieldPage { public: - explicit OComboDBFieldPage( OControlWizard* _pParent ); + explicit OComboDBFieldPage(OControlWizard* pParent, TabPageParent pPageParent); protected: // TabPage overridables diff --git a/extensions/source/dbpilots/unoautopilot.hxx b/extensions/source/dbpilots/unoautopilot.hxx index 20a430999df8..d0440f875dd7 100644 --- a/extensions/source/dbpilots/unoautopilot.hxx +++ b/extensions/source/dbpilots/unoautopilot.hxx @@ -21,14 +21,13 @@ #define INCLUDED_EXTENSIONS_SOURCE_DBPILOTS_UNOAUTOPILOT_HXX #include <svtools/genericunodialog.hxx> -#include <toolkit/helper/vclunohelper.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/proparrhlp.hxx> #include <componentmodule.hxx> #include <cppuhelper/typeprovider.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/PropertyValue.hpp> - +#include <vcl/svapp.hxx> namespace dbp { @@ -107,7 +106,7 @@ namespace dbp // OGenericUnoDialog overridables virtual svt::OGenericUnoDialog::Dialog createDialog(const css::uno::Reference<css::awt::XWindow>& rParent) override { - return svt::OGenericUnoDialog::Dialog(VclPtr<TYPE>::Create(VCLUnoHelper::GetWindow(rParent), m_xObjectModel, m_aContext)); + return svt::OGenericUnoDialog::Dialog(std::make_unique<TYPE>(Application::GetFrameWeld(rParent), m_xObjectModel, m_aContext)); } virtual void implInitialize(const css::uno::Any& _rValue) override diff --git a/extensions/uiconfig/sabpilot/ui/contentfieldpage.ui b/extensions/uiconfig/sabpilot/ui/contentfieldpage.ui index 411d6bb1beee..c91f329015ac 100644 --- a/extensions/uiconfig/sabpilot/ui/contentfieldpage.ui +++ b/extensions/uiconfig/sabpilot/ui/contentfieldpage.ui @@ -1,7 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.1 --> +<!-- Generated with glade 3.22.1 --> <interface domain="pcr"> <requires lib="gtk+" version="3.18"/> + <object class="GtkTreeStore" id="liststore1"> + <columns> + <!-- column-name text --> + <column type="gchararray"/> + <!-- column-name id --> + <column type="gchararray"/> + </columns> + </object> <object class="GtkBox" id="FieldSelectionPage"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -33,7 +41,7 @@ <property name="halign">start</property> <property name="label" translatable="yes" context="contentfieldpage|label1">Existing fields</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">selectfield:border</property> + <property name="mnemonic_widget">selectfield</property> </object> <packing> <property name="expand">False</property> @@ -42,14 +50,38 @@ </packing> </child> <child> - <object class="GtkTreeView" id="selectfield:border"> + <object class="GtkScrolledWindow"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="show_expanders">False</property> - <child internal-child="selection"> - <object class="GtkTreeSelection" id="treeview-selection1"/> + <property name="shadow_type">in</property> + <child> + <object class="GtkTreeView" id="selectfield"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="model">liststore1</property> + <property name="headers_visible">False</property> + <property name="search_column">0</property> + <property name="show_expanders">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="Macro Library List-selection2"/> + </child> + <child> + <object class="GtkTreeViewColumn" id="treeviewcolumn3"> + <property name="spacing">6</property> + <child> + <object class="GtkCellRendererText" id="cellrenderer4"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> + </object> + </child> + </object> </child> </object> <packing> @@ -109,12 +141,16 @@ <property name="can_focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> + <property name="wrap">True</property> + <property name="width_chars">35</property> + <property name="max_width_chars">35</property> <property name="xalign">0</property> <property name="yalign">0</property> - <property name="wrap">True</property> - <accessibility> - <role type="static"/> - </accessibility> + <child internal-child="accessible"> + <object class="AtkObject" id="info-atkobject"> + <property name="AtkObject::accessible-role" translatable="no">static</property> + </object> + </child> </object> <packing> <property name="expand">False</property> diff --git a/extensions/uiconfig/sabpilot/ui/contenttablepage.ui b/extensions/uiconfig/sabpilot/ui/contenttablepage.ui index ee4ec76e39fb..7d6c59d5bd79 100644 --- a/extensions/uiconfig/sabpilot/ui/contenttablepage.ui +++ b/extensions/uiconfig/sabpilot/ui/contenttablepage.ui @@ -1,7 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.1 --> +<!-- Generated with glade 3.22.1 --> <interface domain="pcr"> <requires lib="gtk+" version="3.18"/> + <object class="GtkTreeStore" id="liststore1"> + <columns> + <!-- column-name text --> + <column type="gchararray"/> + <!-- column-name id --> + <column type="gchararray"/> + </columns> + </object> <object class="GtkBox" id="TableSelectionPage"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -35,6 +43,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="row_spacing">12</property> + <property name="column_spacing">6</property> <child> <object class="GtkLabel" id="datasourcelabel"> <property name="visible">True</property> @@ -45,8 +54,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -59,8 +66,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
