open remote entry in the open drop down menu

Change-Id: Idebc8a926c6653c476c2507606d4a89b22e2eaaf
This commit is contained in:
Szymon Kłos
2015-07-06 16:01:26 +02:00
parent e80181ee32
commit 0cfec3d3bd
3 changed files with 26 additions and 0 deletions

View File

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

View File

@@ -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%";

View File

@@ -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 );
}