コード例 #1
0
 def __init__(self,
              parent,
              table,
              fields,
              idcol,
              groupfields,
              mainview,
              name='PaellaRecordSelector'):
     #PaellaManagerWidget.__init__(self, parent, mainview, name=name)
     QSplitter.__init__(self, parent, name)
     BasePaellaWidget.initPaellaCommon(self)
     self.current = currentobject()
     self.table = table
     self.fields = fields
     self.idcol = idcol
     self.groupfields = groupfields
     self.listView = KListView(self)
     self.vsplit = QSplitter(self)
     self.vsplit.setOrientation(self.Vertical)
     self.mainView = mainview(self.vsplit)
     self.recordForm = EditableRecordFrame(self, fields)
     self.connect(self.listView, SIGNAL('selectionChanged()'),
                  self.groupChanged)
     self.connect(self.recordForm.insButton, SIGNAL('clicked()'),
                  self.insertRecord)
     self.connect(self.recordForm.updButton, SIGNAL('clicked()'),
                  self.updateRecord)
     self.initlistView()
     self.setSource(self.handleURL)
コード例 #2
0
ファイル: scoringdialog.py プロジェクト: zero804/kajongg
 def setupUi(self):
     """setup UI elements"""
     self.viewLeft = ScoreViewLeft(self)
     self.viewRight = ScoreViewRight(self)
     self.viewRight.setHorizontalScrollBar(HorizontalScrollBar(self))
     self.viewRight.setHorizontalScrollMode(QAbstractItemView.ScrollPerItem)
     self.viewRight.setFocusPolicy(Qt.NoFocus)
     self.viewRight.header().setSectionsClickable(False)
     self.viewRight.header().setSectionsMovable(False)
     self.viewRight.setSelectionMode(QAbstractItemView.NoSelection)
     windowLayout = QVBoxLayout(self)
     self.splitter = QSplitter(Qt.Vertical)
     self.splitter.setObjectName('ScoreTableSplitter')
     windowLayout.addWidget(self.splitter)
     scoreWidget = QWidget()
     self.scoreLayout = QHBoxLayout(scoreWidget)
     leftLayout = QVBoxLayout()
     leftLayout.addWidget(self.viewLeft)
     self.leftLayout = leftLayout
     self.scoreLayout.addLayout(leftLayout)
     self.scoreLayout.addWidget(self.viewRight)
     self.splitter.addWidget(scoreWidget)
     self.ruleTree = RuleTreeView(i18nc('kajongg', 'Used Rules'))
     self.splitter.addWidget(self.ruleTree)
     # this shows just one line for the ruleTree - so we just see the
     # name of the ruleset:
     self.splitter.setSizes(list([1000, 1]))
コード例 #3
0
ファイル: m_idials_gui.py プロジェクト: ndevenish/DUI
    def __init__(self):
        super(MainWidget, self).__init__()

        self.my_pop = None  # Any child popup windows. Only bravais_table ATM
        self.storage_path = sys_arg.directory

        refresh_gui = False

        # Load the previous state of DUI, if present
        dui_files_path = os.path.join(self.storage_path, "dui_files")

        if os.path.isfile(os.path.join(dui_files_path, "bkp.pickle")):
            try:
                self.idials_runner = load_previous_state(dui_files_path)

            except Exception as e:
                # Something went wrong - tell the user then close
                msg = traceback.format_exc()
                logger.error("ERROR LOADING PREVIOUS DATA:\n%s", msg)
                raise_from(DUIDataLoadingError(msg), e)

            refresh_gui = True
        else:
            # No dui_files path - start with a fresh state
            if not os.path.isdir(dui_files_path):
                os.mkdir(dui_files_path)

            self.idials_runner = Runner()

        self.gui2_log = {"pairs_list": []}

        self.cli_tree_output = TreeShow()
        self.cli_tree_output(self.idials_runner)

        self.cur_html = None
        self.cur_pick = None
        self.cur_json = None
        self.cur_log = None
        self.cur_cmd_name = "None"

        main_box = QVBoxLayout()

        self.centre_par_widget = ControlWidget()
        self.centre_par_widget.pass_sys_arg_object_to_import(sys_arg)
        self.stop_run_retry = StopRunRetry()
        self.tree_out = TreeNavWidget()

        left_control_box = QHBoxLayout()

        left_top_control_box = QVBoxLayout()
        left_top_control_box.addWidget(self.centre_par_widget)
        left_top_control_box.addStretch()
        left_control_box.addLayout(left_top_control_box)

        centre_control_box = QVBoxLayout()

        v_control_splitter = QSplitter()
        v_control_splitter.setOrientation(Qt.Vertical)
        v_control_splitter.addWidget(self.tree_out)
        v_control_splitter.addWidget(self.centre_par_widget.step_param_widg)

        centre_control_box.addWidget(v_control_splitter)
        centre_control_box.addWidget(self.stop_run_retry)
        left_control_box.addLayout(centre_control_box)

        dummy_left_widget = QWidget()
        dummy_h_layout = QHBoxLayout()
        dummy_h_layout.addLayout(left_control_box)
        dummy_left_widget.setLayout(dummy_h_layout)
        dummy_left_widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)

        h_main_splitter = QSplitter()
        h_main_splitter.setOrientation(Qt.Horizontal)
        h_main_splitter.addWidget(dummy_left_widget)

        self.cli_out = CliOutView()
        self.web_view = WebTab()
        self.img_view = MyImgWin()
        self.ext_view = OuterCaller()
        self.info_widget = InfoWidget()

        self.output_info_tabs = QTabWidget()
        self.output_info_tabs.addTab(self.img_view, "Image")
        self.output_info_tabs.addTab(self.cli_out, "Log")
        self.output_info_tabs.addTab(self.web_view, "Report")
        self.output_info_tabs.addTab(self.ext_view, "Tools")
        self.output_info_tabs.addTab(self.info_widget, "Experiment")

        self.view_tab_num = 0
        self.output_info_tabs.currentChanged.connect(self.tab_changed)

        self.img_view.mask_applied.connect(self.pop_mask_list)
        self.img_view.predic_changed.connect(self.tab_changed)
        self.img_view.bc_applied.connect(self.pop_b_centr_coord)

        self.img_view.new_pars_applied.connect(self.pass_parmams)

        # self.ext_view.pass_parmam_lst.connect(self.pass_parmams)

        self.centre_par_widget.finished_masking.connect(self.img_view.unchec_my_mask)
        self.centre_par_widget.click_mask.connect(self.img_view.chec_my_mask)
        self.centre_par_widget.finished_b_centr.connect(self.img_view.unchec_b_centr)
        self.centre_par_widget.click_b_centr.connect(self.img_view.chec_b_centr)

        v_info_splitter = QSplitter()
        v_info_splitter.setOrientation(Qt.Vertical)
        v_info_splitter.addWidget(self.output_info_tabs)

        h_main_splitter.addWidget(v_info_splitter)

        main_box.addWidget(h_main_splitter)

        self.txt_bar = Text_w_Bar()
        main_box.addWidget(self.txt_bar)

        self.connect_all()

        self.custom_thread = CommandThread()
        self.custom_thread.finished.connect(self.update_after_finished)
        self.custom_thread.str_fail_signal.connect(self.after_failed)
        self.custom_thread.str_print_signal.connect(self.cli_out.add_txt)
        self.custom_thread.str_print_signal.connect(self.txt_bar.setText)

        self.custom_thread.busy_box_on.connect(self.pop_busy_box)
        self.custom_thread.busy_box_off.connect(self.close_busy_box)

        self.main_widget = QWidget()
        self.main_widget.setLayout(main_box)
        self.setCentralWidget(self.main_widget)

        self.setWindowTitle("CCP4 DUI - {}: {}".format(__version__,
                dui_files_path))
        self.setWindowIcon(QIcon(self.stop_run_retry.dials_logo_path))

        self.just_reindexed = False
        self.user_stoped = False
        self.reconnect_when_ready()

        self.my_pop = None

        if refresh_gui:
            self.refresh_my_gui()