diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2008-09-11 13:34:38 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2008-09-11 13:34:38 -0300 |
commit | f504a03d71c6cf81b5afb3e85e34cf70ba68be1f (patch) | |
tree | a6ce50aa8182818d9b9ca51b8b8919a183bedd25 | |
parent | 2e9904b0bb5c7bb821659193bbf9dd588819b32c (diff) | |
download | tuna-f504a03d71c6cf81b5afb3e85e34cf70ba68be1f.tar.gz |
tuna_gui: Automatically adjust the cpuview area to show all sockets
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tuna/tuna_gui.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tuna/tuna_gui.py b/tuna/tuna_gui.py index 561ff2c..5c75766 100644 --- a/tuna/tuna_gui.py +++ b/tuna/tuna_gui.py @@ -246,7 +246,7 @@ class cpu_socket_frame(gtk.Frame): class cpuview: - def __init__(self, window, procview, irqview, cpus_filtered): + def __init__(self, vpaned, hpaned, window, procview, irqview, cpus_filtered): self.cpus = sysfs.cpus() self.cpustats = procfs.cpusstats() self.socket_frames = {} @@ -289,6 +289,17 @@ class cpuview: self.previous_pid_affinities = None self.previous_irq_affinities = None + req = frame.size_request() + # FIXME: what is the slack we have + # to add to every row and column? + width = req[0] + 16 + height = req[1] + 20 + if nr_sockets > 1: + width *= columns + height *= rows + vpaned.set_position(int(height)) + hpaned.set_position(int(width)) + self.timer = gobject.timeout_add(3000, self.refresh) def isolate_cpu(self, cpu): @@ -1328,7 +1339,9 @@ class gui: self.ps, show_kthreads, show_uthreads, cpus_filtered) self.irqview = irqview(self.wtree.get_widget("irqlist"), self.irqs, self.ps, cpus_filtered) - self.cpuview = cpuview(self.wtree.get_widget("cpuview"), + self.cpuview = cpuview(self.wtree.get_widget("vpaned1"), + self.wtree.get_widget("hpaned2"), + self.wtree.get_widget("cpuview"), self.procview, self.irqview, cpus_filtered) event_handlers = { "on_mainbig_window_delete_event" : self.on_mainbig_window_delete_event, |