certmanager/lib

cryptoconfigdialog.cpp

00001 /*
00002     cryptoconfigdialog.h
00003 
00004     This file is part of kgpgcertmanager
00005     Copyright (c) 2004 Klarälvdalens Datakonsult AB
00006 
00007     Libkleopatra is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU General Public License,
00009     version 2, as published by the Free Software Foundation.
00010 
00011     Libkleopatra is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019 
00020     In addition, as a special exception, the copyright holders give
00021     permission to link the code of this program with any edition of
00022     the Qt library by Trolltech AS, Norway (or with modified versions
00023     of Qt that use the same license as Qt), and distribute linked
00024     combinations including the two.  You must obey the GNU General
00025     Public License in all respects for all of the code used other than
00026     Qt.  If you modify this file, you may extend this exception to
00027     your version of the file, but you are not obligated to do so.  If
00028     you do not wish to do so, delete this exception statement from
00029     your version.
00030 */
00031 
00032 #include "cryptoconfigdialog.h"
00033 #include "cryptoconfigmodule.h"
00034 #include <klocale.h>
00035 #include <kaccelmanager.h>
00036 
00037 Kleo::CryptoConfigDialog::CryptoConfigDialog( Kleo::CryptoConfig* config, QWidget *parent, const char* name )
00038   : KDialogBase( Swallow,
00039                  // Remove the "whats's this" button since we have no support for it
00040                  WStyle_Customize | WStyle_DialogBorder | WStyle_Maximize | WStyle_Title | WStyle_SysMenu,
00041                  parent, name, true /*modal*/,
00042                  i18n( "Configure" ), Default|Cancel|Apply|Ok|User1,
00043                  Ok, true /*separator*/, KGuiItem( i18n( "&Reset" ), "undo" ) )
00044 {
00045   mMainWidget = new CryptoConfigModule( config, this );
00046   setMainWidget( mMainWidget );
00047   connect( mMainWidget, SIGNAL( changed() ), SLOT( slotChanged() ) );
00048   enableButton( Apply, false );
00049 
00050   // Automatically assign accelerators
00051   KAcceleratorManager::manage( this );
00052 }
00053 
00054 void Kleo::CryptoConfigDialog::slotOk()
00055 {
00056   slotApply();
00057   accept();
00058 }
00059 
00060 void Kleo::CryptoConfigDialog::slotCancel()
00061 {
00062   mMainWidget->cancel();
00063   reject();
00064 }
00065 
00066 void Kleo::CryptoConfigDialog::slotDefault()
00067 {
00068   mMainWidget->defaults();
00069   slotChanged();
00070 }
00071 
00072 void Kleo::CryptoConfigDialog::slotApply()
00073 {
00074   mMainWidget->save();
00075   enableButton( Apply, false );
00076 }
00077 
00078 void Kleo::CryptoConfigDialog::slotUser1() // reset
00079 {
00080   mMainWidget->reset();
00081   enableButton( Apply, false );
00082 }
00083 
00084 void Kleo::CryptoConfigDialog::slotChanged()
00085 {
00086   enableButton( Apply, true );
00087 }
00088 
00089 #include "cryptoconfigdialog.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys