diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2015-07-06 16:01:26 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2015-07-16 09:53:28 +0200 |
commit | 0cfec3d3bd77d9f19d0dc74ff2516a2460a3ea89 (patch) | |
tree | 8b962a85011c3de8ddba3e51585c2145f99eb662 /framework | |
parent | e80181ee32806ebae56f0e64690f219b76bf5560 (diff) |
open remote entry in the open drop down menu
Change-Id: Idebc8a926c6653c476c2507606d4a89b22e2eaaf
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/classes/resource.hrc | 1 | ||||
-rw-r--r-- | framework/source/classes/resource.src | 5 | ||||
-rw-r--r-- | framework/source/uielement/recentfilesmenucontroller.cxx | 20 |
3 files changed, 26 insertions, 0 deletions
diff --git a/framework/inc/classes/resource.hrc b/framework/inc/classes/resource.hrc index 8d2337156bfb..6620c99ca509 100644 --- a/framework/inc/classes/resource.hrc +++ b/framework/inc/classes/resource.hrc @@ -50,6 +50,7 @@ #define STR_CLEAR_RECENT_FILES (RID_STR_START+23) #define STR_CLEAR_RECENT_FILES_HELP (RID_STR_START+24) #define STR_LANGSTATUS_HINT (RID_STR_START+25) +#define STR_OPEN_REMOTE (RID_STR_START+26) #define POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION (RID_MENU_START+0) diff --git a/framework/source/classes/resource.src b/framework/source/classes/resource.src index c54eaa327265..0ef53ae2fed5 100644 --- a/framework/source/classes/resource.src +++ b/framework/source/classes/resource.src @@ -114,6 +114,11 @@ String STR_CLEAR_RECENT_FILES_HELP Text [ en-US ] = "Clears the list with the most recently opened files. This action can not be undone."; }; +String STR_OPEN_REMOTE +{ + Text [ en-US ] = "Open remote file"; +}; + String STR_TOOLBAR_TITLE_ADDON { Text [ en-US ] = "Add-On %num%"; diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 8e4fe9d456ba..a2c3432c77ca 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -44,6 +44,7 @@ using namespace framework; namespace { static const char CMD_CLEAR_LIST[] = ".uno:ClearRecentFileList"; +static const char CMD_OPEN_REMOTE[] = ".uno:OpenRemote"; static const char CMD_PREFIX[] = "vnd.sun.star.popup:RecentFileList?entry="; static const char MENU_SHORTCUT[] = "~N. "; @@ -224,6 +225,12 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > OUString( CMD_CLEAR_LIST ) ); pVCLPopupMenu->SetHelpText( sal_uInt16( nCount + 1 ), FWK_RESSTR(STR_CLEAR_RECENT_FILES_HELP) ); + + // Open remote menu entry + pVCLPopupMenu->InsertItem( sal_uInt16( nCount + 2 ), + FWK_RESSTR(STR_OPEN_REMOTE) ); + pVCLPopupMenu->SetItemCommand( sal_uInt16( nCount + 2 ), + OUString( CMD_OPEN_REMOTE ) ); } else { @@ -232,6 +239,14 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > // Do not disable it, otherwise the Toolbar controller and MenuButton // will display SV_RESID_STRING_NOSELECTIONPOSSIBLE instead of STR_NODOCUMENT pVCLPopupMenu->SetItemBits( 1, pVCLPopupMenu->GetItemBits( 1 ) | MenuItemBits::NOSELECT ); + + pVCLPopupMenu->InsertSeparator(); + + // Open remote menu entry + pVCLPopupMenu->InsertItem( sal_uInt16( 2 ), + FWK_RESSTR(STR_OPEN_REMOTE) ); + pVCLPopupMenu->SetItemCommand( sal_uInt16( 2 ), + OUString( CMD_OPEN_REMOTE ) ); } } } @@ -331,6 +346,11 @@ void SAL_CALL RecentFilesMenuController::itemSelected( const css::awt::MenuEvent "vnd.org.libreoffice.recentdocs:ClearRecentFileList", ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >() ); } + else if ( aCommand == CMD_OPEN_REMOTE ) + { + Sequence< PropertyValue > aArgsList( 0 ); + dispatchCommand( CMD_OPEN_REMOTE, aArgsList ); + } else executeEntry( rEvent.MenuId-1 ); } |