tdf#155503 Add title to document title dialog
Otherwise the title was just "Name" Change-Id: I883d2468c7bd97782b0aef4165a6afe4ff39ce31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156659 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
This commit is contained in:
@@ -25,7 +25,8 @@
|
||||
|*
|
||||
\************************************************************************/
|
||||
|
||||
SvxNameDialog::SvxNameDialog(weld::Window* pParent, const OUString& rName, const OUString& rDesc)
|
||||
SvxNameDialog::SvxNameDialog(weld::Window* pParent, const OUString& rName, const OUString& rDesc,
|
||||
const OUString& rTitle)
|
||||
: GenericDialogController(pParent, "cui/ui/namedialog.ui", "NameDialog")
|
||||
, m_xEdtName(m_xBuilder->weld_entry("name_entry"))
|
||||
, m_xFtDescription(m_xBuilder->weld_label("description_label"))
|
||||
@@ -36,6 +37,8 @@ SvxNameDialog::SvxNameDialog(weld::Window* pParent, const OUString& rName, const
|
||||
m_xEdtName->select_region(0, -1);
|
||||
ModifyHdl(*m_xEdtName);
|
||||
m_xEdtName->connect_changed(LINK(this, SvxNameDialog, ModifyHdl));
|
||||
if (!rTitle.isEmpty())
|
||||
set_title(rTitle);
|
||||
}
|
||||
|
||||
IMPL_LINK_NOARG(SvxNameDialog, ModifyHdl, weld::Entry&, void)
|
||||
|
@@ -1092,9 +1092,9 @@ VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateSvxEditDictionaryDia
|
||||
}
|
||||
|
||||
VclPtr<AbstractSvxNameDialog> AbstractDialogFactory_Impl::CreateSvxNameDialog(weld::Window* pParent,
|
||||
const OUString& rName, const OUString& rDesc)
|
||||
const OUString& rName, const OUString& rDesc, const OUString& rTitle)
|
||||
{
|
||||
return VclPtr<AbstractSvxNameDialog_Impl>::Create(std::make_unique<SvxNameDialog>(pParent, rName, rDesc));
|
||||
return VclPtr<AbstractSvxNameDialog_Impl>::Create(std::make_unique<SvxNameDialog>(pParent, rName, rDesc, rTitle));
|
||||
}
|
||||
|
||||
VclPtr<AbstractSvxObjectNameDialog> AbstractDialogFactory_Impl::CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName)
|
||||
|
@@ -521,7 +521,7 @@ public:
|
||||
virtual VclPtr<AbstractSvxNewDictionaryDialog> CreateSvxNewDictionaryDialog(weld::Window* pParent) override;
|
||||
virtual VclPtr<VclAbstractDialog> CreateSvxEditDictionaryDialog(weld::Window* pParent, const OUString& rName) override;
|
||||
virtual VclPtr<AbstractSvxNameDialog> CreateSvxNameDialog(weld::Window* pParent,
|
||||
const OUString& rName, const OUString& rDesc) override;
|
||||
const OUString& rName, const OUString& rDesc, const OUString& rTitle = "") override;
|
||||
// #i68101#
|
||||
virtual VclPtr<AbstractSvxObjectNameDialog> CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) override;
|
||||
virtual VclPtr<AbstractSvxObjectTitleDescDialog> CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription, bool isDecorative) override;
|
||||
|
@@ -36,7 +36,8 @@ private:
|
||||
DECL_LINK(ModifyHdl, weld::Entry&, void);
|
||||
|
||||
public:
|
||||
SvxNameDialog(weld::Window* pWindow, const OUString& rName, const OUString& rDesc);
|
||||
SvxNameDialog(weld::Window* pWindow, const OUString& rName, const OUString& rDesc,
|
||||
const OUString& rTitle = "");
|
||||
|
||||
OUString GetName() const { return m_xEdtName->get_text(); }
|
||||
|
||||
|
@@ -377,7 +377,7 @@ public:
|
||||
virtual VclPtr<AbstractSvxNewDictionaryDialog> CreateSvxNewDictionaryDialog(weld::Window* pParent) = 0;
|
||||
virtual VclPtr<VclAbstractDialog> CreateSvxEditDictionaryDialog(weld::Window* pParent, const OUString& rName) = 0;
|
||||
virtual VclPtr<AbstractSvxNameDialog> CreateSvxNameDialog(weld::Window* pParent,
|
||||
const OUString& rName, const OUString& rDesc ) = 0;
|
||||
const OUString& rName, const OUString& rDesc, const OUString& rTitle = "" ) = 0;
|
||||
|
||||
// #i68101#
|
||||
virtual VclPtr<AbstractSvxObjectNameDialog> CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) = 0;
|
||||
|
@@ -42,7 +42,8 @@
|
||||
#define STR_DOCUMENT_DEFAULT_LANGUAGE NC_("STR_DOCUMENT_DEFAULT_LANGUAGE", "Document default language is not set.")
|
||||
#define STR_STYLE_NO_LANGUAGE NC_("STR_STYLE_NO_LANGUAGE", "Style “%STYLE_NAME%” has no language set.")
|
||||
#define STR_DOCUMENT_TITLE NC_("STR_DOCUMENT_TITLE", "Document title is not set.")
|
||||
#define STR_ENTER_DOCUMENT_TITLE NC_("STR_ENTER_DOCUMENT_TITLE", "Enter document title:")
|
||||
#define STR_DOCUMENT_TITLE_DLG_TITLE NC_("STR_DOCUMENT_TITLE_DLG_TITLE", "Document title")
|
||||
#define STR_DOCUMENT_TITLE_DLG_DESC NC_("STR_DOCUMENT_TITLE_DLG_DESC", "Enter document title:")
|
||||
|
||||
#define STR_ENTER_ALT NC_("STR_ENTER_ALT", "Enter alternative text:")
|
||||
|
||||
|
@@ -235,11 +235,11 @@ void AccessibilityIssue::quickFixIssue() const
|
||||
break;
|
||||
case IssueObject::DOCUMENT_TITLE:
|
||||
{
|
||||
OUString aDesc = SwResId(STR_ENTER_DOCUMENT_TITLE);
|
||||
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
||||
SwWrtShell* pWrtShell = m_pDoc->GetDocShell()->GetWrtShell();
|
||||
ScopedVclPtr<AbstractSvxNameDialog> aNameDialog(
|
||||
pFact->CreateSvxNameDialog(pWrtShell->GetView().GetFrameWeld(), "", aDesc));
|
||||
ScopedVclPtr<AbstractSvxNameDialog> aNameDialog(pFact->CreateSvxNameDialog(
|
||||
pWrtShell->GetView().GetFrameWeld(), OUString(),
|
||||
SwResId(STR_DOCUMENT_TITLE_DLG_DESC), SwResId(STR_DOCUMENT_TITLE_DLG_TITLE)));
|
||||
if (aNameDialog->Execute() == RET_OK)
|
||||
{
|
||||
SwDocShell* pShell = m_pDoc->GetDocShell();
|
||||
|
Reference in New Issue
Block a user