summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-21 12:14:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-21 21:39:50 +0200
commit2632adfbc2a664ab99de7e24d6fcd6841a10b6f1 (patch)
tree1e703ffbb0e4a77d3b372f74303edd0824d6f4e0 /sfx2/source
parentc3a4937604fc296f3f6bf4dee48f224f255b9ffc (diff)
weld SfxCheckinDialog
Change-Id: Iaa7954baf734229683acb81819daa332b02a7733 Reviewed-on: https://gerrit.libreoffice.org/54624 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 'sfx2/source')
-rw-r--r--sfx2/source/dialog/checkin.cxx30
-rw-r--r--sfx2/source/doc/objserv.cxx6
2 files changed, 13 insertions, 23 deletions
diff --git a/sfx2/source/dialog/checkin.cxx b/sfx2/source/dialog/checkin.cxx
index 60cd7e145cff..b4834eca5535 100644
--- a/sfx2/source/dialog/checkin.cxx
+++ b/sfx2/source/dialog/checkin.cxx
@@ -9,42 +9,32 @@
#include <sfx2/checkin.hxx>
-SfxCheckinDialog::SfxCheckinDialog( vcl::Window* pParent ) :
- ModalDialog( pParent, "CheckinDialog", "sfx/ui/checkin.ui" )
+SfxCheckinDialog::SfxCheckinDialog(weld::Window* pParent)
+ : GenericDialogController( pParent, "sfx/ui/checkin.ui", "CheckinDialog")
+ , m_xCommentED(m_xBuilder->weld_text_view("VersionComment"))
+ , m_xMajorCB(m_xBuilder->weld_check_button("MajorVersion"))
+ , m_xOKBtn(m_xBuilder->weld_button("ok"))
{
- get( m_pCommentED, "VersionComment" );
- get( m_pMajorCB, "MajorVersion" );
-
- get( m_pOKBtn, "ok" );
- m_pOKBtn->SetClickHdl( LINK( this, SfxCheckinDialog, OKHdl ) );
+ m_xOKBtn->connect_clicked(LINK(this, SfxCheckinDialog, OKHdl));
}
SfxCheckinDialog::~SfxCheckinDialog()
{
- disposeOnce();
-}
-
-void SfxCheckinDialog::dispose()
-{
- m_pCommentED.clear();
- m_pMajorCB.clear();
- m_pOKBtn.clear();
- ModalDialog::dispose();
}
OUString SfxCheckinDialog::GetComment( )
{
- return m_pCommentED->GetText( );
+ return m_xCommentED->get_text();
}
bool SfxCheckinDialog::IsMajor( )
{
- return m_pMajorCB->IsChecked( );
+ return m_xMajorCB->get_active();
}
-IMPL_LINK_NOARG( SfxCheckinDialog, OKHdl, Button*, void )
+IMPL_LINK_NOARG(SfxCheckinDialog, OKHdl, weld::Button&, void )
{
- EndDialog( RET_OK );
+ m_xDialog->response(RET_OK);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 009e2a6a1a77..fb4bb7ca7a28 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -353,10 +353,10 @@ void SfxObjectShell::CheckIn( )
{
uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW );
// Pop up dialog to ask for comment and major
- ScopedVclPtrInstance< SfxCheckinDialog > checkinDlg(&GetFrame( )->GetWindow( ));
- if ( checkinDlg->Execute( ) == RET_OK )
+ SfxCheckinDialog checkinDlg(GetFrame()->GetWindow().GetFrameWeld());
+ if (checkinDlg.run() == RET_OK)
{
- xCmisDoc->checkIn( checkinDlg->IsMajor(), checkinDlg->GetComment() );
+ xCmisDoc->checkIn(checkinDlg.IsMajor(), checkinDlg.GetComment());
uno::Reference< util::XModifiable > xModifiable( GetModel( ), uno::UNO_QUERY );
if ( xModifiable.is( ) )
xModifiable->setModified( false );