summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-11-24 02:16:39 +0100
committerJan Holesovsky <kendy@collabora.com>2014-12-19 12:53:46 +0100
commite5d87682c894c3de5b3553c5cee1193f063e017f (patch)
tree89a587fcef72f39c60ff6869fe99fa9501a94e98 /sw
parent2125868dad4b1e8f9318367b47938ad7e8afeebb (diff)
changes sidebar: Manage Changes (Redlining) panel instead of the dialog box.
Change-Id: I4fd415845e2732ee8ef0567b8c58b878bb52fac8
Diffstat (limited to 'sw')
-rw-r--r--sw/UIConfig_swriter.mk1
-rw-r--r--sw/source/ui/misc/swmodalredlineacceptdlg.cxx3
-rw-r--r--sw/source/uibase/inc/redlndlg.hxx18
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx31
-rw-r--r--sw/source/uibase/sidebar/SwPanelFactory.cxx10
-rw-r--r--sw/uiconfig/swriter/ui/managechangessidebar.ui143
6 files changed, 200 insertions, 6 deletions
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index dbfb7d4b578e..706f87644a7e 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -170,6 +170,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/querysavelabeldialog \
sw/uiconfig/swriter/ui/queryshowchangesdialog \
sw/uiconfig/swriter/ui/mailmerge \
+ sw/uiconfig/swriter/ui/managechangessidebar \
sw/uiconfig/swriter/ui/mmaddressblockpage \
sw/uiconfig/swriter/ui/mmcreatingdialog \
sw/uiconfig/swriter/ui/mmlayoutpage \
diff --git a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
index 11475e7af8cf..dc9c786adb41 100644
--- a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
+++ b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
@@ -18,6 +18,7 @@
*/
#include <redline.hxx>
+#include <vcl/layout.hxx>
#include <vcl/msgbox.hxx>
#include <svl/eitem.hxx>
#include <sfx2/viewfrm.hxx>
@@ -46,7 +47,7 @@ SwModalRedlineAcceptDlg::SwModalRedlineAcceptDlg(vcl::Window *pParent)
: SfxModalDialog(pParent,
"AcceptRejectChangesDialog", "svx/ui/acceptrejectchangesdialog.ui")
{
- pImplDlg = new SwRedlineAcceptDlg(this, true);
+ pImplDlg = new SwRedlineAcceptDlg(this, get_content_area(), true);
pImplDlg->Initialize(GetExtraData());
pImplDlg->Activate(); // for data's initialisation
diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx
index b949299b14d2..9e31d25ceab9 100644
--- a/sw/source/uibase/inc/redlndlg.hxx
+++ b/sw/source/uibase/inc/redlndlg.hxx
@@ -24,6 +24,7 @@
#include <tools/datetime.hxx>
#include <vcl/msgbox.hxx>
#include <svl/eitem.hxx>
+#include <svx/sidebar/PanelLayout.hxx>
#include <sfx2/basedlgs.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
@@ -66,7 +67,7 @@ typedef std::vector<SvLBoxEntryPtr> SvLBoxEntryArr;
class SW_DLLPUBLIC SwRedlineAcceptDlg
{
- Dialog* pParentDlg;
+ vcl::Window* pParentDlg;
SwRedlineDataParentArr aRedlineParents;
SwRedlineDataChildArr aRedlineChildren;
SwRedlineDataParentSortArr aUsedSeqNo;
@@ -113,7 +114,7 @@ class SW_DLLPUBLIC SwRedlineAcceptDlg
SAL_DLLPRIVATE sal_uInt16 GetRedlinePos( const SvTreeListEntry& rEntry) const;
public:
- SwRedlineAcceptDlg(Dialog *pParent, bool bAutoFmt = false);
+ SwRedlineAcceptDlg(vcl::Window *pParent, vcl::Window *pContentArea, bool bAutoFmt = false);
virtual ~SwRedlineAcceptDlg();
DECL_LINK( FilterChangedHdl, void *pDummy = 0 );
@@ -157,6 +158,19 @@ public:
virtual bool ReInitDlg(SwDocShell *pDocSh) SAL_OVERRIDE;
};
+/// Redline (Manage Changes) panel for the sidebar.
+class SwRedlineAcceptPanel : public PanelLayout, public SfxListener
+{
+ SwRedlineAcceptDlg* mpImplDlg;
+public:
+ SwRedlineAcceptPanel(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rFrame);
+ virtual ~SwRedlineAcceptPanel();
+
+ /// We need to be a SfxListener to be able to update the list of changes when we get SFX_HINT_DOCCHANGED.
+ using Control::Notify;
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) SAL_OVERRIDE;
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index b13e30d6561f..c830d1a7d7b8 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -89,7 +89,7 @@ SwModelessRedlineAcceptDlg::SwModelessRedlineAcceptDlg(
"AcceptRejectChangesDialog", "svx/ui/acceptrejectchangesdialog.ui")
, pChildWin (pChild)
{
- pImplDlg = new SwRedlineAcceptDlg(this);
+ pImplDlg = new SwRedlineAcceptDlg(this, get_content_area());
}
void SwModelessRedlineAcceptDlg::Activate()
@@ -141,9 +141,9 @@ SwModelessRedlineAcceptDlg::~SwModelessRedlineAcceptDlg()
delete pImplDlg;
}
-SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, bool bAutoFmt) :
+SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, vcl::Window *pContentArea, bool bAutoFmt) :
pParentDlg (pParent),
- aTabPagesCTRL (pParent->get_content_area()),
+ aTabPagesCTRL (pContentArea, dynamic_cast<VclBuilderContainer*>(pParent)),
aPopup (SW_RES(MN_REDLINE_POPUP)),
sInserted (SW_RES(STR_REDLINE_INSERTED)),
sDeleted (SW_RES(STR_REDLINE_DELETED)),
@@ -1206,4 +1206,29 @@ void SwRedlineAcceptDlg::FillInfo(OUString &rExtraData) const
rExtraData += ")";
}
+SwRedlineAcceptPanel::SwRedlineAcceptPanel(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rFrame)
+ : PanelLayout(pParent, "ManageChangesPanel", "modules/swriter/ui/managechangessidebar.ui", rFrame)
+{
+ mpImplDlg = new SwRedlineAcceptDlg(this, get<VclGrid>("content_area"));
+
+ mpImplDlg->Init();
+
+ // we want to receive SFX_HINT_DOCCHANGED
+ StartListening(*(SW_MOD()->GetView()->GetDocShell()));
+}
+
+SwRedlineAcceptPanel::~SwRedlineAcceptPanel()
+{
+ delete mpImplDlg;
+}
+
+void SwRedlineAcceptPanel::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
+{
+ const SfxSimpleHint *pHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
+ if (pHint && pHint->GetId() == SFX_HINT_DOCCHANGED)
+ {
+ mpImplDlg->Activate();
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx
index 4acd66138d11..20e2296e91e5 100644
--- a/sw/source/uibase/sidebar/SwPanelFactory.cxx
+++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx
@@ -22,6 +22,7 @@
#include <PagePropertyPanel.hxx>
#include <WrapPropertyPanel.hxx>
#include <navipi.hxx>
+#include <redlndlg.hxx>
#include <sfx2/sidebar/SidebarPanelBase.hxx>
#include <sfx2/sfxbasecontroller.hxx>
@@ -129,6 +130,15 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
pPanel,
ui::LayoutSize(0,-1,-1));
}
+ else if (rsResourceURL.endsWith("/ManageChangesPanel"))
+ {
+ vcl::Window* pPanel = new SwRedlineAcceptPanel(pParentWindow, xFrame);
+ xElement = sfx2::sidebar::SidebarPanelBase::Create(
+ rsResourceURL,
+ xFrame,
+ pPanel,
+ ui::LayoutSize(-1,-1,-1));
+ }
return xElement;
}
diff --git a/sw/uiconfig/swriter/ui/managechangessidebar.ui b/sw/uiconfig/swriter/ui/managechangessidebar.ui
new file mode 100644
index 000000000000..98a3d7a30744
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/managechangessidebar.ui
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkGrid" id="ManageChangesPanel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_homogeneous">True</property>
+ <property name="column_homogeneous">True</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkBox" id="box9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkGrid" id="content_area">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkButton" id="accept">
+ <property name="label" translatable="yes">_Accept</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="reject">
+ <property name="label" translatable="yes">_Reject</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="acceptall">
+ <property name="label" translatable="yes">A_ccept All</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="rejectall">
+ <property name="label" translatable="yes">R_eject All</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkButton" id="undo">
+ <property name="label">gtk-undo</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="no_show_all">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </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>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+</interface>