[Libreoffice-commits] core.git: Branch 'feature/template_manager_improvements' - sfx2/source sfx2/uiconfig

Efe Gürkan YALAMAN efeyalaman at gmail.com
Fri Aug 8 08:05:31 PDT 2014


 sfx2/source/dialog/backingwindow.cxx |   54 +++--------------------------------
 sfx2/source/dialog/backingwindow.hxx |    5 ---
 sfx2/uiconfig/ui/startcenter.ui      |   13 --------
 3 files changed, 7 insertions(+), 65 deletions(-)

New commits:
commit 7343d0a41516d4b71a5d619ff4dd2889e1db00c9
Author: Efe Gürkan YALAMAN <efeyalaman at gmail.com>
Date:   Fri Aug 8 18:03:12 2014 +0300

    Fixed the Templates button
    
    It works as a button. When clicked the triangle works as dropdown.
    
    Change-Id: Ib4e3b6a1832efef3382e7bd01b06d2ff8d4e7543

diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index bf17b95..603a652 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -68,15 +68,6 @@ const char TEMPLATE_URL[] =       "slot:5500";
 const char OPEN_URL[] =           ".uno:Open";
 const char SERVICENAME_CFGREADACCESS[] = "com.sun.star.configuration.ConfigurationAccess";
 
-//const char TEMPLATEBAR_SAVE[] = "template_save";
-//const char TEMPLATEBAR_OPEN[] = "open";
-//const char TEMPLATEBAR_EDIT[] = "edit";
-//const char TEMPLATEBAR_PROPERTIES[] = "properties";
-//const char TEMPLATEBAR_DEFAULT[] = "default";
-//const char TEMPLATEBAR_MOVE[] = "move";
-//const char TEMPLATEBAR_EXPORT[] = "export";
-//const char TEMPLATEBAR_DELETE[] = "template_delete";
-
 const int nButtonsFontSize = 15;
 const Color aButtonsBackground(114, 168, 84); // TDF green
 const Color aButtonsText(COL_WHITE);
@@ -121,9 +112,6 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
     get(mpHelpButton, "help");
     get(mpExtensionsButton, "extensions");
 
-    //get(mpViewBar, "action_view");
-    //get(mpTemplateBar, "action_templates");
-
     //Containers are invisible to cursor traversal
     //So on pressing "right" when in Help the
     //extension button is considered as a candidate
@@ -265,7 +253,7 @@ void BackingWindow::initControls()
     mpAllRecentThumbnails->Reload();
     mpAllRecentThumbnails->ShowTooltips( true );
 
-    //initialize Template views
+    //initialize Template view
     mpLocalView->SetStyle( mpLocalView->GetStyle() | WB_VSCROLL);
     mpLocalView->setItemDimensions(TEMPLATE_ITEM_MAX_WIDTH,TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT,
                         TEMPLATE_ITEM_MAX_HEIGHT-TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT,
@@ -277,25 +265,12 @@ void BackingWindow::initControls()
 
     mpCurrentView = mpLocalView;
 
-    //mpViewBar->SetButtonType(BUTTON_SYMBOLTEXT);
-    //mpViewBar->SetItemBits(mpViewBar->GetItemId("repository"), TIB_DROPDOWNONLY);
-    //mpViewBar->SetClickHdl(LINK(this,BackingWindow,TBXViewHdl));
-    //mpViewBar->SetDropdownClickHdl(LINK(this,BackingWindow,TBXDropdownHdl));
-    //mpViewBar->Hide();
-    //mpViewBar->HideItem("import");
-
-    //mpTemplateBar->SetButtonType(BUTTON_SYMBOLTEXT);
-    //mpTemplateBar->SetItemBits(mpTemplateBar->GetItemId(TEMPLATEBAR_MOVE), TIB_DROPDOWNONLY);
-    //mpTemplateBar->SetClickHdl( LINK( this, BackingWindow,TBXTemplateHdl ) );
-    //mpTemplateBar->SetDoubleClickHdl( LINK(this, BackingWindow, OpenTemplateHdl) );
-    //mpTemplateBar->SetDropdownClickHdl(LINK(this, BackingWindow,TBXDropdownHdl));
+    mpTemplateButton->SetMenuMode( MENUBUTTON_MENUMODE_TIMED );
 
     //set handlers
     mpLocalView->setOpenRegionHdl(LINK(this, BackingWindow, OpenRegionHdl));
     mpLocalView->setOpenTemplateHdl(LINK(this,BackingWindow,OpenTemplateHdl));
 
-    /*FIXME: Add other things for Local View*/
-
     setupButton( mpOpenButton );
     setupButton( mpTemplateButton );
     setupButton( mpWriterAllButton );
@@ -347,7 +322,6 @@ void BackingWindow::setupButton( PushButton* pButton )
 
     // color that fits the theme
     pButton->SetControlForeground(aButtonsText);
-
     pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) );
 }
 
@@ -358,12 +332,11 @@ void BackingWindow::setupButton( MenuButton* pButton )
     pButton->SetControlFont(aFont);
     pButton->SetControlForeground(aButtonsText);
 
-    //Menubutton implementation
     PopupMenu* pMenu = mpTemplateButton->GetPopupMenu();
     pMenu->SetMenuFlags(
              pMenu->GetMenuFlags() | MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES );
 
-    //pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) );
+    pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) );
     pButton->SetSelectHdl( LINK( this, BackingWindow, MenuSelectHdl ) );
 }
 
@@ -570,18 +543,9 @@ IMPL_LINK( BackingWindow, ClickHdl, Button*, pButton )
     }
     else if( pButton == mpTemplateButton )
     {
-/*        Reference< XDispatchProvider > xFrame( mxFrame, UNO_QUERY );
-
-        Sequence< com::sun::star::beans::PropertyValue > aArgs(1);
-        PropertyValue* pArg = aArgs.getArray();
-        pArg[0].Name = "Referer";
-        pArg[0].Value <<= OUString("private:user");
-
-        dispatchURL( TEMPLATE_URL, OUString(), xFrame, aArgs );
-*/
         mpAllRecentThumbnails->Hide();
+        mpCurrentView->filterItems(ViewFilter_Application(FILTER_APP_NONE));
         mpLocalView->Show();
-        //mpViewBar->Hide();
     }
     return 0;
 }
@@ -590,11 +554,7 @@ IMPL_LINK( BackingWindow, MenuSelectHdl, MenuButton*, pButton )
 {
     OString sId = pButton->GetCurItemIdent();
 
-    if( sId == "filter_none" )
-    {
-        mpCurrentView->filterItems(ViewFilter_Application(FILTER_APP_NONE));
-    }
-    else if( sId == "filter_writer" )
+    if( sId == "filter_writer" )
     {
         mpCurrentView->filterItems(ViewFilter_Application(FILTER_APP_WRITER));
     }
@@ -623,7 +583,6 @@ IMPL_LINK( BackingWindow, MenuSelectHdl, MenuButton*, pButton )
 
     }
 
-
     mpAllRecentThumbnails->Hide();
     mpLocalView->Show();
 
@@ -635,13 +594,10 @@ IMPL_LINK_NOARG( BackingWindow, OpenRegionHdl)
 {
     maSelFolders.clear();
     maSelTemplates.clear();
-    //mpTemplateBar->Hide();
-    //mpViewBar->Hide();
 
     return 0;
 }
 
-//FIXME: Cleanup the code
 IMPL_LINK(BackingWindow, OpenTemplateHdl, ThumbnailViewItem*, pItem)
 {
     if (!mbIsSaveMode)
diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx
index f842644..e4f7a394 100644
--- a/sfx2/source/dialog/backingwindow.hxx
+++ b/sfx2/source/dialog/backingwindow.hxx
@@ -57,11 +57,11 @@ class BackingWindow
     com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider >        mxDesktopDispatchProvider;
     com::sun::star::uno::Reference<com::sun::star::frame::XFrame>                    mxFrame;
     com::sun::star::uno::Reference< com::sun::star::frame::XDesktop2 >               mxDesktop;
+
     /** helper for drag&drop. */
     com::sun::star::uno::Reference< com::sun::star::datatransfer::dnd::XDropTargetListener > mxDropTargetListener;
 
     PushButton*                     mpOpenButton;
-    //PushButton*                     mpTemplateButton;
     MenuButton*                     mpTemplateButton;
 
     FixedText*                      mpCreateLabel;
@@ -88,9 +88,6 @@ class BackingWindow
     TemplateLocalView*              mpLocalView;
     TemplateAbstractView*           mpCurrentView;
 
-    //ToolBox*                        mpViewBar;
-    //ToolBox*                        mpTemplateBar;
-
     std::vector<Window*>            maDndWindows;
 
     Rectangle                       maStartCentButtons;
diff --git a/sfx2/uiconfig/ui/startcenter.ui b/sfx2/uiconfig/ui/startcenter.ui
index 915028e..9c38c7a 100644
--- a/sfx2/uiconfig/ui/startcenter.ui
+++ b/sfx2/uiconfig/ui/startcenter.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.0 on Fri Aug  1 02:51:49 2014 -->
+<!-- Generated with glade 3.16.0 on Fri Aug  8 17:26:41 2014 -->
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
   <!-- interface-requires LibreOffice 1.0 -->
@@ -435,19 +435,10 @@
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <child>
-      <object class="GtkMenuItem" id="filter_none">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="label" translatable="yes">All Templates</property>
-        <property name="use_underline">True</property>
-      </object>
-    </child>
-    <child>
       <object class="GtkMenuItem" id="filter_writer">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="label" translatable="yes">Writer Templates</property>
-        <property name="use_underline">True</property>
       </object>
     </child>
     <child>
@@ -455,7 +446,6 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="label" translatable="yes">Calc Templates</property>
-        <property name="use_underline">True</property>
       </object>
     </child>
     <child>
@@ -463,7 +453,6 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="label" translatable="yes">Impress Templates</property>
-        <property name="use_underline">True</property>
       </object>
     </child>
     <child>


More information about the Libreoffice-commits mailing list