def btn_connect_clicked(self): # When connect button is clicked, show the chat pane self.window.setCentralWidget(self.chat_pane) self.txt_history.append('Connecting...') self.connection = Network.Connection(self.inp_connect_address.text(), 5000)
def create_main_panel_connect(self): """Create a main panel that serves as the primary application interface""" self.connection = Network.Connection(self.c_input_host.text(), self.c_input_port.text()) # Create two displays for the local and remote file systems cm_local_fs_display = QTextEdit() cm_local_fs_display.setReadOnly(True) cm_remote_fs_display = QTextEdit() cm_remote_fs_display.setReadOnly(True) files = os.listdir("/root/sptp_client") """Directory in which files are displayed""" connect_files = [] for file in files: cm_local_fs_display.append(file) connect_files.append(file) mh_panel = make_container_widget( [cm_local_fs_display, cm_remote_fs_display], vertical=False) """Combine the displays into a container widget""" mh_history = QTextEdit() mh_history.setReadOnly(True) mh_history.setFixedHeight(100) # Prototyping the command line interface msr_button = QPushButton() msr_input = QLineEdit() # Transfer command line mh_input = make_container_widget([msr_button, msr_input], vertical=False) # Create entire panel that will be the window layout m_panel = make_container_widget([mh_panel, mh_history, mh_input]) self.window.setCentralWidget(m_panel) self.window.setFixedSize(800, 800) self.window.setWindowTitle("Local: Simple Python Transfer Protocol") self.connect_files = connect_files self.cm_remote_fs_display = cm_remote_fs_display