/*************************************************************************** begin : 2004/02/07 copyright : (C) Mark Kretschmann email : markey@web.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. * * * ***************************************************************************/ #include "configdialog.h" #include "backend.h" #include "archivelimits.h" #include "specialfiletypes.h" /* #include "autoscanoptions.h" */ #include "logoptions.h" #include "sigtool.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //kapp #include #include #include #include #include ////////////////////////////////////////////////////////////////////////////////////////// // PUBLIC ////////////////////////////////////////////////////////////////////////////////////////// KlamavConfigDialog::KlamavConfigDialog( TQWidget *parent, const char* name, TDEConfigSkeleton *config ) : TDEConfigDialog( parent, name, config ) { setWFlags( WDestructiveClose ); // IMPORTANT Don't simply change the page names, they are used as identifiers in other parts of the app. m_klambackend = new KlamBackend( 0, "Scanning Backend" ); m_archivelimits = new ArchiveLimits( 0, "Archive Limits" ); m_emailprotection = new Sigtool ( 0, "E-mail protection" ); m_specialfiletypes = new SpecialFileTypes( 0, "File Types" ); /* m_autoscanoptions = new AutoScanOptions( 0, "Auto-Scan" ); */ m_logoptions = new LogOptions( 0, "Event Logging" ); // add pages addPage( m_klambackend, i18n( "Backend" ), "system-run", i18n( "Configure Scanning Backend" ) ); connect( m_klambackend->kcfg_ScannerClamdscan, SIGNAL(toggled(bool)), this, SLOT(slotToggleClamdscan(bool)) ); slotToggleClamdscan( m_klambackend->kcfg_ScannerClamdscan->isOn() ); // initial state addPage( m_archivelimits, i18n( "Archive Limits" ), "ark", i18n( "Configure Archive Limits" ) ); addPage( m_emailprotection, i18n( "E-mail protection" ), "email", i18n( "Set up your e-mail client to use Klammail" ) ); addPage( m_specialfiletypes, i18n( "File Types" ), "folder", i18n( "Configure File Types" ) ); /* addPage( m_autoscanoptions, i18n( "Auto-Scan" ), "filefind", i18n( "Configure Auto-Scan" ) ); */ addPage( m_logoptions, i18n( "Event Logging" ), "kate", i18n( "Configure Events to Log" ) ); TQObjectList *list = queryList( "TQLabel", "infoPixmap" ); for( TQObject *label = list->first(); label; label = list->next() ) static_cast(label)->setPixmap( TQMessageBox::standardIcon( TQMessageBox::Information ) ); delete list; //stop TDEFont Requesters getting stupidly large list = queryList( "TQLabel", "m_sampleLabel" ); for( TQObject *label = list->first(); label; label = list->next() ) static_cast(label)->setMaximumWidth( 250 ); delete list; } KlamavConfigDialog::~KlamavConfigDialog() { } void KlamavConfigDialog::slotToggleClamdscan(bool on) { m_klambackend->kcfg_ClamdMultiscan->setEnabled(on); m_archivelimits->setEnabled(!on); m_specialfiletypes->setEnabled(!on); } /** Show page by object name */ void KlamavConfigDialog::showPage( const TQCString& page ) { for( uint index = 0; index < m_pageList.count(); index++ ) { if ( m_pageList[index]->name() == page ) { TDEConfigDialog::showPage( index ); return; } } } /** Reimplemented from TDEConfigDialog */ void KlamavConfigDialog::addPage( TQWidget *page, const TQString &itemName, const TQString &pixmapName, const TQString &header, bool manage ) { // Add the widget pointer to our list, for later reference m_pageList << page; TDEConfigDialog::addPage( page, itemName, pixmapName, header, manage ); } #include "configdialog.moc"