@ -84,7 +84,6 @@ Freshklam::Freshklam(TQWidget *parent, const char *name)
// updater->update();
updater = new KlamavUpdate ( this ) ;
connect ( updater , SIGNAL ( getCurrentVersionOfClamAV ( ) ) , SLOT ( getCurrentVersionOfClamAV ( ) ) ) ;
connect ( updater , SIGNAL ( toggleUpgradeButtons ( bool ) ) , SLOT ( toggleUpgradeButtons ( bool ) ) ) ;
@ -113,52 +112,6 @@ Freshklam::Freshklam(TQWidget *parent, const char *name)
TQVBoxLayout * vbox = new TQVBoxLayout ( this , KDialog : : marginHint ( ) ,
KDialog : : spacingHint ( ) , " vbox " ) ;
//Proxy Widget
TQGroupBox * software_group = new TQGroupBox ( i18n ( " Software Updates " ) , this ) ;
vbox - > addWidget ( software_group ) ;
TQGridLayout * software_layout = new TQGridLayout ( software_group , 5 , 2 , KDialog : : spacingHint ( ) ,
KDialog : : spacingHint ( ) , " software_layout " ) ;
software_layout - > addRowSpacing ( 0 , software_group - > fontMetrics ( ) . height ( ) ) ;
software_layout - > setColStretch ( 0 , 1 ) ;
software_layout - > setColStretch ( 1 , 1 ) ;
//Dazuko
TQWidget * dazuko_hlp = new TQWidget ( software_group ) ;
software_layout - > addMultiCellWidget ( dazuko_hlp , 1 , 2 , 0 , 2 ) ;
TQGridLayout * dazuko_dir_layout = new TQGridLayout ( dazuko_hlp , 2 , 2 , KDialog : : spacingHint ( ) ) ;
clamav_box = new TQCheckBox ( i18n ( " Update ClamAV Automatically " ) , dazuko_hlp ) ;
clamav_box - > setMinimumWidth ( clamav_box - > sizeHint ( ) . width ( ) ) ;
dazuko_dir_layout - > addWidget ( clamav_box , 0 , 0 ) ;
klamav_box = new TQCheckBox ( i18n ( " Update KlamAV Automatically " ) , dazuko_hlp ) ;
klamav_box - > setMinimumWidth ( klamav_box - > sizeHint ( ) . width ( ) ) ;
dazuko_dir_layout - > addWidget ( klamav_box , 0 , 1 ) ;
clamav_options = new TQPushButton ( i18n ( " Upgrade ClamAV Now " ) , dazuko_hlp ) ;
dazuko_dir_layout - > addWidget ( clamav_options , 1 , 0 ) ;
clamav_options - > setFixedSize ( clamav_options - > sizeHint ( ) ) ;
connect ( clamav_options , SIGNAL ( clicked ( ) ) , this ,
SLOT ( checkForNewClamAVNow ( ) ) ) ;
klamav_options = new TQPushButton ( i18n ( " Upgrade KlamAV Now " ) , dazuko_hlp ) ;
dazuko_dir_layout - > addWidget ( klamav_options , 1 , 1 ) ;
klamav_options - > setFixedSize ( klamav_options - > sizeHint ( ) ) ;
connect ( klamav_options , SIGNAL ( clicked ( ) ) , this ,
SLOT ( checkForNewKlamAVNow ( ) ) ) ;
# ifdef DISABLE_UPDATES
clamav_box - > setEnabled ( false ) ;
klamav_box - > setEnabled ( false ) ;
clamav_options - > setEnabled ( false ) ;
klamav_options - > setEnabled ( false ) ;
# endif
//Virus Database Directory
TQGroupBox * group = new TQGroupBox ( i18n ( " Virus Database Directory " ) , this ) ;
vbox - > addWidget ( group ) ;
@ -363,18 +316,7 @@ void Freshklam::processOutput()
pos2 = item2 . find ( ' \n ' , pos ) ;
TQString version = item2 . mid ( ( pos + 20 ) , pos2 - ( pos + 20 ) ) . stripWhiteSpace ( ) ;
if ( ( clamav_box - > isChecked ( ) ) ) {
int result = KMessageBox : : warningContinueCancel ( this , i18n ( " It looks like your version of the ClamAV engine is out of date! ClamAV-%1 is the most recent version of ClamAV available. Would you like to KlamAV to download and compile it for you? " ) . arg ( version ) , i18n ( " Download and Install ClamAV-%1 " ) . arg ( version ) , i18n ( " Download and Install ClamAV-%1 " ) . arg ( version ) ) ;
switch ( result ) {
case 2 :
break ;
case 5 :
updater - > downloadComponent ( " clamav " , version , " tar.gz " ) ;
}
} else if ( ! ( clamav_box - > isChecked ( ) ) )
KNotifyClient : : event ( tdemain - > _tray - > winId ( ) , " ClamAVOutDated " , TQString ( " Your copy of ClamAV is out of date! Please Upgrade to ClamAV %1! " ) . arg ( version ) ) ;
KNotifyClient : : event ( tdemain - > _tray - > winId ( ) , " ClamAVOutDated " , TQString ( " Your copy of ClamAV is out of date! Please Upgrade to ClamAV %1! " ) . arg ( version ) ) ;
}
@ -724,20 +666,6 @@ void Freshklam::initCheckBoxes(){
check_combo - > setEnabled ( false ) ;
}
if ( ( config - > readEntry ( " AutoUpdateClamAV " ) ) = = " Yes " ) {
clamav_box - > setChecked ( true ) ;
} else {
clamav_box - > setChecked ( false ) ;
}
if ( ( config - > readEntry ( " AutoUpdateKlamAV " ) ) = = " Yes " ) {
klamav_box - > setChecked ( true ) ;
} else {
klamav_box - > setChecked ( false ) ;
}
connect ( clamav_box , SIGNAL ( toggled ( bool ) ) , SLOT ( handleChecks ( ) ) ) ;
connect ( klamav_box , SIGNAL ( toggled ( bool ) ) , SLOT ( handleChecks ( ) ) ) ;
connect ( daemon_box , SIGNAL ( toggled ( bool ) ) , SLOT ( handleChecks ( ) ) ) ;
connect ( check_combo , SIGNAL ( activated ( int ) ) , SLOT ( handleChecks ( ) ) ) ;
@ -760,18 +688,6 @@ void Freshklam::handleChecks(){
}
config - > writeEntry ( " NoOfUpdates " , check_combo - > currentText ( ) ) ;
if ( clamav_box - > isChecked ( ) ) {
config - > writeEntry ( " AutoUpdateClamAV " , " Yes " ) ;
} else {
config - > writeEntry ( " AutoUpdateClamAV " , " No " ) ;
}
if ( klamav_box - > isChecked ( ) ) {
config - > writeEntry ( " AutoUpdateKlamAV " , " Yes " ) ;
} else {
config - > writeEntry ( " AutoUpdateKlamAV " , " No " ) ;
}
config - > sync ( ) ;
}
@ -969,8 +885,7 @@ void
Freshklam : : resolved ( KResolverResults result ) // SLOT
{
if ( ( ! ( result . error ( ) ! = KResolver : : NoError | | result . isEmpty ( ) ) )
& & klamav_box - > isChecked ( ) ) {
if ( ( ! ( result . error ( ) ! = KResolver : : NoError | | result . isEmpty ( ) ) ) ) {
updater - > checkForNewKlamAV ( ) ;
} else
kdDebug ( ) < < " network error or not set to check for new klamav " < < endl ;
@ -1028,13 +943,4 @@ void Freshklam::readVersionLine(KProcIO *)
}
void Freshklam : : toggleUpgradeButtons ( bool state )
{
klamav_options - > setEnabled ( state ) ;
clamav_options - > setEnabled ( state ) ;
}
# include "freshklam.moc"