summaryrefslogtreecommitdiffstats
path: root/src/klamonacc_config.ui.h
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2021-02-26 19:34:09 +0200
committerMavridis Philippe <mavridisf@gmail.com>2021-03-03 17:44:31 +0200
commit13cb4a5e7dc1c22d25c51da52156a558be0b7d05 (patch)
treee013fb1be4c88430b4be1ef21acb656c7f91eb5d /src/klamonacc_config.ui.h
parent8300c80d583320087d844b9f0ad0025d4a60aa10 (diff)
downloadklamav-13cb4a5e7dc1c22d25c51da52156a558be0b7d05.tar.gz
klamav-13cb4a5e7dc1c22d25c51da52156a558be0b7d05.zip
Added On-Access Scanner.
There are still a few TODOs, but it seems to work quite well already. This relates to issue #10. Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'src/klamonacc_config.ui.h')
-rw-r--r--src/klamonacc_config.ui.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/klamonacc_config.ui.h b/src/klamonacc_config.ui.h
new file mode 100644
index 0000000..7201e8d
--- /dev/null
+++ b/src/klamonacc_config.ui.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you want to add, delete, or rename functions or slots, use
+** TQt Designer to update this file, preserving your code.
+**
+** You should not define a constructor or destructor in this file.
+** Instead, write your code in functions called init() and destroy().
+** These will automatically be called by the form's constructor and
+** destructor.
+*****************************************************************************/
+
+#include "directorylist.h"
+
+#include <kdialogbase.h>
+#include <tdeconfig.h>
+#include <tdeglobal.h>
+
+void KlamOnAccConfig::reconfigurePaths() {
+ // Borrowed from amaroK (collectionbrowser.cpp)
+ KDialogBase dialog( this, 0, false );
+ // kapp->setTopWidget( &dialog );
+ dialog.setCaption( "Configure Directories Watchlist" );
+
+ TDEConfig *config = TDEGlobal::config();
+ config->setGroup("OnAccess");
+ TQStringList dirs = config->readListEntry("Watchlist");
+
+ CollectionSetup *setup = new CollectionSetup( &dialog, true, false, dirs );
+ dialog.setMainWidget( setup );
+ dialog.showButtonApply( false );
+ dialog.adjustSize();
+
+ // Make the dialog a bit bigger, default is too small to be useful
+ dialog.resize( dialog.width() + 50, dialog.height() + 150 );
+
+ if ( dialog.exec() != TQDialog::Rejected ) {
+ setup->writeConfig("OnAccess","Watchlist");
+ }
+
+ restart = true;
+}
+
+void KlamOnAccConfig::slotSettingsChanged() {
+ restart = true;
+}
+
+void KlamOnAccConfig::slotSettingsApplied() {
+ restart = false;
+}
+
+bool KlamOnAccConfig::needsRestart() {
+ return restart;
+}