From 59c45c8e6d16cb145f3551f9ecd1a3c45ca5d4d8 Mon Sep 17 00:00:00 2001 From: Akshay Deep Date: Fri, 17 Jun 2016 12:59:44 +0530 Subject: tdf#90577 Start Center: Clear List item should more accessible Change-Id: Id7179ec32f2f9306fde98e1b7449861c809111f8 Reviewed-on: https://gerrit.libreoffice.org/26404 Reviewed-by: Samuel Mehrbrodt Tested-by: Samuel Mehrbrodt --- sfx2/source/dialog/backingwindow.cxx | 71 +++++++++++++++++++++--------------- sfx2/source/dialog/backingwindow.hxx | 2 +- sfx2/uiconfig/ui/startcenter.ui | 13 ++++++- 3 files changed, 54 insertions(+), 32 deletions(-) diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index 350dc4a55e46..730627ca1733 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -260,6 +261,7 @@ void BackingWindow::initControls() mpLocalView->Hide(); mpTemplateButton->SetMenuMode( MENUBUTTON_MENUMODE_TIMED ); + mpRecentButton->SetMenuMode( MENUBUTTON_MENUMODE_TIMED ); //set handlers mpLocalView->setCreateContextMenuHdl(LINK(this, BackingWindow, CreateContextMenuHdl)); @@ -587,43 +589,52 @@ IMPL_LINK_TYPED( BackingWindow, ClickHdl, Button*, pButton, void ) IMPL_LINK_TYPED( BackingWindow, MenuSelectHdl, MenuButton*, pButton, void ) { - initializeLocalView(); - - OString sId = pButton->GetCurItemIdent(); - - if( sId == "filter_writer" ) + if(pButton == mpRecentButton) { - mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::WRITER)); - } - else if( sId == "filter_calc" ) - { - mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::CALC)); - } - else if( sId == "filter_impress" ) - { - mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::IMPRESS)); - } - else if( sId == "filter_draw" ) - { - mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::DRAW)); + SvtHistoryOptions().Clear(ePICKLIST); + mpAllRecentThumbnails->Reload(); + return; } - else if( sId == "manage" ) + else if(pButton == mpTemplateButton) { - Reference< XDispatchProvider > xFrame( mxFrame, UNO_QUERY ); + initializeLocalView(); - Sequence< css::beans::PropertyValue > aArgs(1); - PropertyValue* pArg = aArgs.getArray(); - pArg[0].Name = "Referer"; - pArg[0].Value <<= OUString("private:user"); + OString sId = pButton->GetCurItemIdent(); - dispatchURL( ".uno:NewDoc", OUString(), xFrame, aArgs ); + if( sId == "filter_writer" ) + { + mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::WRITER)); + } + else if( sId == "filter_calc" ) + { + mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::CALC)); + } + else if( sId == "filter_impress" ) + { + mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::IMPRESS)); + } + else if( sId == "filter_draw" ) + { + mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::DRAW)); + } + else if( sId == "manage" ) + { + Reference< XDispatchProvider > xFrame( mxFrame, UNO_QUERY ); - } + Sequence< css::beans::PropertyValue > aArgs(1); + PropertyValue* pArg = aArgs.getArray(); + pArg[0].Name = "Referer"; + pArg[0].Value <<= OUString("private:user"); - mpAllRecentThumbnails->Hide(); - mpLocalView->Show(); - mpLocalView->reload(); - mpLocalView->GrabFocus(); + dispatchURL( ".uno:NewDoc", OUString(), xFrame, aArgs ); + + } + + mpAllRecentThumbnails->Hide(); + mpLocalView->Show(); + mpLocalView->reload(); + mpLocalView->GrabFocus(); + } } IMPL_LINK_TYPED(BackingWindow, CreateContextMenuHdl, ThumbnailViewItem*, pItem, void) diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx index 199302f2e500..cfaf984975fa 100644 --- a/sfx2/source/dialog/backingwindow.hxx +++ b/sfx2/source/dialog/backingwindow.hxx @@ -59,7 +59,7 @@ class BackingWindow : public vcl::Window, public VclBuilderContainer css::uno::Reference mxDropTargetListener; VclPtr mpOpenButton; - VclPtr mpRecentButton; + VclPtr mpRecentButton; VclPtr mpRemoteButton; VclPtr mpTemplateButton; diff --git a/sfx2/uiconfig/ui/startcenter.ui b/sfx2/uiconfig/ui/startcenter.ui index 2591be7f5928..68ab54835d88 100644 --- a/sfx2/uiconfig/ui/startcenter.ui +++ b/sfx2/uiconfig/ui/startcenter.ui @@ -18,6 +18,17 @@ False res/odg_32_8.png + + True + False + + + True + False + Clear Recent Documents + + + True False @@ -160,7 +171,7 @@ - + _Recent Files True True -- cgit