[Libreoffice-commits] core.git: sc/sdi sc/source sc/uiconfig sc/UIConfig_scalc.mk sd/sdi sd/source sd/uiconfig sd/UIConfig_simpress.mk sfx2/source sfx2/uiconfig sfx2/UIConfig_sfx.mk vcl/source
Szymon Kłos
eszkadev at gmail.com
Tue May 17 12:40:36 UTC 2016
sc/UIConfig_scalc.mk | 1
sc/sdi/docsh.sdi | 1
sc/source/ui/docshell/docsh4.cxx | 14 ++
sc/uiconfig/scalc/ui/notebookbar.ui | 172 +++++++++++++++++++++++++++++++++
sd/UIConfig_simpress.mk | 1
sd/sdi/docshell.sdi | 5
sd/source/ui/docshell/docshel3.cxx | 7 +
sd/source/ui/docshell/docshell.cxx | 7 +
sd/uiconfig/simpress/ui/notebookbar.ui | 118 ++++++++++++++++++++++
sfx2/UIConfig_sfx.mk | 1
sfx2/source/dialog/backingcomp.cxx | 20 +++
sfx2/uiconfig/ui/notebookbar.ui | 118 ++++++++++++++++++++++
vcl/source/window/brdwin.cxx | 2
13 files changed, 467 insertions(+)
New commits:
commit 6ebf9cfbf54052d7fae50cdab146cc5c63ba262a
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Tue May 10 19:16:47 2016 +0200
Set different ui file for NotebookBar in each app
Changes:
+ added ui file for start center, calc and impress
+ NotebookBar not visible in Math, Draw
Change-Id: Ie35935e67524ac712930b088591e9e53955de4a1
Reviewed-on: https://gerrit.libreoffice.org/24860
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index f67a879..21bb7e1 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -137,6 +137,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/leftfooterdialog \
sc/uiconfig/scalc/ui/leftheaderdialog \
sc/uiconfig/scalc/ui/namerangesdialog \
+ sc/uiconfig/scalc/ui/notebookbar \
sc/uiconfig/scalc/ui/managenamesdialog \
sc/uiconfig/scalc/ui/movecopysheet \
sc/uiconfig/scalc/ui/movingaveragedialog \
diff --git a/sc/sdi/docsh.sdi b/sc/sdi/docsh.sdi
index 25852fb..852af49 100644
--- a/sc/sdi/docsh.sdi
+++ b/sc/sdi/docsh.sdi
@@ -87,6 +87,7 @@ interface TableDocument
SID_EDIT_SCENARIO [ ExecMethod = Execute; ]
SID_ATTR_CHAR_FONTLIST [ StateMethod = GetState; ]
SID_SHARE_DOC [ ExecMethod = Execute; StateMethod = GetState; ]
+ SID_NOTEBOOKBAR [ ExecMethod = Execute; StateMethod = GetState; ]
}
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 1bedf91..bdf1c52 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -101,6 +101,7 @@ using namespace ::com::sun::star;
#include "formulacell.hxx"
#include <documentlinkmgr.hxx>
#include <memory>
+#include <sfx2/notebookbar/SfxNotebookBar.hxx>
void ScDocShell::Execute( SfxRequest& rReq )
{
@@ -1103,6 +1104,12 @@ void ScDocShell::Execute( SfxRequest& rReq )
{ &aApp, &aTarget });
}
break;
+ case SID_NOTEBOOKBAR:
+ {
+ if (pBindings)
+ sfx2::SfxNotebookBar::ExecMethod(*pBindings);
+ }
+ break;
default:
{
// kleiner (?) Hack -> forward der Slots an TabViewShell
@@ -1857,6 +1864,13 @@ void ScDocShell::GetState( SfxItemSet &rSet )
rSet.Put( SvxFontListItem( pImpl->pFontList, nWhich ) );
break;
+ case SID_NOTEBOOKBAR:
+ {
+ if (GetViewBindings())
+ sfx2::SfxNotebookBar::StateMethod(*GetViewBindings(), "modules/scalc/ui/notebookbar.ui");
+ }
+ break;
+
default:
{
}
diff --git a/sc/uiconfig/scalc/ui/notebookbar.ui b/sc/uiconfig/scalc/ui/notebookbar.ui
new file mode 100644
index 0000000..337448d
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/notebookbar.ui
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.12"/>
+ <!-- interface-local-resource-path ../../../icon-themes/galaxy/cmd/ -->
+ <object class="GtkGrid" id="NotebookBar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkNotebook" id="notebook1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkBox" id="box63">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkBox" id="box4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkButton" id="button-open">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="action_name">.uno:Open</property>
+ <property name="relief">none</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button-save">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="action_name">.uno:Save</property>
+ <property name="relief">none</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSeparator" id="separator3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">File</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Calc</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index bcb6160..3e7b3fe 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -119,6 +119,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
sd/uiconfig/simpress/ui/interactiondialog \
sd/uiconfig/simpress/ui/interactionpage \
sd/uiconfig/simpress/ui/masterlayoutdlg \
+ sd/uiconfig/simpress/ui/notebookbar \
sd/uiconfig/simpress/ui/optimpressgeneralpage \
sd/uiconfig/simpress/ui/photoalbum \
sd/uiconfig/simpress/ui/presentationdialog \
diff --git a/sd/sdi/docshell.sdi b/sd/sdi/docshell.sdi
index d2a0011..f5f3221 100644
--- a/sd/sdi/docshell.sdi
+++ b/sd/sdi/docshell.sdi
@@ -18,6 +18,11 @@
interface ImpressDocument : DrawDocument
{
+ SID_NOTEBOOKBAR
+ [
+ ExecMethod = Execute;
+ StateMethod = GetState;
+ ]
}
shell DrawDocShell
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx
index 69f15c7..c8fe3f4 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -42,6 +42,7 @@
#include <editeng/langitem.hxx>
#include <editeng/eeitem.hxx>
#include <com/sun/star/i18n/TextConversionOption.hpp>
+#include <sfx2/notebookbar/SfxNotebookBar.hxx>
#include "strings.hrc"
#include "glob.hrc"
@@ -317,6 +318,12 @@ void DrawDocShell::Execute( SfxRequest& rReq )
}
break;
+ case SID_NOTEBOOKBAR:
+ {
+ sfx2::SfxNotebookBar::ExecMethod(mpViewShell->GetFrame()->GetBindings());
+ }
+ break;
+
default:
break;
}
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index e91caaa..65dafa0 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -67,6 +67,7 @@
#include "undo/undofactory.hxx"
#include "OutlineView.hxx"
#include "ViewShellBase.hxx"
+#include <sfx2/notebookbar/SfxNotebookBar.hxx>
using namespace sd;
#define DrawDocShell
@@ -271,6 +272,12 @@ void DrawDocShell::GetState(SfxItemSet &rSet)
}
break;
+ case SID_NOTEBOOKBAR:
+ {
+ sfx2::SfxNotebookBar::StateMethod(mpViewShell->GetFrame()->GetBindings(), "modules/simpress/ui/notebookbar.ui");
+ }
+ break;
+
default:
break;
}
diff --git a/sd/uiconfig/simpress/ui/notebookbar.ui b/sd/uiconfig/simpress/ui/notebookbar.ui
new file mode 100644
index 0000000..f11f6eb
--- /dev/null
+++ b/sd/uiconfig/simpress/ui/notebookbar.ui
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.12"/>
+ <object class="GtkGrid" id="NotebookBar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkNotebook" id="notebook1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkBox" id="box63">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkButton" id="Open">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="action_name">.uno:Open</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="Save">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="action_name">.uno:Save</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">File</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Impress</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/sfx2/UIConfig_sfx.mk b/sfx2/UIConfig_sfx.mk
index f336669..5e90b5a 100644
--- a/sfx2/UIConfig_sfx.mk
+++ b/sfx2/UIConfig_sfx.mk
@@ -34,6 +34,7 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\
sfx2/uiconfig/ui/loadtemplatedialog \
sfx2/uiconfig/ui/managestylepage \
sfx2/uiconfig/ui/newstyle \
+ sfx2/uiconfig/ui/notebookbar \
sfx2/uiconfig/ui/optprintpage \
sfx2/uiconfig/ui/password \
sfx2/uiconfig/ui/printeroptionsdialog \
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index defdaa3..0654b3e 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -48,6 +48,7 @@
#include <vcl/keycod.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/syswin.hxx>
#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
@@ -428,6 +429,14 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f
if( pBack )
pBack->setOwningFrame( m_xFrame );
+ // set NotebookBar
+ SystemWindow* pSysWindow = static_cast<SystemWindow*>(pParent);
+ if (pSysWindow)
+ {
+ pSysWindow->SetNotebookBar("sfx/ui/notebookbar.ui", m_xFrame);
+ pSysWindow->GetNotebookBar()->Show();
+ }
+
// Set a minimum size for Start Center
if( pParent && pBack )
{
@@ -585,6 +594,17 @@ void SAL_CALL BackingComp::disposing( /*IN*/ const css::lang::EventObject& aEven
void SAL_CALL BackingComp::dispose()
throw(css::uno::RuntimeException, std::exception)
{
+ if (m_xFrame.is())
+ {
+ css::uno::Reference< css::awt::XWindow > xParentWindow = m_xFrame->getContainerWindow();
+ VclPtr< WorkWindow > pParent = static_cast<WorkWindow*>(VCLUnoHelper::GetWindow(xParentWindow).get());
+
+ // hide NotebookBar
+ SystemWindow* pSysWindow = static_cast<SystemWindow*>(pParent);
+ if (pSysWindow && pSysWindow->GetNotebookBar())
+ pSysWindow->GetNotebookBar()->Hide();
+ }
+
/* SAFE { */
SolarMutexGuard aGuard;
diff --git a/sfx2/uiconfig/ui/notebookbar.ui b/sfx2/uiconfig/ui/notebookbar.ui
new file mode 100644
index 0000000..1f7bf46
--- /dev/null
+++ b/sfx2/uiconfig/ui/notebookbar.ui
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.12"/>
+ <object class="GtkGrid" id="NotebookBar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkNotebook" id="notebook1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkBox" id="box63">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkButton" id="Open">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="action_name">.uno:Open</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="OpenRemote">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="action_name">.uno:OpenRemote</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">File</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Home</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 57f7e0c..bc58e47 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -2177,6 +2177,8 @@ void ImplBorderWindow::SetMenuBarMode( bool bHide )
void ImplBorderWindow::SetNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame)
{
+ if (mpNotebookBar)
+ mpNotebookBar.disposeAndClear();
mpNotebookBar = VclPtr<NotebookBar>::Create(this, "NotebookBar", rUIXMLDescription, rFrame);
Resize();
}
More information about the Libreoffice-commits
mailing list