diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/klamav.cpp | 31 | ||||
-rw-r--r-- | src/klamav.h | 1 | ||||
-rw-r--r-- | src/tabwidget.cpp | 2 | ||||
-rw-r--r-- | src/tabwidget.h | 1 |
4 files changed, 30 insertions, 5 deletions
diff --git a/src/klamav.cpp b/src/klamav.cpp index ab7d7a7..7499a9b 100644 --- a/src/klamav.cpp +++ b/src/klamav.cpp @@ -53,6 +53,7 @@ Klamav::Klamav() fixedTabs << i18n("Scan") << i18n("Update"); tab = new TabWidget(this, "KlamAV", fixedTabs); + connect( tab, SIGNAL(tabClosed(TQString)), this, SLOT(tabClosed(TQString)) ); _tray = new KSystemTray(tdemain, "klamav tray"); _tray->setPixmap(KSystemTray::loadIcon("klamav_on_acc_disabled")); @@ -108,9 +109,9 @@ Klamav::Klamav() top->setMenuBar(menubar); - activityviewer = new Activityviewer(this); + activityviewer = new Activityviewer(this, "Events"); - aboutklamav = new Aboutklamav(this); + aboutklamav = new Aboutklamav(this, "Welcome"); updateTabState(0, true); // Welcome tab klamscan = new Klamscan(this); @@ -124,10 +125,10 @@ Klamav::Klamav() - kuarantine = new Kuarantine(this); + kuarantine = new Kuarantine(this, "Quarantine"); updateTabState(1, true); // Quarantine tab - klamdb = new KlamDB(this); + klamdb = new KlamDB(this, "DBViewer"); updateTabState(2, true); // Virus Browser tab updateTabState(3, true); // Events tab @@ -248,6 +249,28 @@ void Klamav::updateTabState( int tabId, bool init ) { tabs_menu->setItemChecked(itemId, config->readBoolEntry(optionName, true) ); } +void Klamav::tabClosed(TQString name) { + int uncheck; + TQString optionName; + + if ( name == "Welcome" ) { + uncheck=showWelcomeTab; + optionName="ShowWelcomeTab"; + } else if ( name == "Quarantine" ) { + uncheck=showQuarantineTab; + optionName="ShowQuarantineTab"; + } else if ( name == "DBViewer" ) { + uncheck=showDBViewerTab; + optionName="ShowDBViewerTab"; + } else if ( name == "Events" ) { + uncheck=showEventsTab; + optionName="ShowEventsTab"; + } + + tabs_menu->setItemChecked(uncheck, false); + config->writeEntry(optionName, false); +} + // Menu slots void Klamav::slotScanFile() { klamscan->slotScanFile(); diff --git a/src/klamav.h b/src/klamav.h index e539f85..f3d2960 100644 --- a/src/klamav.h +++ b/src/klamav.h @@ -118,6 +118,7 @@ private slots: void contextEnableFK(); void contextUpdateFK(); void contextDisableFK(); + void tabClosed(TQString name); private: void setupAccel(); diff --git a/src/tabwidget.cpp b/src/tabwidget.cpp index b33be4f..bee6ea7 100644 --- a/src/tabwidget.cpp +++ b/src/tabwidget.cpp @@ -186,7 +186,7 @@ void TabWidget::slotCloseTab() { if(!currentItem) return; removePage(currentItem); - delete currentItem; + emit tabClosed( currentItem->name() ); currentItem = 0; } diff --git a/src/tabwidget.h b/src/tabwidget.h index ffedfb8..b60493a 100644 --- a/src/tabwidget.h +++ b/src/tabwidget.h @@ -38,6 +38,7 @@ class TabWidget:public KTabWidget signals: void currentFrameChanged(Frame *); + void tabClosed(TQString); private: // methods |