summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-06-05 16:11:39 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2020-11-30 18:19:52 +0100
commit44f5cdc14537d244c254f7201f2f8da483cc4727 (patch)
treebc48152222c91d0c93617b3a8836dae96af72e8e /desktop/source
parent3826d521852f408f4679837d94288d97ab13e0b4 (diff)
rework treeview initial toggle button col to be like expander col
cause this assumption is baked into the vcl one making it hard to adapt remaining cases Change-Id: I75dd5264c65b1ffbf4d26c9a86f6d4d08b400d90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95622 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106874 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx18
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.hxx3
2 files changed, 8 insertions, 13 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index c68fab086eaf..32364d384e72 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -487,9 +487,7 @@ UpdateDialog::UpdateDialog(
m_xDescriptions->set_size_request(nWidth, nHeight);
m_xUpdates->set_size_request(nWidth, nHeight);
- std::vector<int> aWidths;
- aWidths.push_back(m_xUpdates->get_checkbox_column_width());
- m_xUpdates->set_column_fixed_widths(aWidths);
+ m_xUpdates->enable_toggle_buttons(weld::ColumnToggleType::Check);
OSL_ASSERT(updateData != nullptr);
@@ -519,14 +517,12 @@ short UpdateDialog::run() {
return nRet;
}
-IMPL_LINK(UpdateDialog, entryToggled, const row_col&, rRowCol, void)
+IMPL_LINK(UpdateDialog, entryToggled, const weld::TreeView::iter_col&, rRowCol, void)
{
- int nRow = rRowCol.first;
-
// error's can't be enabled
const UpdateDialog::Index* p = reinterpret_cast<UpdateDialog::Index const *>(m_xUpdates->get_id(rRowCol.first).toInt64());
if (p->m_eKind == SPECIFIC_ERROR)
- m_xUpdates->set_toggle(nRow, TRISTATE_FALSE, 0);
+ m_xUpdates->set_toggle(rRowCol.first, TRISTATE_FALSE);
enableOk();
}
@@ -535,8 +531,8 @@ void UpdateDialog::insertItem(UpdateDialog::Index *pEntry, bool bEnabledCheckBox
{
int nEntry = m_xUpdates->n_children();
m_xUpdates->append();
- m_xUpdates->set_toggle(nEntry, bEnabledCheckBox ? TRISTATE_TRUE : TRISTATE_FALSE, 0);
- m_xUpdates->set_text(nEntry, pEntry->m_aName, 1);
+ m_xUpdates->set_toggle(nEntry, bEnabledCheckBox ? TRISTATE_TRUE : TRISTATE_FALSE);
+ m_xUpdates->set_text(nEntry, pEntry->m_aName, 0);
m_xUpdates->set_id(nEntry, OUString::number(reinterpret_cast<sal_Int64>(pEntry)));
}
@@ -621,7 +617,7 @@ void UpdateDialog::enableOk() {
if (!m_xChecking->get_visible()) {
int nChecked = 0;
for (int i = 0, nCount = m_xUpdates->n_children(); i < nCount; ++i) {
- if (m_xUpdates->get_toggle(i, 0) == TRISTATE_TRUE)
+ if (m_xUpdates->get_toggle(i) == TRISTATE_TRUE)
++nChecked;
}
m_xOk->set_sensitive(nChecked != 0);
@@ -1022,7 +1018,7 @@ IMPL_LINK_NOARG(UpdateDialog, okHandler, weld::Button&, void)
UpdateDialog::Index const * p =
reinterpret_cast< UpdateDialog::Index const * >(
m_xUpdates->get_id(i).toInt64());
- if (p->m_eKind == ENABLED_UPDATE && m_xUpdates->get_toggle(i, 0) == TRISTATE_TRUE) {
+ if (p->m_eKind == ENABLED_UPDATE && m_xUpdates->get_toggle(i) == TRISTATE_TRUE) {
m_updateData.push_back( m_enabledUpdates[ p->m_nIndex ] );
}
}
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
index e9cfd6f234f8..f676cea992a2 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
@@ -127,8 +127,7 @@ private:
DECL_LINK(allHandler, weld::ToggleButton&, void);
DECL_LINK(okHandler, weld::Button&, void);
DECL_LINK(closeHandler, weld::Button&, void);
- typedef std::pair<int, int> row_col;
- DECL_LINK(entryToggled, const row_col&, void);
+ DECL_LINK(entryToggled, const weld::TreeView::iter_col&, void);
css::uno::Reference< css::uno::XComponentContext > m_context;
OUString m_none;