/* -*- 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 .
*/
bool OGenericAdministrationPage::getSelectedDataSource(OUString& _sReturn, OUString const & _sCurr)
{ // collect all ODBC data source names
std::set<OUString> aOdbcDatasources;
OOdbcEnumeration aEnumeration; if (!aEnumeration.isLoaded())
{ // show an error message
OUString sError(DBA_RES(STR_COULD_NOT_LOAD_ODBC_LIB));
sError = sError.replaceFirst("#lib#", aEnumeration.getLibraryName());
std::unique_ptr<weld::MessageDialog> xDialog(Application::CreateMessageDialog(GetFrameWeld(),
VclMessageType::Warning, VclButtonsType::Ok,
sError));
xDialog->run(); returnfalse;
} else
{
aEnumeration.getDatasourceNames(aOdbcDatasources); // execute the select dialog
ODatasourceSelectDialog aSelector(GetFrameWeld(), aOdbcDatasources); if (!_sCurr.isEmpty())
aSelector.Select(_sCurr); if (RET_OK == aSelector.run())
_sReturn = aSelector.GetSelected();
} returntrue;
}
void OGenericAdministrationPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
{ // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa) bool bValid, bReadonly;
getFlags(_rSet, bValid, bReadonly);
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.