summaryrefslogtreecommitdiffstats
path: root/Src/PyCatcher/src/pyCatcherView.py
diff options
context:
space:
mode:
authorTom2012-05-21 18:30:02 +0200
committerTom2012-05-21 18:30:02 +0200
commit818bd7c053bb9c17f323134a244e6822fa02b99f (patch)
treeade9ada0879c08a6ae329287bf1f4301fb1d849d /Src/PyCatcher/src/pyCatcherView.py
parentfinished experiments seciton apart from tables where data is needed and appendix (diff)
downloadimsi-catcher-detection-818bd7c053bb9c17f323134a244e6822fa02b99f.tar.gz
imsi-catcher-detection-818bd7c053bb9c17f323134a244e6822fa02b99f.tar.xz
imsi-catcher-detection-818bd7c053bb9c17f323134a244e6822fa02b99f.zip
added sections on paging and paging feature in c code, lot of minor changes in tex files
Diffstat (limited to 'Src/PyCatcher/src/pyCatcherView.py')
-rw-r--r--Src/PyCatcher/src/pyCatcherView.py58
1 files changed, 53 insertions, 5 deletions
diff --git a/Src/PyCatcher/src/pyCatcherView.py b/Src/PyCatcher/src/pyCatcherView.py
index 3c3c961..196a650 100644
--- a/Src/PyCatcher/src/pyCatcherView.py
+++ b/Src/PyCatcher/src/pyCatcherView.py
@@ -5,6 +5,7 @@ from xdot import DotWidget
import datetime
import time
from rules import RuleResult
+from evaluators import EvaluatorSelect
class PyCatcherGUI:
@@ -23,13 +24,18 @@ class PyCatcherGUI:
self._evaluators_window = self._builder.get_object('evaluators_window')
self._evaluation_window = self._builder.get_object('evaluation_window')
self._evaluation_image = self._builder.get_object('evaluation_image')
+ self._user_image = self._builder.get_object('img_user')
self._databases_window = self._builder.get_object('databases_window')
+ self._encryption_window = self._builder.get_object('encryption_window')
+ self._user_window = self._builder.get_object('user_window')
+
self._ok_image = gtk.gdk.pixbuf_new_from_file('../GUI/Images/ok.png')
self._warning_image = gtk.gdk.pixbuf_new_from_file('../GUI/Images/warning.png')
self._critical_image = gtk.gdk.pixbuf_new_from_file('../GUI/Images/critical.png')
self._plain_image = gtk.gdk.pixbuf_new_from_file('../GUI/Images/plain.png')
- self.set_image(RuleResult.IGNORE)
+ self.set_evaluator_image(RuleResult.IGNORE)
+ self.set_user_image(RuleResult.IGNORE)
self._catcher_controller = catcher_controller
@@ -61,7 +67,7 @@ class PyCatcherGUI:
self._main_window.show()
- def set_image(self, status):
+ def set_evaluator_image(self, status):
pixbuf = self._plain_image
if status == RuleResult.OK:
pixbuf = self._ok_image
@@ -72,7 +78,21 @@ class PyCatcherGUI:
width, height = self._evaluation_window.get_size()
pixbuf = pixbuf.scale_simple(width, height, gtk.gdk.INTERP_BILINEAR)
self._evaluation_image.set_from_pixbuf(pixbuf)
-
+
+ def set_user_image(self, status):
+ pixbuf = self._plain_image
+ if status == RuleResult.OK:
+ pixbuf = self._ok_image
+ elif status == RuleResult.WARNING:
+ pixbuf = self._warning_image
+ elif status == RuleResult.CRITICAL:
+ pixbuf = self._critical_image
+ elif status == RuleResult.IGNORE:
+ pixbuf = self._plain_image
+ pixbuf = pixbuf.scale_simple(320, 240, gtk.gdk.INTERP_BILINEAR)
+ self._user_image.set_from_pixbuf(pixbuf)
+
+
def _add_column(self, name, index):
column = gtk.TreeViewColumn(name, gtk.CellRendererText(), text=index)
column.set_resizable(True)
@@ -112,7 +132,12 @@ class PyCatcherGUI:
self._catcher_controller.trigger_evaluation()
def _update_evaluators(self):
- pass
+ if self._builder.get_object('rb_conservative_evaluator').get_active():
+ self._catcher_controller.set_evaluator(EvaluatorSelect.CONSERVATIVE)
+ elif self._builder.get_object('rb_weighted_evaluator').get_active():
+ self._catcher_controller.set_evaluator(EvaluatorSelect.WEIGHTED)
+ elif self._builder.get_object('rb_grouped_evaluator').get_active():
+ self._catcher_controller.set_evaluator(EvaluatorSelect.GROUP)
def _on_csv_clicked(self, widget):
self._update_databases()
@@ -140,9 +165,32 @@ class PyCatcherGUI:
def log_line(self, line):
self._log_buffer.insert(self._log_buffer.get_end_iter(),self._utf8conv(datetime.datetime.now().strftime("%I:%M:%S %p")+ ": " + line + "\n"))
- def _on_graph_node_clicked (self, widget, url, event):
+ def _on_graph_node_clicked(self, widget, url, event):
print 'NODE CLICKED'
+ def _on_user_close_clicked(self, widget):
+ self._user_window.hide()
+
+ def _on_encryption_close_clicked(self, widget):
+ self._catcher_controller.trigger_evaluation()
+ self._encryption_window.hide()
+
+ def _on_scan_enc_clicked(self, widget):
+ arfcn_list = map(int,(self._builder.get_object('te_enc_arfcns').get_text()).split(','))
+ timeout = int(self._builder.get_object('te_enc_timeout').get_text())
+ result = self._catcher_controller.scan_encryption(arfcn_list, timeout)
+ self._builder.get_object('lbl_enc_result').set_text('Result: ' + result)
+ def _on_go_clicked(self, widget):
+ provider = self._builder.get_object('te_user_provider').get_text()
+ result = self._catcher_controller.user_go()
+ self.set_user_image(result)
+
+ def _on_user_mode_clicked(self, widget):
+ self._user_window.show()
+
+ def _on_encryption_clicked(self, widget):
+ self._encryption_window.show()
+
def _on_web_services_clicked(self, widget):
self._update_databases()
self._catcher_controller.update_with_web_services()