示例#1
0
    def __init__(self, parent, anim_duration=250):
        super(SweepPanel, self).__init__(parent)

        self.anim_duration = anim_duration

        self.setLayout(QtGui.QHBoxLayout())
        self.layout().setContentsMargins(0, 0, 0, 0)

        self.screen_parent = QtGui.QFrame(self)
        self.screen_parent.setLayout(QtGui.QHBoxLayout())
        self.screen_parent.layout().setContentsMargins(0, 0, 0, 0)
        self.layout().addWidget(self.screen_parent)

        self.current_screen = None
示例#2
0
    def build(self, parent):
        parent_lo = parent.layout()
        lo = QtGui.QHBoxLayout()
        parent_lo.addLayout(lo)

        for widget in self.widgets:
            widget.build(parent, lo)
示例#3
0
    def __init__(self, parent, client):
        super(ProcExecDialog, self).__init__(parent)

        self.setLayout(QtGui.QVBoxLayout())

        self.pep = ProcExecPanel(self, client)
        self.pep.context_updated.connect(self._on_context_update)
        self.layout().addWidget(self.pep)

        buttons_layout = QtGui.QHBoxLayout()
        self.layout().addLayout(buttons_layout)

        self.execute_button = QtGui.QPushButton('Execute', self)
        self.execute_button.clicked.connect(self.execute)
        buttons_layout.addWidget(self.execute_button)

        b = QtGui.QPushButton('Close', self)
        b.clicked.connect(self.close)
        buttons_layout.addWidget(b)
示例#4
0
    def __init__(self, help_text, parent):
        super(Selector, self).__init__(parent)
        
        self._label_to_data = {} # we don't use Qt's data because it returns a QVariant when queried :/
        
        self.setLayout(QtGui.QHBoxLayout())
        self.layout().setContentsMargins(0,0,0,0)

        self._cb = QtGui.QComboBox(self)
        self.layout().addWidget(self._cb, stretch=10)
        self._cb.setEditable(True)
        
        self._help_text = help_text
    
        self.waitter = QtGui.QLabel('Loading')
        wait_movie = QtGui.QMovie(resources.get('gui.icons', 'throbber.gif'))
        self.waitter.setMovie(wait_movie)
        wait_movie.start()
        #self.waitter.hide()
        self.layout().addWidget(self.waitter)
        
        self.set_items([])
        
        self._cb.activated.connect(self._on_activated)
示例#5
0
    def __init__(self, parent, client):
        super(ProcExecPanel, self).__init__(parent)
        if self.__class__.EDITOR_FACTORY is None:
            self.__class__.EDITOR_FACTORY = get_global_factory()

        self.client = client

        self._context = None

        self.setLayout(QtGui.QVBoxLayout())

        #
        #    HEADER
        #
        self.header = QtGui.QLabel(self)
        self.layout().addWidget(self.header)

        if self.USE_SPLITTER:
            splitter = QtGui.QSplitter(self)
            self.layout().addWidget(splitter, stretch=100)
        else:
            splitter = QtGui.QHBoxLayout()
            self.layout().addLayout(splitter)

        #
        #    INPUT COLUMN
        #
        input_scroll = QtGui.QScrollArea(self)
        input_scroll.setFrameStyle(input_scroll.NoFrame)
        input_scroll.setWidgetResizable(True)
        self.input_parent = QtGui.QWidget()
        lo = QtGui.QVBoxLayout()
        self.input_layout = QtGui.QVBoxLayout()
        lo.addLayout(self.input_layout)
        lo.addStretch(100)
        self.input_parent.setLayout(lo)
        input_scroll.setWidget(self.input_parent)
        splitter.addWidget(input_scroll)

        self._node_boxes = {}
        self._node_boxes_open = {}

        #
        #    WORKER COLUMN
        #
        column = QtGui.QWidget(self)
        column.setLayout(QtGui.QVBoxLayout())
        column.layout().setContentsMargins(0, 0, 0, 0)
        splitter.addWidget(column)

        self.workers_table = WorkersTable(self.client, self)
        self.workers_table.show_mine_only(True)
        self.workers_table.selectionModel().selectionChanged.connect(
            self._on_worker_changed)
        self.workers_table.refresh_done.connect(self._on_worker_changed)

        self.workers_tb = WorkerToolBar(self, self.workers_table)

        column.layout().addWidget(self.workers_tb)
        column.layout().addWidget(self.workers_table)

        self.workers_table.on_connect()
        self.workers_tb.on_connect()

        self.depth_needed_features_label = QtGui.QLabel(
            'Overall Features Needed: <no context loaded>', self)
        column.layout().addWidget(self.depth_needed_features_label)

        self.acceptable_docs_label = QtGui.QLabel(
            'Acceptable Document: <no context loaded>', self)
        column.layout().addWidget(self.acceptable_docs_label)

        self.selected_worker_features_label = QtGui.QLabel(
            'Selected Features: <No Worker Selected>', self)
        column.layout().addWidget(self.selected_worker_features_label)

        self.selected_worker_doc_label = QtGui.QLabel(
            'Selected Document: <No Worker Seleced>', self)
        column.layout().addWidget(self.selected_worker_doc_label)

        if self.USE_SPLITTER:
            if 0:
                # make the detail panel hidden but resizable:
                splitter.setSizes([1, 0])
            else:
                splitter.setSizes([100, 100])