[Libreoffice-commits] core.git: 2 commits - extensions/source include/vcl sc/source sfx2/source sw/source sw/uiconfig vcl/source
Caolán McNamara
caolanm at redhat.com
Sun Mar 18 12:43:56 UTC 2018
extensions/source/bibliography/bibview.cxx | 36 +++---
include/vcl/messagedialog.hxx | 6 -
include/vcl/weld.hxx | 8 +
sc/source/filter/oox/workbookfragment.cxx | 37 +++---
sc/source/ui/docshell/docsh.cxx | 60 ++++------
sc/source/ui/inc/warnbox.hxx | 3
sc/source/ui/miscdlgs/warnbox.cxx | 16 --
sfx2/source/dialog/alienwarn.cxx | 11 -
sfx2/source/inc/alienwarn.hxx | 3
sw/source/ui/dbui/mmresultdialogs.cxx | 73 ++++++-------
sw/source/ui/dialog/swmessdialog.cxx | 36 ------
sw/source/uibase/inc/swmessdialog.hxx | 20 ---
sw/uiconfig/swriter/ui/alreadyexistsdialog.ui | 144 ++++++-------------------
sw/uiconfig/swriter/ui/attachnamedialog.ui | 144 ++++++-------------------
sw/uiconfig/swriter/ui/subjectdialog.ui | 146 ++++++--------------------
vcl/source/app/salvtables.cxx | 22 +++
16 files changed, 244 insertions(+), 521 deletions(-)
New commits:
commit aaa28311ae81ee1dfdb64707c4f3f23baee80c0c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 17 21:30:52 2018 +0000
SetMessagesWidths can be private now
Change-Id: Ie7f4e0c0695774b1a7b85ca7b42247fd8db76d27
Reviewed-on: https://gerrit.libreoffice.org/51477
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/include/vcl/messagedialog.hxx b/include/vcl/messagedialog.hxx
index f7fc3c98bc9b..18bfdf18abf1 100644
--- a/include/vcl/messagedialog.hxx
+++ b/include/vcl/messagedialog.hxx
@@ -31,6 +31,9 @@ private:
OUString m_sSecondaryString;
void create_owned_areas();
+ static void SetMessagesWidths(vcl::Window const* pParent, VclMultiLineEdit* pPrimaryMessage,
+ VclMultiLineEdit* pSecondaryMessage);
+
friend class VclPtr<MessageDialog>;
MessageDialog(vcl::Window* pParent, WinBits nStyle);
@@ -49,9 +52,6 @@ public:
void create_message_area();
VclContainer* get_message_area() const { return m_pMessageBox.get(); }
-
- static void SetMessagesWidths(vcl::Window const* pParent, VclMultiLineEdit* pPrimaryMessage,
- VclMultiLineEdit* pSecondaryMessage);
};
#endif
commit 2fb266bb77722cd45af7346e99a8f214c3f8b198
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Mar 16 20:35:23 2018 +0000
unify the message dialogs with extra widgets cases
Change-Id: I9ad3573b15d24c3d1737b9f450792952ae20a31b
Reviewed-on: https://gerrit.libreoffice.org/51476
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/extensions/source/bibliography/bibview.cxx b/extensions/source/bibliography/bibview.cxx
index 308c37ca4f24..c8e87a954dfe 100644
--- a/extensions/source/bibliography/bibview.cxx
+++ b/extensions/source/bibliography/bibview.cxx
@@ -41,6 +41,21 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
+namespace
+{
+ class MessageWithCheck : public weld::MessageDialogController
+ {
+ private:
+ std::unique_ptr<weld::CheckButton> m_xWarningOnBox;
+ public:
+ MessageWithCheck(weld::Window *pParent)
+ : weld::MessageDialogController(pParent, "modules/sbibliography/ui/querydialog.ui", "QueryDialog", "ask")
+ , m_xWarningOnBox(m_xBuilder->weld_check_button("ask"))
+ {
+ }
+ bool get_active() const { return m_xWarningOnBox->get_active(); }
+ };
+}
namespace bib
{
@@ -139,24 +154,11 @@ namespace bib
sErrorString += "\n";
sErrorString += BibResId(RID_MAP_QUESTION);
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/sbibliography/ui/querydialog.ui"));
- std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("QueryDialog"));
- xQueryBox->set_primary_text(sErrorString);
- std::unique_ptr<weld::CheckButton> xWarningOnBox(xBuilder->weld_check_button("ask"));
-
- //fdo#75121, a bit tricky because the widgets we want to align with
- //don't actually exist in the ui description, they're implied
- std::unique_ptr<weld::Container> xOrigParent(xWarningOnBox->weld_parent());
- std::unique_ptr<weld::Container> xContentArea(xQueryBox->weld_message_area());
- xOrigParent->remove(xWarningOnBox.get());
- xContentArea->add(xWarningOnBox.get());
-
- short nResult = xQueryBox->run();
- BibModul::GetConfig()->SetShowColumnAssignmentWarning(!xWarningOnBox->get_active());
+ MessageWithCheck aQueryBox(GetFrameWeld());
+ aQueryBox.set_primary_text(sErrorString);
- //put them back as they were
- xContentArea->remove(xWarningOnBox.get());
- xOrigParent->add(xWarningOnBox.get());
+ short nResult = aQueryBox.run();
+ BibModul::GetConfig()->SetShowColumnAssignmentWarning(!aQueryBox.get_active());
if( RET_YES != nResult )
{
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index eb1f8501cf04..b6c635e89e57 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -613,13 +613,19 @@ private:
protected:
std::unique_ptr<weld::Builder> m_xBuilder;
std::unique_ptr<weld::MessageDialog> m_xDialog;
+ std::unique_ptr<weld::Container> m_xContentArea;
+ std::unique_ptr<weld::Widget> m_xRelocate;
+ std::unique_ptr<weld::Container> m_xOrigParent;
public:
MessageDialogController(weld::Widget* pParent, const OUString& rUIFile,
- const OString& rDialogId);
+ const OString& rDialogId, const OString& rRelocateId = OString());
~MessageDialogController() override;
void set_title(const OUString& rTitle) { m_xDialog->set_title(rTitle); }
void set_help_id(const OString& rHelpId) { m_xDialog->set_help_id(rHelpId); }
+ void set_primary_text(const OUString& rText) { m_xDialog->set_primary_text(rText); }
+ OUString get_primary_text() const { return m_xDialog->get_primary_text(); }
+ void set_default_response(int response) { m_xDialog->set_default_response(response); }
};
}
#endif
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 7a57a2a04402..d1fef597ae2f 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -516,6 +516,19 @@ ScDocShell& getDocShell(const ScDocument& rDoc)
return static_cast<ScDocShell&>(*rDoc.GetDocumentShell());
}
+class MessageWithCheck : public weld::MessageDialogController
+{
+private:
+ std::unique_ptr<weld::CheckButton> m_xWarningOnBox;
+public:
+ MessageWithCheck(weld::Window *pParent, const OUString& rUIFile, const OString& rDialogId)
+ : weld::MessageDialogController(pParent, rUIFile, rDialogId, "ask")
+ , m_xWarningOnBox(m_xBuilder->weld_check_button("ask"))
+ {
+ }
+ bool get_active() const { return m_xWarningOnBox->get_active(); }
+};
+
}
void WorkbookFragment::recalcFormulaCells()
@@ -534,27 +547,13 @@ void WorkbookFragment::recalcFormulaCells()
// Ask the user if full re-calculation is desired.
vcl::Window* pWin = ScDocShell::GetActiveDialogParent();
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWin ? pWin->GetFrameWeld() : nullptr,
- "modules/scalc/ui/recalcquerydialog.ui"));
- std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("RecalcQueryDialog"));
- xQueryBox->set_primary_text(ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
- xQueryBox->set_default_response(RET_YES);
- std::unique_ptr<weld::CheckButton> xWarningOnBox(xBuilder->weld_check_button("ask"));
-
- //fdo#75121, a bit tricky because the widgets we want to align with
- //don't actually exist in the ui description, they're implied
- std::unique_ptr<weld::Container> xOrigParent(xWarningOnBox->weld_parent());
- std::unique_ptr<weld::Container> xContentArea(xQueryBox->weld_message_area());
- xOrigParent->remove(xWarningOnBox.get());
- xContentArea->add(xWarningOnBox.get());
-
- bHardRecalc = xQueryBox->run() == RET_YES;
+ MessageWithCheck aQueryBox(pWin ? pWin->GetFrameWeld() : nullptr, "modules/scalc/ui/recalcquerydialog.ui", "RecalcQueryDialog");
+ aQueryBox.set_primary_text(ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
+ aQueryBox.set_default_response(RET_YES);
- //put them back as they were
- xContentArea->remove(xWarningOnBox.get());
- xOrigParent->add(xWarningOnBox.get());
+ bHardRecalc = aQueryBox.run() == RET_YES;
- if (xWarningOnBox->get_active())
+ if (aQueryBox.get_active())
{
// Always perform selected action in the future.
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index ec9505da8840..e59ee43400e8 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -428,6 +428,19 @@ void processDataStream( ScDocShell& rShell, const sc::ImportPostProcessData& rDa
rMgr.setDataStream(pStrm);
}
+class MessageWithCheck : public weld::MessageDialogController
+{
+private:
+ std::unique_ptr<weld::CheckButton> m_xWarningOnBox;
+public:
+ MessageWithCheck(weld::Window *pParent, const OUString& rUIFile, const OString& rDialogId)
+ : weld::MessageDialogController(pParent, rUIFile, rDialogId, "ask")
+ , m_xWarningOnBox(m_xBuilder->weld_check_button("ask"))
+ {
+ }
+ bool get_active() const { return m_xWarningOnBox->get_active(); }
+};
+
}
bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const css::uno::Reference< css::embed::XStorage >& xStor )
@@ -475,27 +488,14 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const css::uno::Reference< css
// full re-calculation.
vcl::Window* pWin = GetActiveDialogParent();
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWin ? pWin->GetFrameWeld() : nullptr,
- "modules/scalc/ui/recalcquerydialog.ui"));
- std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("RecalcQueryDialog"));
- xQueryBox->set_primary_text(ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS));
- xQueryBox->set_default_response(RET_YES);
- std::unique_ptr<weld::CheckButton> xWarningOnBox(xBuilder->weld_check_button("ask"));
-
- //fdo#75121, a bit tricky because the widgets we want to align with
- //don't actually exist in the ui description, they're implied
- std::unique_ptr<weld::Container> xOrigParent(xWarningOnBox->weld_parent());
- std::unique_ptr<weld::Container> xContentArea(xQueryBox->weld_message_area());
- xOrigParent->remove(xWarningOnBox.get());
- xContentArea->add(xWarningOnBox.get());
-
- bHardRecalc = xQueryBox->run() == RET_YES;
+ MessageWithCheck aQueryBox(pWin ? pWin->GetFrameWeld() : nullptr,
+ "modules/scalc/ui/recalcquerydialog.ui", "RecalcQueryDialog");
+ aQueryBox.set_primary_text(ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS));
+ aQueryBox.set_default_response(RET_YES);
- //put them back as they were
- xContentArea->remove(xWarningOnBox.get());
- xOrigParent->add(xWarningOnBox.get());
+ bHardRecalc = aQueryBox.run() == RET_YES;
- if (xWarningOnBox->get_active())
+ if (aQueryBox.get_active())
{
// Always perform selected action in the future.
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
@@ -725,25 +725,11 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
vcl::Window* pWin = ScDocShell::GetActiveDialogParent();
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWin ? pWin->GetFrameWeld() : nullptr,
- "modules/scalc/ui/sharedwarningdialog.ui"));
- std::unique_ptr<weld::MessageDialog> xWarningBox(xBuilder->weld_message_dialog("SharedWarningDialog"));
- std::unique_ptr<weld::CheckButton> xWarningOnBox(xBuilder->weld_check_button("ask"));
-
- //fdo#75121, a bit tricky because the widgets we want to align with
- //don't actually exist in the ui description, they're implied
- std::unique_ptr<weld::Container> xOrigParent(xWarningOnBox->weld_parent());
- std::unique_ptr<weld::Container> xContentArea(xWarningBox->weld_message_area());
- xOrigParent->remove(xWarningOnBox.get());
- xContentArea->add(xWarningOnBox.get());
-
- xWarningBox->run();
-
- //put them back as they were
- xContentArea->remove(xWarningOnBox.get());
- xOrigParent->add(xWarningOnBox.get());
+ MessageWithCheck aWarningBox(pWin ? pWin->GetFrameWeld() : nullptr,
+ "modules/scalc/ui/sharedwarningdialog.ui", "SharedWarningDialog");
+ aWarningBox.run();
- bool bChecked = xWarningOnBox->get_active();
+ bool bChecked = aWarningBox.get_active();
if (bChecked)
{
aAppOptions.SetShowSharedDocumentWarning( !bChecked );
diff --git a/sc/source/ui/inc/warnbox.hxx b/sc/source/ui/inc/warnbox.hxx
index 54bdd269ebeb..02fea50e181a 100644
--- a/sc/source/ui/inc/warnbox.hxx
+++ b/sc/source/ui/inc/warnbox.hxx
@@ -27,11 +27,8 @@
class ScReplaceWarnBox : public weld::MessageDialogController
{
std::unique_ptr<weld::CheckButton> m_xWarningOnBox;
- std::unique_ptr<weld::Container> m_xOrigParent;
- std::unique_ptr<weld::Container> m_xContentArea;
public:
ScReplaceWarnBox(weld::Window* pParent);
- virtual ~ScReplaceWarnBox() override;
/** Opens dialog if IsDialogEnabled() returns true.
@descr If after executing the dialog the checkbox "Do not show again" is set,
diff --git a/sc/source/ui/miscdlgs/warnbox.cxx b/sc/source/ui/miscdlgs/warnbox.cxx
index bc0302c4bcbd..279639c7996f 100644
--- a/sc/source/ui/miscdlgs/warnbox.cxx
+++ b/sc/source/ui/miscdlgs/warnbox.cxx
@@ -27,26 +27,12 @@
ScReplaceWarnBox::ScReplaceWarnBox(weld::Window* pParent)
: MessageDialogController(pParent, "modules/scalc/ui/checkwarningdialog.ui",
- "CheckWarningDialog")
+ "CheckWarningDialog", "ask")
// By default, the check box is ON, and the user needs to un-check it to
// disable all future warnings.
, m_xWarningOnBox(m_xBuilder->weld_check_button("ask"))
- , m_xOrigParent(m_xWarningOnBox->weld_parent())
- , m_xContentArea(m_xDialog->weld_message_area())
{
m_xDialog->set_default_response(RET_YES);
-
- //fdo#75121, a bit tricky because the widgets we want to align with
- //don't actually exist in the ui description, they're implied
- m_xOrigParent->remove(m_xWarningOnBox.get());
- m_xContentArea->add(m_xWarningOnBox.get());
-}
-
-ScReplaceWarnBox::~ScReplaceWarnBox()
-{
- //put them back as they were
- m_xContentArea->remove(m_xWarningOnBox.get());
- m_xOrigParent->add(m_xWarningOnBox.get());
}
short ScReplaceWarnBox::execute()
diff --git a/sfx2/source/dialog/alienwarn.cxx b/sfx2/source/dialog/alienwarn.cxx
index d9eeed1bd956..d5b45ba091a6 100644
--- a/sfx2/source/dialog/alienwarn.cxx
+++ b/sfx2/source/dialog/alienwarn.cxx
@@ -27,18 +27,11 @@
SfxAlienWarningDialog::SfxAlienWarningDialog(weld::Window* pParent, const OUString& _rFormatName,
const OUString& _rDefaultExtension, bool rDefaultIsAlien)
- : MessageDialogController(pParent, "sfx/ui/alienwarndialog.ui", "AlienWarnDialog")
+ : MessageDialogController(pParent, "sfx/ui/alienwarndialog.ui", "AlienWarnDialog", "ask")
, m_xKeepCurrentBtn(m_xBuilder->weld_button("save"))
, m_xUseDefaultFormatBtn(m_xBuilder->weld_button("cancel"))
, m_xWarningOnBox(m_xBuilder->weld_check_button("ask"))
- , m_xOrigParent(m_xWarningOnBox->weld_parent())
- , m_xContentArea(m_xDialog->weld_message_area())
{
- //fdo#75121, a bit tricky because the widgets we want to align with
- //don't actually exist in the ui description, they're implied
- m_xOrigParent->remove(m_xWarningOnBox.get());
- m_xContentArea->add(m_xWarningOnBox.get());
-
OUString aExtension = "ODF";
// replace formatname (text)
@@ -70,8 +63,6 @@ SfxAlienWarningDialog::SfxAlienWarningDialog(weld::Window* pParent, const OUStri
SfxAlienWarningDialog::~SfxAlienWarningDialog()
{
- m_xContentArea->remove(m_xWarningOnBox.get());
- m_xOrigParent->add(m_xWarningOnBox.get());
// save value of "warning off" checkbox, if necessary
SvtSaveOptions aSaveOpt;
bool bChecked = m_xWarningOnBox->get_active();
diff --git a/sfx2/source/inc/alienwarn.hxx b/sfx2/source/inc/alienwarn.hxx
index 5b93430882d8..eeda0fedfe1d 100644
--- a/sfx2/source/inc/alienwarn.hxx
+++ b/sfx2/source/inc/alienwarn.hxx
@@ -28,9 +28,6 @@ private:
std::unique_ptr<weld::Button> m_xUseDefaultFormatBtn;
std::unique_ptr<weld::CheckButton> m_xWarningOnBox;
- std::unique_ptr<weld::Container> m_xOrigParent;
- std::unique_ptr<weld::Container> m_xContentArea;
-
public:
SfxAlienWarningDialog(weld::Window* pParent, const OUString& _rFormatName,
const OUString& _rDefaultExtension, bool rDefaultIsAlien);
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx
index 708f4718b6e9..732cc26ae4ed 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -120,74 +120,73 @@ static OUString lcl_GetColumnValueOf(const OUString& rColumn, Reference < contai
class SwSaveWarningBox_Impl : public SwMessageAndEditDialog
{
- DECL_LINK( ModifyHdl, Edit&, void);
+ DECL_LINK( ModifyHdl, weld::Entry&, void);
public:
- SwSaveWarningBox_Impl(vcl::Window* pParent, const OUString& rFileName);
+ SwSaveWarningBox_Impl(weld::Window* pParent, const OUString& rFileName);
OUString GetFileName() const
{
- return m_pEdit->GetText();
+ return m_xEdit->get_text();
}
};
class SwSendQueryBox_Impl : public SwMessageAndEditDialog
{
bool bIsEmptyAllowed;
- DECL_LINK( ModifyHdl, Edit&, void);
+ DECL_LINK( ModifyHdl, weld::Entry&, void);
public:
- SwSendQueryBox_Impl(vcl::Window* pParent, const OUString& rID,
+ SwSendQueryBox_Impl(weld::Window* pParent, const OString& rID,
const OUString& rUIXMLDescription);
void SetValue(const OUString& rSet)
{
- m_pEdit->SetText(rSet);
- ModifyHdl(*m_pEdit);
+ m_xEdit->set_text(rSet);
+ ModifyHdl(*m_xEdit);
}
OUString GetValue() const
{
- return m_pEdit->GetText();
+ return m_xEdit->get_text();
}
void SetIsEmptyTextAllowed(bool bSet)
{
bIsEmptyAllowed = bSet;
- ModifyHdl(*m_pEdit);
+ ModifyHdl(*m_xEdit);
}
};
-SwSaveWarningBox_Impl::SwSaveWarningBox_Impl(vcl::Window* pParent, const OUString& rFileName)
+SwSaveWarningBox_Impl::SwSaveWarningBox_Impl(weld::Window* pParent, const OUString& rFileName)
: SwMessageAndEditDialog(pParent, "AlreadyExistsDialog",
"modules/swriter/ui/alreadyexistsdialog.ui")
{
- m_pEdit->SetText(rFileName);
- m_pEdit->SetModifyHdl(LINK(this, SwSaveWarningBox_Impl, ModifyHdl));
+ m_xEdit->set_text(rFileName);
+ m_xEdit->connect_changed(LINK(this, SwSaveWarningBox_Impl, ModifyHdl));
INetURLObject aTmp(rFileName);
- m_pPrimaryMessage->SetText(m_pPrimaryMessage->GetText().replaceAll("%1", aTmp.getName(
+ m_xDialog->set_primary_text(m_xDialog->get_primary_text().replaceAll("%1", aTmp.getName(
INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset)));
- ModifyHdl(*m_pEdit);
+ ModifyHdl(*m_xEdit);
}
-IMPL_LINK( SwSaveWarningBox_Impl, ModifyHdl, Edit&, rEdit, void)
+IMPL_LINK( SwSaveWarningBox_Impl, ModifyHdl, weld::Entry&, rEdit, void)
{
- m_pOKPB->Enable(!rEdit.GetText().isEmpty());
+ m_xOKPB->set_sensitive(!rEdit.get_text().isEmpty());
}
-SwSendQueryBox_Impl::SwSendQueryBox_Impl(vcl::Window* pParent, const OUString& rID,
+SwSendQueryBox_Impl::SwSendQueryBox_Impl(weld::Window* pParent, const OString& rID,
const OUString& rUIXMLDescription)
: SwMessageAndEditDialog(pParent, rID, rUIXMLDescription)
, bIsEmptyAllowed(true)
{
- m_pImageIM->SetImage(GetStandardQueryBoxImage());
- m_pEdit->SetModifyHdl(LINK(this, SwSendQueryBox_Impl, ModifyHdl));
- ModifyHdl(*m_pEdit);
+ m_xEdit->connect_changed(LINK(this, SwSendQueryBox_Impl, ModifyHdl));
+ ModifyHdl(*m_xEdit);
}
-IMPL_LINK( SwSendQueryBox_Impl, ModifyHdl, Edit&, rEdit, void)
+IMPL_LINK( SwSendQueryBox_Impl, ModifyHdl, weld::Entry&, rEdit, void)
{
- m_pOKPB->Enable(bIsEmptyAllowed || !rEdit.GetText().isEmpty());
+ m_xOKPB->set_sensitive(bIsEmptyAllowed || !rEdit.get_text().isEmpty());
}
class SwCopyToDialog : public SfxModalDialog
@@ -734,9 +733,9 @@ IMPL_LINK(SwMMResultSaveDialog, SaveOutputHdl_Impl, Button*, pButton, void)
if(bFailed)
{
- ScopedVclPtrInstance< SwSaveWarningBox_Impl > aWarning( pButton, sOutPath );
- if(RET_OK == aWarning->Execute())
- sOutPath = aWarning->GetFileName();
+ std::unique_ptr<SwSaveWarningBox_Impl> xWarning(new SwSaveWarningBox_Impl(pButton->GetFrameWeld(), sOutPath));
+ if (RET_OK == xWarning->run())
+ sOutPath = xWarning->GetFileName();
else
{
xTempDocShell->DoClose();
@@ -1011,26 +1010,26 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void)
if(m_pSubjectED->GetText().isEmpty())
{
- ScopedVclPtrInstance<SwSendQueryBox_Impl> aQuery(pButton, "SubjectDialog",
- "modules/swriter/ui/subjectdialog.ui");
- aQuery->SetIsEmptyTextAllowed(true);
- aQuery->SetValue("");
- if(RET_OK == aQuery->Execute())
+ std::unique_ptr<SwSendQueryBox_Impl> xQuery(new SwSendQueryBox_Impl(pButton->GetFrameWeld(), "SubjectDialog",
+ "modules/swriter/ui/subjectdialog.ui"));
+ xQuery->SetIsEmptyTextAllowed(true);
+ xQuery->SetValue("");
+ if(RET_OK == xQuery->run())
{
- if(!aQuery->GetValue().isEmpty())
- m_pSubjectED->SetText(aQuery->GetValue());
+ if(!xQuery->GetValue().isEmpty())
+ m_pSubjectED->SetText(xQuery->GetValue());
}
else
return; // back to the dialog
}
if(!bAsBody && m_pAttachmentED->GetText().isEmpty())
{
- ScopedVclPtrInstance<SwSendQueryBox_Impl> aQuery(pButton, "AttachNameDialog",
- "modules/swriter/ui/attachnamedialog.ui");
- aQuery->SetIsEmptyTextAllowed(false);
- if(RET_OK == aQuery->Execute())
+ std::unique_ptr<SwSendQueryBox_Impl> xQuery(new SwSendQueryBox_Impl(pButton->GetFrameWeld(), "AttachNameDialog",
+ "modules/swriter/ui/attachnamedialog.ui"));
+ xQuery->SetIsEmptyTextAllowed(false);
+ if (RET_OK == xQuery->run())
{
- OUString sAttach(aQuery->GetValue());
+ OUString sAttach(xQuery->GetValue());
sal_Int32 nTokenCount = comphelper::string::getTokenCount(sAttach, '.');
if (2 > nTokenCount)
{
diff --git a/sw/source/ui/dialog/swmessdialog.cxx b/sw/source/ui/dialog/swmessdialog.cxx
index 85ad95643832..d244dd7b8392 100644
--- a/sw/source/ui/dialog/swmessdialog.cxx
+++ b/sw/source/ui/dialog/swmessdialog.cxx
@@ -8,41 +8,13 @@
*/
#include <swmessdialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/messagedialog.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/vclmedit.hxx>
-SwMessageAndEditDialog::SwMessageAndEditDialog(vcl::Window* pParent, const OUString& rID,
+SwMessageAndEditDialog::SwMessageAndEditDialog(weld::Window* pParent, const OString& rID,
const OUString& rUIXMLDescription)
- : ModalDialog(pParent, rID, rUIXMLDescription)
+ : MessageDialogController(pParent, rUIXMLDescription, rID, "grid")
+ , m_xEdit(m_xBuilder->weld_entry("edit"))
+ , m_xOKPB(m_xBuilder->weld_button("ok"))
{
- get(m_pOKPB, "ok");
- get(m_pPrimaryMessage, "primarymessage");
- m_pPrimaryMessage->SetPaintTransparent(true);
- get(m_pSecondaryMessage, "secondarymessage");
- m_pSecondaryMessage->SetPaintTransparent(true);
- MessageDialog::SetMessagesWidths(this, m_pPrimaryMessage, m_pSecondaryMessage);
- get(m_pImageIM, "image");
- m_pImageIM->SetImage(GetStandardWarningBoxImage());
- get(m_pEdit, "edit");
-}
-
-SwMessageAndEditDialog::~SwMessageAndEditDialog()
-{
- disposeOnce();
-}
-
-void SwMessageAndEditDialog::dispose()
-{
- m_pOKPB.clear();
- m_pImageIM.clear();
- m_pPrimaryMessage.clear();
- m_pSecondaryMessage.clear();
- m_pEdit.clear();
- ModalDialog::dispose();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/swmessdialog.hxx b/sw/source/uibase/inc/swmessdialog.hxx
index cc5315f4df49..0c95e5e6a4b6 100644
--- a/sw/source/uibase/inc/swmessdialog.hxx
+++ b/sw/source/uibase/inc/swmessdialog.hxx
@@ -10,26 +10,16 @@
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_SWMESSDIALOG_HXX
#define INCLUDED_SW_SOURCE_UIBASE_INC_SWMESSDIALOG_HXX
-#include <vcl/dialog.hxx>
+#include <vcl/weld.hxx>
-class Edit;
-class FixedImage;
-class OKButton;
-class VclMultiLineEdit;
-
-class SwMessageAndEditDialog : public ModalDialog
+class SwMessageAndEditDialog : public weld::MessageDialogController
{
protected:
- VclPtr<OKButton> m_pOKPB;
- VclPtr<FixedImage> m_pImageIM;
- VclPtr<VclMultiLineEdit> m_pPrimaryMessage;
- VclPtr<VclMultiLineEdit> m_pSecondaryMessage;
- VclPtr<Edit> m_pEdit;
+ std::unique_ptr<weld::Entry> m_xEdit;
+ std::unique_ptr<weld::Button> m_xOKPB;
public:
- SwMessageAndEditDialog(vcl::Window* pParent, const OUString& rID,
+ SwMessageAndEditDialog(weld::Window* pParent, const OString& rID,
const OUString& rUIXMLDescription);
- virtual ~SwMessageAndEditDialog() override;
- virtual void dispose() override;
};
#endif // INCLUDED_SW_SOURCE_UIBASE_INC_SWMESSDIALOG_HXX
diff --git a/sw/uiconfig/swriter/ui/alreadyexistsdialog.ui b/sw/uiconfig/swriter/ui/alreadyexistsdialog.ui
index db9d47db0a10..c91eb989ee71 100644
--- a/sw/uiconfig/swriter/ui/alreadyexistsdialog.ui
+++ b/sw/uiconfig/swriter/ui/alreadyexistsdialog.ui
@@ -1,53 +1,50 @@
<?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="GtkTextBuffer" id="textbuffer1">
- <property name="text" translatable="yes" context="alreadyexistsdialog|textbuffer1">A document with the name '%1' already exists.</property>
- </object>
- <object class="GtkTextBuffer" id="textbuffer2">
- <property name="text" translatable="yes" context="alreadyexistsdialog|textbuffer2">Please save this document under a different name.</property>
- </object>
- <object class="GtkDialog" id="AlreadyExistsDialog">
+ <object class="GtkMessageDialog" id="AlreadyExistsDialog">
<property name="can_focus">False</property>
- <property name="border_width">6</property>
<property name="title" translatable="yes" context="alreadyexistsdialog|AlreadyExistsDialog">File already exists</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
<property name="type_hint">dialog</property>
+ <property name="message_type">warning</property>
+ <property name="text" translatable="yes" context="alreadyexistsdialog|textbuffer1">A document with the name '%1' already exists.</property>
+ <property name="secondary_text" translatable="yes" context="alreadyexistsdialog|textbuffer2">Please save this document under a different name.</property>
<child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox1">
+ <object class="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">24</property>
<child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
+ <object class="GtkButtonBox">
<property name="can_focus">False</property>
- <property name="layout_style">end</property>
<child>
- <object class="GtkButton" id="ok">
- <property name="label">gtk-ok</property>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="cancel">
- <property name="label">gtk-cancel</property>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
@@ -55,127 +52,56 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkGrid" id="grid1">
+ <object class="GtkGrid" id="grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="row_spacing">12</property>
- <property name="column_spacing">12</property>
+ <property name="row_spacing">7</property>
<child>
- <object class="GtkGrid" id="grid2">
+ <object class="GtkEntry" id="edit1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="row_spacing">6</property>
- <child>
- <object class="GtkTextView" id="primarymessage">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="editable">False</property>
- <property name="wrap_mode">word</property>
- <property name="cursor_visible">False</property>
- <property name="buffer">textbuffer1</property>
- <property name="accepts_tab">False</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTextView" id="secondarymessage">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="editable">False</property>
- <property name="wrap_mode">word</property>
- <property name="cursor_visible">False</property>
- <property name="buffer">textbuffer2</property>
- <property name="accepts_tab">False</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="grid3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<property name="hexpand">True</property>
- <property name="row_spacing">7</property>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes" context="alreadyexistsdialog|label1">New document name:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">edit</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="edit">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
+ <property name="activates_default">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
+ <property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
- <object class="GtkImage" id="image">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">center</property>
- <property name="valign">start</property>
- <property name="icon-size">6</property>
+ <property name="label" translatable="yes" context="subjectdialog|label1">Subject:</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="height">2</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
</child>
<action-widgets>
- <action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget>
+ <action-widget response="-5">ok</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>
diff --git a/sw/uiconfig/swriter/ui/attachnamedialog.ui b/sw/uiconfig/swriter/ui/attachnamedialog.ui
index b1f4b8aa3fd3..5716a0fa6b00 100644
--- a/sw/uiconfig/swriter/ui/attachnamedialog.ui
+++ b/sw/uiconfig/swriter/ui/attachnamedialog.ui
@@ -1,53 +1,50 @@
<?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="GtkTextBuffer" id="textbuffer1">
- <property name="text" translatable="yes" context="attachnamedialog|textbuffer1">You did not specify a new name for the attachment.</property>
- </object>
- <object class="GtkTextBuffer" id="textbuffer2">
- <property name="text" translatable="yes" context="attachnamedialog|textbuffer2">If you would like to provide one, please type it now.</property>
- </object>
- <object class="GtkDialog" id="AttachNameDialog">
+ <object class="GtkMessageDialog" id="AttachNameDialog">
<property name="can_focus">False</property>
- <property name="border_width">6</property>
<property name="title" translatable="yes" context="attachnamedialog|AttachNameDialog">No Attachment Name</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
<property name="type_hint">dialog</property>
+ <property name="message_type">question</property>
+ <property name="text" translatable="yes" context="attachnamedialog|textbuffer1">You did not specify a new name for the attachment.</property>
+ <property name="secondary_text" translatable="yes" context="attachnamedialog|textbuffer2">If you would like to provide one, please type it now.</property>
<child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox1">
+ <object class="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">24</property>
<child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
+ <object class="GtkButtonBox">
<property name="can_focus">False</property>
- <property name="layout_style">end</property>
<child>
- <object class="GtkButton" id="ok">
- <property name="label">gtk-ok</property>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="cancel">
- <property name="label">gtk-cancel</property>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
@@ -55,127 +52,56 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkGrid" id="grid1">
+ <object class="GtkGrid" id="grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="row_spacing">12</property>
- <property name="column_spacing">12</property>
+ <property name="row_spacing">7</property>
<child>
- <object class="GtkGrid" id="grid2">
+ <object class="GtkEntry" id="edit1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="row_spacing">6</property>
- <child>
- <object class="GtkTextView" id="primarymessage">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="editable">False</property>
- <property name="wrap_mode">word</property>
- <property name="cursor_visible">False</property>
- <property name="buffer">textbuffer1</property>
- <property name="accepts_tab">False</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTextView" id="secondarymessage">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="editable">False</property>
- <property name="wrap_mode">word</property>
- <property name="cursor_visible">False</property>
- <property name="buffer">textbuffer2</property>
- <property name="accepts_tab">False</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="grid3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<property name="hexpand">True</property>
- <property name="row_spacing">7</property>
- <child>
- <object class="GtkEntry" id="edit">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes" context="attachnamedialog|label1">Name:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">edit</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
+ <property name="activates_default">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
+ <property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
- <object class="GtkImage" id="image">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">center</property>
- <property name="valign">start</property>
- <property name="icon-size">6</property>
+ <property name="label" translatable="yes" context="attachnamedialog|label1">Name:</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="height">2</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
</child>
<action-widgets>
- <action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget>
+ <action-widget response="-5">ok</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>
diff --git a/sw/uiconfig/swriter/ui/subjectdialog.ui b/sw/uiconfig/swriter/ui/subjectdialog.ui
index 1f255199b03e..8fecc10b0b07 100644
--- a/sw/uiconfig/swriter/ui/subjectdialog.ui
+++ b/sw/uiconfig/swriter/ui/subjectdialog.ui
@@ -1,53 +1,51 @@
<?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="GtkTextBuffer" id="textbuffer1">
- <property name="text" translatable="yes" context="subjectdialog|textbuffer1">You did not specify a subject for this message.</property>
- </object>
- <object class="GtkTextBuffer" id="textbuffer2">
- <property name="text" translatable="yes" context="subjectdialog|textbuffer2">If you would like to provide one, please type it now.</property>
- </object>
- <object class="GtkDialog" id="SubjectDialog">
+ <object class="GtkMessageDialog" id="SubjectDialog">
<property name="can_focus">False</property>
- <property name="border_width">6</property>
<property name="title" translatable="yes" context="subjectdialog|SubjectDialog">No Subject</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
<property name="type_hint">dialog</property>
+ <property name="message_type">question</property>
+ <property name="text" translatable="yes" context="subjectdialog|textbuffer1">You did not specify a subject for this message.</property>
+ <property name="secondary_text" translatable="yes" context="subjectdialog|textbuffer2">If you would like to provide one, please type it now.</property>
<child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox1">
+ <object class="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">24</property>
<child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
+ <object class="GtkButtonBox">
<property name="can_focus">False</property>
- <property name="layout_style">end</property>
+ <property name="homogeneous">True</property>
<child>
- <object class="GtkButton" id="ok">
- <property name="label">gtk-ok</property>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
+ <property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="cancel">
- <property name="label">gtk-cancel</property>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
@@ -55,127 +53,57 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkGrid" id="grid1">
+ <object class="GtkGrid" id="grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="row_spacing">12</property>
- <property name="column_spacing">12</property>
+ <property name="row_spacing">7</property>
<child>
- <object class="GtkGrid" id="grid2">
+ <object class="GtkEntry" id="edit">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="row_spacing">6</property>
- <child>
- <object class="GtkTextView" id="primarymessage">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="editable">False</property>
- <property name="wrap_mode">word</property>
- <property name="cursor_visible">False</property>
- <property name="buffer">textbuffer1</property>
- <property name="accepts_tab">False</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTextView" id="secondarymessage">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="editable">False</property>
- <property name="wrap_mode">word</property>
- <property name="cursor_visible">False</property>
- <property name="buffer">textbuffer2</property>
- <property name="accepts_tab">False</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="grid3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<property name="hexpand">True</property>
- <property name="row_spacing">7</property>
- <child>
- <object class="GtkEntry" id="edit">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes" context="subjectdialog|label1">Subject:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">edit</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
+ <property name="activates_default">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
+ <property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
- <object class="GtkImage" id="image">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">center</property>
- <property name="valign">start</property>
- <property name="icon-size">6</property>
+ <property name="label" translatable="yes" context="subjectdialog|label1">Subject:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">edit</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="height">2</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
</child>
<action-widgets>
- <action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget>
+ <action-widget response="-5">ok</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index ed2f3b2d08cf..bb66da6b4fb5 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1598,13 +1598,31 @@ namespace weld
Dialog* MessageDialogController::getDialog() { return m_xDialog.get(); }
- MessageDialogController::MessageDialogController(weld::Widget* pParent, const OUString &rUIFile, const OString& rDialogId)
+ MessageDialogController::MessageDialogController(weld::Widget* pParent, const OUString &rUIFile, const OString& rDialogId,
+ const OString& rRelocateId)
: m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
, m_xDialog(m_xBuilder->weld_message_dialog(rDialogId))
+ , m_xContentArea(m_xDialog->weld_message_area())
{
+ if (!rRelocateId.isEmpty())
+ {
+ m_xRelocate.reset(m_xBuilder->weld_container(rRelocateId));
+ m_xOrigParent.reset(m_xRelocate->weld_parent());
+ //fdo#75121, a bit tricky because the widgets we want to align with
+ //don't actually exist in the ui description, they're implied
+ m_xOrigParent->remove(m_xRelocate.get());
+ m_xContentArea->add(m_xRelocate.get());
+ }
}
- MessageDialogController::~MessageDialogController() = default;
+ MessageDialogController::~MessageDialogController()
+ {
+ if (m_xRelocate)
+ {
+ m_xContentArea->remove(m_xRelocate.get());
+ m_xOrigParent->add(m_xRelocate.get());
+ }
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list