File KTrafficAnalyzer-stats.patch of Package KTrafficAnalyzer4

Index: KTrafficAnalyzer-0.5.4.1/lib/TrafficWindow.cpp
===================================================================
--- KTrafficAnalyzer-0.5.4.1.orig/lib/TrafficWindow.cpp
+++ KTrafficAnalyzer-0.5.4.1/lib/TrafficWindow.cpp
@@ -77,7 +77,7 @@ TrafficWindow::TrafficWindow(QWidget * p
     dialog->addPage(statisticsWidget, i18n("Statistics"), "kchart");
 
     //Create correct stats skeleton
-    /*delete KTAStats::self();
+    delete KTAStats::self();
     KTAStats::self(this->trafficInterface->getInterfaceName().prepend("ktastats"));
     //Create stats dialog
     stats = new KConfigDialog(this, "KTAStats", KTAStats::self());
@@ -92,7 +92,7 @@ TrafficWindow::TrafficWindow(QWidget * p
     stats->addPage(monthlyStatsWidget, i18n("Monthly"), "accessories-calculator");
     //Update traffic stats in real-time
     QObject::connect(this, SIGNAL(updateStatsDialog(int)), dailyStatsWidget, SLOT(updateStatistics(int)));
-    QObject::connect(this, SIGNAL(updateStatsDialog(int)), monthlyStatsWidget, SLOT(updateStatistics(int)));*/
+    QObject::connect(this, SIGNAL(updateStatsDialog(int)), monthlyStatsWidget, SLOT(updateStatistics(int)));
 
     //Create display for realtime traffic graph
     this->graphDisplay = new GraphDisplay(this);
@@ -132,7 +132,7 @@ TrafficWindow::TrafficWindow(QWidget * p
 
     //Add context menu entries at the SysTray
     this->sysTray->contextMenu()->addAction(i18n("Settings"), dialog, SLOT(show()));
-    this->sysTray->contextMenu()->addAction(i18n("Stats"), stats, SLOT(show()));
+    //this->sysTray->contextMenu()->addAction(i18n("Stats"), stats, SLOT(show()));
 
     //Restore size?
     if (KTASettings::rememberSize()) {
@@ -550,10 +550,11 @@ void TrafficWindow::interfaceChanged() {
     QObject::connect(this, SIGNAL(updateStatsDialog(int)), dailyStatsWidget, SLOT(updateStatistics(int)));
     QObject::connect(this, SIGNAL(updateStatsDialog(int)), monthlyStatsWidget, SLOT(updateStatistics(int)));
 
-    //Update menu-bar
-    this->menuBar()->removeAction(this->statsEntryAction);
+    //Update menu-bar & systray
+    this->sysTray->contextMenu()->removeAction(this->statsEntryAction);
     this->statsEntryAction = this->menuBar()->addAction(i18n("Stats"), stats, SLOT(show()));
     this->menuBar()->insertAction(this->exitEntryAction, this->statsEntryAction);
+    this->sysTray->contextMenu()->addAction(this->statsEntryAction);
 
     //Reset memory
     this->memoryUpload->reset();
openSUSE Build Service is sponsored by