def ui_init(self): row = 0 # 创建port部件 build_widget(grid=self.grid, widget_class=QLabel, text="port:", row=row, col=0) self.le_port = build_widget(grid=self.grid, widget_class=QLineEdit, text="5432", row=row, col=1) row += 1 # 创建db部件 build_widget(grid=self.grid, widget_class=QLabel, text="db:", row=row, col=0) dbs = get_db() row, ck_db = build_checkbox_widget(grid=self.grid, row=row, col=1, items=dbs) [ck.stateChanged.connect(lambda: process_checked(ck_db, self.dbs)) for ck in ck_db] row += 1 # 创建data path部件 build_widget(grid=self.grid, widget_class=QLabel, text="data path:", row=row, col=0) self.le_data_path = build_widget(grid=self.grid, widget_class=QLineEdit, text=".", row=row, col=1) row += 1 # 创建提交部件 bt_commit = build_widget(grid=self.grid, widget_class=QPushButton, text="提交", row=row, col=0) bt_commit.clicked.connect(self._commit)
def ui_init(self): row = 0 # 创建host部件 build_widget(grid=self.grid, widget_class=QLabel, text="host:", row=row, col=0) hosts = get_host() self.cb_host = build_widget(grid=self.grid, widget_class=QComboBox, text="", row=row, col=1) build_widget_items(self.cb_host, hosts) row += 1 # 创建port部件 build_widget(grid=self.grid, widget_class=QLabel, text="port:", row=row, col=0) self.le_port = build_widget(grid=self.grid, widget_class=QLineEdit, text="5432", row=row, col=1) row += 1 # 创建db部件 build_widget(grid=self.grid, widget_class=QLabel, text="db:", row=row, col=0) dbs = get_db() self.cb_db = build_widget(grid=self.grid, widget_class=QComboBox, text="", row=row, col=1) build_widget_items(self.cb_db, dbs) self.cb_db.insertItem(0, "*") row += 1 # 创建db_user部件 build_widget(grid=self.grid, widget_class=QLabel, text="db_user:"******"postgres", row=row, col=1) row += 1 # 创建db_password部件 build_widget(grid=self.grid, widget_class=QLabel, text="db_password", row=row, col=0) self.le_dbpasswd = build_widget(grid=self.grid, widget_class=QLineEdit, text="postgres", row=row, col=1) row += 1 # 创建提交部件 bt_commit = build_widget(grid=self.grid, widget_class=QPushButton, text="提交", row=row, col=0) bt_commit.clicked.connect(self._commit)
def ui_init(self): row = 0 # 创建host部件 build_widget(grid=self.grid, widget_class=QLabel, text="host:", row=row, col=0) self.le_host = build_widget(grid=self.grid, widget_class=QLineEdit, text=settings.REMOTE_HOST, row=row, col=1) row += 1 # 创建port部件 build_widget(grid=self.grid, widget_class=QLabel, text="port:", row=row, col=0) self.le_port = build_widget(grid=self.grid, widget_class=QLineEdit, text=str(settings.REMOTE_PORT), row=row, col=1) row += 1 # 创建user部件 build_widget(grid=self.grid, widget_class=QLabel, text="user:"******"password:"******"提交", row=row, col=0) bt_commit.clicked.connect(self._commit) # 创建取消部件 bt_cancel = build_widget(grid=self.grid, widget_class=QPushButton, text="取消", row=row, col=1) bt_cancel.clicked.connect(self.close)
def ui_init(self): row = 0 # 创建host部件 build_widget(grid=self.grid, widget_class=QLabel, text="host:", row=row, col=0) hosts = get_host() self.cb_host = build_widget(grid=self.grid, widget_class=QComboBox, text="", row=row, col=1) build_widget_items(self.cb_host, hosts) row += 1 # 创建port部件 build_widget(grid=self.grid, widget_class=QLabel, text="port:", row=row, col=0) self.le_port = build_widget(grid=self.grid, widget_class=QLineEdit, text="5432", row=row, col=1) row += 1 # 创建db部件 build_widget(grid=self.grid, widget_class=QLabel, text="db:", row=row, col=0) dbs = get_db() self.cb_db = build_widget(grid=self.grid, widget_class=QComboBox, text="", row=row, col=1) build_widget_items(self.cb_db, dbs) row += 1 # 创建table部件 build_widget(grid=self.grid, widget_class=QLabel, text="table:", row=row, col=0) self.le_table = build_widget(grid=self.grid, widget_class=QLineEdit, text="", row=row, col=1) row += 1 # 创建bk_path部件 build_widget(grid=self.grid, widget_class=QLabel, text="bk_path:", row=row, col=0) self.le_bk_path = build_widget(grid=self.grid, widget_class=QLineEdit, text=".", row=row, col=1) row += 1 # 创建提交部件 bt_commit = build_widget(grid=self.grid, widget_class=QPushButton, text="提交", row=row, col=0) bt_commit.clicked.connect(self._commit)