LCOV - code coverage report
Current view: top level - dbaccess/source/ui/dlg - DBSetupConnectionPages.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 411 0.0 %
Date: 2014-04-14 Functions: 0 94 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <config_features.h>
      21             : 
      22             : #include "DBSetupConnectionPages.hxx"
      23             : #include "sqlmessage.hxx"
      24             : #include "dbu_resource.hrc"
      25             : #include "AutoControls.hrc"
      26             : #include "dbadminsetup.hrc"
      27             : #include <svl/itemset.hxx>
      28             : #include <svl/stritem.hxx>
      29             : #include <svl/eitem.hxx>
      30             : #include <svl/intitem.hxx>
      31             : #include "dsitems.hxx"
      32             : #include "dsnItem.hxx"
      33             : #include "dbaccess_helpid.hrc"
      34             : #include "localresaccess.hxx"
      35             : #include <vcl/msgbox.hxx>
      36             : #include <vcl/mnemonic.hxx>
      37             : #include <svl/cjkoptions.hxx>
      38             : #if HAVE_FEATURE_JAVA
      39             : #include <jvmaccess/virtualmachine.hxx>
      40             : #endif
      41             : #include <connectivity/CommonTools.hxx>
      42             : #include "DriverSettings.hxx"
      43             : #include "dbadmin.hxx"
      44             : #include <comphelper/types.hxx>
      45             : 
      46             : #include <com/sun/star/task/XInteractionHandler.hpp>
      47             : #include <com/sun/star/sdbc/XDriverAccess.hpp>
      48             : #include "dbustrings.hrc"
      49             : #include <svl/filenotation.hxx>
      50             : 
      51             : #include <unotools/localfilehelper.hxx>
      52             : #include <unotools/ucbhelper.hxx>
      53             : #include <ucbhelper/commandenvironment.hxx>
      54             : #include "finteraction.hxx"
      55             : #include <unotools/pathoptions.hxx>
      56             : #include <svtools/roadmapwizard.hxx>
      57             : #include "TextConnectionHelper.hxx"
      58             : #include <osl/diagnose.h>
      59             : 
      60             : namespace dbaui
      61             : {
      62             : using namespace ::com::sun::star;
      63             : 
      64           0 :     OGenericAdministrationPage* OTextConnectionPageSetup::CreateTextTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
      65             :     {
      66           0 :         return ( new OTextConnectionPageSetup( pParent, _rAttrSet ) );
      67             :     }
      68             : 
      69             :     // OTextConnectionPageSetup
      70           0 :     OTextConnectionPageSetup::OTextConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs )
      71           0 :         :OConnectionTabPageSetup(pParent, PAGE_DBWIZARD_TEXT, _rCoreAttrs, STR_TEXT_HELPTEXT, STR_TEXT_HEADERTEXT, STR_TEXT_PATH_OR_FILE)
      72             :     {
      73             : 
      74           0 :         m_pTextConnectionHelper = new OTextConnectionHelper( this, TC_EXTENSION | TC_SEPARATORS );
      75           0 :         m_pTextConnectionHelper->SetClickHandler(LINK( this, OTextConnectionPageSetup, ImplGetExtensionHdl ) );
      76             : 
      77           0 :         FreeResource();
      78           0 :     }
      79             : 
      80           0 :     OTextConnectionPageSetup::~OTextConnectionPageSetup()
      81             :     {
      82           0 :         DELETEZ(m_pTextConnectionHelper);
      83             : 
      84           0 :     }
      85             : 
      86           0 :     IMPL_LINK(OTextConnectionPageSetup, ImplGetExtensionHdl, OTextConnectionHelper*, /*_pTextConnectionHelper*/)
      87             :     {
      88           0 :         SetRoadmapStateValue(!m_pTextConnectionHelper->GetExtension().isEmpty() && OConnectionTabPageSetup::checkTestConnection());
      89           0 :         callModifiedHdl();
      90           0 :         return sal_True;
      91             :     }
      92             : 
      93           0 :     bool OTextConnectionPageSetup::checkTestConnection()
      94             :     {
      95           0 :         bool bDoEnable = OConnectionTabPageSetup::checkTestConnection();
      96           0 :         bDoEnable = !m_pTextConnectionHelper->GetExtension().isEmpty() && bDoEnable;
      97           0 :         return bDoEnable;
      98             :     }
      99             : 
     100           0 :     void OTextConnectionPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
     101             :     {
     102           0 :         OConnectionTabPageSetup::fillControls(_rControlList);
     103           0 :         m_pTextConnectionHelper->fillControls(_rControlList);
     104           0 :     }
     105           0 :     void OTextConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
     106             :     {
     107           0 :         OConnectionTabPageSetup::fillWindows(_rControlList);
     108           0 :         m_pTextConnectionHelper->fillWindows(_rControlList);
     109           0 :     }
     110           0 :     void OTextConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
     111             :     {
     112             :         // first check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
     113             :         sal_Bool bValid, bReadonly;
     114           0 :         getFlags(_rSet, bValid, bReadonly);
     115           0 :         OConnectionTabPageSetup::implInitControls( _rSet, _bSaveValue);
     116           0 :         m_pTextConnectionHelper->implInitControls(_rSet, bValid);
     117           0 :     }
     118             : 
     119           0 :     bool OTextConnectionPageSetup::FillItemSet( SfxItemSet& _rSet )
     120             :     {
     121           0 :         sal_Bool bChangedSomething = OConnectionTabPageSetup::FillItemSet(_rSet);
     122           0 :         bChangedSomething = m_pTextConnectionHelper->FillItemSet(_rSet, bChangedSomething);
     123           0 :         return bChangedSomething;
     124             :     }
     125             : 
     126           0 :     sal_Bool OTextConnectionPageSetup::prepareLeave(){
     127           0 :         return m_pTextConnectionHelper->prepareLeave();
     128             :     }
     129             : 
     130           0 :     OGenericAdministrationPage* OLDAPConnectionPageSetup::CreateLDAPTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
     131             :     {
     132           0 :         return ( new OLDAPConnectionPageSetup( pParent, _rAttrSet ) );
     133             :     }
     134             : 
     135             :     // OLDAPPageSetup
     136           0 :     OLDAPConnectionPageSetup::OLDAPConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs )
     137             :         :OGenericAdministrationPage(pParent, ModuleRes(PAGE_DBWIZARD_LDAP), _rCoreAttrs)
     138             :         ,m_aFTHeaderText        (this, ModuleRes(FT_LDAP_HEADERTEXT))
     139             :         ,m_aFTHelpText          (this, ModuleRes(FT_LDAP_HELPTEXT))
     140             :         ,m_aFTHostServer        (this, ModuleRes(FT_AUTOHOSTNAME))
     141             :         ,m_aETHostServer        (this, ModuleRes(ET_AUTOHOSTNAME))
     142             :         ,m_aFTBaseDN            (this, ModuleRes(FT_AUTOBASEDN))
     143             :         ,m_aETBaseDN            (this, ModuleRes(ET_AUTOBASEDN))
     144             :         ,m_aFTPortNumber        (this, ModuleRes(FT_AUTOPORTNUMBER))
     145             :         ,m_aNFPortNumber        (this, ModuleRes(NF_AUTOPORTNUMBER))
     146             :         ,m_aFTDefaultPortNumber (this, ModuleRes(FT_AUTOPORTNUMBERDEFAULT))
     147           0 :         ,m_aCBUseSSL            (this, ModuleRes(CB_WIZ_USESSL))
     148             :     {
     149           0 :         SetControlFontWeight(&m_aFTHeaderText);
     150           0 :         m_aFTDefaultPortNumber.SetText(OUString(ModuleRes(STR_LDAP_DEFAULT)));
     151           0 :         m_aETHostServer.SetModifyHdl(getControlModifiedLink());
     152           0 :         m_aETBaseDN.SetModifyHdl(getControlModifiedLink());
     153           0 :         m_aNFPortNumber.SetModifyHdl(getControlModifiedLink());
     154           0 :         m_aCBUseSSL.SetToggleHdl(getControlModifiedLink());
     155           0 :         SetRoadmapStateValue(sal_False);
     156           0 :         FreeResource();
     157           0 :     }
     158             : 
     159           0 :     bool OLDAPConnectionPageSetup::FillItemSet( SfxItemSet& _rSet )
     160             :     {
     161           0 :            sal_Bool bChangedSomething = sal_False;
     162           0 :         fillString(_rSet,&m_aETBaseDN,DSID_CONN_LDAP_BASEDN, bChangedSomething);
     163           0 :         fillInt32(_rSet,&m_aNFPortNumber,DSID_CONN_LDAP_PORTNUMBER,bChangedSomething);
     164             : 
     165           0 :         if ( m_aETHostServer.GetText() != m_aETHostServer.GetSavedValue() )
     166             :         {
     167           0 :             DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rSet.GetItem(DSID_TYPECOLLECTION));
     168           0 :             ::dbaccess::ODsnTypeCollection* pCollection = NULL;
     169           0 :             if (pCollectionItem)
     170           0 :                 pCollection = pCollectionItem->getCollection();
     171             :             OSL_ENSURE(pCollection, "OLDAPConnectionPageSetup::FillItemSet : really need a DSN type collection !");
     172           0 :             if (pCollection)
     173             :             {
     174           0 :                 OUString sUrl = pCollection->getPrefix( OUString("sdbc:address:ldap:"));
     175           0 :                 sUrl += m_aETHostServer.GetText();
     176           0 :                 _rSet.Put(SfxStringItem(DSID_CONNECTURL, sUrl));
     177           0 :                 bChangedSomething = sal_True;
     178             :             }
     179             :         }
     180             : 
     181           0 :         fillBool(_rSet,&m_aCBUseSSL,DSID_CONN_LDAP_USESSL,bChangedSomething);
     182           0 :         return bChangedSomething;
     183             :     }
     184           0 :     void OLDAPConnectionPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
     185             :     {
     186           0 :         _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETHostServer));
     187           0 :         _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETBaseDN));
     188           0 :         _rControlList.push_back(new OSaveValueWrapper<NumericField>(&m_aNFPortNumber));
     189           0 :         _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aCBUseSSL));
     190           0 :     }
     191           0 :     void OLDAPConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
     192             :     {
     193           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTHelpText));
     194           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTHostServer));
     195           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTBaseDN));
     196           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTPortNumber));
     197           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTDefaultPortNumber));
     198           0 :     }
     199           0 :     void OLDAPConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
     200             :     {
     201             :         // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
     202             :         sal_Bool bValid, bReadonly;
     203           0 :         getFlags(_rSet, bValid, bReadonly);
     204             : 
     205           0 :         SFX_ITEMSET_GET(_rSet, pBaseDN, SfxStringItem, DSID_CONN_LDAP_BASEDN, true);
     206           0 :         SFX_ITEMSET_GET(_rSet, pPortNumber, SfxInt32Item, DSID_CONN_LDAP_PORTNUMBER, true);
     207             : 
     208           0 :         if ( bValid )
     209             :         {
     210           0 :             m_aETBaseDN.SetText(pBaseDN->GetValue());
     211           0 :             m_aNFPortNumber.SetValue(pPortNumber->GetValue());
     212             :         }
     213           0 :            OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
     214           0 :         callModifiedHdl();
     215           0 :     }
     216             : 
     217           0 :     IMPL_LINK(OLDAPConnectionPageSetup, OnEditModified, Edit*, /*_pEdit*/)
     218             :     {
     219           0 :         sal_Bool bRoadmapState = ((!m_aETHostServer.GetText().isEmpty() ) && ( !m_aETBaseDN.GetText().isEmpty() ) && (!m_aFTPortNumber.GetText().isEmpty() ));
     220           0 :         SetRoadmapStateValue(bRoadmapState);
     221           0 :         callModifiedHdl();
     222           0 :         return 0L;
     223             :     }
     224             : 
     225           0 :     OMySQLIntroPageSetup* OMySQLIntroPageSetup::CreateMySQLIntroTabPage( Window* _pParent, const SfxItemSet& _rAttrSet )
     226             :     {
     227           0 :         return ( new OMySQLIntroPageSetup( _pParent, _rAttrSet) );
     228             :     }
     229             : 
     230             : 
     231           0 :     OMySQLIntroPageSetup::OMySQLIntroPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs )
     232             :             :OGenericAdministrationPage(pParent, ModuleRes(PAGE_DBWIZARD_MYSQL_INTRO), _rCoreAttrs)
     233             :             ,m_aRB_ODBCDatabase(this, ModuleRes(RB_CONNECTVIAODBC))
     234             :             ,m_aRB_JDBCDatabase(this, ModuleRes(RB_CONNECTVIAJDBC))
     235             :             ,m_aRB_NATIVEDatabase(this, ModuleRes(RB_CONNECTVIANATIVE))
     236             :             ,m_aFT_ConnectionMode(this, ModuleRes(FT_MYSQLCONNECTIONMODE))
     237             :             ,m_aFT_Helptext(this, ModuleRes(FT_MYSQL_HELPTEXT))
     238           0 :             ,m_aFT_Headertext(this, ModuleRes(FT_MYSQL_HEADERTEXT))
     239             :     {
     240             : 
     241           0 :         SetControlFontWeight(&m_aFT_Headertext);
     242           0 :            m_aRB_ODBCDatabase.SetToggleHdl(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected));
     243           0 :            m_aRB_JDBCDatabase.SetToggleHdl(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected));
     244           0 :         m_aRB_NATIVEDatabase.SetToggleHdl(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected));
     245           0 :         FreeResource();
     246           0 :     }
     247             : 
     248           0 :     IMPL_LINK(OMySQLIntroPageSetup, OnSetupModeSelected, RadioButton*, /*_pBox*/)
     249             :     {
     250           0 :         maClickHdl.Call( this );
     251           0 :         return long(true);
     252             :     }
     253             : 
     254           0 :     OMySQLIntroPageSetup::~OMySQLIntroPageSetup()
     255             :     {
     256             : 
     257           0 :     }
     258             : 
     259           0 :     void OMySQLIntroPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool /*_bSaveValue*/)
     260             :     {
     261             :         // show the "Connect directly" option only if the driver is installed
     262           0 :         DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rSet.GetItem(DSID_TYPECOLLECTION));
     263           0 :         bool bHasMySQLNative = ( pCollectionItem != NULL ) && pCollectionItem->getCollection()->hasDriver( "sdbc:mysqlc:" );
     264           0 :         if ( bHasMySQLNative )
     265           0 :             m_aRB_NATIVEDatabase.Show();
     266             : 
     267             :         // if any of the options is checked, then there's nothing to do
     268           0 :         if ( m_aRB_ODBCDatabase.IsChecked() || m_aRB_JDBCDatabase.IsChecked() || m_aRB_NATIVEDatabase.IsChecked() )
     269           0 :             return;
     270             : 
     271             :         // prefer "native" or "JDBC"
     272           0 :         if ( bHasMySQLNative )
     273           0 :             m_aRB_NATIVEDatabase.Check();
     274             :         else
     275           0 :             m_aRB_JDBCDatabase.Check();
     276             :     }
     277             : 
     278           0 :     void OMySQLIntroPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& /*_rControlList*/)
     279             :     {
     280           0 :     }
     281             : 
     282           0 :     void OMySQLIntroPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlList*/)
     283             :     {
     284           0 :     }
     285             : 
     286           0 :     bool OMySQLIntroPageSetup::FillItemSet(SfxItemSet& /*_rSet*/)
     287             :     {
     288             :         OSL_FAIL("Who called me?! Please ask oj for more information.");
     289           0 :         return true;
     290             :     }
     291             : 
     292           0 :     OMySQLIntroPageSetup::ConnectionType OMySQLIntroPageSetup::getMySQLMode()
     293             :     {
     294           0 :         if (m_aRB_JDBCDatabase.IsChecked())
     295           0 :             return VIA_JDBC;
     296           0 :         else if (m_aRB_NATIVEDatabase.IsChecked())
     297           0 :             return VIA_NATIVE;
     298             :         else
     299           0 :             return VIA_ODBC;
     300             :     }
     301             : 
     302             :     // MySQLNativeSetupPage
     303           0 :     MySQLNativeSetupPage::MySQLNativeSetupPage( Window* _pParent, const SfxItemSet& _rCoreAttrs )
     304             :         :OGenericAdministrationPage( _pParent, ModuleRes( PAGE_DBWIZARD_MYSQL_NATIVE ), _rCoreAttrs )
     305             :         ,m_aHeader              ( this, ModuleRes( FT_SETUP_WIZARD_HEADER ) )
     306             :         ,m_aHelpText            ( this, ModuleRes( FT_SETUP_WIZARD_HELP ) )
     307           0 :         ,m_aMySQLSettings       ( *this, getControlModifiedLink() )
     308             :     {
     309           0 :         SetControlFontWeight( &m_aHeader );
     310             : 
     311           0 :         LayoutHelper::positionBelow( m_aHelpText, m_aMySQLSettings, UnrelatedControls, 0 );
     312           0 :         m_aMySQLSettings.Show();
     313             : 
     314           0 :         SetRoadmapStateValue(sal_False);
     315           0 :         FreeResource();
     316           0 :     }
     317             : 
     318           0 :     OGenericAdministrationPage* MySQLNativeSetupPage::Create( Window* pParent, const SfxItemSet& _rAttrSet )
     319             :     {
     320           0 :         return new MySQLNativeSetupPage( pParent, _rAttrSet );
     321             :     }
     322             : 
     323           0 :     void MySQLNativeSetupPage::fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList )
     324             :     {
     325           0 :         m_aMySQLSettings.fillControls( _rControlList );
     326           0 :     }
     327             : 
     328           0 :     void MySQLNativeSetupPage::fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList )
     329             :     {
     330           0 :         _rControlList.push_back( new ODisableWrapper< FixedText >( &m_aHelpText ) );
     331           0 :         m_aMySQLSettings.fillWindows( _rControlList );
     332           0 :     }
     333             : 
     334           0 :     bool MySQLNativeSetupPage::FillItemSet( SfxItemSet& _rSet )
     335             :     {
     336           0 :         return m_aMySQLSettings.FillItemSet( _rSet );
     337             :     }
     338             : 
     339           0 :     void MySQLNativeSetupPage::implInitControls( const SfxItemSet& _rSet, sal_Bool _bSaveValue )
     340             :     {
     341           0 :         m_aMySQLSettings.implInitControls( _rSet );
     342             : 
     343           0 :         OGenericAdministrationPage::implInitControls( _rSet, _bSaveValue );
     344             : 
     345           0 :         OnModified( NULL );
     346           0 :     }
     347             : 
     348           0 :     Link MySQLNativeSetupPage::getControlModifiedLink()
     349             :     {
     350           0 :         return LINK( this, MySQLNativeSetupPage, OnModified );
     351             :     }
     352             : 
     353           0 :     IMPL_LINK( MySQLNativeSetupPage, OnModified, Edit*, _pEdit )
     354             :     {
     355           0 :         SetRoadmapStateValue( m_aMySQLSettings.canAdvance() );
     356             : 
     357           0 :         return OGenericAdministrationPage::getControlModifiedLink().Call( _pEdit );
     358             :     }
     359             : 
     360             :     // OMySQLJDBCConnectionPageSetup
     361           0 :     OGeneralSpecialJDBCConnectionPageSetup::OGeneralSpecialJDBCConnectionPageSetup( Window* pParent,sal_uInt16 _nResId, const SfxItemSet& _rCoreAttrs ,sal_uInt16 _nPortId, sal_uInt16 _nDefaultPortResId, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderTextResId, sal_uInt16 _nDriverClassId)
     362             :         :OGenericAdministrationPage(pParent, ModuleRes(_nResId), _rCoreAttrs)
     363             :         ,m_aFTHelpText          (this, ModuleRes(FT_AUTOWIZARDHELPTEXT))
     364             :         ,m_aFTDatabasename      (this, ModuleRes(FT_AUTODATABASENAME))
     365             :         ,m_aETDatabasename      (this, ModuleRes(ET_AUTODATABASENAME))
     366             :         ,m_aFTHostname          (this, ModuleRes(FT_AUTOHOSTNAME))
     367             :         ,m_aETHostname          (this, ModuleRes(ET_AUTOHOSTNAME))
     368             :         ,m_aFTPortNumber        (this, ModuleRes(FT_AUTOPORTNUMBER))
     369             :         ,m_aFTDefaultPortNumber (this, ModuleRes(FT_AUTOPORTNUMBERDEFAULT))
     370             :         ,m_aNFPortNumber        (this, ModuleRes(NF_AUTOPORTNUMBER))
     371             :         ,m_aFTDriverClass       (this, ModuleRes(FT_AUTOJDBCDRIVERCLASS))
     372             :         ,m_aETDriverClass       (this, ModuleRes(ET_AUTOJDBCDRIVERCLASS))
     373             :         ,m_aPBTestJavaDriver    (this, ModuleRes(PB_AUTOTESTDRIVERCLASS))
     374           0 :         ,m_nPortId(_nPortId)
     375             :     {
     376           0 :         m_aFTDriverClass.SetText(OUString(ModuleRes(_nDriverClassId)));
     377             : 
     378           0 :         m_aFTDefaultPortNumber.SetText(OUString(ModuleRes(_nDefaultPortResId)));
     379           0 :         OUString sHelpText = OUString(ModuleRes(_nHelpTextResId));
     380           0 :         m_aFTHelpText.SetText(sHelpText);
     381             :         //TODO this code snippet is redundant
     382           0 :         SetHeaderText(FT_AUTOWIZARDHEADER, _nHeaderTextResId);
     383             : 
     384           0 :         m_aETDatabasename.SetModifyHdl(getControlModifiedLink());
     385           0 :         m_aETHostname.SetModifyHdl(getControlModifiedLink());
     386           0 :         m_aNFPortNumber.SetModifyHdl(getControlModifiedLink());
     387             : 
     388           0 :         m_aETDriverClass.SetModifyHdl(LINK(this, OGeneralSpecialJDBCConnectionPageSetup, OnEditModified));
     389           0 :         m_aPBTestJavaDriver.SetClickHdl(LINK(this,OGeneralSpecialJDBCConnectionPageSetup,OnTestJavaClickHdl));
     390             : 
     391           0 :         SFX_ITEMSET_GET(_rCoreAttrs, pUrlItem, SfxStringItem, DSID_CONNECTURL, true);
     392           0 :         SFX_ITEMSET_GET(_rCoreAttrs, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, true);
     393           0 :         ::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL;
     394           0 :         if (pTypeCollection && pUrlItem && pUrlItem->GetValue().getLength() )
     395             :         {
     396           0 :             m_sDefaultJdbcDriverName = pTypeCollection->getJavaDriverClass(pUrlItem->GetValue());
     397             :         }
     398             : 
     399           0 :         SetRoadmapStateValue(sal_False);
     400           0 :         FreeResource();
     401           0 :     }
     402             : 
     403           0 :     OGenericAdministrationPage* OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
     404             :     {
     405             :         return ( new OGeneralSpecialJDBCConnectionPageSetup( pParent,
     406             :                                                          PAGE_DBWIZARD_MYSQL_JDBC,
     407             :                                                          _rAttrSet,
     408             :                                                          DSID_MYSQL_PORTNUMBER ,
     409             :                                                          STR_MYSQL_DEFAULT,
     410             :                                                          STR_MYSQLJDBC_HELPTEXT,
     411             :                                                          STR_MYSQLJDBC_HEADERTEXT,
     412           0 :                                                          STR_MYSQL_DRIVERCLASSTEXT) );
     413             :     }
     414             : 
     415           0 :     OGenericAdministrationPage* OGeneralSpecialJDBCConnectionPageSetup::CreateOracleJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
     416             :     {
     417             :         return ( new OGeneralSpecialJDBCConnectionPageSetup( pParent,
     418             :                                                           PAGE_DBWIZARD_ORACLE,
     419             :                                                           _rAttrSet,
     420             :                                                           DSID_ORACLE_PORTNUMBER,
     421             :                                                           STR_ORACLE_DEFAULT,
     422             :                                                           STR_ORACLE_HELPTEXT,
     423             :                                                           STR_ORACLE_HEADERTEXT,
     424           0 :                                                           STR_ORACLE_DRIVERCLASSTEXT) );
     425             :     }
     426             : 
     427           0 :     void OGeneralSpecialJDBCConnectionPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
     428             :     {
     429           0 :         _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETDatabasename));
     430           0 :         _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETDriverClass));
     431           0 :         _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETHostname));
     432           0 :         _rControlList.push_back(new OSaveValueWrapper<NumericField>(&m_aNFPortNumber));
     433           0 :     }
     434           0 :     void OGeneralSpecialJDBCConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
     435             :     {
     436           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTHelpText));
     437           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTDatabasename));
     438           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTHostname));
     439           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTPortNumber));
     440           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTDefaultPortNumber));
     441           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTDriverClass));
     442           0 :     }
     443             : 
     444           0 :     bool OGeneralSpecialJDBCConnectionPageSetup::FillItemSet( SfxItemSet& _rSet )
     445             :     {
     446           0 :         sal_Bool bChangedSomething = sal_False;
     447           0 :         fillString(_rSet,&m_aETDriverClass,DSID_JDBCDRIVERCLASS,bChangedSomething);
     448           0 :         fillString(_rSet,&m_aETHostname,DSID_CONN_HOSTNAME,bChangedSomething);
     449           0 :         fillString(_rSet,&m_aETDatabasename,DSID_DATABASENAME,bChangedSomething);
     450           0 :         fillInt32(_rSet,&m_aNFPortNumber,m_nPortId,bChangedSomething );
     451           0 :         return bChangedSomething;
     452             :     }
     453             : 
     454           0 :     void OGeneralSpecialJDBCConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
     455             :     {
     456             :         // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
     457             :         sal_Bool bValid, bReadonly;
     458           0 :         getFlags(_rSet, bValid, bReadonly);
     459             : 
     460           0 :         SFX_ITEMSET_GET(_rSet, pDatabaseName, SfxStringItem, DSID_DATABASENAME, true);
     461           0 :         SFX_ITEMSET_GET(_rSet, pDrvItem, SfxStringItem, DSID_JDBCDRIVERCLASS, true);
     462           0 :         SFX_ITEMSET_GET(_rSet, pHostName, SfxStringItem, DSID_CONN_HOSTNAME, true);
     463           0 :         SFX_ITEMSET_GET(_rSet, pPortNumber, SfxInt32Item, m_nPortId, true);
     464             : 
     465           0 :         if ( bValid )
     466             :         {
     467           0 :             m_aETDatabasename.SetText(pDatabaseName->GetValue());
     468           0 :             m_aETDatabasename.ClearModifyFlag();
     469             : 
     470           0 :             m_aETDriverClass.SetText(pDrvItem->GetValue());
     471           0 :             m_aETDriverClass.ClearModifyFlag();
     472             : 
     473           0 :             m_aETHostname.SetText(pHostName->GetValue());
     474           0 :             m_aETHostname.ClearModifyFlag();
     475             : 
     476           0 :             m_aNFPortNumber.SetValue(pPortNumber->GetValue());
     477           0 :             m_aNFPortNumber.ClearModifyFlag();
     478             :         }
     479           0 :         OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
     480             : 
     481             :         // to get the correct value when saveValue was called by base class
     482           0 :         if ( m_aETDriverClass.GetText().isEmpty() )
     483             :         {
     484           0 :             m_aETDriverClass.SetText(m_sDefaultJdbcDriverName);
     485           0 :             m_aETDriverClass.SetModifyFlag();
     486             :         }
     487           0 :         callModifiedHdl();
     488             : 
     489           0 :         sal_Bool bRoadmapState = ((!m_aETDatabasename.GetText().isEmpty() ) && (!m_aETHostname.GetText().isEmpty()) && (!m_aNFPortNumber.GetText().isEmpty() ) && ( !m_aETDriverClass.GetText().isEmpty() ));
     490           0 :         SetRoadmapStateValue(bRoadmapState);
     491           0 :     }
     492             : 
     493           0 :     IMPL_LINK(OGeneralSpecialJDBCConnectionPageSetup, OnTestJavaClickHdl, PushButton*, /*_pButton*/)
     494             :     {
     495             :         OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
     496             : 
     497           0 :         sal_Bool bSuccess = sal_False;
     498             : #if HAVE_FEATURE_JAVA
     499             :         try
     500             :         {
     501           0 :             if ( !m_aETDriverClass.GetText().isEmpty() )
     502             :             {
     503             : // TODO change jvmaccess
     504           0 :                 ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
     505           0 :                 bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aETDriverClass.GetText());
     506             :             }
     507             :         }
     508           0 :         catch(::com::sun::star::uno::Exception&)
     509             :         {
     510             :         }
     511             : #endif
     512           0 :         const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
     513           0 :         const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error;
     514           0 :         OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt );
     515           0 :         aMsg.Execute();
     516           0 :         return 0L;
     517             :     }
     518             : 
     519           0 :     IMPL_LINK(OGeneralSpecialJDBCConnectionPageSetup, OnEditModified, Edit*, _pEdit)
     520             :     {
     521           0 :         if ( _pEdit == &m_aETDriverClass )
     522           0 :             m_aPBTestJavaDriver.Enable( !m_aETDriverClass.GetText().isEmpty() );
     523           0 :         sal_Bool bRoadmapState = ((!m_aETDatabasename.GetText().isEmpty() ) && ( !m_aETHostname.GetText().isEmpty() ) && (!m_aNFPortNumber.GetText().isEmpty() ) && ( !m_aETDriverClass.GetText().isEmpty() ));
     524           0 :         SetRoadmapStateValue(bRoadmapState);
     525           0 :         callModifiedHdl();
     526           0 :         return 0L;
     527             :     }
     528             : 
     529           0 :     OGenericAdministrationPage* OJDBCConnectionPageSetup::CreateJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
     530             :     {
     531           0 :         return ( new OJDBCConnectionPageSetup( pParent, _rAttrSet));
     532             :     }
     533             : 
     534             :     // OMySQLJDBCConnectionPageSetup
     535           0 :     OJDBCConnectionPageSetup::OJDBCConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs)
     536             :         :OConnectionTabPageSetup(pParent, PAGE_DBWIZARD_JDBC, _rCoreAttrs, STR_JDBC_HELPTEXT, STR_JDBC_HEADERTEXT, STR_COMMONURL)
     537             :         ,m_aFTDriverClass       (this, ModuleRes(FT_AUTOJDBCDRIVERCLASS))
     538             :         ,m_aETDriverClass       (this, ModuleRes(ET_AUTOJDBCDRIVERCLASS))
     539           0 :         ,m_aPBTestJavaDriver    (this, ModuleRes(PB_AUTOTESTDRIVERCLASS))
     540             :     {
     541           0 :         m_aETDriverClass.SetModifyHdl(LINK(this, OJDBCConnectionPageSetup, OnEditModified));
     542           0 :         m_aPBTestJavaDriver.SetClickHdl(LINK(this,OJDBCConnectionPageSetup,OnTestJavaClickHdl));
     543           0 :         FreeResource();
     544           0 :     }
     545             : 
     546           0 :     void OJDBCConnectionPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
     547             :     {
     548           0 :         _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETDriverClass));
     549           0 :     }
     550             : 
     551           0 :     void OJDBCConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
     552             :     {
     553           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTDriverClass));
     554           0 :     }
     555             : 
     556           0 :     bool OJDBCConnectionPageSetup::FillItemSet( SfxItemSet& _rSet )
     557             :     {
     558           0 :         sal_Bool bChangedSomething = OConnectionTabPageSetup::FillItemSet(_rSet);
     559           0 :         fillString(_rSet,&m_aETDriverClass,DSID_JDBCDRIVERCLASS,bChangedSomething);
     560           0 :         return bChangedSomething;
     561             :     }
     562             : 
     563           0 :     void OJDBCConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
     564             :     {
     565             :         // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
     566             :         sal_Bool bValid, bReadonly;
     567           0 :         getFlags(_rSet, bValid, bReadonly);
     568             : 
     569           0 :         SFX_ITEMSET_GET(_rSet, pDrvItem, SfxStringItem, DSID_JDBCDRIVERCLASS, true);
     570             : 
     571           0 :         if ( bValid )
     572             :         {
     573           0 :             if ( !pDrvItem->GetValue().getLength() )
     574             :             {
     575           0 :                 OUString sDefaultJdbcDriverName = m_pCollection->getJavaDriverClass(m_eType);
     576           0 :                 if ( !sDefaultJdbcDriverName.isEmpty() )
     577             :                 {
     578           0 :                     m_aETDriverClass.SetText(sDefaultJdbcDriverName);
     579           0 :                     m_aETDriverClass.SetModifyFlag();
     580           0 :                 }
     581             :             }
     582             :             else
     583             :             {
     584           0 :                 m_aETDriverClass.SetText(pDrvItem->GetValue());
     585           0 :                 m_aETDriverClass.ClearModifyFlag();
     586             :             }
     587             :         }
     588           0 :         sal_Bool bEnable = pDrvItem->GetValue().getLength() != 0;
     589           0 :         m_aPBTestJavaDriver.Enable(bEnable);
     590           0 :         OConnectionTabPageSetup::implInitControls(_rSet, _bSaveValue);
     591             : 
     592           0 :         SetRoadmapStateValue(checkTestConnection());
     593           0 :     }
     594             : 
     595           0 :     bool OJDBCConnectionPageSetup::checkTestConnection()
     596             :     {
     597             :         OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
     598           0 :         sal_Bool bEnableTestConnection = !m_aConnectionURL.IsVisible() || !m_aConnectionURL.GetTextNoPrefix().isEmpty();
     599           0 :         bEnableTestConnection = bEnableTestConnection && (!m_aETDriverClass.GetText().isEmpty());
     600           0 :         return bEnableTestConnection;
     601             :     }
     602             : 
     603           0 :     IMPL_LINK(OJDBCConnectionPageSetup, OnTestJavaClickHdl, PushButton*, /*_pButton*/)
     604             :     {
     605             :         OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
     606           0 :         sal_Bool bSuccess = sal_False;
     607             : #if HAVE_FEATURE_JAVA
     608             :         try
     609             :         {
     610           0 :             if ( !m_aETDriverClass.GetText().isEmpty() )
     611             :             {
     612             : // TODO change jvmaccess
     613           0 :                 ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
     614           0 :                 bSuccess = xJVM.is() && ::connectivity::existsJavaClassByName(xJVM,m_aETDriverClass.GetText());
     615             :             }
     616             :         }
     617           0 :         catch(::com::sun::star::uno::Exception&)
     618             :         {
     619             :         }
     620             : #endif
     621           0 :         sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
     622           0 :         OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString() );
     623           0 :         aMsg.Execute();
     624           0 :         return 0L;
     625             :     }
     626             : 
     627           0 :     IMPL_LINK(OJDBCConnectionPageSetup, OnEditModified, Edit*, _pEdit)
     628             :     {
     629           0 :         if ( _pEdit == &m_aETDriverClass )
     630           0 :             m_aPBTestJavaDriver.Enable( !m_aETDriverClass.GetText().isEmpty() );
     631           0 :         SetRoadmapStateValue(checkTestConnection());
     632             :         // tell the listener we were modified
     633           0 :         callModifiedHdl();
     634           0 :         return 0L;
     635             :     }
     636             : 
     637           0 :     OGenericAdministrationPage* OSpreadSheetConnectionPageSetup::CreateSpreadSheetTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
     638             :     {
     639           0 :         return ( new OSpreadSheetConnectionPageSetup( pParent, _rAttrSet ) );
     640             :     }
     641             : 
     642             : 
     643           0 :     OSpreadSheetConnectionPageSetup::OSpreadSheetConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs )
     644             :         :OConnectionTabPageSetup(pParent, PAGE_DBWIZARD_SPREADSHEET, _rCoreAttrs, STR_SPREADSHEET_HELPTEXT, STR_SPREADSHEET_HEADERTEXT, STR_SPREADSHEETPATH)
     645           0 :             , m_aCBPasswordrequired(this, ModuleRes(CB_SPREADSHEETPASSWORDREQUIRED))
     646             :     {
     647             : 
     648           0 :            m_aCBPasswordrequired.SetToggleHdl(getControlModifiedLink());
     649           0 :         FreeResource();
     650           0 :     }
     651             : 
     652           0 :     OSpreadSheetConnectionPageSetup::~OSpreadSheetConnectionPageSetup()
     653             :     {
     654             : 
     655           0 :     }
     656             : 
     657           0 :     void OSpreadSheetConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlList*/)
     658             :     {
     659           0 :     }
     660             : 
     661           0 :     void OSpreadSheetConnectionPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
     662             :     {
     663           0 :         OConnectionTabPageSetup::fillControls(_rControlList);
     664           0 :         _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aCBPasswordrequired));
     665             : 
     666           0 :     }
     667             : 
     668           0 :     void OSpreadSheetConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue)
     669             :     {
     670           0 :         OConnectionTabPageSetup::implInitControls(_rSet, _bSaveValue);
     671           0 :     }
     672             : 
     673           0 :     bool OSpreadSheetConnectionPageSetup::FillItemSet( SfxItemSet& _rSet )
     674             :     {
     675           0 :         sal_Bool bChangedSomething = OConnectionTabPageSetup::FillItemSet(_rSet);
     676           0 :         fillBool(_rSet,&m_aCBPasswordrequired,DSID_PASSWORDREQUIRED,bChangedSomething);
     677           0 :         return bChangedSomething;
     678             :     }
     679             : 
     680           0 :     OGenericAdministrationPage* OAuthentificationPageSetup::CreateAuthentificationTabPage( Window* pParent, const SfxItemSet& _rAttrSet )
     681             :     {
     682           0 :         return ( new OAuthentificationPageSetup( pParent, _rAttrSet) );
     683             :     }
     684             : 
     685             : 
     686           0 :     OAuthentificationPageSetup::OAuthentificationPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs )
     687             :         :OGenericAdministrationPage(pParent, ModuleRes(PAGE_DBWIZARD_AUTHENTIFICATION), _rCoreAttrs )
     688             :         , m_aFTHelpText             (this, ModuleRes(FT_AUTHENTIFICATIONHELPTEXT))
     689             :         , m_aFTHeaderText           (this, ModuleRes(FT_AUTHENTIFICATIONHEADERTEXT))
     690             :         , m_aFTUserName             (this, ModuleRes(FT_GENERALUSERNAME))
     691             :         , m_aETUserName             (this, ModuleRes(ET_GENERALUSERNAME))
     692             :         , m_aCBPasswordRequired     (this, ModuleRes(CB_GENERALPASSWORDREQUIRED))
     693           0 :         , m_aPBTestConnection       (this, ModuleRes(PB_TESTCONNECTION))
     694             :     {
     695             : 
     696           0 :         SetControlFontWeight(&m_aFTHeaderText);
     697           0 :         m_aETUserName.SetModifyHdl(getControlModifiedLink());
     698           0 :         m_aCBPasswordRequired.SetClickHdl(getControlModifiedLink());
     699           0 :            m_aPBTestConnection.SetClickHdl(LINK(this,OGenericAdministrationPage,OnTestConnectionClickHdl));
     700           0 :         FreeResource();
     701             : 
     702           0 :         LayoutHelper::fitSizeRightAligned( m_aPBTestConnection );
     703           0 :     }
     704             : 
     705           0 :     OAuthentificationPageSetup::~OAuthentificationPageSetup()
     706             :     {
     707             : 
     708           0 :     }
     709             : 
     710           0 :     void OAuthentificationPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
     711             :     {
     712           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTHelpText));
     713           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(&m_aFTUserName));
     714           0 :         _rControlList.push_back(new ODisableWrapper<PushButton>(&m_aPBTestConnection));
     715           0 :     }
     716             : 
     717           0 :     void OAuthentificationPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
     718             :     {
     719           0 :         _rControlList.push_back(new OSaveValueWrapper<Edit>(&m_aETUserName));
     720           0 :         _rControlList.push_back(new OSaveValueWrapper<CheckBox>(&m_aCBPasswordRequired));
     721           0 :     }
     722             : 
     723           0 :     void OAuthentificationPageSetup::implInitControls(const SfxItemSet& _rSet, sal_Bool /*_bSaveValue*/)
     724             :     {
     725             :         // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
     726             :         sal_Bool bValid, bReadonly;
     727           0 :         getFlags(_rSet, bValid, bReadonly);
     728           0 :         SFX_ITEMSET_GET(_rSet, pUidItem, SfxStringItem, DSID_USER, true);
     729           0 :         SFX_ITEMSET_GET(_rSet, pAllowEmptyPwd, SfxBoolItem, DSID_PASSWORDREQUIRED, true);
     730             : 
     731           0 :         m_aETUserName.SetText(pUidItem->GetValue());
     732           0 :         m_aCBPasswordRequired.Check(pAllowEmptyPwd->GetValue());
     733             : 
     734           0 :         m_aETUserName.ClearModifyFlag();
     735           0 :     }
     736             : 
     737           0 :     bool OAuthentificationPageSetup::FillItemSet( SfxItemSet& _rSet )
     738             :     {
     739           0 :         sal_Bool bChangedSomething = sal_False;
     740             : 
     741           0 :         if (m_aETUserName.GetText() != m_aETUserName.GetSavedValue())
     742             :         {
     743           0 :             _rSet.Put(SfxStringItem(DSID_USER, m_aETUserName.GetText()));
     744           0 :             _rSet.Put(SfxStringItem(DSID_PASSWORD, OUString()));
     745           0 :             bChangedSomething = sal_True;
     746             :         }
     747           0 :         fillBool(_rSet,&m_aCBPasswordRequired,DSID_PASSWORDREQUIRED,bChangedSomething);
     748           0 :         return bChangedSomething;
     749             :     }
     750             : 
     751           0 :     OGenericAdministrationPage* OFinalDBPageSetup::CreateFinalDBTabPageSetup( Window* pParent, const SfxItemSet& _rAttrSet)
     752             :     {
     753           0 :         return ( new OFinalDBPageSetup( pParent, _rAttrSet) );
     754             :     }
     755             : 
     756             : 
     757           0 :     OFinalDBPageSetup::OFinalDBPageSetup(Window* pParent, const SfxItemSet& _rCoreAttrs)
     758             :         : OGenericAdministrationPage(pParent, "PageFinal",
     759           0 :             "dbaccess/ui/finalpagewizard.ui", _rCoreAttrs)
     760             :     {
     761           0 :         get(m_pFTFinalHeader, "headerText");
     762           0 :         get(m_pFTFinalHelpText, "helpText");
     763           0 :         get(m_pRBRegisterDataSource, "yesregister");
     764           0 :         get(m_pRBDontregisterDataSource, "noregister");
     765           0 :         get(m_pFTAdditionalSettings, "additionalText");
     766           0 :         get(m_pCBOpenAfterwards, "openediting");
     767           0 :         get(m_pCBStartTableWizard, "usewizard");
     768           0 :         get(m_pFTFinalText, "finishText");
     769             : 
     770           0 :         m_pCBOpenAfterwards->SetClickHdl(LINK(this, OFinalDBPageSetup, OnOpenSelected));
     771           0 :         m_pCBStartTableWizard->SetClickHdl(getControlModifiedLink());
     772           0 :         m_pRBRegisterDataSource->SetState(true);
     773           0 :     }
     774             : 
     775           0 :     OFinalDBPageSetup::~OFinalDBPageSetup()
     776             :     {
     777             : 
     778           0 :     }
     779             : 
     780           0 :     sal_Bool OFinalDBPageSetup::IsDatabaseDocumentToBeRegistered()
     781             :     {
     782           0 :         return m_pRBRegisterDataSource->IsChecked() && m_pRBRegisterDataSource->IsEnabled();
     783             :     }
     784             : 
     785           0 :     sal_Bool OFinalDBPageSetup::IsDatabaseDocumentToBeOpened()
     786             :     {
     787           0 :         return m_pCBOpenAfterwards->IsChecked() && m_pCBOpenAfterwards->IsEnabled();
     788             :     }
     789             : 
     790           0 :     sal_Bool OFinalDBPageSetup::IsTableWizardToBeStarted()
     791             :     {
     792           0 :         return m_pCBStartTableWizard->IsChecked() && m_pCBStartTableWizard->IsEnabled();
     793             :     }
     794             : 
     795           0 :     void OFinalDBPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
     796             :     {
     797           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTFinalHeader));
     798           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTFinalHelpText));
     799           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTAdditionalSettings));
     800           0 :         _rControlList.push_back(new ODisableWrapper<FixedText>(m_pFTFinalText));
     801           0 :     }
     802             : 
     803           0 :     void OFinalDBPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
     804             :     {
     805           0 :         _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pCBOpenAfterwards));
     806           0 :         _rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pCBStartTableWizard));
     807           0 :         _rControlList.push_back(new OSaveValueWrapper<RadioButton>(m_pRBRegisterDataSource));
     808           0 :         _rControlList.push_back(new OSaveValueWrapper<RadioButton>(m_pRBDontregisterDataSource));
     809           0 :     }
     810             : 
     811           0 :     void OFinalDBPageSetup::implInitControls(const SfxItemSet& /*_rSet*/, sal_Bool /*_bSaveValue*/)
     812             :     {
     813           0 :         m_pCBOpenAfterwards->Check();
     814           0 :     }
     815             : 
     816           0 :     void OFinalDBPageSetup::enableTableWizardCheckBox( sal_Bool _bSupportsTableCreation)
     817             :     {
     818           0 :         m_pCBStartTableWizard->Enable(_bSupportsTableCreation);
     819           0 :     }
     820             : 
     821           0 :     bool OFinalDBPageSetup::FillItemSet( SfxItemSet& /*_rSet*/ )
     822             :     {
     823           0 :         return true;
     824             :     }
     825             : 
     826           0 :     IMPL_LINK(OFinalDBPageSetup, OnOpenSelected, CheckBox*, _pBox)
     827             :     {
     828           0 :         m_pCBStartTableWizard->Enable( _pBox->IsEnabled() && _pBox->IsChecked() );
     829           0 :         callModifiedHdl();
     830             :         // outta here
     831           0 :         return 0L;
     832             :     }
     833           0 : }
     834             : 
     835             : // namespace dbaui
     836             : 
     837             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10