36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
#!/usr/bin/python
|
|
from . import common
|
|
from . import testchooser
|
|
from . import testproperties
|
|
from . import testresults
|
|
from gi.repository import GObject
|
|
from gi.repository import Gtk
|
|
|
|
class TestChooser(Gtk.Box):
|
|
def __init__(self):
|
|
Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
|
|
self.stack = testchooser.Stack()
|
|
self.append(Gtk.StackSwitcher(stack=self.stack))
|
|
self.append(self.stack)
|
|
self.stack.connect("test-selected", self.on_test_selected)
|
|
|
|
def on_test_selected(self, stack, path):
|
|
self.emit("test-selected", path)
|
|
|
|
@GObject.Signal(arg_types=(testchooser.Path,))
|
|
def test_selected(self, path): pass
|
|
|
|
|
|
class TestView(Gtk.Box):
|
|
def __init__(self):
|
|
Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
|
|
self.stack = testproperties.Stack()
|
|
self.append(Gtk.StackSwitcher(stack=self.stack, halign=Gtk.Align.CENTER))
|
|
self.append(self.stack)
|
|
|
|
def set_test_result(self, file):
|
|
self.stack.clear()
|
|
if file and file.get_is_test_result():
|
|
results = testresults.TestResults(file.path)
|
|
self.stack.show_properties(results)
|