def __init__(self, parent): super(DetailModule, self).__init__(parent) self.asset = self._is_loading = self._load_queue = False toolbar_layout = QHBoxLayout() fdata = [] for id_folder in sorted(config["folders"].keys()): fdata.append({ "value": id_folder, "alias": config["folders"][id_folder]["title"], "role": "option", }) self.folder_select = FireflySelect(self, data=fdata) for i, fd in enumerate(fdata): self.folder_select.setItemIcon( i, QIcon(pixlib["folder_" + str(fd["value"])])) self.folder_select.currentIndexChanged.connect(self.on_folder_changed) self.folder_select.setEnabled(False) toolbar_layout.addWidget(self.folder_select, 0) self.duration = FireflyTimecode(self) toolbar_layout.addWidget(self.duration, 0) self.toolbar = detail_toolbar(self) toolbar_layout.addWidget(self.toolbar) self.detail_tabs = DetailTabs(self) layout = QVBoxLayout() layout.setContentsMargins(0, 0, 0, 0) layout.addLayout(toolbar_layout, 1) layout.addWidget(self.detail_tabs) self.setLayout(layout)
def __init__(self, parent, **kwargs): super(BrowserTab, self).__init__(parent) self._parent = parent self.loading = False self.title = False # Search query self.search_query = { "id_view": kwargs.get("id_view", min(config["views"])), "fulltext": kwargs.get("fulltext", ""), "order": kwargs.get("order", "ctime desc"), "conds": kwargs.get("conds", []), } # Layout self.search_box = SearchWidget(self) if self.search_query.get("fulltext"): self.search_box.setText(self.search_query["fulltext"]) self.first_load = True self.view = FireflyBrowserView(self) self.view.horizontalHeader().sectionResized.connect(self.on_section_resize) self.view.horizontalHeader().sortIndicatorChanged.connect( self.on_section_resize ) action_clear = QAction(QIcon(pixlib["cancel"]), "&Clear search query", parent) action_clear.triggered.connect(self.on_clear) self.action_search = QMenu("Views") self.action_search.setStyleSheet(app_skin) self.action_search.menuAction().setIcon(QIcon(pixlib["search"])) self.action_search.menuAction().triggered.connect(self.load) self.load_view_menu() action_copy = QAction("Copy result", self) action_copy.setShortcut("CTRL+SHIFT+C") action_copy.triggered.connect(self.on_copy_result) self.addAction(action_copy) toolbar = QToolBar(self) toolbar.addAction(action_clear) toolbar.addAction(self.action_search.menuAction()) search_layout = QHBoxLayout() search_layout.setContentsMargins(0, 0, 0, 0) search_layout.addWidget(self.search_box) search_layout.addWidget(toolbar) self.pager = Pager(self) layout = QVBoxLayout() layout.setContentsMargins(0, 0, 0, 0) layout.addLayout(search_layout, 0) layout.addWidget(self.view, 1) layout.addWidget(self.pager, 0) self.setLayout(layout)
def __init__(self, parent): super(SchedulerCalendar, self).__init__(parent) self.week_start_time = self.week_end_time = 0 self.events = [] self.focus_data = [] self.dragging = False self.drag_offset = 0 self.drag_source = False self.append_condition = False self.selected_event = False header_layout = QHBoxLayout() header_layout.addSpacing(CLOCKBAR_WIDTH + 15) cols_layout = QHBoxLayout() self.clock_bar = SchedulerClockBar(self) cols_layout.addWidget(self.clock_bar, 0) self.headers = [] self.days = [] for i in range(7): self.headers.append(SchedulerDayHeaderWidget(self, i)) self.days.append(SchedulerDayWidget(self)) header_layout.addWidget(self.headers[-1]) cols_layout.addWidget(self.days[-1], 1) header_layout.addSpacing(20) self.scroll_widget = QWidget() self.scroll_widget.setLayout(cols_layout) self.scroll_widget.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) self.scroll_area = QScrollArea(self) self.scroll_area.setFrameStyle(QFrame.NoFrame) self.scroll_area.setWidgetResizable(True) self.scroll_area.setWidget(self.scroll_widget) self.scroll_area.setContentsMargins(0, 0, 0, 0) self.scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) zoomlevel = self.parent().app_state.get("scheduler_zoom", 0) self.zoom = QSlider(Qt.Horizontal) self.zoom.setMinimum(0) self.zoom.setMaximum(10000) self.zoom.valueChanged.connect(self.on_zoom) logging.debug("Setting scheduler zoom level to", zoomlevel) self.zoom.setValue(zoomlevel) layout = QVBoxLayout() layout.addLayout(header_layout) layout.addWidget(self.scroll_area, 1) layout.addWidget(self.zoom, 0) self.setLayout(layout) self.setMinimumHeight(450)
def __init__(self, parent): super(MCR, self).__init__(parent) self.progress_bar = QProgressBar(self) self.progress_bar.setTextVisible(False) self.progress_bar.setValue(0) self.progress_bar.setMaximum(PROGRESS_BAR_RESOLUTION) self.btn_take = MCRButton("Take", self, self.on_take) self.btn_freeze = MCRButton("Freeze", self, self.on_freeze) self.btn_retake = MCRButton("Retake", self, self.on_retake) self.btn_abort = MCRButton("Abort", self, self.on_abort) self.btn_loop = MCRButton("Loop", self, self.on_loop, checkable=True) self.btn_cue_backward = MCRButton("<", self, self.on_cue_backward) self.btn_cue_forward = MCRButton(">", self, self.on_cue_forward) self.btn_cue_backward.setShortcut("Ctrl+J") self.btn_take.setShortcut("Ctrl+K") self.btn_cue_forward.setShortcut("Ctrl+L") self.btn_retake.setShortcut("Alt+J") self.btn_freeze.setShortcut("Alt+K") self.btn_abort.setShortcut("Alt+L") btns_layout = QHBoxLayout() btns_layout.addStretch(1) btns_layout.addWidget(self.btn_take, 0) btns_layout.addWidget(self.btn_freeze, 0) btns_layout.addWidget(self.btn_retake, 0) btns_layout.addWidget(self.btn_abort, 0) btns_layout.addWidget(self.btn_loop, 0) btns_layout.addWidget(self.btn_cue_backward, 0) btns_layout.addWidget(self.btn_cue_forward, 0) btns_layout.addStretch(1) self.display_clock = MCRLabel("CLK", "--:--:--:--") self.display_pos = MCRLabel("POS", "--:--:--:--") self.display_current = MCRLabel("CUR", "(no clip)", tcolor="#cc0000") self.display_cued = MCRLabel("NXT", "(no clip)", tcolor="#00cc00") self.display_rem = MCRLabel("REM", "(unknown)") self.display_dur = MCRLabel("DUR", "--:--:--:--") info_layout = QGridLayout() info_layout.setContentsMargins(0, 0, 0, 0) info_layout.setSpacing(2) info_layout.addWidget(self.display_clock, 0, 0) info_layout.addWidget(self.display_pos, 1, 0) info_layout.addWidget(self.display_current, 0, 1) info_layout.addWidget(self.display_cued, 1, 1) info_layout.addWidget(self.display_rem, 0, 2) info_layout.addWidget(self.display_dur, 1, 2) info_layout.setColumnStretch(1, 1) layout = QVBoxLayout() layout.addLayout(info_layout, 0) layout.addWidget(self.progress_bar, 0) layout.addLayout(btns_layout, 0) self.setLayout(layout) self.on_channel_changed() self.display_timer = QTimer(self) self.display_timer.timeout.connect(self.update_display)