21#include <core_resource.hxx>
33#include <com/sun/star/sdbc/XConnection.hpp>
52 :
SfxTabPage(pPage, pController, rUIXMLDescription, rId, &rAttrSet)
53 , m_abEnableRoadmap(false)
54 , m_pAdminDialog(nullptr)
55 , m_pItemSetHelper(nullptr)
68 return DeactivateRC::KeepPage;
72 return DeactivateRC::LeavePage;
96 _rValid = !pInvalid || !pInvalid->
GetValue();
98 _rReadonly = !_rValid || (pReadonly && pReadonly->
GetValue());
103 callModifiedHdl(pCtrl);
108 callModifiedHdl(&rCtrl);
113 callModifiedHdl(&rCtrl);
118 callModifiedHdl(&rCtrl);
124 std::set<OUString> aOdbcDatasources;
129 OUString sError(
DBA_RES(STR_COULD_NOT_LOAD_ODBC_LIB));
130 sError = sError.replaceFirst(
"#lib#", aEnumeration.
getLibraryName());
132 VclMessageType::Warning, VclButtonsType::Ok,
142 if (!_sCurr.isEmpty())
153 bool bValid, bReadonly;
156 std::vector< std::unique_ptr<ISaveValueWrapper> > aControlList;
160 for(
const auto& pValueWrapper : aControlList )
162 pValueWrapper->SaveValue();
169 for(
const auto& pValueWrapper : aControlList )
171 pValueWrapper->Disable();
209 _bChangedSomething =
true;
216 _bChangedSomething =
true;
224 _bChangedSomething =
true;
232 _bChangedSomething =
true;
238 OSL_ENSURE(m_pAdminDialog,
"No Admin dialog set! ->GPF");
239 bool bSuccess =
false;
240 if ( !m_pAdminDialog )
243 m_pAdminDialog->saveDatasource();
245 bool bShowMessage =
true;
248 std::pair< Reference<XConnection>,
bool> aConnectionPair = m_pAdminDialog->createConnection();
249 bShowMessage = aConnectionPair.second;
250 bSuccess = aConnectionPair.first.is();
251 ::comphelper::disposeComponent(aConnectionPair.first);
259 OUString aMessage,sTitle;
260 sTitle =
DBA_RES(STR_CONNECTION_TEST);
263 aMessage =
DBA_RES(STR_CONNECTION_SUCCESS);
268 aMessage =
DBA_RES(STR_CONNECTION_NO_SUCCESS);
274 m_pAdminDialog->clearPassword();
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void SetExchangeSupport()
virtual bool FillItemSet(SfxItemSet *)
weld::Window * GetFrameWeld() const
virtual const SfxItemSet * getOutputSet() const =0
virtual ~ISaveValueWrapper()=0
bool get_value_changed_from_saved() const
OUString GetSelected() const
void Select(const OUString &_rEntry)
virtual short run() override
OGenericAdministrationPage(weld::Container *pPage, weld::DialogController *pController, const OUString &rUIXMLDescription, const OUString &rId, const SfxItemSet &rAttrSet)
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList)=0
will be called inside <method>implInitControls</method> to disable if necessary
virtual void Activate() override
static void getFlags(const SfxItemSet &_rSet, bool &_rValid, bool &_rReadonly)
analyze the invalid and the readonly flag which may be present in the set
virtual void ActivatePage(const SfxItemSet &_rSet) override
default implementation: call implInitControls with the given item set and _bSaveValue = sal_True
virtual void Reset(const SfxItemSet *_rCoreAttrs) override
default implementation: call implInitControls with the given item set and _bSaveValue = sal_False
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList)=0
will be called inside <method>implInitControls</method> to save the value if necessary
virtual void initializePage() override
static void fillString(SfxItemSet &_rSet, const weld::Entry *pEdit, TypedWhichId< SfxStringItem > _nID, bool &_bChangedSomething)
fills the String value into the item set when the value changed.
virtual bool prepareLeave()
called from within DeactivatePage. The page is allowed to be deactivated if this method returns sal_T...
virtual bool canAdvance() const override
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
default implementation: call FillItemSet, call prepareLeave,
virtual bool commitPage(::vcl::WizardTypes::CommitPageReason _eReason) override
bool getSelectedDataSource(OUString &_sReturn, OUString const &_sCurr)
opens a dialog filled with all data sources available for this type and returns the selected on.
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue)
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
static void fillBool(SfxItemSet &_rSet, const weld::CheckButton *pCheckBox, sal_uInt16 _nID, bool bOptionalBool, bool &_bChangedSomething, bool _bRevertValue=false)
fills the Boolean value into the item set when the value changed.
static void fillInt32(SfxItemSet &_rSet, const weld::SpinButton *pEdit, TypedWhichId< SfxInt32Item > _nID, bool &_bChangedSomething)
fills the int value into the item set when the value changed.
IItemSetHelper * m_pItemSetHelper
const OUString & getLibraryName() const
void getDatasourceNames(std::set< OUString > &_rNames)
void SetValue(bool _bValue)
virtual OUString get_text() const=0
bool get_value_changed_from_saved() const
virtual bool get_active() const=0
bool get_state_changed_from_saved() const
TriState get_state() const
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
#define DSID_INVALID_SELECTION
IMPL_LINK_NOARG(OApplicationController, OnClipboardChanged, TransferableDataHelper *, void)
IMPL_LINK(OApplicationController, OnSelectContainer, void *, _pType, void)
Reference< XNameAccess > m_xContainer