diff options
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/office/PlacesListBox.cxx | 12 | ||||
-rw-r--r-- | fpicker/source/office/PlacesListBox.hxx | 1 | ||||
-rw-r--r-- | fpicker/uiconfig/ui/explorerfiledialog.ui | 2 |
3 files changed, 15 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: */ diff --git a/fpicker/uiconfig/ui/explorerfiledialog.ui b/fpicker/uiconfig/ui/explorerfiledialog.ui index 1817d785c814..84a50b05d91c 100644 --- a/fpicker/uiconfig/ui/explorerfiledialog.ui +++ b/fpicker/uiconfig/ui/explorerfiledialog.ui @@ -293,6 +293,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes" context="explorerfiledialog|add">Add shortcut</property> <property name="image">image1</property> <property name="always_show_image">True</property> </object> @@ -307,6 +308,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes" context="explorerfiledialog|add">Delete shortcut</property> <property name="image">image2</property> <property name="always_show_image">True</property> </object> |