TDE personal information management applications
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cryptoconfigdialog.cpp 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. cryptoconfigdialog.h
  3. This file is part of kgpgcertmanager
  4. Copyright (c) 2004 Klarälvdalens Datakonsult AB
  5. Libkleopatra is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License,
  7. version 2, as published by the Free Software Foundation.
  8. Libkleopatra is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  15. In addition, as a special exception, the copyright holders give
  16. permission to link the code of this program with any edition of
  17. the Qt library by Trolltech AS, Norway (or with modified versions
  18. of Qt that use the same license as Qt), and distribute linked
  19. combinations including the two. You must obey the GNU General
  20. Public License in all respects for all of the code used other than
  21. Qt. If you modify this file, you may extend this exception to
  22. your version of the file, but you are not obligated to do so. If
  23. you do not wish to do so, delete this exception statement from
  24. your version.
  25. */
  26. #include "cryptoconfigdialog.h"
  27. #include "cryptoconfigmodule.h"
  28. #include <klocale.h>
  29. #include <kaccelmanager.h>
  30. Kleo::CryptoConfigDialog::CryptoConfigDialog( Kleo::CryptoConfig* config, TQWidget *parent, const char* name )
  31. : KDialogBase( Swallow,
  32. // Remove the "whats's this" button since we have no support for it
  33. WStyle_Customize | WStyle_DialogBorder | WStyle_Maximize | WStyle_Title | WStyle_SysMenu,
  34. parent, name, true /*modal*/,
  35. i18n( "Configure" ), Default|Cancel|Apply|Ok|User1,
  36. Ok, true /*separator*/, KGuiItem( i18n( "&Reset" ), "undo" ) )
  37. {
  38. mMainWidget = new CryptoConfigModule( config, this );
  39. setMainWidget( mMainWidget );
  40. connect( mMainWidget, TQT_SIGNAL( changed() ), TQT_SLOT( slotChanged() ) );
  41. enableButton( Apply, false );
  42. if ( mMainWidget->hasError() ) {
  43. showButton( Default, false );
  44. showButton( User1, false );
  45. showButton( Apply, false );
  46. showButton( Ok, false );
  47. }
  48. // Automatically assign accelerators
  49. KAcceleratorManager::manage( this );
  50. }
  51. void Kleo::CryptoConfigDialog::slotOk()
  52. {
  53. slotApply();
  54. accept();
  55. }
  56. void Kleo::CryptoConfigDialog::slotCancel()
  57. {
  58. mMainWidget->cancel();
  59. reject();
  60. }
  61. void Kleo::CryptoConfigDialog::slotDefault()
  62. {
  63. mMainWidget->defaults();
  64. slotChanged();
  65. }
  66. void Kleo::CryptoConfigDialog::slotApply()
  67. {
  68. mMainWidget->save();
  69. enableButton( Apply, false );
  70. }
  71. void Kleo::CryptoConfigDialog::slotUser1() // reset
  72. {
  73. mMainWidget->reset();
  74. enableButton( Apply, false );
  75. }
  76. void Kleo::CryptoConfigDialog::slotChanged()
  77. {
  78. enableButton( Apply, true );
  79. }
  80. #include "cryptoconfigdialog.moc"