diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-08-29 20:17:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-08-30 22:18:37 +0200 |
commit | 69fbf74d5bf9c474a6ec04101426dfe79b4ad9bf (patch) | |
tree | b7ca5a562f9f2a65a04264e8dfdc0db0439d9da0 /extensions/source/abpilot/tableselectionpage.cxx | |
parent | 8cecd48af5dbd290d06641b7feeb7c0969752d57 (diff) |
weld addressbook wizard
Change-Id: I118ed34ddaf7d62e5bb15497399cd10533339328
Reviewed-on: https://gerrit.libreoffice.org/78287
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'extensions/source/abpilot/tableselectionpage.cxx')
-rw-r--r-- | extensions/source/abpilot/tableselectionpage.cxx | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/extensions/source/abpilot/tableselectionpage.cxx b/extensions/source/abpilot/tableselectionpage.cxx index 7e68a65e88e9..3d56a33fb8bf 100644 --- a/extensions/source/abpilot/tableselectionpage.cxx +++ b/extensions/source/abpilot/tableselectionpage.cxx @@ -27,41 +27,32 @@ namespace abp { - TableSelectionPage::TableSelectionPage( OAddressBookSourcePilot* _pParent ) - :AddressBookSourcePage(_pParent, "SelectTablePage", - "modules/sabpilot/ui/selecttablepage.ui") + TableSelectionPage::TableSelectionPage(OAddressBookSourcePilot* pDialog, TabPageParent pPageParent) + : AddressBookSourcePage(pDialog, pPageParent, "modules/sabpilot/ui/selecttablepage.ui", "SelectTablePage") + , m_xTableList(m_xBuilder->weld_tree_view("table")) { - get(m_pTableList, "table"); - m_pTableList->SetSelectHdl( LINK( this, TableSelectionPage, OnTableSelected ) ); - m_pTableList->SetDoubleClickHdl( LINK( this, TableSelectionPage, OnTableDoubleClicked ) ); + m_xTableList->connect_changed( LINK( this, TableSelectionPage, OnTableSelected ) ); + m_xTableList->connect_row_activated( LINK( this, TableSelectionPage, OnTableDoubleClicked ) ); } TableSelectionPage::~TableSelectionPage() { - disposeOnce(); - } - - void TableSelectionPage::dispose() - { - m_pTableList.clear(); - AddressBookSourcePage::dispose(); } void TableSelectionPage::ActivatePage() { AddressBookSourcePage::ActivatePage(); - m_pTableList->GrabFocus(); + m_xTableList->grab_focus(); } - void TableSelectionPage::initializePage() { AddressBookSourcePage::initializePage(); const AddressSettings& rSettings = getSettings(); - m_pTableList->Clear(); + m_xTableList->clear(); // get the table names const StringBag& aTableNames = getDialog()->getDataSource().getTableNames(); @@ -70,46 +61,40 @@ namespace abp // fill the list for (auto const& tableName : aTableNames) - m_pTableList->InsertEntry(tableName); + m_xTableList->append_text(tableName); // initially select the proper table - m_pTableList->SelectEntry( rSettings.sSelectedTable ); + m_xTableList->select_text(rSettings.sSelectedTable); } - - IMPL_LINK_NOARG( TableSelectionPage, OnTableDoubleClicked, ListBox&, void ) + IMPL_LINK_NOARG( TableSelectionPage, OnTableDoubleClicked, weld::TreeView&, void ) { - if ( 1 == m_pTableList->GetSelectedEntryCount() ) + if (m_xTableList->count_selected_rows() == 1) getDialog()->travelNext(); } - - IMPL_LINK_NOARG( TableSelectionPage, OnTableSelected, ListBox&, void ) + IMPL_LINK_NOARG( TableSelectionPage, OnTableSelected, weld::TreeView&, void ) { updateDialogTravelUI(); } - bool TableSelectionPage::commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) { if (!AddressBookSourcePage::commitPage(_eReason)) return false; AddressSettings& rSettings = getSettings(); - rSettings.sSelectedTable = m_pTableList->GetSelectedEntry(); + rSettings.sSelectedTable = m_xTableList->get_selected_text(); return true; } - bool TableSelectionPage::canAdvance() const { return AddressBookSourcePage::canAdvance() - && ( 0 < m_pTableList->GetSelectedEntryCount() ); + && (m_xTableList->count_selected_rows() > 0); } - } // namespace abp - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |