From af97c180983e5a8ac147b97f7773d483bba8cfef Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Thu, 11 Aug 2016 13:53:20 +0200 Subject: GSoC notebookbar: multiple .ui implementations + added menu controller for .uno:Notebookbar showing all implementations + switching between .ui files + officecfg stores implementation description + added second implementation file notebookbar_groups.ui Change-Id: I9f406daced7a111793f61a2e9f939cba27d92184 Reviewed-on: https://gerrit.libreoffice.org/28067 Reviewed-by: Samuel Mehrbrodt Tested-by: Samuel Mehrbrodt --- sc/UIConfig_scalc.mk | 1 + sc/source/ui/docshell/docsh4.cxx | 12 ++- sc/uiconfig/scalc/ui/notebookbar_groups.ui | 133 +++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 sc/uiconfig/scalc/ui/notebookbar_groups.ui (limited to 'sc') diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 7ab8cd4fbdfa..366eef035f34 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -139,6 +139,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/leftheaderdialog \ sc/uiconfig/scalc/ui/namerangesdialog \ sc/uiconfig/scalc/ui/notebookbar \ + sc/uiconfig/scalc/ui/notebookbar_groups \ sc/uiconfig/scalc/ui/managenamesdialog \ sc/uiconfig/scalc/ui/movecopysheet \ sc/uiconfig/scalc/ui/movingaveragedialog \ diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 6ce6eae2e36d..8fcb604ca0dd 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1097,8 +1097,16 @@ void ScDocShell::Execute( SfxRequest& rReq ) break; case SID_NOTEBOOKBAR: { - if (pBindings) + const SfxStringItem* pFile = rReq.GetArg( SID_NOTEBOOKBAR ); + + if ( pBindings && ( !pFile || ( pFile && !sfx2::SfxNotebookBar::IsActive() ) ) ) sfx2::SfxNotebookBar::ExecMethod(*pBindings); + else if ( pBindings && pFile && pFile->GetValue().isEmpty() ) + { + sfx2::SfxNotebookBar::CloseMethod(*pBindings); + if ( sfx2::SfxNotebookBar::IsActive() ) + sfx2::SfxNotebookBar::ExecMethod(*pBindings); + } } break; default: @@ -1858,7 +1866,7 @@ void ScDocShell::GetState( SfxItemSet &rSet ) case SID_NOTEBOOKBAR: { if (GetViewBindings()) - sfx2::SfxNotebookBar::StateMethod(*GetViewBindings(), "modules/scalc/ui/notebookbar.ui"); + sfx2::SfxNotebookBar::StateMethod(*GetViewBindings(), "modules/scalc/ui/"); } break; diff --git a/sc/uiconfig/scalc/ui/notebookbar_groups.ui b/sc/uiconfig/scalc/ui/notebookbar_groups.ui new file mode 100644 index 000000000000..0154978af690 --- /dev/null +++ b/sc/uiconfig/scalc/ui/notebookbar_groups.ui @@ -0,0 +1,133 @@ + + + + + + + + True + False + + + True + False + vertical + + + True + True + True + True + + + True + False + 6 + + + + + + + + + + + + + + + + + + + + + + + + True + False + + + + + + + False + True + 7 + + + + + + + True + False + File + True + + + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + True + 0 + + + + + 0 + 0 + + + + -- cgit