def actionNewSession(self): server_session = SessionModel() session_dialog = HkuEditSessionDialog(self) session_dialog.setWindowTitle(_translate("MainWindow", "New Session")) session_dialog.setData(server_session) if session_dialog.exec() >= 0: session_data = session_dialog.getData() session_data.save() self.server_view_dock.addSession(session_data) session_dialog.destroy()
def getData(self): if self.session_model is None: self.session_model = SessionModel() self.session_model.name = self.name self.session_model.host = self.host self.session_model.port = self.port self.session_model.user = self.user self.session_model.password = self.password self.session_model.remark = self.remark return self.session_model