[Libreoffice-commits] core.git: filter/source include/vcl sw/source sw/uiconfig vcl/inc vcl/source
Caolán McNamara
caolanm at redhat.com
Tue Mar 20 08:52:12 UTC 2018
filter/source/pdf/impdialog.hxx | 1
sw/source/ui/dbui/mmoutputtypepage.cxx | 35 ++++++++++--------------------
sw/uiconfig/swriter/ui/warnemaildialog.ui | 31 ++++++++++++++++++++------
vcl/inc/messagedialog.hxx | 4 ---
vcl/source/app/salvtables.cxx | 2 -
vcl/source/window/builder.cxx | 2 -
vcl/source/window/dialog.cxx | 2 -
vcl/source/window/layout.cxx | 2 -
8 files changed, 41 insertions(+), 38 deletions(-)
New commits:
commit 0ee398cf33077ec366a572c76267a3f40bcf08fd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Mar 19 20:42:55 2018 +0000
weld SwSendWarningBox
and then MessageDialog can become a vcl internal
Change-Id: I8bf1f963971420b11f6c4163f624be26603cc942
Reviewed-on: https://gerrit.libreoffice.org/51601
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index cddb100b8968..f65ffafc05e4 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -27,7 +27,6 @@
#include <vcl/fixed.hxx>
#include <vcl/field.hxx>
#include <vcl/edit.hxx>
-#include <vcl/messagedialog.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/combobox.hxx>
#include <vcl/group.hxx>
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index 0725959da127..fe6c362a7bbd 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -20,8 +20,6 @@
#include "mmoutputtypepage.hxx"
#include <mailmergewizard.hxx>
#include <mmconfigitem.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/messagedialog.hxx>
#include <dbui.hrc>
#include <strings.hrc>
#include <bitmaps.hlst>
@@ -29,8 +27,9 @@
#include <rtl/ref.hxx>
#include <com/sun/star/mail/XSmtpService.hpp>
-#include <vcl/svapp.hxx>
#include <vcl/idle.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/weld.hxx>
#include <cmdid.h>
#include <swunohelper.hxx>
@@ -213,30 +212,20 @@ void SwMailDispatcherListener_Impl::DeleteAttachments( uno::Reference< mail::XMa
}
}
-class SwSendWarningBox_Impl : public MessageDialog
+class SwSendWarningBox_Impl : public weld::MessageDialogController
{
- VclPtr<VclMultiLineEdit> m_pDetailED;
+ std::unique_ptr<weld::TextView> m_xDetailED;
public:
- SwSendWarningBox_Impl(vcl::Window* pParent, const OUString& rDetails);
- virtual ~SwSendWarningBox_Impl() override { disposeOnce(); }
- virtual void dispose() override
+ SwSendWarningBox_Impl(weld::Window* pParent, const OUString& rDetails)
+ : MessageDialogController(pParent, "modules/swriter/ui/warnemaildialog.ui", "WarnEmailDialog", "grid")
+ , m_xDetailED(m_xBuilder->weld_text_view("errors"))
{
- m_pDetailED.clear();
- MessageDialog::dispose();
+ m_xDetailED->set_size_request(80 * m_xDetailED->get_approximate_digit_width(),
+ 8 * m_xDetailED->get_text_height());
+ m_xDetailED->set_text(rDetails);
}
};
-SwSendWarningBox_Impl::SwSendWarningBox_Impl(vcl::Window* pParent, const OUString& rDetails)
- : MessageDialog(pParent, "WarnEmailDialog", "modules/swriter/ui/warnemaildialog.ui")
-{
- get(m_pDetailED, "errors");
- m_pDetailED->SetMaxTextWidth(80 * m_pDetailED->approximate_char_width());
- m_pDetailED->set_width_request(80 * m_pDetailED->approximate_char_width());
- m_pDetailED->set_height_request(8 * m_pDetailED->GetTextHeight());
- m_pDetailED->SetText(rDetails);
- create_message_area();
-}
-
#define ITEMID_TASK 1
#define ITEMID_STATUS 2
@@ -558,8 +547,8 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> const &
if (pError)
{
- VclPtrInstance< SwSendWarningBox_Impl > pDlg(nullptr, *pError);
- pDlg->Execute();
+ SwSendWarningBox_Impl aDlg(GetFrameWeld(), *pError);
+ aDlg.run();
}
}
diff --git a/sw/uiconfig/swriter/ui/warnemaildialog.ui b/sw/uiconfig/swriter/ui/warnemaildialog.ui
index e1a18149547d..706080e4713a 100644
--- a/sw/uiconfig/swriter/ui/warnemaildialog.ui
+++ b/sw/uiconfig/swriter/ui/warnemaildialog.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.20.2 -->
<interface domain="sw">
<requires lib="gtk+" version="3.18"/>
<object class="GtkMessageDialog" id="WarnEmailDialog">
@@ -7,6 +7,8 @@
<property name="title" translatable="yes" context="warnemaildialog|WarnEmailDialog">E-Mails could not be sent</property>
<property name="resizable">False</property>
<property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
<property name="type_hint">dialog</property>
<property name="skip_taskbar_hint">True</property>
<property name="message_type">warning</property>
@@ -30,19 +32,31 @@
</packing>
</child>
<child>
- <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <object class="GtkGrid" id="grid">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="shadow_type">in</property>
<child>
- <object class="GtkTextView" id="errors:border">
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="cursor_visible">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="errors">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</property>
+ <property name="cursor_visible">False</property>
+ </object>
+ </child>
</object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
</child>
</object>
<packing>
@@ -53,5 +67,8 @@
</child>
</object>
</child>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>
diff --git a/include/vcl/messagedialog.hxx b/vcl/inc/messagedialog.hxx
similarity index 96%
rename from include/vcl/messagedialog.hxx
rename to vcl/inc/messagedialog.hxx
index 18bfdf18abf1..09d3a909fece 100644
--- a/include/vcl/messagedialog.hxx
+++ b/vcl/inc/messagedialog.hxx
@@ -10,12 +10,10 @@
#ifndef INCLUDED_VCL_INC_MESSAGEDIALOG_HXX
#define INCLUDED_VCL_INC_MESSAGEDIALOG_HXX
-#include <vcl/dllapi.h>
-
#include <vcl/dialog.hxx>
#include <vcl/layout.hxx>
-class VCL_DLLPUBLIC MessageDialog : public Dialog
+class MessageDialog : public Dialog
{
private:
VclButtonsType m_eButtonsType;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 4945c764f8a0..62b923f98cb8 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -29,7 +29,7 @@
#include <salobj.hxx>
#include <salmenu.hxx>
#include <svdata.hxx>
-#include <vcl/messagedialog.hxx>
+#include <messagedialog.hxx>
#include <vcl/builder.hxx>
#include <vcl/combobox.hxx>
#include <vcl/lstbox.hxx>
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 1c1f63e7cdf6..8f982e435fe2 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -43,7 +43,7 @@
#include <vcl/commandinfoprovider.hxx>
#include <svdata.hxx>
#include <bitmaps.hlst>
-#include <vcl/messagedialog.hxx>
+#include <messagedialog.hxx>
#include <window.h>
#include <xmlreader/xmlreader.hxx>
#include <desktop/crashreport.hxx>
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 16aa5293f9b1..25e9fc972dbb 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -57,7 +57,7 @@
#include <vcl/uitest/logger.hxx>
#include <vcl/virdev.hxx>
#include <vcl/IDialogRenderable.hxx>
-#include <vcl/messagedialog.hxx>
+#include <messagedialog.hxx>
#include <salframe.hxx>
#include <iostream>
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 16e1db86c99d..3a01fa7611f6 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -15,7 +15,7 @@
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
-#include <vcl/messagedialog.hxx>
+#include <messagedialog.hxx>
#include <window.h>
#include <boost/multi_array.hpp>
#include <officecfg/Office/Common.hxx>
More information about the Libreoffice-commits
mailing list