[Libreoffice-commits] core.git: cui/source dbaccess/source dbaccess/uiconfig dbaccess/UIConfig_dbaccess.mk include/svtools include/tools include/vcl vcl/source vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 22 14:38:09 UTC 2019


 cui/source/dialogs/about.cxx                      |   28 -
 cui/source/inc/about.hxx                          |   11 
 dbaccess/UIConfig_dbaccess.mk                     |    1 
 dbaccess/source/ui/dlg/adminpages.cxx             |    4 
 dbaccess/source/ui/dlg/dbwizsetup.cxx             |   88 +--
 dbaccess/source/ui/dlg/generalpage.cxx            |   44 -
 dbaccess/source/ui/dlg/generalpage.hxx            |    6 
 dbaccess/source/ui/dlg/sqlmessage.cxx             |    2 
 dbaccess/source/ui/inc/dbwizsetup.hxx             |    5 
 dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx      |    6 
 dbaccess/uiconfig/ui/authentificationpage.ui      |    4 
 dbaccess/uiconfig/ui/databasewizard.ui            |   18 
 dbaccess/uiconfig/ui/dbasepage.ui                 |    4 
 dbaccess/uiconfig/ui/dbwizconnectionpage.ui       |    5 
 dbaccess/uiconfig/ui/dbwizmysqlintropage.ui       |    5 
 dbaccess/uiconfig/ui/dbwizmysqlnativepage.ui      |    8 
 dbaccess/uiconfig/ui/dbwizspreadsheetpage.ui      |   39 -
 dbaccess/uiconfig/ui/dbwiztextpage.ui             |    8 
 dbaccess/uiconfig/ui/finalpagewizard.ui           |   23 
 dbaccess/uiconfig/ui/generalpagewizard.ui         |   67 +-
 dbaccess/uiconfig/ui/jdbcconnectionpage.ui        |    3 
 dbaccess/uiconfig/ui/ldapconnectionpage.ui        |    4 
 dbaccess/uiconfig/ui/specialjdbcconnectionpage.ui |    5 
 include/svtools/helpids.h                         |    3 
 include/tools/wintypes.hxx                        |    5 
 include/vcl/roadmapwizard.hxx                     |  146 +++++
 include/vcl/vclenum.hxx                           |   15 
 include/vcl/weld.hxx                              |   42 +
 include/vcl/wizardmachine.hxx                     |  251 ++++++++-
 vcl/source/app/salvtables.cxx                     |  293 ++++++++++
 vcl/source/control/button.cxx                     |    3 
 vcl/source/control/roadmapwizard.cxx              |  356 ++++++++++++-
 vcl/source/control/wizardmachine.cxx              |  598 +++++++++++++++++++++-
 vcl/unx/gtk3/gtk3gtkinst.cxx                      |  399 ++++++++++++--
 34 files changed, 2219 insertions(+), 280 deletions(-)

New commits:
commit 69057064d8957804c76e623d57c103c3413b7cbc
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 5 17:26:53 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Aug 22 16:37:16 2019 +0200

    weld ODbTypeWizDialogSetup
    
    split up RoadmapWizard to sit its wizard logic on top of a a native GtkAssistant
    
    a) awkwardly GtkAssistant is not a GtkDialog, but derives directly from
    GtkWindow so some shuffling around required due to that
    
    b) hidden/unused pages are shuffled to the end of the list of pages and
    their titles turned off in order to hide them from the roadmap
    
    c) some nonstandard hackery required to get the gtk roadmap titles to wrap
    
    Change-Id: I0d2346c489fef744136a2785f33c846d97bd8dc6
    Reviewed-on: https://gerrit.libreoffice.org/76876
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index a9617f7a8381..da2e4d2b4e2d 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -68,13 +68,13 @@ AboutDialog::AboutDialog(weld::Window* pParent)
     m_xDialog->add_button(CuiResId(RID_SVXSTR_ABOUT_WEBSITE), 102);
     m_xDialog->add_button(CuiResId(RID_SVXSTR_ABOUT_RELEASE_NOTES), 103);
 
-    m_pCreditsButton = m_xDialog->get_widget_for_response(101);
-    m_pCreditsButton->set_secondary(true);
-    m_pWebsiteButton = m_xDialog->get_widget_for_response(102);
-    m_pWebsiteButton->set_secondary(true);
-    m_pReleaseNotesButton = m_xDialog->get_widget_for_response(103);
-    m_pReleaseNotesButton->set_secondary(true);
-    m_pCloseButton = m_xDialog->get_widget_for_response(RET_CLOSE);
+    m_xCreditsButton.reset(m_xDialog->weld_widget_for_response(101));
+    m_xCreditsButton->set_secondary(true);
+    m_xWebsiteButton.reset(m_xDialog->weld_widget_for_response(102));
+    m_xWebsiteButton->set_secondary(true);
+    m_xReleaseNotesButton.reset(m_xDialog->weld_widget_for_response(103));
+    m_xReleaseNotesButton->set_secondary(true);
+    m_xCloseButton.reset(m_xDialog->weld_widget_for_response(RET_CLOSE));
 
     m_buildIdLinkString = m_xDialog->get_website_label();
 
@@ -88,10 +88,10 @@ AboutDialog::AboutDialog(weld::Window* pParent)
     m_xDialog->connect_size_allocate(LINK(this, AboutDialog, SizeAllocHdl));
 
     // Connect all handlers
-    m_pCreditsButton->connect_clicked( LINK( this, AboutDialog, HandleClick ) );
-    m_pWebsiteButton->connect_clicked( LINK( this, AboutDialog, HandleClick ) );
-    m_pReleaseNotesButton->connect_clicked( LINK( this, AboutDialog, HandleClick ) );
-    m_pCloseButton->grab_focus();
+    m_xCreditsButton->connect_clicked( LINK( this, AboutDialog, HandleClick ) );
+    m_xWebsiteButton->connect_clicked( LINK( this, AboutDialog, HandleClick ) );
+    m_xReleaseNotesButton->connect_clicked( LINK( this, AboutDialog, HandleClick ) );
+    m_xCloseButton->grab_focus();
 }
 
 AboutDialog::~AboutDialog()
@@ -103,14 +103,14 @@ IMPL_LINK(AboutDialog, HandleClick, weld::Button&, rButton, void)
     OUString sURL = "";
 
     // Find which button was pressed and from this, get the URL to be opened
-    if (&rButton == m_pCreditsButton)
+    if (&rButton == m_xCreditsButton.get())
         sURL = CuiResId(RID_SVXSTR_ABOUT_CREDITS_URL);
-    else if (&rButton == m_pWebsiteButton)
+    else if (&rButton == m_xWebsiteButton.get())
     {
         sURL = officecfg::Office::Common::Help::StartCenter::InfoURL::get();
         localizeWebserviceURI(sURL);
     }
-    else if (&rButton == m_pReleaseNotesButton)
+    else if (&rButton == m_xReleaseNotesButton.get())
     {
         sURL = officecfg::Office::Common::Menus::ReleaseNotesURL::get() +
                "?LOvers=" + utl::ConfigManager::getProductVersion() +
diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx
index adafb7448ef0..c51eb15433d8 100644
--- a/cui/source/inc/about.hxx
+++ b/cui/source/inc/about.hxx
@@ -27,18 +27,17 @@ class AboutDialog : public weld::DialogController
 private:
     std::unique_ptr<weld::Builder> m_xBuilder;
     std::shared_ptr<weld::AboutDialog> m_xDialog;
-    std::shared_ptr<weld::Container> m_xContentArea;
+    std::unique_ptr<weld::Container> m_xContentArea;
+    std::unique_ptr<weld::Button> m_xCreditsButton;
+    std::unique_ptr<weld::Button> m_xWebsiteButton;
+    std::unique_ptr<weld::Button> m_xReleaseNotesButton;
+    std::unique_ptr<weld::Button> m_xCloseButton;
 
     BitmapEx           aLogoBitmap;
     BitmapEx           aBackgroundBitmap;
 
     OUString m_buildIdLinkString;
 
-    weld::Button* m_pCreditsButton;
-    weld::Button* m_pWebsiteButton;
-    weld::Button* m_pReleaseNotesButton;
-    weld::Button* m_pCloseButton;
-
     void SetBuildIdLink();
     void SetLogo();
 
diff --git a/dbaccess/UIConfig_dbaccess.mk b/dbaccess/UIConfig_dbaccess.mk
index eacb9eb112c2..ff79be062c22 100644
--- a/dbaccess/UIConfig_dbaccess.mk
+++ b/dbaccess/UIConfig_dbaccess.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_UIConfig_add_uifiles,dbaccess, \
     dbaccess/uiconfig/ui/colwidthdialog \
     dbaccess/uiconfig/ui/connectionpage \
     dbaccess/uiconfig/ui/copytablepage \
+    dbaccess/uiconfig/ui/databasewizard \
     dbaccess/uiconfig/ui/dbaseindexdialog \
     dbaccess/uiconfig/ui/dbasepage \
     dbaccess/uiconfig/ui/dbwizconnectionpage \
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index e0599f5f1517..3672e247de5c 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -64,8 +64,10 @@ namespace dbaui
         , m_pAdminDialog(nullptr)
         , m_pItemSetHelper(nullptr)
     {
-
         SetExchangeSupport();
+
+        Size aSize(LogicToPixel(::Size(WIZARD_PAGE_X, WIZARD_PAGE_Y), MapMode(MapUnit::MapAppFont)));
+        m_xContainer->set_size_request(aSize.Width(), aSize.Height());
     }
 
     DeactivateRC OGenericAdministrationPage::DeactivatePage(SfxItemSet* _pSet)
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index 97cdfdb5e609..e878a7d611eb 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -99,12 +99,12 @@ using namespace ::comphelper;
 using namespace ::cppu;
 
 // ODbTypeWizDialogSetup
-ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(vcl::Window* _pParent
+ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(weld::Window* _pParent
                                ,SfxItemSet const * _pItems
                                ,const Reference< XComponentContext >& _rxORB
                                ,const css::uno::Any& _aDataSourceName
                                )
-    :vcl::RoadmapWizard( _pParent )
+    : vcl::RoadmapWizardMachine( _pParent )
 
     , m_bIsConnectable( false)
     , m_sRM_IntroText( DBA_RES( STR_PAGETITLE_INTROPAGE ) )
@@ -135,14 +135,13 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(vcl::Window* _pParent
 
     OSL_ENSURE(m_pCollection, "ODbTypeWizDialogSetup::ODbTypeWizDialogSetup : really need a DSN type collection !");
 
-    m_pImpl.reset(new ODbDataSourceAdministrationHelper(_rxORB,GetFrameWeld(),_pParent ? _pParent->GetFrameWeld() : nullptr, this));
+    m_pImpl.reset(new ODbDataSourceAdministrationHelper(_rxORB, m_xAssistant.get(), _pParent, this));
     m_pImpl->setDataSourceOrName(_aDataSourceName);
     Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
     m_pOutSet.reset( new SfxItemSet( *_pItems->GetPool(), _pItems->GetRanges() ) );
 
     m_pImpl->translateProperties(xDatasource, *m_pOutSet);
 
-    SetPageSizePixel(LogicToPixel(::Size(WIZARD_PAGE_X, WIZARD_PAGE_Y), MapMode(MapUnit::MapAppFont)));
     defaultButton(WizardButtonFlags::NEXT);
     enableButtons(WizardButtonFlags::FINISH, true);
     enableAutomaticNextButtonState();
@@ -165,13 +164,13 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(vcl::Window* _pParent
     aPath.push_back(PAGE_DBSETUPWIZARD_INTRO);
     declarePath( static_cast<PathId>(m_pCollection->size()+1), aPath);
 
-    m_pPrevPage->SetHelpId(HID_DBWIZ_PREVIOUS);
-    m_pNextPage->SetHelpId(HID_DBWIZ_NEXT);
-    m_pCancel->SetHelpId(HID_DBWIZ_CANCEL);
-    m_pFinish->SetHelpId(HID_DBWIZ_FINISH);
-    SetRoadmapInteractive( true );
+    m_xPrevPage->set_help_id(HID_DBWIZ_PREVIOUS);
+    m_xNextPage->set_help_id(HID_DBWIZ_NEXT);
+    m_xCancel->set_help_id(HID_DBWIZ_CANCEL);
+    m_xFinish->set_help_id(HID_DBWIZ_FINISH);
     ActivatePage();
     setTitleBase(DBA_RES(STR_DBWIZARDTITLE));
+    m_xAssistant->set_current_page(0);
 }
 
 void ODbTypeWizDialogSetup::declareAuthDepPath( const OUString& _sURL, PathId _nPathId, const vcl::RoadmapWizardTypes::WizardPath& _rPaths)
@@ -188,7 +187,7 @@ void ODbTypeWizDialogSetup::declareAuthDepPath( const OUString& _sURL, PathId _n
     }
 
     // call base method
-    ::vcl::RoadmapWizard::declarePath( _nPathId, aPath );
+    ::vcl::RoadmapWizardMachine::declarePath( _nPathId, aPath );
 }
 
 OUString ODbTypeWizDialogSetup::getStateDisplayName( WizardState _nState ) const
@@ -256,16 +255,6 @@ OUString ODbTypeWizDialogSetup::getStateDisplayName( WizardState _nState ) const
 
 ODbTypeWizDialogSetup::~ODbTypeWizDialogSetup()
 {
-    disposeOnce();
-}
-
-void ODbTypeWizDialogSetup::dispose()
-{
-    m_pOutSet.reset();
-    m_pGeneralPage.clear();
-    m_pMySQLIntroPage.clear();
-    m_pFinalPage.clear();
-    vcl::RoadmapWizard::dispose();
 }
 
 IMPL_LINK_NOARG(ODbTypeWizDialogSetup, OnTypeSelected, OGeneralPage&, void)
@@ -458,10 +447,16 @@ VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
 {
     VclPtr<SfxTabPage> pFirstPage;
     VclPtr<OGenericAdministrationPage> pPage;
+
+    OString sIdent(OString::number(_nState));
+    weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
+    // TODO eventually pass DialogController as distinct argument instead of bundling into TabPageParent
+    TabPageParent aParent(pPageContainer, this);
+
     switch(_nState)
     {
         case PAGE_DBSETUPWIZARD_INTRO:
-            pFirstPage = VclPtr<OGeneralPageWizard>::Create(this,*m_pOutSet);
+            pFirstPage = VclPtr<OGeneralPageWizard>::Create(aParent,*m_pOutSet);
             pPage = static_cast<OGenericAdministrationPage*> (pFirstPage.get());
             m_pGeneralPage = static_cast<OGeneralPageWizard*>(pFirstPage.get());
             m_pGeneralPage->SetTypeSelectHandler(LINK(this, ODbTypeWizDialogSetup, OnTypeSelected));
@@ -471,70 +466,70 @@ VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
             break;
 
         case PAGE_DBSETUPWIZARD_DBASE:
-            pPage = OConnectionTabPageSetup::CreateDbaseTabPage(this,*m_pOutSet);
+            pPage = OConnectionTabPageSetup::CreateDbaseTabPage(aParent, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_ADO:
-            pPage = OConnectionTabPageSetup::CreateADOTabPage( this, *m_pOutSet);
+            pPage = OConnectionTabPageSetup::CreateADOTabPage(aParent, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_TEXT:
-            pPage = OTextConnectionPageSetup::CreateTextTabPage(this,*m_pOutSet);
+            pPage = OTextConnectionPageSetup::CreateTextTabPage(aParent, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_ODBC:
-            pPage = OConnectionTabPageSetup::CreateODBCTabPage( this, *m_pOutSet);
+            pPage = OConnectionTabPageSetup::CreateODBCTabPage(aParent, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_JDBC:
-            pPage = OJDBCConnectionPageSetup::CreateJDBCTabPage( this, *m_pOutSet);
+            pPage = OJDBCConnectionPageSetup::CreateJDBCTabPage(aParent, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_MYSQL_ODBC:
             m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix("sdbc:mysql:odbc:")));
-            pPage = OConnectionTabPageSetup::CreateODBCTabPage( this, *m_pOutSet);
+            pPage = OConnectionTabPageSetup::CreateODBCTabPage(aParent, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_MYSQL_JDBC:
             m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix("sdbc:mysql:jdbc:")));
-            pPage = OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage( this, *m_pOutSet);
+            pPage = OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage(aParent, *m_pOutSet);
             break;
         case PAGE_DBSETUPWIZARD_MYSQL_NATIVE:
             m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix("sdbc:mysql:mysqlc:")));
-            pPage = MySQLNativeSetupPage::Create( this, *m_pOutSet);
+            pPage = MySQLNativeSetupPage::Create(aParent, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_ORACLE:
-            pPage = OGeneralSpecialJDBCConnectionPageSetup::CreateOracleJDBCTabPage( this, *m_pOutSet);
+            pPage = OGeneralSpecialJDBCConnectionPageSetup::CreateOracleJDBCTabPage(aParent, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_LDAP:
-            pPage = OLDAPConnectionPageSetup::CreateLDAPTabPage(this,*m_pOutSet);
+            pPage = OLDAPConnectionPageSetup::CreateLDAPTabPage(aParent, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_DOCUMENT_OR_SPREADSHEET:
-            pPage = OSpreadSheetConnectionPageSetup::CreateDocumentOrSpreadSheetTabPage(this,*m_pOutSet);
+            pPage = OSpreadSheetConnectionPageSetup::CreateDocumentOrSpreadSheetTabPage(aParent, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_MSACCESS:
-            pPage  = OConnectionTabPageSetup::CreateMSAccessTabPage(this,*m_pOutSet);
+            pPage  = OConnectionTabPageSetup::CreateMSAccessTabPage(aParent, *m_pOutSet);
             break;
         case PAGE_DBSETUPWIZARD_MYSQL_INTRO:
-            m_pMySQLIntroPage = OMySQLIntroPageSetup::CreateMySQLIntroTabPage(this,*m_pOutSet);
+            m_pMySQLIntroPage = OMySQLIntroPageSetup::CreateMySQLIntroTabPage(aParent, *m_pOutSet);
             m_pMySQLIntroPage->SetClickHdl(LINK( this, ODbTypeWizDialogSetup, ImplClickHdl ) );
             pPage = m_pMySQLIntroPage;
             break;
 
         case PAGE_DBSETUPWIZARD_AUTHENTIFICATION:
-            pPage = OAuthentificationPageSetup::CreateAuthentificationTabPage(this,*m_pOutSet);
+            pPage = OAuthentificationPageSetup::CreateAuthentificationTabPage(aParent, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_USERDEFINED:
-            pPage = OConnectionTabPageSetup::CreateUserDefinedTabPage(this,*m_pOutSet);
+            pPage = OConnectionTabPageSetup::CreateUserDefinedTabPage(aParent, *m_pOutSet);
             break;
 
         case PAGE_DBSETUPWIZARD_FINAL:
-            pPage = OFinalDBPageSetup::CreateFinalDBTabPageSetup(this,*m_pOutSet);
+            pPage = OFinalDBPageSetup::CreateFinalDBTabPageSetup(aParent, *m_pOutSet);
             m_pFinalPage = static_cast<OFinalDBPageSetup*> (pPage.get());
             break;
     }
@@ -553,6 +548,8 @@ VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
         enableButtons( WizardButtonFlags::FINISH, _nState == PAGE_DBSETUPWIZARD_FINAL );
         enableButtons( WizardButtonFlags::NEXT, _nState != PAGE_DBSETUPWIZARD_FINAL );
         pPage->Show();
+
+        m_xAssistant->set_page_title(sIdent, getStateDisplayName(_nState));
     }
     return pPage;
 }
@@ -606,7 +603,7 @@ IMPL_LINK_NOARG(ODbTypeWizDialogSetup, OnSingleDocumentChosen, OGeneralPageWizar
 void ODbTypeWizDialogSetup::enterState(WizardState _nState)
 {
     m_sURL = dbaui::ODbDataSourceAdministrationHelper::getDatasourceType(*m_pOutSet);
-    RoadmapWizard::enterState(_nState);
+    RoadmapWizardMachine::enterState(_nState);
     switch(_nState)
     {
         case PAGE_DBSETUPWIZARD_INTRO:
@@ -622,7 +619,7 @@ void ODbTypeWizDialogSetup::enterState(WizardState _nState)
 
 void ODbTypeWizDialogSetup::saveDatasource()
 {
-    SfxTabPage* pPage = static_cast<SfxTabPage*>(WizardDialog::GetPage(getCurrentState()));
+    SfxTabPage* pPage = static_cast<SfxTabPage*>(GetPage(getCurrentState()));
     if ( pPage )
         pPage->FillItemSet(m_pOutSet.get());
 }
@@ -635,14 +632,13 @@ bool ODbTypeWizDialogSetup::leaveState(WizardState _nState)
     {
         resetPages(m_pImpl->getCurrentDataSource());
     }
-    SfxTabPage* pPage = static_cast<SfxTabPage*>(WizardDialog::GetPage(_nState));
+    SfxTabPage* pPage = static_cast<SfxTabPage*>(GetPage(_nState));
     return pPage && pPage->DeactivatePage(m_pOutSet.get()) != DeactivateRC::KeepPage;
 }
 
-void ODbTypeWizDialogSetup::setTitle(const OUString& /*_sTitle*/)
+void ODbTypeWizDialogSetup::setTitle(const OUString& _sTitle)
 {
-    OSL_FAIL( "ODbTypeWizDialogSetup::setTitle: not implemented!" );
-        // why?
+    m_xAssistant->set_title(_sTitle);
 }
 
 void ODbTypeWizDialogSetup::enableConfirmSettings( bool /*_bEnable*/ )
@@ -779,7 +775,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
         bool bRet = false;
         ::sfx2::FileDialogHelper aFileDlg(
                 ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION,
-                FileDialogFlags::NONE, GetFrameWeld());
+                FileDialogFlags::NONE, m_xAssistant.get());
         std::shared_ptr<const SfxFilter> pFilter = getStandardDatabaseFilter();
         if ( pFilter )
         {
@@ -971,7 +967,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
             // wants us to load could be a non-database document. Instead, we asynchronously
             // open the selected document. Thus, the wizard's return value is RET_CANCEL,
             // which means to not continue loading the database document
-            if ( !OWizardMachine::Finish() )
+            if ( !WizardMachine::Finish() )
                 return false;
 
             try
@@ -993,7 +989,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
             skipUntil(PAGE_DBSETUPWIZARD_FINAL);
         }
         if (getCurrentState() == PAGE_DBSETUPWIZARD_FINAL)
-            return SaveDatabaseDocument() && OWizardMachine::onFinish();
+            return SaveDatabaseDocument() && WizardMachine::onFinish();
         else
         {
             enableButtons( WizardButtonFlags::FINISH, false );
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 2ed044a43795..5fe9655c37e9 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -239,6 +239,7 @@ namespace dbaui
         {
             implSetCurrentType( dbaccess::ODsnTypeCollection::getEmbeddedDatabase() );
             sDisplayName = m_pCollection->getTypeDisplayName( m_eCurrentSelection );
+            onTypeSelected(m_eCurrentSelection);
         }
 
         // select the correct datasource type
@@ -451,6 +452,7 @@ namespace dbaui
         , m_xFT_EmbeddedDBLabel(m_xBuilder->weld_label("embeddeddbLabel"))
         , m_xEmbeddedDBType(m_xBuilder->weld_combo_box("embeddeddbList"))
         , m_xFT_DocListLabel(m_xBuilder->weld_label("docListLabel"))
+        , m_xFT_HelpText(m_xBuilder->weld_label("helpText"))
         , m_xLB_DocumentList(new OpenDocumentListBox(m_xBuilder->weld_combo_box("documentList"), "com.sun.star.sdb.OfficeDatabaseDocument"))
         , m_xPB_OpenDatabase(new OpenDocumentButton(m_xBuilder->weld_button("openDatabase"), "com.sun.star.sdb.OfficeDatabaseDocument"))
         , m_eOriginalCreationMode(eCreateNew)
@@ -482,7 +484,7 @@ namespace dbaui
 
         // do some knittings
         m_xEmbeddedDBType->connect_changed(LINK(this, OGeneralPageWizard, OnEmbeddedDBTypeSelected));
-        m_xRB_CreateDatabase->connect_clicked( LINK( this, OGeneralPageWizard, OnCreateDatabaseModeSelected ) );
+        m_xRB_CreateDatabase->connect_clicked( LINK( this, OGeneralPageWizard, OnSetupModeSelected ) );
         m_xRB_ConnectDatabase->connect_clicked( LINK( this, OGeneralPageWizard, OnSetupModeSelected ) );
         m_xRB_OpenExistingDatabase->connect_clicked( LINK( this, OGeneralPageWizard, OnSetupModeSelected ) );
         m_xLB_DocumentList->connect_changed( LINK( this, OGeneralPageWizard, OnDocumentSelected ) );
@@ -532,18 +534,13 @@ namespace dbaui
             m_xFT_DocListLabel->set_sensitive( false );
             m_xLB_DocumentList->set_sensitive( false );
         }
-        else
-        {
-            m_xDatasourceType->set_sensitive( false );
-            m_xPB_OpenDatabase->set_sensitive( false );
-            m_xFT_DocListLabel->set_sensitive( false );
-            m_xLB_DocumentList->set_sensitive( false );
-        }
 
         if (m_xLB_DocumentList->get_count())
             m_xLB_DocumentList->set_active(0);
 
         m_eOriginalCreationMode = GetDatabaseCreationMode();
+
+        SetupModeSelected();
     }
 
     OUString OGeneralPageWizard::getDatasourceName(const SfxItemSet& _rSet)
@@ -620,12 +617,8 @@ namespace dbaui
             return m_xLB_DocumentList->GetSelectedDocumentURL();
     }
 
-    IMPL_LINK_NOARG( OGeneralPageWizard, OnCreateDatabaseModeSelected, weld::Button&, void )
+    void OGeneralPageWizard::EnableControls()
     {
-        m_aCreationModeHandler.Call( *this );
-
-        OnEmbeddedDBTypeSelected( *m_xEmbeddedDBType );
-
         bool bValid, bReadonly;
         getFlags( GetItemSet(), bValid, bReadonly );
         if ( bValid && !bReadonly )
@@ -639,22 +632,21 @@ namespace dbaui
         }
     }
 
-    IMPL_LINK_NOARG( OGeneralPageWizard, OnSetupModeSelected, weld::Button&, void )
+    void OGeneralPageWizard::SetupModeSelected()
     {
         m_aCreationModeHandler.Call( *this );
-        OnDatasourceTypeSelected(*m_xDatasourceType);
 
-        bool bValid, bReadonly;
-        getFlags( GetItemSet(), bValid, bReadonly );
-        if ( bValid && !bReadonly )
-        {
-            m_xEmbeddedDBType->set_sensitive(m_xRB_CreateDatabase->get_active());
-            m_xFT_EmbeddedDBLabel->set_sensitive(m_xRB_CreateDatabase->get_active());
-            m_xDatasourceType->set_sensitive(m_xRB_ConnectDatabase->get_active());
-            m_xPB_OpenDatabase->set_sensitive(m_xRB_OpenExistingDatabase->get_active());
-            m_xFT_DocListLabel->set_sensitive(m_xRB_OpenExistingDatabase->get_active());
-            m_xLB_DocumentList->set_sensitive(m_xRB_OpenExistingDatabase->get_active());
-        }
+        if (m_xRB_CreateDatabase->get_active())
+            OnEmbeddedDBTypeSelected(*m_xEmbeddedDBType);
+        else
+            OnDatasourceTypeSelected(*m_xDatasourceType);
+
+        EnableControls();
+    }
+
+    IMPL_LINK_NOARG( OGeneralPageWizard, OnSetupModeSelected, weld::Button&, void )
+    {
+        SetupModeSelected();
     }
 
     IMPL_LINK_NOARG( OGeneralPageWizard, OnDocumentSelected, weld::ComboBox&, void )
diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx
index 359ed6641f82..63d8736ea38b 100644
--- a/dbaccess/source/ui/dlg/generalpage.hxx
+++ b/dbaccess/source/ui/dlg/generalpage.hxx
@@ -137,6 +137,7 @@ namespace dbaui
         std::unique_ptr<weld::ComboBox> m_xEmbeddedDBType;
 
         std::unique_ptr<weld::Label> m_xFT_DocListLabel;
+        std::unique_ptr<weld::Label> m_xFT_HelpText;
         std::unique_ptr<OpenDocumentListBox> m_xLB_DocumentList;
         std::unique_ptr<OpenDocumentButton> m_xPB_OpenDatabase;
 
@@ -151,6 +152,8 @@ namespace dbaui
         bool                    m_bInitEmbeddedDBList : 1;
         void                    insertEmbeddedDBTypeEntryData( const OUString& _sType, const OUString& sDisplayName );
 
+        void                    EnableControls();
+
     public:
         void                    SetCreationModeHandler( const Link<OGeneralPageWizard&,void>& _rHandler ) { m_aCreationModeHandler = _rHandler; }
         CreationMode            GetDatabaseCreationMode() const;
@@ -174,8 +177,9 @@ namespace dbaui
         OUString getEmbeddedDBName( const SfxItemSet& _rSet );
         void initializeEmbeddedDBList();
 
+        void SetupModeSelected();
+
         DECL_LINK( OnEmbeddedDBTypeSelected, weld::ComboBox&, void );
-        DECL_LINK( OnCreateDatabaseModeSelected, weld::Button&, void );
         DECL_LINK( OnSetupModeSelected, weld::Button&, void );
         DECL_LINK( OnDocumentSelected, weld::ComboBox&, void );
         DECL_LINK( OnOpenDocument, weld::Button&, void );
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index f4e4204d9c4c..3bcb10c4ebcd 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -509,7 +509,7 @@ void OSQLMessageBox::impl_addDetailsButton()
     if ( bMoreDetailsAvailable )
     {
         m_xDialog->add_button(Button::GetStandardText(StandardButtonType::More), RET_MORE);
-        m_xMoreButton.reset(m_xDialog->get_widget_for_response(RET_MORE));
+        m_xMoreButton.reset(m_xDialog->weld_widget_for_response(RET_MORE));
         m_xMoreButton->connect_clicked(LINK(this, OSQLMessageBox, ButtonClickHdl));
     }
 }
diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx
index 25001361b3f5..16969b467ee3 100644
--- a/dbaccess/source/ui/inc/dbwizsetup.hxx
+++ b/dbaccess/source/ui/inc/dbwizsetup.hxx
@@ -54,7 +54,7 @@ class ODbDataSourceAdministrationHelper;
 class OMySQLIntroPageSetup;
 class OFinalDBPageSetup;
 
-class ODbTypeWizDialogSetup final : public vcl::RoadmapWizard , public IItemSetHelper, public IDatabaseSettingsDialog
+class ODbTypeWizDialogSetup final : public vcl::RoadmapWizardMachine, public IItemSetHelper, public IDatabaseSettingsDialog
 {
 private:
     std::unique_ptr<ODbDataSourceAdministrationHelper>  m_pImpl;
@@ -89,13 +89,12 @@ public:
     /** ctor. The itemset given should have been created by <method>createItemSet</method> and should be destroyed
         after the dialog has been destroyed
     */
-    ODbTypeWizDialogSetup(vcl::Window* pParent
+    ODbTypeWizDialogSetup(weld::Window* pParent
         ,SfxItemSet const * _pItems
         ,const css::uno::Reference< css::uno::XComponentContext >& _rxORB
         ,const css::uno::Any& _aDataSourceName
         );
     virtual ~ODbTypeWizDialogSetup() override;
-    virtual void dispose() override;
 
     virtual const SfxItemSet* getOutputSet() const override;
     virtual SfxItemSet* getWriteOutputSet() override;
diff --git a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx
index f8d021055730..8361a2325cea 100644
--- a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx
+++ b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx
@@ -27,7 +27,7 @@
 #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
 #include <com/sun/star/sdbc/XDataSource.hpp>
 #include <comphelper/processfactory.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
+#include <vcl/svapp.hxx>
 
 using namespace dbaui;
 
@@ -108,14 +108,14 @@ Reference<XPropertySetInfo>  SAL_CALL ODBTypeWizDialogSetup::getPropertySetInfo(
 
 svt::OGenericUnoDialog::Dialog ODBTypeWizDialogSetup::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
 {
-    return svt::OGenericUnoDialog::Dialog(VclPtr<ODbTypeWizDialogSetup>::Create(VCLUnoHelper::GetWindow(rParent), m_pDatasourceItems.get(), m_aContext, m_aInitialSelection));
+    return svt::OGenericUnoDialog::Dialog(std::make_unique<ODbTypeWizDialogSetup>(Application::GetFrameWeld(rParent), m_pDatasourceItems.get(), m_aContext, m_aInitialSelection));
 }
 
 void ODBTypeWizDialogSetup::executedDialog(sal_Int16 _nExecutionResult)
 {
     if ( _nExecutionResult == RET_OK )
     {
-        const ODbTypeWizDialogSetup* pDialog = static_cast<ODbTypeWizDialogSetup*>(m_aDialog.m_xVclDialog.get());
+        const ODbTypeWizDialogSetup* pDialog = static_cast<ODbTypeWizDialogSetup*>(m_aDialog.m_xWeldDialog.get());
         m_bOpenDatabase = pDialog->IsDatabaseDocumentToBeOpened();
         m_bStartTableWizard = pDialog->IsTableWizardToBeStarted();
     }
diff --git a/dbaccess/uiconfig/ui/authentificationpage.ui b/dbaccess/uiconfig/ui/authentificationpage.ui
index 0c1a6a44a3b0..3515cb813f6b 100644
--- a/dbaccess/uiconfig/ui/authentificationpage.ui
+++ b/dbaccess/uiconfig/ui/authentificationpage.ui
@@ -34,8 +34,8 @@
         <property name="margin_bottom">6</property>
         <property name="label" translatable="yes" context="authentificationpage|helptext">Some databases require you to enter a user name.</property>
         <property name="wrap">True</property>
-        <property name="width_chars">60</property>
-        <property name="max_width_chars">60</property>
+        <property name="width_chars">72</property>
+        <property name="max_width_chars">72</property>
         <property name="xalign">0</property>
       </object>
       <packing>
diff --git a/dbaccess/uiconfig/ui/databasewizard.ui b/dbaccess/uiconfig/ui/databasewizard.ui
new file mode 100644
index 000000000000..5f07332a825e
--- /dev/null
+++ b/dbaccess/uiconfig/ui/databasewizard.ui
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface domain="dba">
+  <requires lib="gtk+" version="3.20"/>
+  <object class="GtkAssistant" id="DatabaseWizard">
+    <property name="can_focus">True</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes" context="databasewizard|DatabaseWizard">Database Wizard</property>
+    <property name="modal">True</property>
+    <property name="default_width">0</property>
+    <property name="default_height">0</property>
+    <property name="type_hint">dialog</property>
+    <property name="use_header_bar">0</property>
+    <child>
+      <placeholder/>
+    </child>
+  </object>
+</interface>
diff --git a/dbaccess/uiconfig/ui/dbasepage.ui b/dbaccess/uiconfig/ui/dbasepage.ui
index dfe64734364e..244b754d48bc 100644
--- a/dbaccess/uiconfig/ui/dbasepage.ui
+++ b/dbaccess/uiconfig/ui/dbasepage.ui
@@ -120,8 +120,8 @@
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes" context="dbasepage|specMessageLabel">Note: When deleted, and thus inactive, records are displayed, you will not be able to delete records from the data source.</property>
                     <property name="wrap">True</property>
-                    <property name="width_chars">60</property>
-                    <property name="max_width_chars">60</property>
+                    <property name="width_chars">72</property>
+                    <property name="max_width_chars">72</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
diff --git a/dbaccess/uiconfig/ui/dbwizconnectionpage.ui b/dbaccess/uiconfig/ui/dbwizconnectionpage.ui
index 3d022c5307e7..81249794875d 100644
--- a/dbaccess/uiconfig/ui/dbwizconnectionpage.ui
+++ b/dbaccess/uiconfig/ui/dbwizconnectionpage.ui
@@ -33,7 +33,8 @@
         <property name="margin_bottom">6</property>
         <property name="label" translatable="yes" context="dbwizconnectionpage|helptext">label</property>
         <property name="wrap">True</property>
-        <property name="max_width_chars">60</property>
+        <property name="width_chars">72</property>
+        <property name="max_width_chars">72</property>
         <property name="xalign">0</property>
       </object>
       <packing>
@@ -46,6 +47,7 @@
       <object class="GtkGrid" id="grid1">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
+        <property name="hexpand">True</property>
         <property name="row_spacing">6</property>
         <property name="column_spacing">12</property>
         <child>
@@ -92,6 +94,7 @@
           <object class="GtkGrid">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
             <child>
               <object class="GtkEntry" id="browseurl">
                 <property name="visible">True</property>
diff --git a/dbaccess/uiconfig/ui/dbwizmysqlintropage.ui b/dbaccess/uiconfig/ui/dbwizmysqlintropage.ui
index 8f1d39966b27..224f17189da2 100644
--- a/dbaccess/uiconfig/ui/dbwizmysqlintropage.ui
+++ b/dbaccess/uiconfig/ui/dbwizmysqlintropage.ui
@@ -23,7 +23,6 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="top_padding">6</property>
-            <property name="left_padding">12</property>
             <child>
               <object class="GtkBox" id="box1">
                 <property name="visible">True</property>
@@ -37,8 +36,8 @@
                     <property name="label" translatable="yes" context="dbwizmysqlintropage|label2">You can connect to a MySQL database using either ODBC or JDBC.
 Please contact your system administrator if you are unsure about the following settings.</property>
                     <property name="wrap">True</property>
-                    <property name="width_chars">100</property>
-                    <property name="max_width_chars">100</property>
+                    <property name="width_chars">72</property>
+                    <property name="max_width_chars">72</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
diff --git a/dbaccess/uiconfig/ui/dbwizmysqlnativepage.ui b/dbaccess/uiconfig/ui/dbwizmysqlnativepage.ui
index 4eaa3ce7b4c1..5d2b38c6ecf4 100644
--- a/dbaccess/uiconfig/ui/dbwizmysqlnativepage.ui
+++ b/dbaccess/uiconfig/ui/dbwizmysqlnativepage.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="dba">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkBox" id="DBWizMysqlNativePage">
@@ -25,7 +25,6 @@
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
             <property name="top_padding">6</property>
-            <property name="left_padding">12</property>
             <child>
               <object class="GtkBox" id="box1">
                 <property name="visible">True</property>
@@ -37,10 +36,11 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="halign">start</property>
-                    <property name="xalign">0</property>
                     <property name="label" translatable="yes" context="dbwizmysqlnativepage|helptext">Please enter the required information to connect to a MySQL database.</property>
                     <property name="wrap">True</property>
-                    <property name="max_width_chars">100</property>
+                    <property name="width_chars">72</property>
+                    <property name="max_width_chars">72</property>
+                    <property name="xalign">0</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
diff --git a/dbaccess/uiconfig/ui/dbwizspreadsheetpage.ui b/dbaccess/uiconfig/ui/dbwizspreadsheetpage.ui
index 2dbe3dd2eb6b..ed65d12b29dc 100644
--- a/dbaccess/uiconfig/ui/dbwizspreadsheetpage.ui
+++ b/dbaccess/uiconfig/ui/dbwizspreadsheetpage.ui
@@ -6,7 +6,6 @@
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="hexpand">True</property>
-    <property name="vexpand">True</property>
     <property name="border_width">6</property>
     <property name="orientation">vertical</property>
     <property name="spacing">12</property>
@@ -24,7 +23,6 @@
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
             <property name="top_padding">6</property>
-            <property name="left_padding">12</property>
             <child>
               <object class="GtkBox" id="box1">
                 <property name="visible">True</property>
@@ -40,7 +38,8 @@
                     <property name="halign">start</property>
                     <property name="hexpand">True</property>
                     <property name="wrap">True</property>
-                    <property name="max_width_chars">100</property>
+                    <property name="width_chars">72</property>
+                    <property name="max_width_chars">72</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -100,10 +99,12 @@
                       <object class="GtkGrid">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="hexpand">True</property>
                         <child>
                           <object class="GtkEntry" id="browseurl">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
+                            <property name="hexpand">True</property>
                             <property name="activates_default">True</property>
                           </object>
                           <packing>
@@ -127,6 +128,22 @@
                         <property name="top_attach">1</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkCheckButton" id="passwordrequired">
+                        <property name="label" translatable="yes" context="dbwizspreadsheetpage|passwordrequired">_Password required</property>
+                        <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="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">2</property>
+                        <property name="width">3</property>
+                      </packing>
+                    </child>
                   </object>
                   <packing>
                     <property name="expand">True</property>
@@ -154,21 +171,5 @@
         <property name="position">0</property>
       </packing>
     </child>
-    <child>
-      <object class="GtkCheckButton" id="passwordrequired">
-        <property name="label" translatable="yes" context="dbwizspreadsheetpage|passwordrequired">_Password required</property>
-        <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="xalign">0</property>
-        <property name="draw_indicator">True</property>
-      </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">1</property>
-      </packing>
-    </child>
   </object>
 </interface>
diff --git a/dbaccess/uiconfig/ui/dbwiztextpage.ui b/dbaccess/uiconfig/ui/dbwiztextpage.ui
index bbb6600d4232..24b4e57a787f 100644
--- a/dbaccess/uiconfig/ui/dbwiztextpage.ui
+++ b/dbaccess/uiconfig/ui/dbwiztextpage.ui
@@ -24,7 +24,6 @@
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
             <property name="top_padding">6</property>
-            <property name="left_padding">12</property>
             <child>
               <object class="GtkBox" id="box1">
                 <property name="visible">True</property>
@@ -40,7 +39,8 @@
                     <property name="halign">start</property>
                     <property name="hexpand">True</property>
                     <property name="wrap">True</property>
-                    <property name="max_width_chars">100</property>
+                    <property name="width_chars">72</property>
+                    <property name="max_width_chars">72</property>
                     <property name="xalign">0</property>
                   </object>
                   <packing>
@@ -100,10 +100,12 @@
                       <object class="GtkGrid">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="hexpand">True</property>
                         <child>
                           <object class="GtkEntry" id="browseurl">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
+                            <property name="hexpand">True</property>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
@@ -158,8 +160,6 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="hexpand">True</property>
-        <property name="vexpand">True</property>
-        <property name="border_width">6</property>
         <property name="orientation">vertical</property>
         <property name="spacing">12</property>
         <child>
diff --git a/dbaccess/uiconfig/ui/finalpagewizard.ui b/dbaccess/uiconfig/ui/finalpagewizard.ui
index 919421029fa1..8e065ea1faa0 100644
--- a/dbaccess/uiconfig/ui/finalpagewizard.ui
+++ b/dbaccess/uiconfig/ui/finalpagewizard.ui
@@ -2,28 +2,28 @@
 <!-- Generated with glade 3.22.1 -->
 <interface domain="dba">
   <requires lib="gtk+" version="3.18"/>
-  <object class="GtkBox" id="PageFinal">
-    <property name="width_request">400</property>
+  <object class="GtkGrid" id="PageFinal">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="border_width">8</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <property name="border_width">6</property>
     <property name="orientation">vertical</property>
-    <property name="spacing">12</property>
+    <property name="row_spacing">12</property>
     <child>
       <object class="GtkLabel" id="headerText">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="label" translatable="yes" context="finalpagewizard|headerText">Decide How to Proceed After Saving the Database</property>
-        <property name="wrap">True</property>
+        <property name="single_line_mode">True</property>
         <property name="xalign">0</property>
         <attributes>
           <attribute name="weight" value="bold"/>
         </attributes>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">0</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">0</property>
       </packing>
     </child>
     <child>
@@ -42,7 +42,6 @@
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes" context="finalpagewizard|helpText">Do you want the wizard to register the database in %PRODUCTNAME?</property>
                 <property name="wrap">True</property>
-                <property name="wrap_mode">word-char</property>
                 <property name="width_chars">72</property>
                 <property name="max_width_chars">72</property>
                 <property name="xalign">0</property>
@@ -103,6 +102,7 @@
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes" context="finalpagewizard|additionalText">After the database file has been saved, what do you want to do?</property>
                 <property name="wrap">True</property>
+                <property name="width_chars">72</property>
                 <property name="max_width_chars">72</property>
                 <property name="xalign">0</property>
               </object>
@@ -163,9 +163,8 @@
         </child>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">1</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">1</property>
       </packing>
     </child>
   </object>
diff --git a/dbaccess/uiconfig/ui/generalpagewizard.ui b/dbaccess/uiconfig/ui/generalpagewizard.ui
index 8413935a4a34..32a666a71db9 100644
--- a/dbaccess/uiconfig/ui/generalpagewizard.ui
+++ b/dbaccess/uiconfig/ui/generalpagewizard.ui
@@ -2,34 +2,35 @@
 <!-- Generated with glade 3.22.1 -->
 <interface domain="dba">
   <requires lib="gtk+" version="3.18"/>
-  <object class="GtkBox" id="PageGeneral">
-    <property name="width_request">400</property>
+  <object class="GtkGrid" id="PageGeneral">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="border_width">8</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <property name="border_width">6</property>
     <property name="orientation">vertical</property>
-    <property name="spacing">6</property>
+    <property name="row_spacing">6</property>
     <child>
       <object class="GtkLabel" id="headerText">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="label" translatable="yes" context="generalpagewizard|headerText">Welcome to the %PRODUCTNAME Database Wizard</property>
-        <property name="wrap">True</property>
+        <property name="single_line_mode">True</property>
         <property name="xalign">0</property>
         <attributes>
           <attribute name="weight" value="bold"/>
         </attributes>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">0</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">0</property>
       </packing>
     </child>
     <child>
       <object class="GtkLabel" id="helpText">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
+        <property name="hexpand">True</property>
         <property name="label" translatable="yes" context="generalpagewizard|helpText">Use the Database Wizard to create a new database, open an existing database file, or connect to a database stored on a server.</property>
         <property name="wrap">True</property>
         <property name="width_chars">72</property>
@@ -37,9 +38,8 @@
         <property name="xalign">0</property>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">1</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">1</property>
       </packing>
     </child>
     <child>
@@ -51,9 +51,8 @@
         <property name="xalign">0</property>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">2</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">2</property>
       </packing>
     </child>
     <child>
@@ -69,9 +68,8 @@
         <property name="draw_indicator">True</property>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">3</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">3</property>
       </packing>
     </child>
     <child>
@@ -108,9 +106,8 @@
         </child>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">4</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">4</property>
       </packing>
     </child>
     <child>
@@ -127,9 +124,8 @@
         <property name="group">createDatabase</property>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">5</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">5</property>
       </packing>
     </child>
     <child>
@@ -167,9 +163,8 @@
         </child>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">6</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">6</property>
       </packing>
     </child>
     <child>
@@ -183,9 +178,8 @@
         <property name="always_show_image">True</property>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">7</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">7</property>
       </packing>
     </child>
     <child>
@@ -202,9 +196,8 @@
         <property name="group">createDatabase</property>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">8</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">8</property>
       </packing>
     </child>
     <child>
@@ -215,9 +208,8 @@
         <property name="margin_left">24</property>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">9</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">9</property>
       </packing>
     </child>
     <child>
@@ -226,9 +218,8 @@
         <property name="xalign">0</property>
       </object>
       <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">10</property>
+        <property name="left_attach">0</property>
+        <property name="top_attach">10</property>
       </packing>
     </child>
   </object>
diff --git a/dbaccess/uiconfig/ui/jdbcconnectionpage.ui b/dbaccess/uiconfig/ui/jdbcconnectionpage.ui
index 0df26ed00151..9e55d4e0e7ae 100644
--- a/dbaccess/uiconfig/ui/jdbcconnectionpage.ui
+++ b/dbaccess/uiconfig/ui/jdbcconnectionpage.ui
@@ -33,7 +33,8 @@
         <property name="can_focus">False</property>
         <property name="label" translatable="yes" context="jdbcconnectionpage|helptext">Please enter the required information to connect to a JDBC database. Please contact your system administrator if you are unsure about the following settings.</property>
         <property name="wrap">True</property>
-        <property name="max_width_chars">60</property>
+        <property name="width_chars">72</property>
+        <property name="max_width_chars">72</property>
         <property name="xalign">0</property>
       </object>
       <packing>
diff --git a/dbaccess/uiconfig/ui/ldapconnectionpage.ui b/dbaccess/uiconfig/ui/ldapconnectionpage.ui
index e386c06102d2..a64373d9d43e 100644
--- a/dbaccess/uiconfig/ui/ldapconnectionpage.ui
+++ b/dbaccess/uiconfig/ui/ldapconnectionpage.ui
@@ -37,8 +37,8 @@
         <property name="can_focus">False</property>
         <property name="label" translatable="yes" context="ldapconnectionpage|helpLabel">Please enter the required information to connect to an LDAP directory. Please contact your system administrator if you are unsure about the following settings.</property>
         <property name="wrap">True</property>
-        <property name="width_chars">80</property>
-        <property name="max_width_chars">80</property>
+        <property name="width_chars">72</property>
+        <property name="max_width_chars">72</property>
         <property name="xalign">0</property>
       </object>
       <packing>
diff --git a/dbaccess/uiconfig/ui/specialjdbcconnectionpage.ui b/dbaccess/uiconfig/ui/specialjdbcconnectionpage.ui
index 8fa89c34d21c..c63f6a2c03e4 100644
--- a/dbaccess/uiconfig/ui/specialjdbcconnectionpage.ui
+++ b/dbaccess/uiconfig/ui/specialjdbcconnectionpage.ui
@@ -38,8 +38,8 @@
         <property name="can_focus">False</property>
         <property name="label" translatable="yes" context="specialjdbcconnectionpage|helpLabel">Please enter the required information to connect to a MySQL database using JDBC. Note that a JDBC driver class must be installed on your system and registered with %PRODUCTNAME. Please contact your system administrator if you are unsure about the following settings. </property>
         <property name="wrap">True</property>
-        <property name="width_chars">80</property>
-        <property name="max_width_chars">80</property>
+        <property name="width_chars">72</property>
+        <property name="max_width_chars">72</property>
         <property name="xalign">0</property>
       </object>
       <packing>
@@ -133,6 +133,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="hexpand">True</property>
+                <property name="activates_default">True</property>
                 <property name="adjustment">adjustment1</property>
               </object>
               <packing>
diff --git a/include/svtools/helpids.h b/include/svtools/helpids.h
index 0c296ba613c2..ce1b29cf6cd6 100644
--- a/include/svtools/helpids.h
+++ b/include/svtools/helpids.h
@@ -45,9 +45,6 @@
 #define HID_FILEOPEN_IMAGE_TEMPLATE                            "SVT_HID_FILEOPEN_IMAGE_TEMPLATE"
 #define HID_FILEOPEN_IMAGE_ANCHOR                              "SVT_HID_FILEOPEN_IMAGE_ANCHOR"
 
-#define HID_WIZARD_NEXT                                        "SVT_HID_WIZARD_NEXT"
-#define HID_WIZARD_PREVIOUS                                    "SVT_HID_WIZARD_PREVIOUS"
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx
index 4fa4eab908f9..5bcaec41aa17 100644
--- a/include/tools/wintypes.hxx
+++ b/include/tools/wintypes.hxx
@@ -257,7 +257,10 @@ enum class StandardButtonType
     Ignore       = 8,
     Abort        = 9,
     Less         = 10,
-    Count        = 11,
+    Back         = 11,
+    Next         = 12,
+    Finish       = 13,
+    Count        = 14,
 };
 
 // prominent place for ListBox window types
diff --git a/include/vcl/roadmapwizard.hxx b/include/vcl/roadmapwizard.hxx
index 6764d40f8c6e..df0632af5085 100644
--- a/include/vcl/roadmapwizard.hxx
+++ b/include/vcl/roadmapwizard.hxx
@@ -75,6 +75,12 @@ namespace vcl
 
         void            SetRoadmapInteractive( bool _bInteractive );
 
+        void            InsertRoadmapItem(int nIndex, const OUString& rLabel, int nId, bool bEnabled);
+        void            DeleteRoadmapItems();
+        int             GetCurrentRoadmapItemID() const;
+        void            SelectRoadmapItemByID(int nId);
+        void            SetItemSelectHdl( const Link<LinkParamNone*,void>& _rHdl );
+
         // returns whether a given state is enabled
         bool            isStateEnabled( WizardState _nState ) const;
 
@@ -213,6 +219,146 @@ namespace vcl
         VCL_DLLPRIVATE void impl_construct();
     };
 
+    class VCL_DLLPUBLIC RoadmapWizardMachine : public vcl::WizardMachine, public RoadmapWizardTypes
+    {
+    private:
+        std::unique_ptr<RoadmapWizardImpl>  m_pImpl;
+
+    public:
+        RoadmapWizardMachine(weld::Window* _pParent);
+        virtual ~RoadmapWizardMachine( ) override;
+
+        void            SetRoadmapHelpId( const OString& _rId );
+
+        void            SetRoadmapInteractive( bool _bInteractive );
+
+        // returns whether a given state is enabled
+        bool            isStateEnabled( WizardState _nState ) const;
+
+        // WizardDialog overridables
+        virtual bool    canAdvance() const override;
+        virtual void    updateTravelUI() override;
+
+    protected:
+        /** declares a valid path in the wizard
+
+            The very first path which is declared is automatically activated.
+
+            Note that all paths which are declared must have the very first state in
+            common. Also note that due to a restriction of the very base class (WizardDialog),
+            this common first state must be 0.
+
+            You cannot declare new paths once the wizard started, so it's recommended that
+            you do all declarations within your derivee's constructor.
+
+            @see activatePath
+
+            @param _nId
+                the unique id you wish to give this path. This id can later on be used
+                to refer to the path which you just declared
+        */
+        void    declarePath( PathId _nPathId, const WizardPath& _lWizardStates);
+
+        /** provides basic information about a state
+
+            The given display name is used in the default implementation of getStateDisplayName,
+            and the given factory is used in the default implementation of createPage.
+        */
+        void    describeState( WizardState _nState, const OUString& _rStateDisplayName, RoadmapPageFactory _pPageFactory );
+
+        /** activates a path which has previously been declared with <member>declarePath</member>
+
+            You can only activate paths which share the first <code>k</code> states with the path
+            which is previously active (if any), where <code>k</code> is the index of the
+            current state within the current path.
+
+            <example>
+            Say you have paths, <code>(0,1,2,5)</code> and <code>(0,1,4,5)</code>. This means that after
+            step <code>1</code>, you either continue with state <code>2</code> or state <code>4</code>,
+            and after this, you finish in state <code>5</code>.<br/>
+            Now if the first path is active, and your current state is <code>1</code>, then you can
+            easily switch to the second path, since both paths start with <code>(0,1)</code>.<br/>
+            However, if your current state is <code>2</code>, then you can not switch to the second
+            path anymore.
+            </example>
+
+            @param _nPathId
+                the id of the path. The path must have been declared (under this id) with
+                <member>declarePath</member> before it can be activated.
+
+            @param _bDecideForIt
+                If <TRUE/>, the path will be completely activated, even if it is a conflicting path
+                (i.e. there is another path which shares the first <code>k</code> states with
+                the to-be-activated path.)<br/>
+                If <FALSE/>, then the new path is checked for conflicts with other paths. If such
+                conflicts exists, the path is not completely activated, but only up to the point
+                where it does <em>not</em> conflict.<br/>
+                With the paths in the example above, if you activate the second path (when both are
+                already declared), then only steps <code>0</code> and <code>1</code> are activated,
+                since they are common to both paths.
+        */
+        void    activatePath( PathId _nPathId, bool _bDecideForIt = false );
+
+        /** determine the next state to travel from the given one
+
+            This method (which is declared in OWizardMachine and overwritten here)
+            ensures that traveling happens along the active path.
+
+            @see activatePath
+        */
+        virtual WizardState     determineNextState( WizardState _nCurrentState ) const override;
+
+        /** en- or disables a state
+
+            In the wizard's roadmap, states to travel to can be freely chosen. To prevent
+            users from selecting a state which is currently not available, you can declare this
+            state as being disabled.
+
+            A situation where you need this may be when you have a checkbox which, when checked
+            by the user, enables a page with additional settings. As long as this checkbox is
+            not checked, the respective state would be disabled.
+
+            Note that in theory, you can declare multiple paths, instead of disabling states.
+            For instance, if you have a path where one state can be potentially disabled, then
+            you could declare a second path, which does not contain this state. However, the
+            disadvantage is that then, not the complete path would be visible in the roadmap,
+            but only all steps up to the point where the both paths diverge.<br/>
+            Another disadvantage is that the number of needed paths grows exponentially with
+            the number of states which can be potentially disabled.
+
+            @see declarePath
+        */
+        void    enableState( WizardState _nState, bool _bEnable = true );
+
+        /** returns true if and only if the given state is known in at least one declared path
+        */
+        bool    knowsState( WizardState _nState ) const;
+
+        // OWizardMachine overriables
+        virtual void            enterState( WizardState _nState ) override;
+
+        /** returns a human readable name for a given state
+
+            There is a default implementation for this method, which returns the display name
+            as given in a call to describeState. If there is no description for the given state,
+            this is worth an assertion in a non-product build, and then an empty string is
+            returned.
+        */
+        virtual OUString  getStateDisplayName( WizardState _nState ) const;
+
+        /** asks for a new label of the wizard page
+
+         */
+        void    updateRoadmapItemLabel( WizardState _nState );
+
+    private:
+        DECL_DLLPRIVATE_LINK( OnRoadmapItemSelected, const OString&, bool );
+
+        /** updates the roadmap control to show the given path, as far as possible
+            (modulo conflicts with other paths)
+        */
+        VCL_DLLPRIVATE void implUpdateRoadmap( );
+    };
 
 } // namespace vcl
 
diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx
index 1e8f59428e3f..c7ced830da49 100644
--- a/include/vcl/vclenum.hxx
+++ b/include/vcl/vclenum.hxx
@@ -273,6 +273,21 @@ enum class VclPolicyType
     NEVER
 };
 
+enum class WizardButtonFlags : sal_Int16
+{
+    NONE                = 0x0000,
+    NEXT                = 0x0001,
+    PREVIOUS            = 0x0002,
+    FINISH              = 0x0004,
+    CANCEL              = 0x0008,
+    HELP                = 0x0010,
+};
+
+namespace o3tl
+{
+    template<> struct typed_flags<WizardButtonFlags> : is_typed_flags<WizardButtonFlags, 0x001f> {};
+}
+
 #endif // INCLUDED_VCL_VCLENUM_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 198b7a72f0d6..d4b688243c68 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -250,6 +250,8 @@ class VCL_DLLPUBLIC Container : virtual public Widget
 public:
     //remove and add in one go
     virtual void move(weld::Widget* pWidget, weld::Container* pNewParent) = 0;
+    //recursively unset has-default on any buttons in the widget hierarchy
+    virtual void recursively_unset_default_buttons() = 0;
 };
 
 class VCL_DLLPUBLIC ScrolledWindow : virtual public Container
@@ -423,7 +425,7 @@ public:
     virtual void add_button(const OUString& rText, int response, const OString& rHelpId = OString())
         = 0;
     virtual void set_default_response(int response) = 0;
-    virtual Button* get_widget_for_response(int response) = 0;
+    virtual Button* weld_widget_for_response(int response) = 0;
     virtual Container* weld_content_area() = 0;
 
     // shrink the dialog down to shown just these widgets
@@ -457,6 +459,30 @@ public:
     virtual void set_background(const css::uno::Reference<css::graphic::XGraphic>& rImage) = 0;
 };
 
+class VCL_DLLPUBLIC Assistant : virtual public Dialog
+{
+protected:
+    Link<const OString&, bool> m_aJumpPageHdl;
+
+    bool signal_jump_page(const OString& rIdent) { return m_aJumpPageHdl.Call(rIdent); }
+
+public:
+    virtual int get_current_page() const = 0;
+    virtual int get_n_pages() const = 0;
+    virtual OString get_page_ident(int nPage) const = 0;
+    virtual OString get_current_page_ident() const = 0;
+    virtual void set_current_page(int nPage) = 0;
+    virtual void set_current_page(const OString& rIdent) = 0;
+    // move the page rIdent to position nIndex
+    virtual void set_page_index(const OString& rIdent, int nIndex) = 0;
+    virtual void set_page_title(const OString& rIdent, const OUString& rTitle) = 0;
+    virtual OUString get_page_title(const OString& rIdent) const = 0;
+    virtual void set_page_sensitive(const OString& rIdent, bool bSensitive) = 0;
+    virtual weld::Container* append_page(const OString& rIdent) = 0;
+
+    void connect_jump_page(const Link<const OString&, bool>& rLink) { m_aJumpPageHdl = rLink; }
+};
+
 struct VCL_DLLPUBLIC ComboBoxEntry
 {
     OUString sString;
@@ -1785,6 +1811,8 @@ public:
     virtual std::unique_ptr<AboutDialog> weld_about_dialog(const OString& id,
                                                            bool bTakeOwnership = true)
         = 0;
+    virtual std::unique_ptr<Assistant> weld_assistant(const OString& id, bool bTakeOwnership = true)
+        = 0;
     virtual std::unique_ptr<Window> weld_window(const OString& id, bool bTakeOwnership = true) = 0;
     virtual std::unique_ptr<Widget> weld_widget(const OString& id, bool bTakeOwnership = false) = 0;
     virtual std::unique_ptr<Container> weld_container(const OString& id,
@@ -1907,6 +1935,18 @@ public:
     OUString get_primary_text() const { return m_xDialog->get_primary_text(); }
     void set_default_response(int nResponse) { m_xDialog->set_default_response(nResponse); }
 };
+
+class VCL_DLLPUBLIC AssistantController : public DialogController
+{
+protected:
+    std::unique_ptr<weld::Builder> m_xBuilder;
+    std::unique_ptr<weld::Assistant> m_xAssistant;
+
+public:
+    AssistantController(weld::Widget* pParent, const OUString& rUIFile, const OString& rDialogId);
+    virtual Dialog* getDialog() override;
+    virtual ~AssistantController() override;
+};
 }
 #endif
 
diff --git a/include/vcl/wizardmachine.hxx b/include/vcl/wizardmachine.hxx
index 0b0afbce1576..c840af3f0745 100644
--- a/include/vcl/wizardmachine.hxx
+++ b/include/vcl/wizardmachine.hxx
@@ -31,20 +31,6 @@ namespace weld {
     class Container;
 }
 
-enum class WizardButtonFlags
-{
-    NONE                = 0x0000,
-    NEXT                = 0x0001,
-    PREVIOUS            = 0x0002,
-    FINISH              = 0x0004,
-    CANCEL              = 0x0008,
-    HELP                = 0x0010,
-};
-namespace o3tl
-{
-    template<> struct typed_flags<WizardButtonFlags> : is_typed_flags<WizardButtonFlags, 0x001f> {};
-}
-
 namespace vcl
 {
 
@@ -152,9 +138,6 @@ namespace vcl
     class VCL_DLLPUBLIC OWizardMachine : public WizardDialog, public WizardTypes
     {
     private:
-        // restrict access to some aspects of our base class
-        using WizardDialog::AddPage;
-        using WizardDialog::SetPage;
         //  TabPage*            GetPage( sal_uInt16 nLevel ) const { return WizardDialog::GetPage(nLevel); }
         // TODO: probably the complete page handling (next, previous etc.) should be prohibited ...
 
@@ -163,7 +146,7 @@ namespace vcl
         // here (e.g. committing page data) depend on having full control over page traveling.
         // So use the travelXXX methods if you need to travel
 
-    protected:
+    public:
         VclPtr<OKButton>       m_pFinish;
         VclPtr<CancelButton>   m_pCancel;
         VclPtr<PushButton>     m_pNextPage;
@@ -358,23 +341,245 @@ namespace vcl
         VCL_DLLPRIVATE void     implConstruct( const WizardButtonFlags _nButtonFlags );
     };
 
+    class VCL_DLLPUBLIC WizardMachine : public weld::AssistantController, public WizardTypes
+    {
+    private:
+        VclPtr<TabPage> m_xCurTabPage;
+
+        WizardState m_nCurState;
+        ImplWizPageData* m_pFirstPage;
+
+    protected:
+        std::unique_ptr<weld::Button> m_xFinish;
+        std::unique_ptr<weld::Button> m_xCancel;
+        std::unique_ptr<weld::Button> m_xNextPage;
+        std::unique_ptr<weld::Button> m_xPrevPage;
+        std::unique_ptr<weld::Button> m_xHelp;
+
+    private:
+        // hold members in this structure to allow keeping compatible when members are added
+        std::unique_ptr<WizardMachineImplData>  m_pImpl;
+
+    public:
+        WizardMachine(weld::Window* _pParent, WizardButtonFlags _nButtonFlags );
+        virtual ~WizardMachine() override;
+
+        bool Finish(short nResult = RET_CANCEL);
+        bool ShowPage(WizardState nState);
+
+        void                AddPage( TabPage* pPage );
+        void                SetPage( WizardState nLevel, TabPage* pPage );
+        TabPage*            GetPage( WizardState eState ) const;
+
+        /// enable (or disable) buttons
+        void                enableButtons(WizardButtonFlags _nWizardButtonFlags, bool _bEnable);
+        /// set the default style for a button
+        void                defaultButton(WizardButtonFlags _nWizardButtonFlags);
+        /// set the default style for a button
+        void                defaultButton(weld::Button* _pNewDefButton);
+
+        /// set the base of the title to use - the title of the current page is appended
+        void                setTitleBase(const OUString& _rTitleBase);
+
+        /// determines whether there is a next state to which we can advance
+        virtual bool        canAdvance() const;
+
+        /** updates the user interface which deals with traveling in the wizard
+
+            The default implementation simply checks whether both the current page and the wizard
+            itself allow to advance to the next state (<code>canAdvance</code>), and enables the "Next"
+            button if and only if this is the case.
+        */
+        virtual void        updateTravelUI();
+
+    protected:
+        // WizardDialog overridables
+        virtual void        ActivatePage();
+        virtual bool        DeactivatePage();
+
+        // our own overridables
+
+        /// to override to create new pages
+        virtual VclPtr<TabPage> createPage(WizardState _nState) = 0;
+
+        /// will be called when a new page is about to be displayed
+        virtual void        enterState(WizardState _nState);
+
+        /** will be called when the current state is about to be left for the given reason
+
+            The base implementation in this class will simply call <member>OWizardPage::commitPage</member>
+            for the current page, and return whatever this call returns.
+
+            @param _eReason
+                The reason why the state is to be left.
+            @return
+                <TRUE/> if and only if the page is allowed to be left
+        */
+        virtual bool        prepareLeaveCurrentState( CommitPageReason _eReason );
+
+        /** will be called when the given state is left
+
+            This is the very last possibility for derived classes to veto the deactivation
+            of a page.
+
+            @todo Normally, we would not need the return value here - derived classes now have
+            the possibility to veto page deactivations in <member>prepareLeaveCurrentState</member>. However,
+            changing this return type is too incompatible at the moment ...
+
+            @return
+                <TRUE/> if and only if the page is allowed to be left
+        */
+        virtual bool        leaveState( WizardState _nState );
+
+        /** determine the next state to travel from the given one
+
+            The default behaviour is linear traveling, overwrite this to change it
+
+            Return WZS_INVALID_STATE to prevent traveling.
+        */
+        virtual WizardState determineNextState( WizardState _nCurrentState ) const;
+
+        /** called when the finish button is pressed
+            <p>By default, only the base class' Finish method (which is not virtual) is called</p>
+        */
+        virtual bool        onFinish();
+
+        /// travel to the next state
+        bool                travelNext();
+
+        /// travel to the previous state
+        bool                travelPrevious();
+
+        /** enables the automatic enabled/disabled state of the "Next" button
+
+            If this is <TRUE/>, then upon entering a new state, the "Next" button will automatically be
+            enabled if and only if determineNextState does not return WZS_INVALID_STATE.
+        */
+        void                enableAutomaticNextButtonState();
+        bool                isAutomaticNextButtonStateEnabled() const;
+
+        /** removes a page from the history. Should be called when the page is being disabled
+        */
+        void                removePageFromHistory( WizardState nToRemove );
+
+        /** skip a state
+
+            The method behaves as if from the current state, <arg>_nSteps</arg> <method>travelNext</method>s were
+            called, but without actually creating or displaying the \EDntermediate pages. Only the
+            (<arg>_nSteps</arg> + 1)th page is created.
+
+            The skipped states appear in the state history, so <method>travelPrevious</method> will make use of them.
+
+            A very essential precondition for using this method is that your <method>determineNextState</method>
+            method is able to determine the next state without actually having the page of the current state.
+
+            @see skipUntil
+            @see skipBackwardUntil
+        */
+        void                    skip();
+
+        /** skips one or more states, until a given state is reached
+
+            The method behaves as if from the current state, <method>travelNext</method>s were called
+            successively, until <arg>_nTargetState</arg> is reached, but without actually creating or
+            displaying the \EDntermediate pages.
+
+            The skipped states appear in the state history, so <method>travelPrevious</method> will make use of them.
+
+            @return
+                <TRUE/> if and only if traveling was successful
+
+            @see skip
+            @see skipBackwardUntil
+        */
+        bool                    skipUntil( WizardState _nTargetState );
+
+        /** moves back one or more states, until a given state is reached
+
+            This method allows traveling backwards more than one state without actually showing the intermediate
+            states.
+
+            For instance, if you want to travel two steps backward at a time, you could used
+            two travelPrevious calls, but this would <em>show</em> both pages, which is not necessary,
+            since you're interested in the target page only. Using <member>skipBackwardUntil</member> relieves
+            you of this.
+
+            @return
+                <TRUE/> if and only if traveling was successful
+
+            @see skipUntil
+            @see skip
+        */
+        bool                    skipBackwardUntil( WizardState _nTargetState );
+
+        /** returns the current state of the machine
+
+            Vulgo, this is the identifier of the current tab page :)
+        */
+        WizardState             getCurrentState() const { return m_nCurState; }
+
+        virtual IWizardPageController*
+                                getPageController( TabPage* _pCurrentPage ) const;
+
+        /** retrieves a copy of the state history, i.e. all states we already visited
+        */
+        void                    getStateHistory( ::std::vector< WizardState >& _out_rHistory );
+
+    public:
+        class AccessGuard
+        {
+            friend class WizardTravelSuspension;
+        private:
+            AccessGuard() { }
+        };
+
+        void                   suspendTraveling( AccessGuard );
+        void                   resumeTraveling( AccessGuard );
+        bool                   isTravelingSuspended() const;
+
+    protected:
+        TabPage* GetOrCreatePage( const WizardState i_nState );
+
+    private:
+        DECL_DLLPRIVATE_LINK(OnNextPage, weld::Button&, void);
+        DECL_DLLPRIVATE_LINK(OnPrevPage, weld::Button&, void);
+        DECL_DLLPRIVATE_LINK(OnFinish, weld::Button&, void);
+        DECL_DLLPRIVATE_LINK(OnCancel, weld::Button&, void);
+
+        VCL_DLLPRIVATE void     implUpdateTitle();
+        VCL_DLLPRIVATE void     implConstruct( const WizardButtonFlags _nButtonFlags );
+    };
+
+
     /// helper class to temporarily suspend any traveling in the wizard
     class WizardTravelSuspension
     {
     public:
-        WizardTravelSuspension( OWizardMachine& _rWizard )
-            :m_rWizard( _rWizard )
+        WizardTravelSuspension(OWizardMachine& rWizard)
+            : m_pOWizard(&rWizard)
+            , m_pWizard(nullptr)
+        {
+            m_pOWizard->suspendTraveling(OWizardMachine::AccessGuard());
+        }
+
+        WizardTravelSuspension(WizardMachine& rWizard)
+            : m_pOWizard(nullptr)
+            , m_pWizard(&rWizard)
         {
-            m_rWizard.suspendTraveling( OWizardMachine::AccessGuard() );
+            m_pWizard->suspendTraveling(WizardMachine::AccessGuard());
         }
 
         ~WizardTravelSuspension()
         {
-            m_rWizard.resumeTraveling( OWizardMachine::AccessGuard() );
+            if (m_pOWizard)
+                m_pOWizard->resumeTraveling(OWizardMachine::AccessGuard());
+            if (m_pWizard)
+                m_pWizard->resumeTraveling(WizardMachine::AccessGuard());
         }
 
     private:
-        OWizardMachine& m_rWizard;
+        VclPtr<OWizardMachine> m_pOWizard;
+        WizardMachine* m_pWizard;
     };
 
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 66b5e3d1bbe2..e0f3ad3f35c3 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -50,6 +50,7 @@
 #include <vcl/menubtn.hxx>
 #include <vcl/prgsbar.hxx>
 #include <vcl/ptrstyle.hxx>
+#include <vcl/roadmapwizard.hxx>
 #include <vcl/slider.hxx>
 #include <vcl/sysdata.hxx>
 #include <vcl/svimpbox.hxx>
@@ -966,6 +967,35 @@ class SalInstanceContainer : public SalInstanceWidget, public virtual weld::Cont
 {
 private:
     VclPtr<vcl::Window> m_xContainer;
+
+    void implResetDefault(const vcl::Window* _pWindow)
+    {
+        vcl::Window* pChildLoop = _pWindow->GetWindow(GetWindowType::FirstChild);
+        while (pChildLoop)
+        {
+            // does the window participate in the tabbing order?
+            if (pChildLoop->GetStyle() & WB_DIALOGCONTROL)
+                implResetDefault(pChildLoop);
+
+            // is it a button?
+            WindowType eType = pChildLoop->GetType();
+            if  (   (WindowType::PUSHBUTTON == eType)
+                ||  (WindowType::OKBUTTON == eType)
+                ||  (WindowType::CANCELBUTTON == eType)
+                ||  (WindowType::HELPBUTTON == eType)
+                ||  (WindowType::IMAGEBUTTON == eType)
+                ||  (WindowType::MENUBUTTON == eType)
+                ||  (WindowType::MOREBUTTON == eType)
+                )
+            {
+                pChildLoop->SetStyle(pChildLoop->GetStyle() & ~WB_DEFBUTTON);
+            }
+
+            // the next one ...
+            pChildLoop = pChildLoop->GetWindow(GetWindowType::Next);
+        }
+    }
+
 public:
     SalInstanceContainer(vcl::Window* pContainer, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
         : SalInstanceWidget(pContainer, pBuilder, bTakeOwnership)
@@ -980,6 +1010,10 @@ public:
         assert(!pNewParent || pNewVclParent);
         pVclWidget->getWidget()->SetParent(pNewVclParent ? pNewVclParent->getWidget() : nullptr);
     }
+    virtual void recursively_unset_default_buttons() override
+    {
+        implResetDefault(m_xContainer.get());
+    }
 };
 
 std::unique_ptr<weld::Container> SalInstanceWidget::weld_parent() const
@@ -1358,7 +1392,7 @@ public:
         return m_xDialog->IsModalInputMode();
     }
 
-    virtual weld::Button* get_widget_for_response(int nResponse) override;
+    virtual weld::Button* weld_widget_for_response(int nResponse) override;
 
     virtual void set_default_response(int nResponse) override
     {
@@ -1448,6 +1482,218 @@ public:
     }
 };
 
+class SalInstanceAssistant : public SalInstanceDialog, public virtual weld::Assistant
+{
+private:
+    VclPtr<vcl::RoadmapWizard> m_xWizard;
+    std::vector<std::unique_ptr<SalInstanceContainer>> m_aPages;
+    std::vector<VclPtr<TabPage>> m_aAddedPages;
+    std::vector<int> m_aIds;
+    std::vector<VclPtr<VclGrid>> m_aAddedGrids;
+    Idle m_aUpdateRoadmapIdle;
+
+    int find_page(const OString& rIdent) const
+    {
+        for (size_t i = 0; i < m_aAddedPages.size(); ++i)
+        {
+            if (m_aAddedPages[i]->get_id().toUtf8() == rIdent)
+                return i;
+        }
+        return -1;
+    }
+
+    int find_id(int nId) const
+    {
+        for (size_t i = 0; i < m_aIds.size(); ++i)
+        {
+            if (nId == m_aIds[i])
+                return i;
+        }
+        return -1;
+    }
+
+    DECL_LINK(OnRoadmapItemSelected, LinkParamNone*, void);
+    DECL_LINK(UpdateRoadmap_Hdl, Timer*, void);
+
+public:
+    SalInstanceAssistant(vcl::RoadmapWizard* pDialog, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+        : SalInstanceDialog(pDialog, pBuilder, bTakeOwnership)
+        , m_xWizard(pDialog)
+    {
+        m_xWizard->SetItemSelectHdl(LINK(this, SalInstanceAssistant, OnRoadmapItemSelected));
+
+        m_aUpdateRoadmapIdle.SetInvokeHandler(LINK(this, SalInstanceAssistant, UpdateRoadmap_Hdl));
+        m_aUpdateRoadmapIdle.SetPriority(TaskPriority::HIGHEST);
+    }
+
+    virtual int get_current_page() const override
+    {
+        return find_id(m_xWizard->GetCurLevel());
+    }
+
+    virtual int get_n_pages() const override
+    {
+        return m_aAddedPages.size();
+    }
+
+    virtual OString get_page_ident(int nPage) const override
+    {
+        return m_aAddedPages[nPage]->get_id().toUtf8();
+    }
+
+    virtual OString get_current_page_ident() const override
+    {
+        return get_page_ident(get_current_page());
+    }
+
+    virtual void set_current_page(int nPage) override
+    {
+        disable_notify_events();
+
+        // take the first shown page as the size for all pages
+        if (m_xWizard->GetPageSizePixel().Width() == 0)
+        {
+            TabPage* pPage = m_xWizard->GetPage(m_aIds[nPage]);
+            assert(pPage);
+            Size aPageSize(pPage->get_preferred_size());
+            m_xWizard->SetPageSizePixel(aPageSize);
+        }
+
+        m_xWizard->ShowPage(m_aIds[nPage]);
+        enable_notify_events();
+    }
+
+    virtual void set_current_page(const OString& rIdent) override
+    {
+        int nIndex = find_page(rIdent);
+        if (nIndex == -1)
+            return;
+        set_current_page(nIndex);
+    }
+
+    virtual void set_page_index(const OString& rIdent, int nNewIndex) override
+    {
+        int nOldIndex = find_page(rIdent);
+
+        if (nOldIndex == -1)
+            return;
+
+        if (nOldIndex == nNewIndex)
+            return;
+
+        disable_notify_events();
+
+        auto entry = std::move(m_aAddedPages[nOldIndex]);
+        m_aAddedPages.erase(m_aAddedPages.begin() + nOldIndex);
+        m_aAddedPages.insert(m_aAddedPages.begin() + nNewIndex, std::move(entry));
+
+        int nId = m_aIds[nOldIndex];
+        m_aIds.erase(m_aIds.begin() + nOldIndex);
+        m_aIds.insert(m_aIds.begin() + nNewIndex, nId);
+
+        m_aUpdateRoadmapIdle.Start();
+
+        enable_notify_events();
+    }
+
+    virtual weld::Container* append_page(const OString& rIdent) override
+    {
+        VclPtrInstance<TabPage> xPage(m_xWizard);
+        VclPtrInstance<VclGrid> xGrid(xPage);
+        xPage->set_id(OUString::fromUtf8(rIdent));
+        xPage->Show();
+        xGrid->set_hexpand(true);
+        xGrid->set_vexpand(true);
+        xGrid->Show();
+        m_xWizard->AddPage(xPage);
+        m_aIds.push_back(m_aAddedPages.size());
+        m_xWizard->SetPage(m_aIds.back(), xPage);
+        m_aAddedPages.push_back(xPage);
+        m_aAddedGrids.push_back(xGrid);
+
+        m_aUpdateRoadmapIdle.Start();
+
+        m_aPages.emplace_back(new SalInstanceContainer(xGrid, m_pBuilder, false));
+        return m_aPages.back().get();
+    }
+
+    virtual OUString get_page_title(const OString& rIdent) const override
+    {
+        int nIndex = find_page(rIdent);
+        if (nIndex == -1)
+            return OUString();
+        return m_aAddedPages[nIndex]->GetText();
+    }
+
+    virtual void set_page_title(const OString& rIdent, const OUString& rTitle) override
+    {
+        int nIndex = find_page(rIdent);
+        if (nIndex == -1)
+            return;
+        if (m_aAddedPages[nIndex]->GetText() != rTitle)
+        {
+            disable_notify_events();
+            m_aAddedPages[nIndex]->SetText(rTitle);
+            m_aUpdateRoadmapIdle.Start();
+            enable_notify_events();
+        }
+    }
+
+    virtual void set_page_sensitive(const OString& rIdent, bool bSensitive) override
+    {
+        int nIndex = find_page(rIdent);
+        if (nIndex == -1)
+            return;
+        if (m_aAddedPages[nIndex]->IsEnabled() != bSensitive)
+        {
+            disable_notify_events();
+            m_aAddedPages[nIndex]->Enable(bSensitive);
+            m_aUpdateRoadmapIdle.Start();
+            enable_notify_events();
+        }
+    }
+
+    weld::Button* weld_widget_for_response(int nResponse) override;
+
+    virtual ~SalInstanceAssistant() override
+    {
+        for (auto &rGrid : m_aAddedGrids)
+            rGrid.disposeAndClear();
+        for (auto &rPage : m_aAddedPages)
+            rPage.disposeAndClear();
+    }
+};
+
+IMPL_LINK_NOARG(SalInstanceAssistant, OnRoadmapItemSelected, LinkParamNone*, void)
+{
+    if (notify_events_disabled())
+        return;
+    int nPageIndex(find_id(m_xWizard->GetCurrentRoadmapItemID()));
+    if (!signal_jump_page(get_page_ident(nPageIndex)))
+        m_xWizard->SelectRoadmapItemByID(m_xWizard->GetCurLevel());
+}
+
+IMPL_LINK_NOARG(SalInstanceAssistant, UpdateRoadmap_Hdl, Timer*, void)
+{
+    disable_notify_events();
+
+    m_xWizard->DeleteRoadmapItems();
+
+    int nPos = 0;
+    for (size_t i = 0; i < m_aAddedPages.size(); ++i)
+    {
+        const OUString& rLabel = m_aAddedPages[i]->GetText();
+        bool bSensitive = m_aAddedPages[i]->IsEnabled();
+        if (rLabel.isEmpty())
+            continue;
+        m_xWizard->InsertRoadmapItem(nPos++, rLabel, m_aIds[i], bSensitive);
+    }
+
+    m_xWizard->SelectRoadmapItemByID(m_aIds[get_current_page()]);
+
+    enable_notify_events();
+}
+
 class SalInstanceFrame : public SalInstanceContainer, public virtual weld::Frame
 {
 private:
@@ -1978,12 +2224,30 @@ IMPL_LINK(SalInstanceButton, ClickHdl, ::Button*, pButton, void)
     signal_clicked();
 }
 
-weld::Button* SalInstanceDialog::get_widget_for_response(int nResponse)
+weld::Button* SalInstanceDialog::weld_widget_for_response(int nResponse)
 {
     PushButton* pButton = dynamic_cast<PushButton*>(m_xDialog->get_widget_for_response(nResponse));
     return pButton ? new SalInstanceButton(pButton, nullptr, false) : nullptr;
 }
 
+weld::Button* SalInstanceAssistant::weld_widget_for_response(int nResponse)
+{
+    PushButton* pButton = nullptr;
+    if (nResponse == static_cast<int>(WizardButtonFlags::NEXT))
+        pButton = m_xWizard->m_pNextPage;
+    else if (nResponse == static_cast<int>(WizardButtonFlags::PREVIOUS))
+        pButton = m_xWizard->m_pPrevPage;
+    else if (nResponse == static_cast<int>(WizardButtonFlags::FINISH))
+        pButton = m_xWizard->m_pFinish;
+    else if (nResponse == static_cast<int>(WizardButtonFlags::CANCEL))
+        pButton = m_xWizard->m_pCancel;
+    else if (nResponse == static_cast<int>(WizardButtonFlags::HELP))
+        pButton = m_xWizard->m_pHelp;
+    if (pButton)
+        return new SalInstanceButton(pButton, nullptr, false);
+    return nullptr;
+}
+
 class SalInstanceMenuButton : public SalInstanceButton, public virtual weld::MenuButton
 {
 private:
@@ -5286,6 +5550,19 @@ public:
         return pRet;
     }
 
+    virtual std::unique_ptr<weld::Assistant> weld_assistant(const OString &id, bool bTakeOwnership) override
+    {
+        vcl::RoadmapWizard* pDialog = m_xBuilder->get<vcl::RoadmapWizard>(id);
+        std::unique_ptr<weld::Assistant> pRet(pDialog ? new SalInstanceAssistant(pDialog, this, false) : nullptr);
+        if (bTakeOwnership && pDialog)
+        {
+            assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed");
+            m_aOwnedToplevel.set(pDialog);
+            m_xBuilder->drop_ownership(pDialog);
+        }
+        return pRet;
+    }
+
     virtual std::unique_ptr<weld::Window> weld_window(const OString &id, bool bTakeOwnership) override
     {
         SystemWindow* pWindow = m_xBuilder->get<SystemWindow>(id);
@@ -5676,6 +5953,18 @@ namespace weld
         }
     }
 
+    AssistantController::AssistantController(weld::Widget* pParent, const OUString &rUIFile, const OString& rDialogId)
+        : m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
+        , m_xAssistant(m_xBuilder->weld_assistant(rDialogId))
+    {
+    }
+
+    Dialog* AssistantController::getDialog() { return m_xAssistant.get(); }
+
+    AssistantController::~AssistantController()
+    {
+    }
+
     void TriStateEnabled::ButtonToggled(weld::ToggleButton& rToggle)
     {
         if (bTriStateEnabled)
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 8a076fadceb9..8669e655479f 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -145,6 +145,9 @@ OUString Button::GetStandardText(StandardButtonType eButton)
         SV_BUTTONTEXT_IGNORE,
         SV_BUTTONTEXT_ABORT,
         SV_BUTTONTEXT_LESS,
+        STR_WIZDLG_PREVIOUS,
+        STR_WIZDLG_NEXT,
+        STR_WIZDLG_FINISH,
     };
 
     return VclResId(aResIdAry[static_cast<sal_uInt16>(eButton)]);
diff --git a/vcl/source/control/roadmapwizard.cxx b/vcl/source/control/roadmapwizard.cxx
index ec27bb6dae82..2d29a71aa47a 100644
--- a/vcl/source/control/roadmapwizard.cxx
+++ b/vcl/source/control/roadmapwizard.cxx
@@ -124,6 +124,13 @@ namespace vcl
         impl_construct();
     }
 
+    RoadmapWizardMachine::RoadmapWizardMachine(weld::Window* pParent)
+        : WizardMachine(pParent, WizardButtonFlags::NEXT | WizardButtonFlags::PREVIOUS | WizardButtonFlags::FINISH | WizardButtonFlags::CANCEL | WizardButtonFlags::HELP)
+        , m_pImpl( new RoadmapWizardImpl )
+    {
+        m_xAssistant->connect_jump_page(LINK(this, RoadmapWizardMachine, OnRoadmapItemSelected));
+    }
+
     void RoadmapWizard::impl_construct()
     {
         SetLeftAlignedButtonCount( 1 );
@@ -143,12 +150,15 @@ namespace vcl
         m_pImpl->pRoadmap->Show();
     }
 
-
     RoadmapWizard::~RoadmapWizard()
     {
         disposeOnce();
     }
 
+    RoadmapWizardMachine::~RoadmapWizardMachine()
+    {
+    }
+
     void RoadmapWizard::dispose()
     {
         m_pImpl.reset();
@@ -160,12 +170,15 @@ namespace vcl
         m_pImpl->pRoadmap->SetHelpId( _rId );
     }
 
-
     void RoadmapWizard::SetRoadmapInteractive( bool _bInteractive )
     {
         m_pImpl->pRoadmap->SetRoadmapInteractive( _bInteractive );
     }
 
+    void RoadmapWizardMachine::SetRoadmapInteractive( bool _bInteractive )
+    {
+        m_pImpl->pRoadmap->SetRoadmapInteractive( _bInteractive );
+    }
 
     void RoadmapWizard::declarePath( PathId _nPathId, const WizardPath& _lWizardStates)
     {
@@ -179,6 +192,17 @@ namespace vcl
             implUpdateRoadmap( );
     }
 
+    void RoadmapWizardMachine::declarePath( PathId _nPathId, const WizardPath& _lWizardStates)
+    {
+
+        m_pImpl->aPaths.emplace( _nPathId, _lWizardStates );
+
+        if ( m_pImpl->aPaths.size() == 1 )
+            // the very first path -> activate it
+            activatePath( _nPathId );
+        else
+            implUpdateRoadmap( );
+    }
 
     void RoadmapWizard::describeState( WizardState _nState, const OUString& _rStateDisplayName, RoadmapPageFactory _pPageFactory )
     {
@@ -187,7 +211,6 @@ namespace vcl
         m_pImpl->aStateDescriptors[ _nState ] = StateDescriptions::mapped_type( _rStateDisplayName, _pPageFactory );
     }
 
-
     void RoadmapWizard::activatePath( PathId _nPathId, bool _bDecideForIt )
     {
 
@@ -231,6 +254,47 @@ namespace vcl
         implUpdateRoadmap( );
     }
 
+    void RoadmapWizardMachine::activatePath( PathId _nPathId, bool _bDecideForIt )
+    {
+        if ( ( _nPathId == m_pImpl->nActivePath ) && ( _bDecideForIt == m_pImpl->bActivePathIsDefinite ) )
+            // nothing to do
+            return;
+
+        // does the given path exist?
+        Paths::const_iterator aNewPathPos = m_pImpl->aPaths.find( _nPathId );
+        DBG_ASSERT( aNewPathPos != m_pImpl->aPaths.end(), "RoadmapWizard::activate: there is no such path!" );
+        if ( aNewPathPos == m_pImpl->aPaths.end() )
+            return;
+
+        // determine the index of the current state in the current path
+        sal_Int32 nCurrentStatePathIndex = -1;
+        if ( m_pImpl->nActivePath != -1 )
+            nCurrentStatePathIndex = m_pImpl->getStateIndexInPath( getCurrentState(), m_pImpl->nActivePath );
+
+        DBG_ASSERT( static_cast<sal_Int32>(aNewPathPos->second.size()) > nCurrentStatePathIndex,
+            "RoadmapWizard::activate: you cannot activate a path which has less states than we've already advanced!" );
+            // If this asserts, this for instance means that we are already in state number, say, 5
+            // of our current path, and the caller tries to activate a path which has less than 5
+            // states
+        if ( static_cast<sal_Int32>(aNewPathPos->second.size()) <= nCurrentStatePathIndex )
+            return;
+
+        // assert that the current and the new path are equal, up to nCurrentStatePathIndex
+        Paths::const_iterator aActivePathPos = m_pImpl->aPaths.find( m_pImpl->nActivePath );
+        if ( aActivePathPos != m_pImpl->aPaths.end() )
+        {
+            if ( RoadmapWizardImpl::getFirstDifferentIndex( aActivePathPos->second, aNewPathPos->second ) <= nCurrentStatePathIndex )
+            {
+                OSL_FAIL( "RoadmapWizard::activate: you cannot activate a path which conflicts with the current one *before* the current state!" );
+                return;
+            }
+        }
+
+        m_pImpl->nActivePath = _nPathId;
+        m_pImpl->bActivePathIsDefinite = _bDecideForIt;
+
+        implUpdateRoadmap( );
+    }
 
     void RoadmapWizard::implUpdateRoadmap( )
     {
@@ -337,6 +401,110 @@ namespace vcl
         m_pImpl->pRoadmap->SetRoadmapComplete( !bIncompletePath );
     }
 
+    void RoadmapWizardMachine::implUpdateRoadmap( )
+    {
+
+        DBG_ASSERT( m_pImpl->aPaths.find( m_pImpl->nActivePath ) != m_pImpl->aPaths.end(),
+            "RoadmapWizard::implUpdateRoadmap: there is no such path!" );
+        const WizardPath& rActivePath( m_pImpl->aPaths[ m_pImpl->nActivePath ] );
+
+        sal_Int32 nCurrentStatePathIndex = RoadmapWizardImpl::getStateIndexInPath( getCurrentState(), rActivePath );
+        if (nCurrentStatePathIndex < 0)
+            return;
+
+        // determine up to which index (in the new path) we have to display the items
+        RoadmapTypes::ItemIndex nUpperStepBoundary = static_cast<RoadmapTypes::ItemIndex>(rActivePath.size());
+        if ( !m_pImpl->bActivePathIsDefinite )
+        {
+            for (auto const& path : m_pImpl->aPaths)
+            {
+                if ( path.first == m_pImpl->nActivePath )
+                    // it's the path we are just activating -> no need to check anything
+                    continue;
+                // the index from which on both paths differ
+                sal_Int32 nDivergenceIndex = RoadmapWizardImpl::getFirstDifferentIndex( rActivePath, path.second );
+                if ( nDivergenceIndex <= nCurrentStatePathIndex )
+                    // they differ in an index which we have already left behind us
+                    // -> this is no conflict anymore
+                    continue;
+
+                // the path conflicts with our new path -> don't activate the
+                // *complete* new path, but only up to the step which is unambiguous
+                nUpperStepBoundary = nDivergenceIndex;
+            }
+        }
+
+        // can we advance from the current page?
+        bool bCurrentPageCanAdvance = true;
+        TabPage* pCurrentPage = GetPage( getCurrentState() );
+        if ( pCurrentPage )
+        {
+            const IWizardPageController* pController = getPageController( GetPage( getCurrentState() ) );
+            OSL_ENSURE( pController != nullptr, "RoadmapWizard::implUpdateRoadmap: no controller for the current page!" );
+            bCurrentPageCanAdvance = !pController || pController->canAdvance();
+        }
+
+        // now, we have to remove all items after nCurrentStatePathIndex, and insert the items from the active
+        // path, up to (excluding) nUpperStepBoundary
+        RoadmapTypes::ItemIndex nRoadmapItems = m_xAssistant->get_n_pages();
+        RoadmapTypes::ItemIndex nLoopUntil = ::std::max( nUpperStepBoundary, nRoadmapItems );
+        for ( RoadmapTypes::ItemIndex nItemIndex = nCurrentStatePathIndex; nItemIndex < nLoopUntil; ++nItemIndex )
+        {
+            bool bExistentItem = ( nItemIndex < nRoadmapItems );
+            bool bNeedItem = ( nItemIndex < nUpperStepBoundary );
+
+            bool bInsertItem = false;
+            if ( bExistentItem )
+            {
+                if ( !bNeedItem )
+                {
+                    int nPages = nRoadmapItems;
+                    for (int i = nPages - 1; i >= nItemIndex; --i)
+                    {
+                        m_xAssistant->set_page_title(m_xAssistant->get_page_ident(i), "");
+                        --nRoadmapItems;
+                    }
+                    break;
+                }
+                else
+                {
+                    // there is an item with this index in the roadmap - does it match what is requested by
+                    // the respective state in the active path?
+                    RoadmapTypes::ItemId nPresentItemId = m_xAssistant->get_page_ident(nItemIndex).toInt32();

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list