[Libreoffice-commits] core.git: sfx2/source sfx2/uiconfig

Akshay Deep akshaydeepiitr at gmail.com
Fri Jun 17 08:05:49 UTC 2016


 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(-)

New commits:
commit 59c45c8e6d16cb145f3551f9ecd1a3c45ca5d4d8
Author: Akshay Deep <akshaydeepiitr at gmail.com>
Date:   Fri Jun 17 12:59:44 2016 +0530

    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 at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index 350dc4a..730627c 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 199302f..cfaf984 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 2591be7..68ab548 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>


More information about the Libreoffice-commits mailing list