summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Deep <akshaydeepiitr@gmail.com>2016-06-17 12:59:44 +0530
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-06-17 08:05:15 +0000
commit59c45c8e6d16cb145f3551f9ecd1a3c45ca5d4d8 (patch)
treea34a92fd8c7ae7bce07c76f66a2aafdb4a6c11ec
parent48b7176fc09279d06d12fbab5619770767faad60 (diff)
tdf#90577 Start Center: Clear List item should more accessible
Change-Id: Id7179ec32f2f9306fde98e1b7449861c809111f8 Reviewed-on: https://gerrit.libreoffice.org/26404 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r--sfx2/source/dialog/backingwindow.cxx71
-rw-r--r--sfx2/source/dialog/backingwindow.hxx2
-rw-r--r--sfx2/uiconfig/ui/startcenter.ui13
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 <vcl/virdev.hxx>
#include <unotools/dynamicmenuoptions.hxx>
+#include <unotools/historyoptions.hxx>
#include <svtools/openfiledroptargetlistener.hxx>
#include <svtools/colorcfg.hxx>
#include <svtools/langhelp.hxx>
@@ -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<css::datatransfer::dnd::XDropTargetListener> mxDropTargetListener;
VclPtr<PushButton> mpOpenButton;
- VclPtr<PushButton> mpRecentButton;
+ VclPtr<MenuButton> mpRecentButton;
VclPtr<PushButton> mpRemoteButton;
VclPtr<MenuButton> 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 @@
<property name="can_focus">False</property>
<property name="pixbuf">res/odg_32_8.png</property>
</object>
+ <object class="GtkMenu" id="clearmenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="clear_all">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Clear Recent Documents</property>
+ </object>
+ </child>
+ </object>
<object class="GtkMenu" id="filtermenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -160,7 +171,7 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="open_recent">
+ <object class="GtkButton" id="open_recent:clearmenu">
<property name="label" translatable="yes">_Recent Files</property>
<property name="visible">True</property>
<property name="can_focus">True</property>