summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-06 15:21:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-10 14:37:06 +0200
commit476ed0aed1c09055fa05209485919a026e5f014e (patch)
tree68c2cc8ca587dd7b47f97d800d32560339f546fc /sd
parent7cee480efe22d48af9e9d96b49ad4358a4010690 (diff)
weld SdStartPresentationDlg
to get duration spinbutton working need to know where the cursor is in the spinbutton and to change the adjustment factor depending on that, and need to additionally disable the vcl round to nearest base unit on up/down Change-Id: I6dd09e1639454cb4820d3aeb0c0c698fcebd417e Reviewed-on: https://gerrit.libreoffice.org/54065 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/sdabstdlg.hxx2
-rw-r--r--sd/qa/unit/dialogs-test.cxx5
-rw-r--r--sd/source/ui/dlg/present.cxx262
-rw-r--r--sd/source/ui/dlg/sddlgfact.cxx14
-rw-r--r--sd/source/ui/dlg/sddlgfact.hxx11
-rw-r--r--sd/source/ui/func/fusldlg.cxx2
-rw-r--r--sd/source/ui/inc/present.hxx78
-rw-r--r--sd/uiconfig/simpress/ui/presentationdialog.ui156
8 files changed, 257 insertions, 273 deletions
diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index 4b1e402f6eb7..65cfb1afeadc 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -190,7 +190,7 @@ public:
virtual VclPtr<AbstractMorphDlg> CreateMorphDlg(weld::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2) = 0;
virtual VclPtr<SfxAbstractTabDialog> CreateSdOutlineBulletTabDlg(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) = 0;
virtual VclPtr<SfxAbstractTabDialog> CreateSdParagraphTabDlg(vcl::Window* pWindow, const SfxItemSet* pAttr) = 0;
- virtual VclPtr<AbstractSdStartPresDlg> CreateSdStartPresentationDlg( vcl::Window* pWindow, const SfxItemSet& rInAttrs,
+ virtual VclPtr<AbstractSdStartPresDlg> CreateSdStartPresentationDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs,
const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList ) = 0;
virtual VclPtr<VclAbstractDialog> CreateRemoteDialog( vcl::Window* pWindow ) = 0;
virtual VclPtr<SfxAbstractTabDialog> CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool ) = 0;
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 868388102e07..a30643293ed1 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -430,7 +430,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
}
case 13:
{
- // CreateSdStartPresentationDlg(vcl::Window* pWindow, const SfxItemSet& rInAttrs, const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList) override;
+ // CreateSdStartPresentationDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs, const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList) override;
const std::vector<OUString> aPageNames;
SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
CPPUNIT_ASSERT(pDrawDoc);
@@ -451,8 +451,9 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
aDlgSet.Put(SfxBoolItem(ATTR_PRESENT_SHOW_PAUSELOGO, rPresentationSettings.mbShowPauseLogo));
//SdOptions* pOptions = SD_MOD()->GetSdOptions(DocumentType::Impress);
aDlgSet.Put(SfxInt32Item(ATTR_PRESENT_DISPLAY, 0 /*pOptions->GetDisplay()*/));
+ vcl::Window* pWin = Application::GetDefDialogParent(),
pRetval = getSdAbstractDialogFactory()->CreateSdStartPresentationDlg(
- Application::GetDefDialogParent(),
+ pWin ? pWin->GetFrameWeld() : nullptr,
aDlgSet,
aPageNames,
nullptr);
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx
index 4bb21bcc460e..ea97037ef2ab 100644
--- a/sd/source/ui/dlg/present.cxx
+++ b/sd/source/ui/dlg/present.cxx
@@ -33,59 +33,51 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::beans;
-SdStartPresentationDlg::SdStartPresentationDlg( vcl::Window* pWindow,
- const SfxItemSet& rInAttrs,
- const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList ) :
- ModalDialog ( pWindow, "PresentationDialog", "modules/simpress/ui/presentationdialog.ui" ),
- pCustomShowList ( pCSList ),
- rOutAttrs ( rInAttrs ),
- mnMonitors ( 0 )
+SdStartPresentationDlg::SdStartPresentationDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs,
+ const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList)
+ : GenericDialogController(pWindow, "modules/simpress/ui/presentationdialog.ui", "PresentationDialog")
+ , pCustomShowList(pCSList)
+ , rOutAttrs(rInAttrs)
+ , mnMonitors(0)
+ , m_xRbtAll(m_xBuilder->weld_radio_button("allslides"))
+ , m_xRbtAtDia(m_xBuilder->weld_radio_button("from"))
+ , m_xRbtCustomshow(m_xBuilder->weld_radio_button("customslideshow"))
+ , m_xLbDias(m_xBuilder->weld_combo_box_text("from_cb"))
+ , m_xLbCustomshow(m_xBuilder->weld_combo_box_text("customslideshow_cb"))
+ , m_xRbtStandard(m_xBuilder->weld_radio_button("default"))
+ , m_xRbtWindow(m_xBuilder->weld_radio_button("window"))
+ , m_xRbtAuto(m_xBuilder->weld_radio_button("auto"))
+ , m_xTmfPause(m_xBuilder->weld_time_spin_button("pauseduration", TimeFieldFormat::F_SEC))
+ , m_xCbxAutoLogo(m_xBuilder->weld_check_button("showlogo"))
+ , m_xCbxManuel(m_xBuilder->weld_check_button("manualslides"))
+ , m_xCbxMousepointer(m_xBuilder->weld_check_button("pointervisible"))
+ , m_xCbxPen(m_xBuilder->weld_check_button("pointeraspen"))
+ , m_xCbxAnimationAllowed(m_xBuilder->weld_check_button("animationsallowed"))
+ , m_xCbxChangePage(m_xBuilder->weld_check_button("changeslidesbyclick"))
+ , m_xCbxAlwaysOnTop(m_xBuilder->weld_check_button("alwaysontop"))
+ , m_xFtMonitor(m_xBuilder->weld_label("presdisplay_label"))
+ , m_xLBMonitor(m_xBuilder->weld_combo_box_text("presdisplay_cb"))
+ , m_xMonitor(m_xBuilder->weld_label("monitor_str"))
+ , m_xAllMonitors(m_xBuilder->weld_label("allmonitors_str"))
+ , m_xMonitorExternal(m_xBuilder->weld_label("externalmonitor_str"))
+ , m_xExternal(m_xBuilder->weld_label("external_str"))
{
- get( aRbtAll, "allslides" );
- get( aRbtAtDia, "from" );
- get( aRbtCustomshow, "customslideshow" );
- get( aLbDias, "from_cb" );
- get( aLbCustomshow, "customslideshow_cb" );
-
- get( aRbtStandard, "default" );
- get( aRbtWindow, "window" );
- get( aRbtAuto, "auto" );
- get( aTmfPause, "pauseduration" );
- get( aCbxAutoLogo, "showlogo" );
-
- get( aCbxManuel, "manualslides" );
- get( aCbxMousepointer, "pointervisible" );
- get( aCbxPen, "pointeraspen" );
- get( aCbxAnimationAllowed, "animationsallowed" );
- get( aCbxChangePage, "changeslidesbyclick" );
- get( aCbxAlwaysOnTop, "alwaysontop" );
-
- get( maFtMonitor, "presdisplay_label" );
- get( maLBMonitor, "presdisplay_cb" );
-
- get( msMonitor, "monitor_str" );
- get( msMonitorExternal, "externalmonitor_str" );
- get( msExternal, "external_str" );
- get( msMonitor, "monitor_str" );
- get( msAllMonitors, "allmonitors_str" );
-
- Link<Button*,void> aLink( LINK( this, SdStartPresentationDlg, ChangeRangeHdl ) );
-
- aRbtAll->SetClickHdl( aLink );
- aRbtAtDia->SetClickHdl( aLink );
- aRbtCustomshow->SetClickHdl( aLink );
+ Link<weld::Button&,void> aLink( LINK( this, SdStartPresentationDlg, ChangeRangeHdl ) );
+
+ m_xRbtAll->connect_clicked( aLink );
+ m_xRbtAtDia->connect_clicked( aLink );
+ m_xRbtCustomshow->connect_clicked( aLink );
aLink = LINK( this, SdStartPresentationDlg, ClickWindowPresentationHdl );
- aRbtStandard->SetClickHdl( aLink );
- aRbtWindow->SetClickHdl( aLink );
- aRbtAuto->SetClickHdl( aLink );
+ m_xRbtStandard->connect_clicked( aLink );
+ m_xRbtWindow->connect_clicked( aLink );
+ m_xRbtAuto->connect_clicked( aLink );
- aTmfPause->SetModifyHdl( LINK( this, SdStartPresentationDlg, ChangePauseHdl ) );
- aTmfPause->SetFormat( TimeFieldFormat::F_SEC );
+ m_xTmfPause->connect_changed( LINK( this, SdStartPresentationDlg, ChangePauseHdl ) );
// fill Listbox with page names
for (std::vector<OUString>::const_iterator pIter = rPageNames.begin(); pIter != rPageNames.end(); ++pIter)
- aLbDias->InsertEntry(*pIter);
+ m_xLbDias->append_text(*pIter);
if( pCustomShowList )
{
@@ -96,86 +88,56 @@ SdStartPresentationDlg::SdStartPresentationDlg( vcl::Window* pWindow,
pCustomShow != nullptr;
pCustomShow = pCustomShowList->Next() )
{
- aLbCustomshow->InsertEntry( pCustomShow->GetName() );
+ m_xLbCustomshow->append_text( pCustomShow->GetName() );
}
- aLbCustomshow->SelectEntryPos( nPosToSelect );
+ m_xLbCustomshow->set_active( nPosToSelect );
pCustomShowList->Seek( nPosToSelect );
}
else
- aRbtCustomshow->Disable();
+ m_xRbtCustomshow->set_sensitive(false);
if( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_CUSTOMSHOW ) ).GetValue() && pCSList )
- aRbtCustomshow->Check();
+ m_xRbtCustomshow->set_active(true);
else if( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ALL ) ).GetValue() )
- aRbtAll->Check();
+ m_xRbtAll->set_active(true);
else
- aRbtAtDia->Check();
+ m_xRbtAtDia->set_active(true);
- aLbDias->SelectEntry( static_cast<const SfxStringItem&>( rOutAttrs.Get( ATTR_PRESENT_DIANAME ) ).GetValue() );
- aCbxManuel->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_MANUEL ) ).GetValue() );
- aCbxMousepointer->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_MOUSE ) ).GetValue() );
- aCbxPen->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_PEN ) ).GetValue() );
- aCbxAnimationAllowed->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ANIMATION_ALLOWED ) ).GetValue() );
- aCbxChangePage->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_CHANGE_PAGE ) ).GetValue() );
- aCbxAlwaysOnTop->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ALWAYS_ON_TOP ) ).GetValue() );
+ m_xLbDias->set_active_text( static_cast<const SfxStringItem&>( rOutAttrs.Get( ATTR_PRESENT_DIANAME ) ).GetValue() );
+ m_xCbxManuel->set_active( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_MANUEL ) ).GetValue() );
+ m_xCbxMousepointer->set_active( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_MOUSE ) ).GetValue() );
+ m_xCbxPen->set_active( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_PEN ) ).GetValue() );
+ m_xCbxAnimationAllowed->set_active( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ANIMATION_ALLOWED ) ).GetValue() );
+ m_xCbxChangePage->set_active( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_CHANGE_PAGE ) ).GetValue() );
+ m_xCbxAlwaysOnTop->set_active( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ALWAYS_ON_TOP ) ).GetValue() );
const bool bEndless = static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ENDLESS ) ).GetValue();
const bool bWindow = !static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_FULLSCREEN ) ).GetValue();
const long nPause = static_cast<const SfxUInt32Item&>( rOutAttrs.Get( ATTR_PRESENT_PAUSE_TIMEOUT ) ).GetValue();
- aTmfPause->SetTime( tools::Time( 0, 0, nPause ) );
- // set cursor in timefield
- Edit *pEdit = aTmfPause->GetField();
- Selection aSel( pEdit->GetMaxTextLen(), pEdit->GetMaxTextLen() );
- pEdit->SetSelection( aSel );
+ m_xTmfPause->set_value( tools::Time( 0, 0, nPause ) );
+ // set cursor in timefield to end
+ m_xTmfPause->set_position(-1);
- aCbxAutoLogo->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_SHOW_PAUSELOGO ) ).GetValue() );
+ m_xCbxAutoLogo->set_active( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_SHOW_PAUSELOGO ) ).GetValue() );
if( bWindow )
- aRbtWindow->Check();
+ m_xRbtWindow->set_active(true);
else if( bEndless )
- aRbtAuto->Check();
+ m_xRbtAuto->set_active(true);
else
- aRbtStandard->Check();
+ m_xRbtStandard->set_active(true);
InitMonitorSettings();
- ChangeRangeHdl( nullptr );
+ ChangeRangeHdl(*m_xRbtCustomshow);
- ClickWindowPresentationHdl( nullptr );
- ChangePauseHdl( *aTmfPause );
+ ClickWindowPresentationHdl(*m_xRbtStandard);
+ ChangePause();
}
SdStartPresentationDlg::~SdStartPresentationDlg()
{
- disposeOnce();
-}
-
-void SdStartPresentationDlg::dispose()
-{
- aRbtAll.clear();
- aRbtAtDia.clear();
- aRbtCustomshow.clear();
- aLbDias.clear();
- aLbCustomshow.clear();
- aRbtStandard.clear();
- aRbtWindow.clear();
- aRbtAuto.clear();
- aTmfPause.clear();
- aCbxAutoLogo.clear();
- aCbxManuel.clear();
- aCbxMousepointer.clear();
- aCbxPen.clear();
- aCbxAnimationAllowed.clear();
- aCbxChangePage.clear();
- aCbxAlwaysOnTop.clear();
- maFtMonitor.clear();
- maLBMonitor.clear();
- msMonitor.clear();
- msAllMonitors.clear();
- msMonitorExternal.clear();
- msExternal.clear();
- ModalDialog::dispose();
}
OUString SdStartPresentationDlg::GetDisplayName( sal_Int32 nDisplay,
@@ -186,14 +148,14 @@ OUString SdStartPresentationDlg::GetDisplayName( sal_Int32 nDisplay,
switch ( eType )
{
case EXTERNAL_IS_NUMBER:
- aName = msExternal->GetText();
+ aName = m_xExternal->get_label();
break;
case MONITOR_IS_EXTERNAL:
- aName = msMonitorExternal->GetText();
+ aName = m_xMonitorExternal->get_label();
break;
default:
case MONITOR_NORMAL:
- aName = msMonitor->GetText();
+ aName = m_xMonitor->get_label();
break;
}
aName = aName.replaceFirst( "%1", OUString::number( nDisplay ) );
@@ -205,26 +167,23 @@ OUString SdStartPresentationDlg::GetDisplayName( sal_Int32 nDisplay,
sal_Int32 SdStartPresentationDlg::InsertDisplayEntry(const rtl::OUString &aName,
sal_Int32 nDisplay)
{
- maLBMonitor->InsertEntry( aName );
- const sal_uInt32 nEntryIndex = maLBMonitor->GetEntryCount() - 1;
- maLBMonitor->SetEntryData( nEntryIndex, reinterpret_cast<void*>(static_cast<sal_IntPtr>(nDisplay)) );
-
- return nEntryIndex;
+ m_xLBMonitor->append(OUString::number(nDisplay), aName);
+ return m_xLBMonitor->get_count() - 1;
}
void SdStartPresentationDlg::InitMonitorSettings()
{
try
{
- maFtMonitor->Show();
- maLBMonitor->Show();
+ m_xFtMonitor->show();
+ m_xLBMonitor->show();
mnMonitors = Application::GetScreenCount();
if( mnMonitors <= 1 )
{
- maFtMonitor->Enable( false );
- maLBMonitor->Enable( false );
+ m_xFtMonitor->set_sensitive( false );
+ m_xLBMonitor->set_sensitive( false );
}
else
{
@@ -264,7 +223,7 @@ void SdStartPresentationDlg::InitMonitorSettings()
if( bUnifiedDisplay )
{
- nInsertedEntry = InsertDisplayEntry( msAllMonitors->GetText(), -1 );
+ nInsertedEntry = InsertDisplayEntry( m_xAllMonitors->get_label(), -1 );
if( nDefaultSelectedDisplay == -1 )
nSelectedIndex = nInsertedEntry;
}
@@ -277,7 +236,7 @@ void SdStartPresentationDlg::InitMonitorSettings()
nSelectedIndex = nDefaultExternalIndex;
}
- maLBMonitor->SelectEntryPos(nSelectedIndex);
+ m_xLBMonitor->set_active(nSelectedIndex);
}
}
catch( Exception& )
@@ -290,69 +249,74 @@ void SdStartPresentationDlg::InitMonitorSettings()
*/
void SdStartPresentationDlg::GetAttr( SfxItemSet& rAttr )
{
- rAttr.Put( SfxBoolItem ( ATTR_PRESENT_ALL, aRbtAll->IsChecked() ) );
- rAttr.Put( SfxBoolItem ( ATTR_PRESENT_CUSTOMSHOW, aRbtCustomshow->IsChecked() ) );
- rAttr.Put( SfxStringItem ( ATTR_PRESENT_DIANAME, aLbDias->GetSelectedEntry() ) );
- rAttr.Put( SfxBoolItem ( ATTR_PRESENT_MANUEL, aCbxManuel->IsChecked() ) );
- rAttr.Put( SfxBoolItem ( ATTR_PRESENT_MOUSE, aCbxMousepointer->IsChecked() ) );
- rAttr.Put( SfxBoolItem ( ATTR_PRESENT_PEN, aCbxPen->IsChecked() ) );
- rAttr.Put( SfxBoolItem ( ATTR_PRESENT_ANIMATION_ALLOWED, aCbxAnimationAllowed->IsChecked() ) );
- rAttr.Put( SfxBoolItem ( ATTR_PRESENT_CHANGE_PAGE, aCbxChangePage->IsChecked() ) );
- rAttr.Put( SfxBoolItem ( ATTR_PRESENT_ALWAYS_ON_TOP, aCbxAlwaysOnTop->IsChecked() ) );
- rAttr.Put( SfxBoolItem ( ATTR_PRESENT_FULLSCREEN, !aRbtWindow->IsChecked() ) );
- rAttr.Put( SfxBoolItem ( ATTR_PRESENT_ENDLESS, aRbtAuto->IsChecked() ) );
- rAttr.Put( SfxUInt32Item ( ATTR_PRESENT_PAUSE_TIMEOUT, aTmfPause->GetTime().GetMSFromTime() / 1000 ) );
- rAttr.Put( SfxBoolItem ( ATTR_PRESENT_SHOW_PAUSELOGO, aCbxAutoLogo->IsChecked() ) );
-
- sal_Int32 nPos = maLBMonitor->GetSelectedEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
- rAttr.Put( SfxInt32Item ( ATTR_PRESENT_DISPLAY, static_cast<sal_Int32>(reinterpret_cast<sal_IntPtr>(maLBMonitor->GetEntryData(nPos)))) );
-
- nPos = aLbCustomshow->GetSelectedEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND )
+ rAttr.Put( SfxBoolItem ( ATTR_PRESENT_ALL, m_xRbtAll->get_active() ) );
+ rAttr.Put( SfxBoolItem ( ATTR_PRESENT_CUSTOMSHOW, m_xRbtCustomshow->get_active() ) );
+ rAttr.Put( SfxStringItem ( ATTR_PRESENT_DIANAME, m_xLbDias->get_active_text() ) );
+ rAttr.Put( SfxBoolItem ( ATTR_PRESENT_MANUEL, m_xCbxManuel->get_active() ) );
+ rAttr.Put( SfxBoolItem ( ATTR_PRESENT_MOUSE, m_xCbxMousepointer->get_active() ) );
+ rAttr.Put( SfxBoolItem ( ATTR_PRESENT_PEN, m_xCbxPen->get_active() ) );
+ rAttr.Put( SfxBoolItem ( ATTR_PRESENT_ANIMATION_ALLOWED, m_xCbxAnimationAllowed->get_active() ) );
+ rAttr.Put( SfxBoolItem ( ATTR_PRESENT_CHANGE_PAGE, m_xCbxChangePage->get_active() ) );
+ rAttr.Put( SfxBoolItem ( ATTR_PRESENT_ALWAYS_ON_TOP, m_xCbxAlwaysOnTop->get_active() ) );
+ rAttr.Put( SfxBoolItem ( ATTR_PRESENT_FULLSCREEN, !m_xRbtWindow->get_active() ) );
+ rAttr.Put( SfxBoolItem ( ATTR_PRESENT_ENDLESS, m_xRbtAuto->get_active() ) );
+ rAttr.Put( SfxUInt32Item ( ATTR_PRESENT_PAUSE_TIMEOUT, m_xTmfPause->get_value().GetMSFromTime() / 1000 ) );
+ rAttr.Put( SfxBoolItem ( ATTR_PRESENT_SHOW_PAUSELOGO, m_xCbxAutoLogo->get_active() ) );
+
+ int nPos = m_xLBMonitor->get_active();
+ if (nPos != -1)
+ rAttr.Put(SfxInt32Item(ATTR_PRESENT_DISPLAY, m_xLBMonitor->get_id(nPos).toInt32()));
+
+ nPos = m_xLbCustomshow->get_active();
+ if (nPos != -1)
pCustomShowList->Seek( nPos );
}
/**
* Handler: Enabled/Disabled Listbox "Dias"
*/
-IMPL_LINK_NOARG(SdStartPresentationDlg, ChangeRangeHdl, Button*, void)
+IMPL_LINK_NOARG(SdStartPresentationDlg, ChangeRangeHdl, weld::Button&, void)
{
- aLbDias->Enable( aRbtAtDia->IsChecked() );
- aLbCustomshow->Enable( aRbtCustomshow->IsChecked() );
+ m_xLbDias->set_sensitive( m_xRbtAtDia->get_active() );
+ m_xLbCustomshow->set_sensitive( m_xRbtCustomshow->get_active() );
}
/**
* Handler: Enabled/Disabled Checkbox "AlwaysOnTop"
*/
-IMPL_LINK_NOARG(SdStartPresentationDlg, ClickWindowPresentationHdl, Button*, void)
+IMPL_LINK_NOARG(SdStartPresentationDlg, ClickWindowPresentationHdl, weld::Button&, void)
{
- const bool bAuto = aRbtAuto->IsChecked();
- const bool bWindow = aRbtWindow->IsChecked();
+ const bool bAuto = m_xRbtAuto->get_active();
+ const bool bWindow = m_xRbtWindow->get_active();
- // aFtPause.Enable( bAuto );
- aTmfPause->Enable( bAuto );
- aCbxAutoLogo->Enable( bAuto && ( aTmfPause->GetTime().GetMSFromTime() > 0 ) );
+ // m_xFtPause.set_sensitive( bAuto );
+ m_xTmfPause->set_sensitive( bAuto );
+ m_xCbxAutoLogo->set_sensitive( bAuto && ( m_xTmfPause->get_value().GetMSFromTime() > 0 ) );
const bool bDisplay = !bWindow && ( mnMonitors > 1 );
- maFtMonitor->Enable( bDisplay );
- maLBMonitor->Enable( bDisplay );
+ m_xFtMonitor->set_sensitive( bDisplay );
+ m_xLBMonitor->set_sensitive( bDisplay );
if( bWindow )
{
- aCbxAlwaysOnTop->Enable( false );
- aCbxAlwaysOnTop->Check( false );
+ m_xCbxAlwaysOnTop->set_sensitive(false);
+ m_xCbxAlwaysOnTop->set_active(false);
}
else
- aCbxAlwaysOnTop->Enable();
+ m_xCbxAlwaysOnTop->set_sensitive(true);
}
/**
* Handler: Enabled/Disabled Checkbox "AlwaysOnTop"
*/
-IMPL_LINK_NOARG(SdStartPresentationDlg, ChangePauseHdl, Edit&, void)
+IMPL_LINK_NOARG(SdStartPresentationDlg, ChangePauseHdl, weld::Entry&, void)
+{
+ ChangePause();
+}
+
+void SdStartPresentationDlg::ChangePause()
{
- aCbxAutoLogo->Enable( aRbtAuto->IsChecked() && ( aTmfPause->GetTime().GetMSFromTime() > 0 ) );
+ m_xCbxAutoLogo->set_sensitive(m_xRbtAuto->get_active() && ( m_xTmfPause->get_value().GetMSFromTime() > 0 ));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 2c6131f7fd4b..af5f6345fccb 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -70,7 +70,11 @@ short AbstractMorphDlg_Impl::Execute()
return m_xDlg->run();
}
-IMPL_ABSTDLG_BASE(AbstractSdStartPresDlg_Impl);
+short AbstractSdStartPresDlg_Impl::Execute()
+{
+ return m_xDlg->run();
+}
+
IMPL_ABSTDLG_BASE(AbstractSdPresLayoutDlg_Impl);
IMPL_ABSTDLG_BASE(SdAbstractSfxDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractSdVectorizeDlg_Impl);
@@ -271,7 +275,7 @@ bool AbstractMorphDlg_Impl::IsOrientationFade() const
void AbstractSdStartPresDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
{
- pDlg->GetAttr( rOutAttrs );
+ m_xDlg->GetAttr( rOutAttrs );
}
void AbstractSdPresLayoutDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
@@ -368,10 +372,10 @@ VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdParagraphTabD
return VclPtr<SdAbstractTabDialog_Impl>::Create( VclPtr<SdParagraphDlg>::Create( pParent, pAttr ) );
}
-VclPtr<AbstractSdStartPresDlg> SdAbstractDialogFactory_Impl::CreateSdStartPresentationDlg( vcl::Window* pParent, const SfxItemSet& rInAttrs,
- const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList )
+VclPtr<AbstractSdStartPresDlg> SdAbstractDialogFactory_Impl::CreateSdStartPresentationDlg(weld::Window* pParent,
+ const SfxItemSet& rInAttrs, const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList)
{
- return VclPtr<AbstractSdStartPresDlg_Impl>::Create( VclPtr<SdStartPresentationDlg>::Create( pParent, rInAttrs, rPageNames, pCSList ) );
+ return VclPtr<AbstractSdStartPresDlg_Impl>::Create(new SdStartPresentationDlg(pParent, rInAttrs, rPageNames, pCSList));
}
VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateRemoteDialog( vcl::Window* pParent )
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index d8bb3438f65f..66ba0a90a1aa 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -202,7 +202,14 @@ public:
class SdStartPresentationDlg;
class AbstractSdStartPresDlg_Impl : public AbstractSdStartPresDlg
{
- DECL_ABSTDLG_BASE(AbstractSdStartPresDlg_Impl,SdStartPresentationDlg)
+private:
+ std::unique_ptr<SdStartPresentationDlg> m_xDlg;
+public:
+ AbstractSdStartPresDlg_Impl(SdStartPresentationDlg* pDlg)
+ : m_xDlg(pDlg)
+ {
+ }
+ virtual short Execute() override;
virtual void GetAttr( SfxItemSet& rOutAttrs ) override;
};
@@ -258,7 +265,7 @@ public:
virtual VclPtr<AbstractMorphDlg> CreateMorphDlg(weld::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2) override;
virtual VclPtr<SfxAbstractTabDialog> CreateSdOutlineBulletTabDlg(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView) override;
virtual VclPtr<SfxAbstractTabDialog> CreateSdParagraphTabDlg(vcl::Window* pParent, const SfxItemSet* pAttr) override;
- virtual VclPtr<AbstractSdStartPresDlg> CreateSdStartPresentationDlg( vcl::Window* pWindow, const SfxItemSet& rInAttrs,
+ virtual VclPtr<AbstractSdStartPresDlg> CreateSdStartPresentationDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs,
const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList ) override;
virtual VclPtr<VclAbstractDialog> CreateRemoteDialog( vcl::Window* pWindow ) override; // ad for RemoteDialog
virtual VclPtr<SfxAbstractTabDialog> CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool ) override;
diff --git a/sd/source/ui/func/fusldlg.cxx b/sd/source/ui/func/fusldlg.cxx
index 13da0d20e957..1a5ee50eb6b7 100644
--- a/sd/source/ui/func/fusldlg.cxx
+++ b/sd/source/ui/func/fusldlg.cxx
@@ -106,7 +106,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& )
aDlgSet.Put( SfxInt32Item( ATTR_PRESENT_DISPLAY, pOptions->GetDisplay() ) );
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSdStartPresDlg> pDlg(pFact ? pFact->CreateSdStartPresentationDlg(mpWindow, aDlgSet, aPageNameList, pCustomShowList) : nullptr);
+ ScopedVclPtr<AbstractSdStartPresDlg> pDlg(pFact ? pFact->CreateSdStartPresentationDlg(mpWindow ? mpWindow->GetFrameWeld() : nullptr, aDlgSet, aPageNameList, pCustomShowList) : nullptr);
if( pDlg && (pDlg->Execute() == RET_OK) )
{
OUString aPage;
diff --git a/sd/source/ui/inc/present.hxx b/sd/source/ui/inc/present.hxx
index f627bcf419ea..d81b2918e66e 100644
--- a/sd/source/ui/inc/present.hxx
+++ b/sd/source/ui/inc/present.hxx
@@ -20,57 +20,53 @@
#ifndef INCLUDED_SD_SOURCE_UI_INC_PRESENT_HXX
#define INCLUDED_SD_SOURCE_UI_INC_PRESENT_HXX
-#include <vcl/lstbox.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/field.hxx>
+#include <vcl/weld.hxx>
class SfxItemSet;
class List;
class SdCustomShowList;
/**
- * Dialog to define options and to start the presentation
+ * Dialog to define optionsm_xnd to start the presentation
*/
-class SdStartPresentationDlg : public ModalDialog
+class SdStartPresentationDlg : public weld::GenericDialogController
{
private:
+ SdCustomShowList* pCustomShowList;
+ const SfxItemSet& rOutAttrs;
+ sal_Int32 mnMonitors;
- VclPtr<RadioButton> aRbtAll;
- VclPtr<RadioButton> aRbtAtDia;
- VclPtr<RadioButton> aRbtCustomshow;
- VclPtr<ListBox> aLbDias;
- VclPtr<ListBox> aLbCustomshow;
-
- VclPtr<RadioButton> aRbtStandard;
- VclPtr<RadioButton> aRbtWindow;
- VclPtr<RadioButton> aRbtAuto;
- VclPtr<TimeField> aTmfPause;
- VclPtr<CheckBox> aCbxAutoLogo;
+ std::unique_ptr<weld::RadioButton> m_xRbtAll;
+ std::unique_ptr<weld::RadioButton> m_xRbtAtDia;
+ std::unique_ptr<weld::RadioButton> m_xRbtCustomshow;
+ std::unique_ptr<weld::ComboBoxText> m_xLbDias;
+ std::unique_ptr<weld::ComboBoxText> m_xLbCustomshow;
- VclPtr<CheckBox> aCbxManuel;
- VclPtr<CheckBox> aCbxMousepointer;
- VclPtr<CheckBox> aCbxPen;
- VclPtr<CheckBox> aCbxAnimationAllowed;
- VclPtr<CheckBox> aCbxChangePage;
- VclPtr<CheckBox> aCbxAlwaysOnTop;
+ std::unique_ptr<weld::RadioButton> m_xRbtStandard;
+ std::unique_ptr<weld::RadioButton> m_xRbtWindow;
+ std::unique_ptr<weld::RadioButton> m_xRbtAuto;
+ std::unique_ptr<weld::TimeSpinButton> m_xTmfPause;
+ std::unique_ptr<weld::CheckButton> m_xCbxAutoLogo;
- VclPtr<FixedText> maFtMonitor;
- VclPtr<ListBox> maLBMonitor;
+ std::unique_ptr<weld::CheckButton> m_xCbxManuel;
+ std::unique_ptr<weld::CheckButton> m_xCbxMousepointer;
+ std::unique_ptr<weld::CheckButton> m_xCbxPen;
+ std::unique_ptr<weld::CheckButton> m_xCbxAnimationAllowed;
+ std::unique_ptr<weld::CheckButton> m_xCbxChangePage;
+ std::unique_ptr<weld::CheckButton> m_xCbxAlwaysOnTop;
- SdCustomShowList* pCustomShowList;
- const SfxItemSet& rOutAttrs;
- sal_Int32 mnMonitors;
+ std::unique_ptr<weld::Label> m_xFtMonitor;
+ std::unique_ptr<weld::ComboBoxText> m_xLBMonitor;
- VclPtr<FixedText> msMonitor;
- VclPtr<FixedText> msAllMonitors;
- VclPtr<FixedText> msMonitorExternal;
- VclPtr<FixedText> msExternal;
+ std::unique_ptr<weld::Label> m_xMonitor;
+ std::unique_ptr<weld::Label> m_xAllMonitors;
+ std::unique_ptr<weld::Label> m_xMonitorExternal;
+ std::unique_ptr<weld::Label> m_xExternal;
- DECL_LINK( ChangeRangeHdl, Button*, void );
- DECL_LINK( ClickWindowPresentationHdl, Button*, void );
- DECL_LINK( ChangePauseHdl, Edit&, void );
+ DECL_LINK(ChangeRangeHdl, weld::Button&, void);
+ DECL_LINK(ClickWindowPresentationHdl, weld::Button&, void);
+ void ChangePause();
+ DECL_LINK(ChangePauseHdl, weld::Entry&, void);
void InitMonitorSettings();
enum DisplayType {
@@ -83,13 +79,11 @@ private:
OUString GetDisplayName( sal_Int32 nDisplay,
DisplayType eType );
public:
- SdStartPresentationDlg( vcl::Window* pWindow,
- const SfxItemSet& rInAttrs,
- const std::vector<OUString> &rPageNames,
- SdCustomShowList* pCSList );
+ SdStartPresentationDlg(weld::Window* pWindow,
+ const SfxItemSet& rInAttrs,
+ const std::vector<OUString> &rPageNames,
+ SdCustomShowList* pCSList);
virtual ~SdStartPresentationDlg() override;
- virtual void dispose() override;
-
void GetAttr( SfxItemSet& rOutAttrs );
};
diff --git a/sd/uiconfig/simpress/ui/presentationdialog.ui b/sd/uiconfig/simpress/ui/presentationdialog.ui
index 366f1957042e..d85e2f19edee 100644
--- a/sd/uiconfig/simpress/ui/presentationdialog.ui
+++ b/sd/uiconfig/simpress/ui/presentationdialog.ui
@@ -1,11 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.20.4 -->
<interface domain="sd">
<requires lib="gtk+" version="3.18"/>
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="upper">86400000</property>
+ <property name="step_increment">1000</property>
+ <property name="page_increment">60000</property>
+ </object>
<object class="GtkDialog" id="PresentationDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="presentationdialog|PresentationDialog">Slide Show Settings</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">
@@ -13,6 +21,64 @@
<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="visible">True</property>
+ <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">False</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</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="visible">True</property>
@@ -64,7 +130,7 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="from_cb">
+ <object class="GtkComboBoxText" id="from_cb">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
@@ -98,7 +164,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
- <property name="group">from</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -114,7 +179,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
- <property name="group">from</property>
+ <property name="group">allslides</property>
<accessibility>
<relation type="label-for" target="customslideshow_cb"/>
</accessibility>
@@ -125,7 +190,7 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="customslideshow_cb">
+ <object class="GtkComboBoxText" id="customslideshow_cb">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">12</property>
@@ -187,7 +252,7 @@
<property name="vexpand">True</property>
<property name="column_spacing">12</property>
<child>
- <object class="GtkComboBox" id="presdisplay_cb">
+ <object class="GtkComboBoxText" id="presdisplay_cb">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
@@ -201,10 +266,10 @@
<object class="GtkLabel" id="presdisplay_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="presentationdialog|presdisplay_label">P_resentation display:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">presdisplay_cb</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -322,7 +387,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
- <property name="group">auto</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -338,7 +402,7 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
- <property name="group">auto</property>
+ <property name="group">default</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -354,9 +418,9 @@
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
- <property name="group">window</property>
+ <property name="group">default</property>
<accessibility>
- <relation type="label-for" target="pauseduration:hh:mm"/>
+ <relation type="label-for" target="pauseduration"/>
</accessibility>
</object>
<packing>
@@ -381,17 +445,19 @@
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="pauseduration:hh:mm">
+ <object class="GtkSpinButton" id="pauseduration">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes" context="presentationdialog|pauseduration|tooltip_text">Duration of pause</property>
<property name="margin_left">12</property>
+ <property name="activates_default">True</property>
+ <property name="adjustment">adjustment1</property>
<accessibility>
<relation type="labelled-by" target="auto"/>
</accessibility>
<child internal-child="accessible">
- <object class="AtkObject" id="pauseduration:hh:mm-atkobject">
+ <object class="AtkObject" id="pauseduration-atkobject">
<property name="AtkObject::accessible-name" translatable="yes" context="presentationdialog|pauseduration-atkobject">Pause Duration</property>
</object>
</child>
@@ -532,6 +598,9 @@
<property name="top_attach">6</property>
</packing>
</child>
+ <child>
+ <placeholder/>
+ </child>
</object>
</child>
</object>
@@ -565,64 +634,6 @@
<property name="position">0</property>
</packing>
</child>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <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">False</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</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>
@@ -630,5 +641,8 @@
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>