Resolves tdf#161725 - Toggle module-specific file types in MRU
Change-Id: I254659718f26800d8dab94e51e8cf66857b0992e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171399 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
This commit is contained in:
parent
49763e1fc4
commit
6e20a5d6b9
2 changed files with 16 additions and 0 deletions
|
@ -35,6 +35,8 @@
|
|||
#define STR_NODOCUMENT NC_("STR_NODOCUMENT", "No Documents")
|
||||
#define STR_CLEAR_RECENT_FILES NC_("STR_CLEAR_RECENT_FILES", "Clear List")
|
||||
#define STR_CLEAR_RECENT_FILES_HELP NC_("STR_CLEAR_RECENT_FILES_HELP", "Clears the list with the most recently opened files. This action can not be undone.")
|
||||
#define STR_TOGGLE_CURRENT_MODULE NC_("STR_TOGGLE_CURRENT_MODULE", "Current Module Only")
|
||||
#define STR_TOGGLE_CURRENT_MODULE_HELP NC_("STR_TOGGLE_CURRENT_MODULE_HELP", "Shows only documents from the current module")
|
||||
#define STR_REMOTE_TITLE NC_("STR_REMOTE_TITLE", " (Remote)")
|
||||
#define STR_EMDASH_SEPARATOR NC_("STR_EMDASH_SEPARATOR", " — ")
|
||||
#define STR_SAFEMODE_TITLE NC_("STR_SAFEMODE_TITLE", " (Safe Mode)")
|
||||
|
|
|
@ -51,6 +51,7 @@ using namespace com::sun::star::util;
|
|||
namespace {
|
||||
|
||||
constexpr OUString CMD_CLEAR_LIST = u".uno:ClearRecentFileList"_ustr;
|
||||
constexpr OUString CMD_TOGGLE_CURRENTMODULE = u".uno:ToggleCurrentModule"_ustr;
|
||||
constexpr OUString CMD_OPEN_AS_TEMPLATE = u".uno:OpenTemplate"_ustr;
|
||||
constexpr OUString CMD_OPEN_REMOTE = u".uno:OpenRemote"_ustr;
|
||||
|
||||
|
@ -295,6 +296,12 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
|
|||
rPopupMenu->setCommand(sal_uInt16(nCount + 1), CMD_CLEAR_LIST);
|
||||
rPopupMenu->setHelpText(sal_uInt16(nCount + 1), FwkResId(STR_CLEAR_RECENT_FILES_HELP));
|
||||
|
||||
// Toggle current module only
|
||||
rPopupMenu->insertItem(sal_uInt16(nCount + 2), FwkResId(STR_TOGGLE_CURRENT_MODULE), 0, -1);
|
||||
rPopupMenu->checkItem(sal_uInt16(nCount + 2), bShowCurrentModuleOnly);
|
||||
rPopupMenu->setCommand(sal_uInt16(nCount + 2), CMD_TOGGLE_CURRENTMODULE);
|
||||
rPopupMenu->setHelpText(sal_uInt16(nCount + 2), FwkResId(STR_TOGGLE_CURRENT_MODULE_HELP));
|
||||
|
||||
// Open remote menu entry
|
||||
if ( m_bShowToolbarEntries )
|
||||
{
|
||||
|
@ -388,6 +395,13 @@ void SAL_CALL RecentFilesMenuController::itemSelected( const css::awt::MenuEvent
|
|||
u"vnd.org.libreoffice.recentdocs:ClearRecentFileList"_ustr,
|
||||
css::uno::Sequence< css::beans::PropertyValue >() );
|
||||
}
|
||||
if ( aCommand == CMD_TOGGLE_CURRENTMODULE )
|
||||
{
|
||||
bool bIsExclusive = officecfg::Office::Common::History::ShowCurrentModuleOnly::get();
|
||||
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
|
||||
officecfg::Office::Common::History::ShowCurrentModuleOnly::set(!bIsExclusive, batch);
|
||||
batch->commit();
|
||||
}
|
||||
else if ( aCommand == CMD_OPEN_REMOTE )
|
||||
{
|
||||
Sequence< PropertyValue > aArgsList( 0 );
|
||||
|
|
Loading…
Reference in a new issue