summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorGrzegorz Araminowicz <grzegorz.araminowicz@collabora.com>2019-08-18 16:23:51 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-08-23 09:53:09 +0200
commit5457ddf2f529daf5962abcba76dbaeccff0de826 (patch)
treedde8f794d3c9349874d8fb0d573ef906855d7580 /cui
parent1aed241deb816b2a6b9f3f97978443939f61d076 (diff)
SmartArt: add Edit Diagram dialog
Currently it displays only text representation of diagram. Change-Id: I3ff12c4abf2ed32f68ea9d7437905afc13279e62 Reviewed-on: https://gerrit.libreoffice.org/77873 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/Library_cui.mk1
-rw-r--r--cui/UIConfig_cui.mk1
-rw-r--r--cui/source/dialogs/DiagramDialog.cxx27
-rw-r--r--cui/source/factory/dlgfact.cxx13
-rw-r--r--cui/source/factory/dlgfact.hxx21
-rw-r--r--cui/source/inc/DiagramDialog.hxx34
-rw-r--r--cui/uiconfig/ui/diagramdialog.ui73
7 files changed, 170 insertions, 0 deletions
diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk
index 1822dc311097..f770cb08158a 100644
--- a/cui/Library_cui.mk
+++ b/cui/Library_cui.mk
@@ -110,6 +110,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
cui/source/dialogs/cuiimapwnd \
cui/source/dialogs/cuitbxform \
cui/source/dialogs/dlgname \
+ cui/source/dialogs/DiagramDialog \
cui/source/dialogs/FontFeaturesDialog \
cui/source/dialogs/hangulhanjadlg \
cui/source/dialogs/hldocntp \
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index e25d8fbe6a13..f953af64a954 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -48,6 +48,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/croppage \
cui/uiconfig/ui/cuiimapdlg \
cui/uiconfig/ui/databaselinkdialog \
+ cui/uiconfig/ui/diagramdialog \
cui/uiconfig/ui/dimensionlinestabpage \
cui/uiconfig/ui/editdictionarydialog \
cui/uiconfig/ui/editmodulesdialog \
diff --git a/cui/source/dialogs/DiagramDialog.cxx b/cui/source/dialogs/DiagramDialog.cxx
new file mode 100644
index 000000000000..f93b3bbdf28b
--- /dev/null
+++ b/cui/source/dialogs/DiagramDialog.cxx
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+* This file is part of the LibreOffice project.
+*
+* This Source Code Form is subject to the terms of the Mozilla Public
+* License, v. 2.0. If a copy of the MPL was not distributed with this
+* file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*/
+
+#include <DiagramDialog.hxx>
+
+#include <svx/DiagramDataInterface.hxx>
+
+DiagramDialog::DiagramDialog(weld::Window* pWindow,
+ std::shared_ptr<DiagramDataInterface> pDiagramData)
+ : GenericDialogController(pWindow, "cui/ui/diagramdialog.ui", "DiagramDialog")
+ , mpDiagramData(pDiagramData)
+ , mpBtnOk(m_xBuilder->weld_button("btnOk"))
+ , mpBtnCancel(m_xBuilder->weld_button("btnCancel"))
+ , mpTextDiagram(m_xBuilder->weld_text_view("textDiagram"))
+{
+ mpTextDiagram->set_text(mpDiagramData->getString());
+}
+
+DiagramDialog::~DiagramDialog() {}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 37460b879aa0..289c79ccf8be 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -87,6 +87,7 @@
#include <thesdlg.hxx>
#include <about.hxx>
#include <tipofthedaydlg.hxx>
+#include <DiagramDialog.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::frame;
@@ -1384,6 +1385,11 @@ short AbstractTipOfTheDayDialog_Impl::Execute()
return m_xDlg->run();
}
+short AbstractDiagramDialog_Impl::Execute()
+{
+ return m_xDlg->run();
+}
+
VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateSvxMacroAssignDlg(
weld::Window* _pParent, const Reference< XFrame >& _rxDocumentFrame, const bool _bUnoDialogMode,
const Reference< XNameReplace >& _rxEvents, const sal_uInt16 _nInitiallySelectedEvent )
@@ -1641,4 +1647,11 @@ AbstractDialogFactory_Impl::CreateTipOfTheDayDialog(weld::Window* pParent)
return VclPtr<AbstractTipOfTheDayDialog_Impl>::Create(std::make_unique<TipOfTheDayDialog>(pParent));
}
+VclPtr<AbstractDiagramDialog>
+AbstractDialogFactory_Impl::CreateDiagramDialog(weld::Window* pParent, std::shared_ptr<DiagramDataInterface> pDiagramData)
+{
+ return VclPtr<AbstractDiagramDialog_Impl>::Create(
+ std::make_unique<DiagramDialog>(pParent, pDiagramData));
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 9948e71fcf24..7d579b22ae20 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -37,6 +37,7 @@
#include <cuitabarea.hxx>
#include <cuitbxform.hxx>
#include <dlgname.hxx>
+#include <DiagramDialog.hxx>
#include <dstribut.hxx>
#include <hangulhanjadlg.hxx>
#include <hyphen.hxx>
@@ -740,6 +741,22 @@ public:
virtual short Execute() override;
};
+class DiagramDialog;
+
+/** Edit Diagram dialog */
+class AbstractDiagramDialog_Impl : public AbstractDiagramDialog
+{
+protected:
+ std::unique_ptr<DiagramDialog> m_xDlg;
+
+public:
+ explicit AbstractDiagramDialog_Impl(std::unique_ptr<DiagramDialog> p)
+ : m_xDlg(std::move(p))
+ {
+ }
+ virtual short Execute() override;
+};
+
//AbstractDialogFactory_Impl implementations
class AbstractDialogFactory_Impl : public SvxAbstractDialogFactory
{
@@ -926,6 +943,10 @@ public:
const css::uno::Reference<css::frame::XModel> xModel, bool bEditExisting) override;
virtual VclPtr<AbstractTipOfTheDayDialog> CreateTipOfTheDayDialog(weld::Window* pParent) override;
+
+ virtual VclPtr<AbstractDiagramDialog> CreateDiagramDialog(
+ weld::Window* pParent,
+ std::shared_ptr<DiagramDataInterface> pDiagramData) override;
};
#endif
diff --git a/cui/source/inc/DiagramDialog.hxx b/cui/source/inc/DiagramDialog.hxx
new file mode 100644
index 000000000000..55a948c15cc4
--- /dev/null
+++ b/cui/source/inc/DiagramDialog.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+* This file is part of the LibreOffice project.
+*
+* This Source Code Form is subject to the terms of the Mozilla Public
+* License, v. 2.0. If a copy of the MPL was not distributed with this
+* file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*/
+
+#ifndef INCLUDED_CUI_SOURCE_INC_DIAGRAMDIALOG_HXX
+#define INCLUDED_CUI_SOURCE_INC_DIAGRAMDIALOG_HXX
+
+#include <tools/link.hxx>
+#include <vcl/weld.hxx>
+
+class DiagramDataInterface;
+
+/** Edit Diagram dialog */
+class DiagramDialog : public weld::GenericDialogController
+{
+public:
+ DiagramDialog(weld::Window* pWindow, std::shared_ptr<DiagramDataInterface> pDiagramData);
+ virtual ~DiagramDialog() override;
+
+private:
+ std::shared_ptr<DiagramDataInterface> mpDiagramData;
+ std::unique_ptr<weld::Button> mpBtnOk;
+ std::unique_ptr<weld::Button> mpBtnCancel;
+ std::unique_ptr<weld::TextView> mpTextDiagram;
+};
+
+#endif // INCLUDED_CUI_SOURCE_INC_DIAGRAMDIALOG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/uiconfig/ui/diagramdialog.ui b/cui/uiconfig/ui/diagramdialog.ui
new file mode 100644
index 000000000000..6b6c888808df
--- /dev/null
+++ b/cui/uiconfig/ui/diagramdialog.ui
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface domain="cui">
+ <requires lib="gtk+" version="3.18"/>
+ <object class="GtkDialog" id="DiagramDialog">
+ <property name="can_focus">False</property>
+ <property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="vbox">
+ <object class="GtkBox">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="btnOk">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="btnCancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTextView" id="textDiagram">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-5">btnOk</action-widget>
+ <action-widget response="-6">btnCancel</action-widget>
+ </action-widgets>
+ </object>
+</interface> \ No newline at end of file