diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-04-16 12:57:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-17 10:03:13 +0200 |
commit | 82fb4c66103073043d17b5cea845e35410b826f3 (patch) | |
tree | dbeee553e192880fbd6da17e3b6cd19d0bb49f5e /sw | |
parent | 66ed9797ba8f61994a187dfcc189f375dcd0cdcc (diff) |
weld SwJavaEditDialog
Change-Id: I409e66ed7446ad56933bb806093aa7f7b1d62a4e
Reviewed-on: https://gerrit.libreoffice.org/53000
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/swabstdlg.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 21 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 11 | ||||
-rw-r--r-- | sw/source/ui/fldui/javaedit.cxx | 225 | ||||
-rw-r--r-- | sw/source/uibase/inc/javaedit.hxx | 73 | ||||
-rw-r--r-- | sw/source/uibase/shells/textfld.cxx | 4 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/insertscript.ui | 212 |
7 files changed, 269 insertions, 279 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 8e35a4114fc9..862f8bb94751 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -467,7 +467,7 @@ public: virtual VclPtr<VclAbstractDialog> CreateTitlePageDlg ( vcl::Window * pParent ) = 0; virtual VclPtr<VclAbstractDialog> CreateVclSwViewDialog(SwView& rView) = 0; virtual VclPtr<AbstractInsTableDlg> CreateInsTableDlg(SwView& rView) = 0; - virtual VclPtr<AbstractJavaEditDialog> CreateJavaEditDialog(vcl::Window* pParent, + virtual VclPtr<AbstractJavaEditDialog> CreateJavaEditDialog(weld::Window* pParent, SwWrtShell* pWrtSh) = 0; virtual VclPtr<AbstractMailMergeDlg> CreateMailMergeDlg( vcl::Window* pParent, SwWrtShell& rSh, diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 7aa070b94d4c..6796a973c5dc 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -155,7 +155,11 @@ short AbstractInsTableDlg_Impl::Execute() return m_xDlg->run(); } -IMPL_ABSTDLG_BASE(AbstractJavaEditDialog_Impl); +short AbstractJavaEditDialog_Impl::Execute() +{ + return m_xDlg->run(); +} + IMPL_ABSTDLG_BASE(AbstractMailMergeDlg_Impl); IMPL_ABSTDLG_BASE(AbstractMailMergeCreateFromDlg_Impl); IMPL_ABSTDLG_BASE(AbstractMailMergeFieldConnectionsDlg_Impl); @@ -493,27 +497,27 @@ void AbstractInsTableDlg_Impl::GetValues( OUString& rName, sal_uInt16& rRow, sal OUString AbstractJavaEditDialog_Impl::GetScriptText() const { - return pDlg->GetScriptText(); + return m_xDlg->GetScriptText(); } OUString AbstractJavaEditDialog_Impl::GetScriptType() const { - return pDlg->GetScriptType(); + return m_xDlg->GetScriptType(); } bool AbstractJavaEditDialog_Impl::IsUrl() const { - return pDlg->IsUrl(); + return m_xDlg->IsUrl(); } bool AbstractJavaEditDialog_Impl::IsNew() const { - return pDlg->IsNew(); + return m_xDlg->IsNew(); } bool AbstractJavaEditDialog_Impl::IsUpdate() const { - return pDlg->IsUpdate(); + return m_xDlg->IsUpdate(); } DBManagerOptions AbstractMailMergeDlg_Impl::GetMergeType() @@ -955,10 +959,9 @@ VclPtr<AbstractInsTableDlg> SwAbstractDialogFactory_Impl::CreateInsTableDlg(SwVi } VclPtr<AbstractJavaEditDialog> SwAbstractDialogFactory_Impl::CreateJavaEditDialog( - vcl::Window* pParent, SwWrtShell* pWrtSh) + weld::Window* pParent, SwWrtShell* pWrtSh) { - VclPtr<SwJavaEditDialog> pDlg = VclPtr<SwJavaEditDialog>::Create(pParent, pWrtSh); - return VclPtr<AbstractJavaEditDialog_Impl>::Create( pDlg ); + return VclPtr<AbstractJavaEditDialog_Impl>::Create(new SwJavaEditDialog(pParent, pWrtSh)); } VclPtr<AbstractMailMergeDlg> SwAbstractDialogFactory_Impl::CreateMailMergeDlg( diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 503049b63f8b..904e005276c4 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -389,7 +389,14 @@ public: class SwJavaEditDialog; class AbstractJavaEditDialog_Impl : public AbstractJavaEditDialog { - DECL_ABSTDLG_BASE(AbstractJavaEditDialog_Impl,SwJavaEditDialog) +protected: + std::unique_ptr<SwJavaEditDialog> m_xDlg; +public: + explicit AbstractJavaEditDialog_Impl(SwJavaEditDialog* p) + : m_xDlg(p) + { + } + virtual short Execute() override; virtual OUString GetScriptText() const override; virtual OUString GetScriptType() const override; virtual bool IsUrl() const override; @@ -574,7 +581,7 @@ public: virtual VclPtr<VclAbstractDialog> CreateTitlePageDlg ( vcl::Window * pParent ) override; virtual VclPtr<VclAbstractDialog> CreateVclSwViewDialog(SwView& rView) override; virtual VclPtr<AbstractInsTableDlg> CreateInsTableDlg(SwView& rView) override; - virtual VclPtr<AbstractJavaEditDialog> CreateJavaEditDialog(vcl::Window* pParent, + virtual VclPtr<AbstractJavaEditDialog> CreateJavaEditDialog(weld::Window* pParent, SwWrtShell* pWrtSh) override; virtual VclPtr<AbstractMailMergeDlg> CreateMailMergeDlg( vcl::Window* pParent, SwWrtShell& rSh, diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx index 847e1217ee92..1088cb693d17 100644 --- a/sw/source/ui/fldui/javaedit.cxx +++ b/sw/source/ui/fldui/javaedit.cxx @@ -37,105 +37,78 @@ using namespace ::com::sun::star; -SwJavaEditDialog::SwJavaEditDialog(vcl::Window* pParent, SwWrtShell* pWrtSh) : - SvxStandardDialog(pParent, "InsertScriptDialog", "modules/swriter/ui/insertscript.ui"), - - bNew(true), - bIsUrl(false), - - pSh(pWrtSh), - pFileDlg(nullptr) +SwJavaEditDialog::SwJavaEditDialog(weld::Window* pParent, SwWrtShell* pWrtSh) + : GenericDialogController(pParent, "modules/swriter/ui/insertscript.ui", "InsertScriptDialog") + , m_bNew(true) + , m_bIsUrl(false) + , m_pSh(pWrtSh) + , m_pFileDlg(nullptr) + , m_xTypeED(m_xBuilder->weld_entry("scripttype")) + , m_xUrlRB(m_xBuilder->weld_radio_button("url")) + , m_xEditRB(m_xBuilder->weld_radio_button("text")) + , m_xUrlPB(m_xBuilder->weld_button("browse")) + , m_xUrlED(m_xBuilder->weld_entry("urlentry")) + , m_xEditED(m_xBuilder->weld_text_view("textentry")) + , m_xOKBtn(m_xBuilder->weld_button("ok")) + , m_xPrevBtn(m_xBuilder->weld_button("previous")) + , m_xNextBtn(m_xBuilder->weld_button("next")) { - get(m_pTypeED, "scripttype"); - get(m_pUrlRB, "url"); - get(m_pUrlED, "urlentry"); - get(m_pUrlPB, "browse"); - get(m_pEditRB, "text"); - get(m_pEditED, "textentry"); - - get(m_pOKBtn, "ok"); - get(m_pPrevBtn, "previous"); - get(m_pNextBtn, "next"); - // install handler - m_pPrevBtn->SetClickHdl( LINK( this, SwJavaEditDialog, PrevHdl ) ); - m_pNextBtn->SetClickHdl( LINK( this, SwJavaEditDialog, NextHdl ) ); - m_pOKBtn->SetClickHdl( LINK( this, SwJavaEditDialog, OKHdl ) ); - - Link<Button*,void> aLk = LINK(this, SwJavaEditDialog, RadioButtonHdl); - m_pUrlRB->SetClickHdl(aLk); - m_pEditRB->SetClickHdl(aLk); - m_pUrlPB->SetClickHdl(LINK(this, SwJavaEditDialog, InsertFileHdl)); + m_xPrevBtn->connect_clicked( LINK( this, SwJavaEditDialog, PrevHdl ) ); + m_xNextBtn->connect_clicked( LINK( this, SwJavaEditDialog, NextHdl ) ); + m_xOKBtn->connect_clicked( LINK( this, SwJavaEditDialog, OKHdl ) ); - vcl::Font aFont( m_pEditED->GetFont() ); - aFont.SetWeight( WEIGHT_LIGHT ); - m_pEditED->SetFont( aFont ); + Link<weld::Button&,void> aLk = LINK(this, SwJavaEditDialog, RadioButtonHdl); + m_xUrlRB->connect_clicked(aLk); + m_xEditRB->connect_clicked(aLk); + m_xUrlPB->connect_clicked(LINK(this, SwJavaEditDialog, InsertFileHdl)); - pMgr = new SwFieldMgr(pSh); - pField = static_cast<SwScriptField*>(pMgr->GetCurField()); + m_pMgr = new SwFieldMgr(m_pSh); + m_pField = static_cast<SwScriptField*>(m_pMgr->GetCurField()); - bNew = !(pField && pField->GetTyp()->Which() == SwFieldIds::Script); + m_bNew = !(m_pField && m_pField->GetTyp()->Which() == SwFieldIds::Script); CheckTravel(); - if( !bNew ) - SetText( SwResId( STR_JAVA_EDIT ) ); + if (!m_bNew) + m_xDialog->set_title(SwResId(STR_JAVA_EDIT)); - RadioButtonHdl(nullptr); + RadioButtonHdl(*m_xUrlRB); } SwJavaEditDialog::~SwJavaEditDialog() { - disposeOnce(); + m_pSh->EnterStdMode(); + delete m_pMgr; + delete m_pFileDlg; } -void SwJavaEditDialog::dispose() +IMPL_LINK_NOARG(SwJavaEditDialog, PrevHdl, weld::Button&, void) { - pSh->EnterStdMode(); - delete pMgr; - delete pFileDlg; - m_pTypeED.clear(); - m_pUrlRB.clear(); - m_pEditRB.clear(); - m_pUrlPB.clear(); - m_pUrlED.clear(); - m_pEditED.clear(); - m_pOKBtn.clear(); - m_pPrevBtn.clear(); - m_pNextBtn.clear(); - SvxStandardDialog::dispose(); -} - -IMPL_LINK_NOARG(SwJavaEditDialog, PrevHdl, Button*, void) -{ - pSh->EnterStdMode(); + m_pSh->EnterStdMode(); SetField(); - pMgr->GoPrev(); - pField = static_cast<SwScriptField*>(pMgr->GetCurField()); + m_pMgr->GoPrev(); + m_pField = static_cast<SwScriptField*>(m_pMgr->GetCurField()); CheckTravel(); - RadioButtonHdl(nullptr); + RadioButtonHdl(*m_xUrlRB); } -IMPL_LINK_NOARG(SwJavaEditDialog, NextHdl, Button*, void) +IMPL_LINK_NOARG(SwJavaEditDialog, NextHdl, weld::Button&, void) { - pSh->EnterStdMode(); + m_pSh->EnterStdMode(); SetField(); - pMgr->GoNext(); - pField = static_cast<SwScriptField*>(pMgr->GetCurField()); + m_pMgr->GoNext(); + m_pField = static_cast<SwScriptField*>(m_pMgr->GetCurField()); CheckTravel(); - RadioButtonHdl(nullptr); + RadioButtonHdl(*m_xUrlRB); } -IMPL_LINK_NOARG(SwJavaEditDialog, OKHdl, Button*, void) +IMPL_LINK_NOARG(SwJavaEditDialog, OKHdl, weld::Button&, void) { SetField(); - EndDialog( RET_OK ); -} - -void SwJavaEditDialog::Apply() -{ + m_xDialog->response(RET_OK); } void SwJavaEditDialog::CheckTravel() @@ -143,135 +116,135 @@ void SwJavaEditDialog::CheckTravel() bool bTravel = false; bool bNext(false), bPrev(false); - if(!bNew) + if (!m_bNew) { // Traveling only when more than one field - pSh->StartAction(); - pSh->CreateCursor(); + m_pSh->StartAction(); + m_pSh->CreateCursor(); - bNext = pMgr->GoNext(); + bNext = m_pMgr->GoNext(); if( bNext ) - pMgr->GoPrev(); + m_pMgr->GoPrev(); - bPrev = pMgr->GoPrev(); + bPrev = m_pMgr->GoPrev(); if( bPrev ) - pMgr->GoNext(); + m_pMgr->GoNext(); bTravel |= bNext || bPrev; - pSh->DestroyCursor(); - pSh->EndAction(); + m_pSh->DestroyCursor(); + m_pSh->EndAction(); - if (pField->IsCodeURL()) + if (m_pField->IsCodeURL()) { - OUString sURL(pField->GetPar2()); + OUString sURL(m_pField->GetPar2()); if(!sURL.isEmpty()) { INetURLObject aINetURL(sURL); if(INetProtocol::File == aINetURL.GetProtocol()) sURL = aINetURL.PathToFileName(); } - m_pUrlED->SetText(sURL); - m_pEditED->SetText(OUString()); - m_pUrlRB->Check(); + m_xUrlED->set_text(sURL); + m_xEditED->set_text(OUString()); + m_xUrlRB->set_active(true); } else { - m_pEditED->SetText(pField->GetPar2()); - m_pUrlED->SetText(OUString()); - m_pEditRB->Check(); + m_xEditED->set_text(m_pField->GetPar2()); + m_xUrlED->set_text(OUString()); + m_xEditRB->set_active(true); } - m_pTypeED->SetText(pField->GetPar1()); + m_xTypeED->set_text(m_pField->GetPar1()); } if ( !bTravel ) { - m_pPrevBtn->Hide(); - m_pNextBtn->Hide(); + m_xPrevBtn->hide(); + m_xNextBtn->hide(); } else { - m_pPrevBtn->Enable(bPrev); - m_pNextBtn->Enable(bNext); + m_xPrevBtn->set_sensitive(bPrev); + m_xNextBtn->set_sensitive(bNext); } } void SwJavaEditDialog::SetField() { - if( !m_pOKBtn->IsEnabled() ) + if( !m_xOKBtn->get_sensitive() ) return ; - aType = m_pTypeED->GetText(); - bIsUrl = m_pUrlRB->IsChecked(); + m_aType = m_xTypeED->get_text(); + m_bIsUrl = m_xUrlRB->get_active(); - if( bIsUrl ) + if (m_bIsUrl) { - aText = m_pUrlED->GetText(); - if (!aText.isEmpty()) + m_aText = m_xUrlED->get_text(); + if (!m_aText.isEmpty()) { - SfxMedium* pMedium = pSh->GetView().GetDocShell()->GetMedium(); + SfxMedium* pMedium = m_pSh->GetView().GetDocShell()->GetMedium(); INetURLObject aAbs; if( pMedium ) aAbs = pMedium->GetURLObject(); - aText = URIHelper::SmartRel2Abs( - aAbs, aText, URIHelper::GetMaybeFileHdl()); + m_aText = URIHelper::SmartRel2Abs( + aAbs, m_aText, URIHelper::GetMaybeFileHdl()); } } else - aText = m_pEditED->GetText(); + m_aText = m_xEditED->get_text(); - if( aType.isEmpty() ) - aType = "JavaScript"; + if (m_aType.isEmpty()) + m_aType = "JavaScript"; } bool SwJavaEditDialog::IsUpdate() const { - return pField && ( sal_uInt32(bIsUrl ? 1 : 0) != pField->GetFormat() || pField->GetPar2() != aType || pField->GetPar1() != aText ); + return m_pField && ( sal_uInt32(m_bIsUrl ? 1 : 0) != m_pField->GetFormat() || m_pField->GetPar2() != m_aType || m_pField->GetPar1() != m_aText ); } -IMPL_LINK_NOARG(SwJavaEditDialog, RadioButtonHdl, Button*, void) +IMPL_LINK_NOARG(SwJavaEditDialog, RadioButtonHdl, weld::Button&, void) { - bool bEnable = m_pUrlRB->IsChecked(); - m_pUrlPB->Enable(bEnable); - m_pUrlED->Enable(bEnable); - m_pEditED->Enable(!bEnable); + bool bEnable = m_xUrlRB->get_active(); + m_xUrlPB->set_sensitive(bEnable); + m_xUrlED->set_sensitive(bEnable); + m_xEditED->set_sensitive(!bEnable); - if( !bNew ) + if (!m_bNew) { - bEnable = !pSh->IsReadOnlyAvailable() || !pSh->HasReadonlySel(); - m_pOKBtn->Enable( bEnable ); - m_pUrlED->SetReadOnly( !bEnable ); - m_pEditED->SetReadOnly( !bEnable); - m_pTypeED->SetReadOnly( !bEnable); - if( m_pUrlPB->IsEnabled() && !bEnable ) - m_pUrlPB->Enable( false ); + bEnable = !m_pSh->IsReadOnlyAvailable() || !m_pSh->HasReadonlySel(); + m_xOKBtn->set_sensitive(bEnable); + m_xUrlED->set_editable(bEnable); + m_xEditED->set_editable(bEnable); + m_xTypeED->set_editable(bEnable); + if( m_xUrlPB->get_sensitive() && !bEnable ) + m_xUrlPB->set_sensitive( false ); } } -IMPL_LINK_NOARG( SwJavaEditDialog, InsertFileHdl, Button *, void ) +IMPL_LINK_NOARG( SwJavaEditDialog, InsertFileHdl, weld::Button&, void ) { - if ( !pFileDlg ) + if (!m_pFileDlg) { - pFileDlg = new ::sfx2::FileDialogHelper( + m_pFileDlg = new ::sfx2::FileDialogHelper( ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - FileDialogFlags::Insert, "swriter", SfxFilterFlags::NONE, SfxFilterFlags::NONE, GetFrameWeld()); + FileDialogFlags::Insert, "swriter", SfxFilterFlags::NONE, SfxFilterFlags::NONE, m_xDialog.get()); } - pFileDlg->StartExecuteModal( LINK( this, SwJavaEditDialog, DlgClosedHdl ) ); + m_pFileDlg->StartExecuteModal( LINK( this, SwJavaEditDialog, DlgClosedHdl ) ); } IMPL_LINK_NOARG(SwJavaEditDialog, DlgClosedHdl, sfx2::FileDialogHelper *, void) { - if ( pFileDlg->GetError() == ERRCODE_NONE ) + if (m_pFileDlg->GetError() == ERRCODE_NONE) { - OUString sFileName = pFileDlg->GetPath(); + OUString sFileName = m_pFileDlg->GetPath(); if ( !sFileName.isEmpty() ) { INetURLObject aINetURL( sFileName ); if ( INetProtocol::File == aINetURL.GetProtocol() ) sFileName = aINetURL.PathToFileName(); } - m_pUrlED->SetText( sFileName ); + m_xUrlED->set_text(sFileName); } } diff --git a/sw/source/uibase/inc/javaedit.hxx b/sw/source/uibase/inc/javaedit.hxx index 22b8c4ce7c4f..ccd83e3ecb9f 100644 --- a/sw/source/uibase/inc/javaedit.hxx +++ b/sw/source/uibase/inc/javaedit.hxx @@ -19,10 +19,7 @@ #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_JAVAEDIT_HXX #define INCLUDED_SW_SOURCE_UIBASE_INC_JAVAEDIT_HXX -#include <svx/stddlg.hxx> -#include <vcl/fixed.hxx> -#include <svtools/svmedit.hxx> -#include <vcl/button.hxx> +#include <vcl/weld.hxx> class SwWrtShell; class SwFieldMgr; @@ -30,54 +27,50 @@ class SwScriptField; namespace sfx2 { class FileDialogHelper; } -class SwJavaEditDialog : public SvxStandardDialog +class SwJavaEditDialog : public weld::GenericDialogController { private: - VclPtr<Edit> m_pTypeED; - VclPtr<RadioButton> m_pUrlRB; - VclPtr<RadioButton> m_pEditRB; - VclPtr<PushButton> m_pUrlPB; - VclPtr<Edit> m_pUrlED; - VclPtr<VclMultiLineEdit> m_pEditED; - - VclPtr<OKButton> m_pOKBtn; - VclPtr<PushButton> m_pPrevBtn; - VclPtr<PushButton> m_pNextBtn; - - OUString aText; - OUString aType; - - bool bNew; - bool bIsUrl; - - SwScriptField* pField; - SwFieldMgr* pMgr; - SwWrtShell* pSh; - sfx2::FileDialogHelper* pFileDlg; - - DECL_LINK(OKHdl, Button*, void); - DECL_LINK(PrevHdl, Button*, void); - DECL_LINK(NextHdl, Button*, void); - DECL_LINK(RadioButtonHdl, Button*, void); - DECL_LINK(InsertFileHdl, Button *, void); + OUString m_aText; + OUString m_aType; + + bool m_bNew; + bool m_bIsUrl; + + SwScriptField* m_pField; + SwFieldMgr* m_pMgr; + SwWrtShell* m_pSh; + sfx2::FileDialogHelper* m_pFileDlg; + + std::unique_ptr<weld::Entry> m_xTypeED; + std::unique_ptr<weld::RadioButton> m_xUrlRB; + std::unique_ptr<weld::RadioButton> m_xEditRB; + std::unique_ptr<weld::Button> m_xUrlPB; + std::unique_ptr<weld::Entry> m_xUrlED; + std::unique_ptr<weld::TextView> m_xEditED; + std::unique_ptr<weld::Button> m_xOKBtn; + std::unique_ptr<weld::Button> m_xPrevBtn; + std::unique_ptr<weld::Button> m_xNextBtn; + + DECL_LINK(OKHdl, weld::Button&, void); + DECL_LINK(PrevHdl, weld::Button&, void); + DECL_LINK(NextHdl, weld::Button&, void); + DECL_LINK(RadioButtonHdl, weld::Button&, void); + DECL_LINK(InsertFileHdl, weld::Button&, void); DECL_LINK(DlgClosedHdl, sfx2::FileDialogHelper *, void); - virtual void Apply() override; - void CheckTravel(); void SetField(); public: - SwJavaEditDialog(vcl::Window* pParent, SwWrtShell* pWrtSh); + SwJavaEditDialog(weld::Window* pParent, SwWrtShell* pWrtSh); virtual ~SwJavaEditDialog() override; - virtual void dispose() override; - const OUString& GetScriptText() const { return aText; } + const OUString& GetScriptText() const { return m_aText; } - const OUString& GetScriptType() const { return aType; } + const OUString& GetScriptType() const { return m_aType; } - bool IsUrl() const { return bIsUrl; } - bool IsNew() const { return bNew; } + bool IsUrl() const { return m_bIsUrl; } + bool IsNew() const { return m_bNew; } bool IsUpdate() const; }; diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index bb2131fcc500..fc7735bd7ec2 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -592,7 +592,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) SvxAbstractDialogFactory* pFact2 = SvxAbstractDialogFactory::Create(); assert(pFact2 && "Dialog creation failed!"); - ScopedVclPtr<AbstractSvxPostItDialog> pDlg(pFact2->CreateSvxPostItDialog(pMDI->GetFrameWeld(), aSet, bTravel)); + ScopedVclPtr<AbstractSvxPostItDialog> pDlg(pFact2->CreateSvxPostItDialog(GetView().GetFrameWeld(), aSet, bTravel)); assert(pDlg && "Dialog creation failed!"); pDlg->HideAuthor(); @@ -651,7 +651,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); assert(pFact && "Dialog creation failed!"); - ScopedVclPtr<AbstractJavaEditDialog> pDlg(pFact->CreateJavaEditDialog(pMDI, &rSh)); + ScopedVclPtr<AbstractJavaEditDialog> pDlg(pFact->CreateJavaEditDialog(GetView().GetFrameWeld(), &rSh)); assert(pDlg && "Dialog creation failed!"); if ( pDlg->Execute() ) { diff --git a/sw/uiconfig/swriter/ui/insertscript.ui b/sw/uiconfig/swriter/ui/insertscript.ui index 631582daaf4e..6b99bab44862 100644 --- a/sw/uiconfig/swriter/ui/insertscript.ui +++ b/sw/uiconfig/swriter/ui/insertscript.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.20.4 --> <interface domain="sw"> <requires lib="gtk+" version="3.18"/> <object class="GtkImage" id="image1"> @@ -16,17 +16,117 @@ <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes" context="insertscript|InsertScriptDialog">Insert Script</property> + <property name="modal">True</property> + <property name="default_width">0</property> + <property name="default_height">0</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> <property name="orientation">vertical</property> <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkGrid" id="grid2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="column_spacing">6</property> + <property name="column_homogeneous">True</property> + <child> + <object class="GtkButton" id="previous"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="image">image1</property> + <property name="image_position">right</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="next"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="image">image2</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <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="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <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">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</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">False</property> + <property name="fill">True</property> + <property name="position">3</property> + <property name="secondary">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">1</property> + </packing> + </child> <child> <object class="GtkGrid" id="grid1"> <property name="width_request">400</property> <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">6</property> <property name="column_spacing">12</property> <child> @@ -44,6 +144,7 @@ <object class="GtkEntry" id="scripttype"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="activates_default">True</property> <property name="text" translatable="yes" context="insertscript|scripttype">JavaScript</property> </object> <packing> @@ -58,8 +159,8 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> - <property name="use_underline">True</property> <property name="halign">start</property> + <property name="use_underline">True</property> <property name="xalign">0</property> <property name="draw_indicator">True</property> <property name="group">text</property> @@ -74,6 +175,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> + <property name="activates_default">True</property> </object> <packing> <property name="left_attach">1</property> @@ -99,12 +201,11 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> - <property name="use_underline">True</property> <property name="halign">start</property> + <property name="use_underline">True</property> <property name="xalign">0</property> <property name="active">True</property> <property name="draw_indicator">True</property> - <property name="group">url</property> </object> <packing> <property name="left_attach">0</property> @@ -116,11 +217,15 @@ <property name="height_request">200</property> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> <property name="shadow_type">in</property> <child> - <object class="GtkTextView" id="textentry:border"> + <object class="GtkTextView" id="textentry"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> </object> </child> </object> @@ -143,100 +248,6 @@ <property name="position">0</property> </packing> </child> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <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="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="cancel"> - <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">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkButton" id="help"> - <property name="label">gtk-help</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">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkGrid" id="grid2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="column_spacing">6</property> - <child> - <object class="GtkButton" id="previous"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="image">image1</property> - <property name="image_position">right</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="next"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="image">image2</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">3</property> - <property name="secondary">True</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">1</property> - </packing> - </child> </object> </child> <action-widgets> @@ -244,5 +255,8 @@ <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> </action-widgets> + <child> + <placeholder/> + </child> </object> </interface> |