[ui] adding information to text field
This commit is contained in:
parent
031b5098d5
commit
cbc86598b0
@ -68,7 +68,10 @@ class PyRelacs(QMainWindow):
|
||||
self.setCentralWidget(widget)
|
||||
|
||||
filename = path.joinpath(path.cwd(), "data.nix")
|
||||
self.nix_file = nix.File.open(str(filename), nix.FileMode.ReadWrite)
|
||||
if filename.exists():
|
||||
self.nix_file = nix.File.open(str(filename), nix.FileMode.ReadOnly)
|
||||
else:
|
||||
self.nix_file = nix.File.open(str(filename), nix.FileMode.Overwrite)
|
||||
|
||||
def create_actions(self):
|
||||
self._rlx_exitaction = QAction(QIcon(":/icons/exit.png"), "Exit", self)
|
||||
@ -271,8 +274,12 @@ class PyRelacs(QMainWindow):
|
||||
|
||||
self.threadpool.start(worker)
|
||||
|
||||
def add_to_textfield(self, s: str):
|
||||
self.text.appendPlainText(s)
|
||||
|
||||
def on_exit(self):
|
||||
print("exit button!")
|
||||
log.info("exit button!")
|
||||
self.add_to_textfield("exiting")
|
||||
self.close()
|
||||
|
||||
def on_about(self, e):
|
||||
@ -280,10 +287,12 @@ class PyRelacs(QMainWindow):
|
||||
about.show()
|
||||
|
||||
def print_output(self, s):
|
||||
print(s)
|
||||
log.info(s)
|
||||
self.add_to_textfield(s)
|
||||
|
||||
def thread_complete(self):
|
||||
print("THREAD COMPLETE!")
|
||||
log.info("Thread complete!")
|
||||
self.add_to_textfield("Thread complete!")
|
||||
|
||||
def progress_fn(self, n):
|
||||
print("%d%% done" % n)
|
||||
|
Loading…
Reference in New Issue
Block a user