summaryrefslogtreecommitdiff
path: root/fpicker/source
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2022-05-02 19:31:26 +0200
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2022-05-07 11:09:32 +0200
commit9313b6c02cc40633edfaadfc7941cbb5640368b2 (patch)
tree4c06560f150be5cb4fe1b58ad81be0d57265fa79 /fpicker/source
parent1fe08ae6b383c2222178a21c926480a055a87f99 (diff)
tdf#62776 - Add tooltip for folder location shortcuts
Change-Id: I326fd3c3695e5467a49688fc2164fe591aef2397 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133709 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'fpicker/source')
-rw-r--r--fpicker/source/office/PlacesListBox.cxx12
-rw-r--r--fpicker/source/office/PlacesListBox.hxx1
2 files changed, 13 insertions, 0 deletions
diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx
index 050cee39c113..86bd505179a3 100644
--- a/fpicker/source/office/PlacesListBox.cxx
+++ b/fpicker/source/office/PlacesListBox.cxx
@@ -29,6 +29,7 @@ PlacesListBox::PlacesListBox(std::unique_ptr<weld::TreeView> xControl,
mxImpl->connect_changed( LINK( this, PlacesListBox, Selection ) );
mxImpl->connect_row_activated( LINK( this, PlacesListBox, DoubleClick ) ) ;
+ mxImpl->connect_query_tooltip(LINK(this, PlacesListBox, QueryTooltipHdl));
}
PlacesListBox::~PlacesListBox( )
@@ -136,6 +137,17 @@ IMPL_LINK_NOARG( PlacesListBox, DoubleClick, weld::TreeView&, bool )
return true;
}
+IMPL_LINK(PlacesListBox, QueryTooltipHdl, const weld::TreeIter&, rIter, OUString)
+{
+ const OUString sText = mxImpl->get_text(rIter);
+ for (const auto& pPlace : maPlaces)
+ {
+ if (pPlace->GetName() == sText)
+ return pPlace->GetUrlObject().GetMainURL(INetURLObject::DecodeMechanism::Unambiguous);
+ }
+ return OUString();
+}
+
void PlacesListBox::updateView( )
{
sal_uInt32 nSelected = mxImpl->get_cursor_index();
diff --git a/fpicker/source/office/PlacesListBox.hxx b/fpicker/source/office/PlacesListBox.hxx
index ca507e06ae3a..ed3a0798e9e7 100644
--- a/fpicker/source/office/PlacesListBox.hxx
+++ b/fpicker/source/office/PlacesListBox.hxx
@@ -60,6 +60,7 @@ private:
DECL_LINK( Selection, weld::TreeView&, void );
DECL_LINK( DoubleClick, weld::TreeView&, bool );
+ DECL_LINK(QueryTooltipHdl, const weld::TreeIter&, OUString);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */