def __init__(self): super(Example, self).__init__() self.setGeometry(300, 300, 250, 150) self.setWindowTitle('Qthread Toy') main_box = QHBoxLayout() self.textedit = QTextEdit() main_box.addWidget(self.textedit) self.pushbutton = QPushButton('Click Me') main_box.addWidget(self.pushbutton) self.pushbutton.clicked.connect(self.start_thread) self.stopbutton = QPushButton('Stop Me') main_box.addWidget(self.stopbutton) self.stopbutton.clicked.connect(self.stop_thread) self.controller = Controller(".") self.thrd = MyThread(self) #, self.controller) self.thrd.set_controler(self.controller) self.thrd.handler.write_signal.connect(self.append_text) self.thrd.finished.connect(self.tell_finished) self.setLayout(main_box) self.show()
def __init__(self): ''' Initialise the console ''' from dials.util.idials import Controller # Initialise the console base Cmd.__init__(self) # Open a file for history self.command_history = open("command_history", "a") # Create the controller object self.controller = Controller() # Set the prompt to show the current mode self.prompt = "%s >> " % self.controller.get_mode()
def __init__(self, parent=None, dials_logo=None): super(IdialsInnerrWidget, self).__init__(parent) self.super_parent = parent self.controller = Controller(".") self.next_cmd = "import" self.failed = None if (self.super_parent.embedded_reindex): big_box = QHBoxLayout() else: big_box = QVBoxLayout() self.tree_nav = TreeNavWidget(self) big_box.addWidget(self.tree_nav) self.thrd = MyThread(self) #, self.controller) self.thrd.set_controler(self.controller) self.thrd.std_handler.write_signal.connect(self.append_text) self.thrd.err_handler.write_signal.connect(self.err_append_text) self.thrd.started.connect(self.started_thread) self.thrd.finished.connect(self.finished_thread) self.setLayout(big_box) self.show()
def __init__(self): super(MainWidget, self).__init__() self.controller = Controller(".") self.next_cmd = "import" big_vbox = QVBoxLayout() self.btn_up = QPushButton('\n Up \n', self) self.btn_up.clicked.connect(self.up_clicked) big_vbox.addWidget(self.btn_up) midl_hbox = QHBoxLayout() self.btn_prv = QPushButton('\n Prev \n', self) self.btn_prv.clicked.connect(self.prv_clicked) midl_hbox.addWidget(self.btn_prv) self.btn_go = QPushButton('\n Go/Next \n', self) self.btn_go.clicked.connect(self.go_clicked) midl_hbox.addWidget(self.btn_go) tmp_off = ''' self.btn_nxt = QPushButton('\n Next \n', self) self.btn_nxt.clicked.connect(self.nxt_clicked) midl_hbox.addWidget(self.btn_nxt) ''' big_vbox.addLayout(midl_hbox) self.btn_dwn = QPushButton('\n Down \n', self) self.btn_dwn.clicked.connect(self.dwn_clicked) big_vbox.addWidget(self.btn_dwn) self.setLayout(big_vbox) self.setWindowTitle('Shell dialog') self.show()