/*************************************************************************** * Copyright (C) 2006 by Michael Kaufmann * * michael@enlighter.de * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include #include #include "kovpnconfigdialog.h" #include "prefopenvpn.h" #include "prefgeneral.h" #include "kovpnconfig.h" #include "openvpnmanager.h" using namespace std; kovpnConfigDialog::kovpnConfigDialog( QWidget *parent, const char *name, kovpnConfig *config, DialogType dialogType, int dialogButtons, ButtonCode defaultButton, bool modal ) : KConfigDialog( parent, name, config, dialogType, dialogButtons, defaultButton, modal ) { // mConfig = config; mPrefGeneral = new prefGeneral; mPrefOpenVPN = new prefOpenVPN; addPage( mPrefOpenVPN, i18n( "OpenVPN" ), "kovpn_config", i18n( "OpenVPN Settings" ) ); addPage( mPrefGeneral, i18n( "General" ), "package_settings", i18n( "General Settings" ) ); connect( mPrefOpenVPN, SIGNAL( widgetChanged() ), this, SLOT( updateButtons() ) ); } kovpnConfigDialog::~kovpnConfigDialog() {} bool kovpnConfigDialog::hasChanged( ) { return mPrefOpenVPN->hasChanged(); } bool kovpnConfigDialog::isDefault() { return mPrefOpenVPN->isDefault(); } void kovpnConfigDialog::updateSettings( ) { debug("updateSettings"); KConfigDialog::updateSettings(); mPrefOpenVPN->updateSettings(); // if ( hasChanged() ) { KConfigDialog::settingsChangedSlot(); // } } void kovpnConfigDialog::slotHelp( ) { KConfigDialog::slotHelp(); } void kovpnConfigDialog::updateWidgets( ) { // KConfigDialog::updateWidgets(); mPrefOpenVPN->updateWidgets(); } void kovpnConfigDialog::updateWidgetsDefault( ) { // KConfigDialog::updateWidgetsDefault(); mPrefOpenVPN->updateWidgetsDefault(); } kovpnConfigDialog * kovpnConfigDialog::self( QWidget * parent, const char * name, kovpnConfig * config, DialogType dialogType, int dialogButtons, ButtonCode defaultButton, bool modal ) { if ( !mSelf ) { mSelf = new kovpnConfigDialog( parent, name, config, dialogType, dialogButtons, defaultButton, modal ); } return mSelf; } void kovpnConfigDialog::debug( const QString & method, const QString & message ) { #ifdef DEBUG QString myMethod ( method ); static unsigned int maxLen = 0; maxLen = QMAX( myMethod.length(), maxLen ); cout << "kovpnConfigDialog::" << myMethod.leftJustify( maxLen ) << " => " << message << endl; #endif } #include "kovpnconfigdialog.moc"