/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
void ConnectionPoolOptionsPage::implInitControls(const SfxItemSet& _rSet)
{ // the enabled flag const SfxBoolItem* pEnabled = _rSet.GetItem<SfxBoolItem>(SID_SB_POOLING_ENABLED);
OSL_ENSURE(pEnabled, "ConnectionPoolOptionsPage::implInitControls: missing the Enabled item!");
m_xEnablePooling->set_active(pEnabled == nullptr || pEnabled->GetValue());
m_xEnablePooling->set_sensitive(!officecfg::Office::DataAccess::ConnectionPool::EnablePooling::isReadOnly());
m_xEnablePoolingImg->set_visible(officecfg::Office::DataAccess::ConnectionPool::EnablePooling::isReadOnly());
m_xEnablePooling->save_state();
// the settings for the single drivers const DriverPoolingSettingsItem* pDriverSettings = _rSet.GetItem<DriverPoolingSettingsItem>(SID_SB_DRIVER_TIMEOUTS); if (pDriverSettings)
UpdateDriverList(pDriverSettings->getSettings()); else
{
SAL_WARN("cui.options", "ConnectionPoolOptionsPage::implInitControls: missing the DriverTimeouts item!");
UpdateDriverList(DriverPoolingSettings());
}
saveDriverList();
// reflect the new settings
OnEnabledDisabled(*m_xEnablePooling);
}
bool bModified = false; // the enabled flag if (m_xEnablePooling->get_state_changed_from_saved())
{
_rSet->Put(SfxBoolItem(SID_SB_POOLING_ENABLED, m_xEnablePooling->get_active()));
bModified = true;
}
// the settings for the single drivers if (isModifiedDriverList())
{
_rSet->Put(DriverPoolingSettingsItem(SID_SB_DRIVER_TIMEOUTS, m_aSettings));
bModified = true;
}
if (m_xEnablePooling.get() == &rCheckBox)
{
m_xDriversLabel->set_sensitive(bGloballyEnabled);
m_xDriverList->set_sensitive(bGloballyEnabled); if (!bGloballyEnabled)
m_xDriverList->select(-1);
m_xDriverLabel->set_sensitive(bGloballyEnabled);
m_xDriver->set_sensitive(bGloballyEnabled);
m_xDriverPoolingEnabled->set_sensitive(bGloballyEnabled && !m_xDriverPoolingEnabledImg->get_visible());
} else
OSL_ENSURE(bLocalDriverChanged, "ConnectionPoolOptionsPage::OnEnabledDisabled: where did this come from?");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.