def __init__(self, parent): if IS_DEV: icon_file_name = "icon_dev.png" else: icon_file_name = "icon.png" self.icon = QtGui.QIcon(get_resource(icon_file_name)) QtWidgets.QSystemTrayIcon.__init__(self, self.icon, parent) # Store parent - QtWidgets.QMainWindow() self.parent = parent # Setup menu in Tray self.menu = QtWidgets.QMenu() self.menu.setStyleSheet(style.load_stylesheet()) # Set modules self.tray_man = TrayManager(self, self.parent) self.tray_man.process_presets() # Catch activate event self.activated.connect(self.on_systray_activated) # Add menu to Context of SystemTrayIcon self.setContextMenu(self.menu)
def __init__(self, parent=None): super(LogsWindow, self).__init__(parent) self.setStyleSheet(style.load_stylesheet()) self.resize(1200, 800) logs_widget = LogsWidget(parent=self) log_detail = LogDetailWidget(parent=self) main_layout = QtWidgets.QHBoxLayout() log_splitter = QtWidgets.QSplitter() log_splitter.setOrientation(QtCore.Qt.Horizontal) log_splitter.addWidget(logs_widget) log_splitter.addWidget(log_detail) log_splitter.setStretchFactor(0, 65) log_splitter.setStretchFactor(1, 35) main_layout.addWidget(log_splitter) self.logs_widget = logs_widget self.log_detail = log_detail self.setLayout(main_layout) self.setWindowTitle("Logs") self.logs_widget.active_changed.connect(self.on_selection_changed)
def __init__(self, parent): super(WidgetUserIdle, self).__init__() self.bool_is_showed = False self.bool_not_stopped = True self.parent_widget = parent self.setWindowIcon(parent.tray_widget.icon) self.setWindowFlags( QtCore.Qt.WindowCloseButtonHint | QtCore.Qt.WindowMinimizeButtonHint ) self._translate = QtCore.QCoreApplication.translate self.font = QtGui.QFont() self.font.setFamily("DejaVu Sans Condensed") self.font.setPointSize(9) self.font.setBold(True) self.font.setWeight(50) self.font.setKerning(True) self.resize(self.SIZE_W, self.SIZE_H) self.setMinimumSize(QtCore.QSize(self.SIZE_W, self.SIZE_H)) self.setMaximumSize(QtCore.QSize(self.SIZE_W+100, self.SIZE_H+100)) self.setStyleSheet(style.load_stylesheet()) self.setLayout(self._main()) self.refresh_context() self.setWindowTitle('Pype - Stop timers')
def tray_menu(self, parent): """ Add **change credentials** option to tray menu. """ # Menu for Tray App self.menu = QtWidgets.QMenu('Muster', parent) self.menu.setProperty('submenu', 'on') self.menu.setStyleSheet(style.load_stylesheet()) # Actions self.aShowLogin = QtWidgets.QAction("Change login", self.menu) self.menu.addAction(self.aShowLogin) self.aShowLogin.triggered.connect(self.show_login) parent.addMenu(self.menu)
def __init__(self, module): super(UserWidget, self).__init__() self.module = module # Style icon = QtGui.QIcon(resources.get_resource("icon.png")) self.setWindowIcon(icon) self.setWindowTitle("Username Settings") self.setMinimumWidth(self.MIN_WIDTH) self.setStyleSheet(style.load_stylesheet()) self.setWindowFlags(QtCore.Qt.WindowCloseButtonHint | QtCore.Qt.WindowMinimizeButtonHint) self.setLayout(self._main())
def __init__(self, main_parent=None, parent=None, optional=True): super(ClockifySettings, self).__init__() self.parent = parent self.main_parent = main_parent self.clockapi = parent.clockapi self.optional = optional self.validated = False # Icon if hasattr(parent, 'icon'): self.setWindowIcon(self.parent.icon) elif hasattr(parent, 'parent') and hasattr(parent.parent, 'icon'): self.setWindowIcon(self.parent.parent.icon) else: pype_setup = os.getenv('PYPE_ROOT') items = [pype_setup, "app", "resources", "icon.png"] fname = os.path.sep.join(items) icon = QtGui.QIcon(fname) self.setWindowIcon(icon) self.setWindowFlags(QtCore.Qt.WindowCloseButtonHint | QtCore.Qt.WindowMinimizeButtonHint) self._translate = QtCore.QCoreApplication.translate # Font self.font = QtGui.QFont() self.font.setFamily("DejaVu Sans Condensed") self.font.setPointSize(9) self.font.setBold(True) self.font.setWeight(50) self.font.setKerning(True) # Size setting self.resize(self.SIZE_W, self.SIZE_H) self.setMinimumSize(QtCore.QSize(self.SIZE_W, self.SIZE_H)) self.setMaximumSize(QtCore.QSize(self.SIZE_W + 100, self.SIZE_H + 100)) self.setStyleSheet(style.load_stylesheet()) self.setLayout(self._main()) self.setWindowTitle('Clockify settings')
def tray_menu(self, parent_menu): # Menu for Tray App self.menu = QtWidgets.QMenu('Clockify', parent_menu) self.menu.setProperty('submenu', 'on') self.menu.setStyleSheet(style.load_stylesheet()) # Actions self.aShowSettings = QtWidgets.QAction("Settings", self.menu) self.aStopTimer = QtWidgets.QAction("Stop timer", self.menu) self.menu.addAction(self.aShowSettings) self.menu.addAction(self.aStopTimer) self.aShowSettings.triggered.connect(self.show_settings) self.aStopTimer.triggered.connect(self.stop_timer) self.set_menu_visibility() parent_menu.addMenu(self.menu)
def __init__(self, parent=None, is_event=False): super(Login_Dialog_ui, self).__init__() self.parent = parent self.is_event = is_event if hasattr(parent, 'icon'): self.setWindowIcon(self.parent.icon) elif hasattr(parent, 'parent') and hasattr(parent.parent, 'icon'): self.setWindowIcon(self.parent.parent.icon) else: pype_setup = os.getenv('PYPE_ROOT') items = [pype_setup, "app", "resources", "icon.png"] fname = os.path.sep.join(items) icon = QtGui.QIcon(fname) self.setWindowIcon(icon) self.setWindowFlags( QtCore.Qt.WindowCloseButtonHint | QtCore.Qt.WindowMinimizeButtonHint ) self.loginSignal.connect(self.loginWithCredentials) self._translate = QtCore.QCoreApplication.translate self.font = QtGui.QFont() self.font.setFamily("DejaVu Sans Condensed") self.font.setPointSize(9) self.font.setBold(True) self.font.setWeight(50) self.font.setKerning(True) self.resize(self.SIZE_W, self.SIZE_H) self.setMinimumSize(QtCore.QSize(self.SIZE_W, self.SIZE_H)) self.setMaximumSize(QtCore.QSize(self.SIZE_W+100, self.SIZE_H+100)) self.setStyleSheet(style.load_stylesheet()) self.setLayout(self._main()) self.setWindowTitle('Pype - Ftrack Login')
def add_action(self, action_name): if action_name.lower() == 'split': for action in self.actions: if action.text() == 'Split to frames': return new_action = QtWidgets.QAction('Split to frames', self) new_action.triggered.connect(self.split_sequence) elif action_name.lower() == 'merge': for action in self.actions: if action.text() == 'Merge components': return new_action = QtWidgets.QAction('Merge components', self) new_action.triggered.connect(self.merge_sequence) else: print('unknown action') return self.action_menu.addAction(new_action) self.actions.append(new_action) if not self.btn_action_menu.isVisible(): self.btn_action_menu.setVisible(True) self.btn_action_menu.clicked.connect(self.show_actions) self.action_menu.setStyleSheet(style.load_stylesheet())
def __init__(self, parent=None, messages=[], title="Message"): super(MessageWidget, self).__init__() self._parent = parent # Icon if parent and hasattr(parent, 'icon'): self.setWindowIcon(parent.icon) else: from pypeapp.resources import get_resource self.setWindowIcon(QtGui.QIcon(get_resource('icon.png'))) self.setWindowFlags( QtCore.Qt.WindowCloseButtonHint | QtCore.Qt.WindowMinimizeButtonHint ) # Font self.font = QtGui.QFont() self.font.setFamily("DejaVu Sans Condensed") self.font.setPointSize(9) self.font.setBold(True) self.font.setWeight(50) self.font.setKerning(True) # Size setting self.resize(self.SIZE_W, self.SIZE_H) self.setMinimumSize(QtCore.QSize(self.SIZE_W, self.SIZE_H)) self.setMaximumSize(QtCore.QSize(self.SIZE_W+100, self.SIZE_H+100)) # Style self.setStyleSheet(style.load_stylesheet()) self.setLayout(self._ui_layout(messages)) self.setWindowTitle(title)
def __init__(self): super(Login_Dialog_ui, self).__init__() self.Dialog = QtWidgets.QDialog() self.Dialog.setStyleSheet(style.load_stylesheet()) self.Dialog.setObjectName("Dialog") self.Dialog.resize(SIZE_W, SIZE_H) self.Dialog.setMinimumSize(QtCore.QSize(SIZE_W, SIZE_H)) self.verticalLayoutWidget = QtWidgets.QWidget(self.Dialog) self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 0, SIZE_W + 1, SIZE_H + 1)) self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget) self.verticalLayout.setContentsMargins(10, 5, 10, 5) self.verticalLayout.setObjectName("verticalLayout") self.user_label = QtWidgets.QLabel(self.verticalLayoutWidget) sizePolicy = QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.user_label.sizePolicy().hasHeightForWidth()) self.user_label.setSizePolicy(sizePolicy) self.user_label.setMinimumSize(QtCore.QSize(150, 28)) font = QtGui.QFont() font.setFamily("DejaVu Sans Condensed") font.setPointSize(9) font.setBold(True) font.setWeight(50) font.setKerning(True) self.user_label.setFont(font) self.user_label.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) self.user_label.setTextFormat(QtCore.Qt.RichText) self.user_label.setObjectName("user_label") self.verticalLayout.addWidget(self.user_label) self.user_input = QtWidgets.QLineEdit(self.verticalLayoutWidget) self.user_input.setEnabled(True) self.user_input.setFrame(True) self.user_input.setObjectName("user_input") self.verticalLayout.addWidget(self.user_input) self.passw_label = QtWidgets.QLabel(self.verticalLayoutWidget) sizePolicy = QtWidgets.QSizePolicy( QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.passw_label.sizePolicy().hasHeightForWidth()) self.passw_label.setSizePolicy(sizePolicy) self.passw_label.setMinimumSize(QtCore.QSize(150, 28)) font = QtGui.QFont() font.setFamily("DejaVu Sans Condensed") font.setPointSize(9) font.setBold(True) font.setWeight(50) font.setKerning(True) self.passw_label.setFont(font) self.passw_label.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) self.passw_label.setTextFormat(QtCore.Qt.RichText) self.passw_label.setObjectName("passw_label") self.verticalLayout.addWidget(self.passw_label) self.passw_input = QtWidgets.QLineEdit(self.verticalLayoutWidget) self.passw_input.setEnabled(True) self.passw_input.setInputMethodHints( QtCore.Qt.ImhHiddenText | QtCore.Qt.ImhNoAutoUppercase | QtCore.Qt.ImhNoPredictiveText | QtCore.Qt.ImhSensitiveData) self.passw_input.setInputMask("") self.passw_input.setText("") self.passw_input.setFrame(True) self.passw_input.setEchoMode(QtWidgets.QLineEdit.Password) self.passw_input.setReadOnly(False) self.passw_input.setObjectName("passw_input") self.verticalLayout.addWidget(self.passw_input) spacerItem = QtWidgets.QSpacerItem( 20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.buttonBox = QtWidgets.QDialogButtonBox(self.verticalLayoutWidget) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons( QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(self.Dialog) self.buttonBox.accepted.connect(self.execute) self.buttonBox.rejected.connect(self.Dialog.reject) QtCore.QMetaObject.connectSlotsByName(self.Dialog) self.Dialog.setTabOrder(self.user_input, self.passw_input)
def __init__(self, parent=None): super(Project_name_getUI, self).__init__(parent) self.platform = platform.system() self.new_index = 0 # get projects from ftrack self.session = ftrack_api.Session() self.projects_from_ft = self.session.query( 'Project where status is active') self.disks_from_ft = self.session.query('Disk') self.schemas_from_ft = self.session.query('ProjectSchema') self.projects = self._get_projects_ftrack() # define window geometry self.setWindowTitle('Set project attributes') self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) self.resize(550, 340) self.setStyleSheet(style.load_stylesheet()) # define disk combobox widget self.disks = self._get_all_disks() self.disk_combobox_label = QtWidgets.QLabel('Destination storage:') self.disk_combobox = QtWidgets.QComboBox() # define schema combobox widget self.schemas = self._get_all_schemas() self.schema_combobox_label = QtWidgets.QLabel('Project schema:') self.schema_combobox = QtWidgets.QComboBox() # define fps widget self.fps_label = QtWidgets.QLabel('Fps:') self.fps_label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.fps = QtWidgets.QLineEdit() # define project dir widget self.project_dir_label = QtWidgets.QLabel('Project dir:') self.project_dir_label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.project_dir = QtWidgets.QLineEdit() self.project_path_label = QtWidgets.QLabel( 'Project_path (if not then created):') self.project_path_label.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) project_path_font = QtGui.QFont("Helvetica [Cronyx]", 12, QtGui.QFont.Bold) self.project_path = QtWidgets.QLabel() self.project_path.setObjectName('nom_plan_label') self.project_path.setStyleSheet( 'QtWidgets.QLabel#nom_plan_label {color: red}') self.project_path.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) self.project_path.setFont(project_path_font) # define handles widget self.handles_label = QtWidgets.QLabel('Handles:') self.handles_label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.handles = QtWidgets.QLineEdit() # define resolution widget self.resolution_w_label = QtWidgets.QLabel('W:') self.resolution_w = QtWidgets.QLineEdit() self.resolution_h_label = QtWidgets.QLabel('H:') self.resolution_h = QtWidgets.QLineEdit() devider = QtWidgets.QFrame() # devider.Shape(QFrame.HLine) devider.setFrameShape(QtWidgets.QFrame.HLine) devider.setFrameShadow(QtWidgets.QFrame.Sunken) self.generate_lines() # define push buttons self.set_pushbutton = QtWidgets.QPushButton('Set project') self.cancel_pushbutton = QtWidgets.QPushButton('Cancel') # definition of layouts ############################################ action_layout = QtWidgets.QHBoxLayout() action_layout.addWidget(self.set_pushbutton) action_layout.addWidget(self.cancel_pushbutton) # schema property schema_layout = QtWidgets.QGridLayout() schema_layout.addWidget(self.schema_combobox, 0, 1) schema_layout.addWidget(self.schema_combobox_label, 0, 0) # storage property storage_layout = QtWidgets.QGridLayout() storage_layout.addWidget(self.disk_combobox, 0, 1) storage_layout.addWidget(self.disk_combobox_label, 0, 0) # fps property fps_layout = QtWidgets.QGridLayout() fps_layout.addWidget(self.fps, 1, 1) fps_layout.addWidget(self.fps_label, 1, 0) # project dir property project_dir_layout = QtWidgets.QGridLayout() project_dir_layout.addWidget(self.project_dir, 1, 1) project_dir_layout.addWidget(self.project_dir_label, 1, 0) # project path property project_path_layout = QtWidgets.QGridLayout() spacer_1_item = QtWidgets.QSpacerItem(10, 10) project_path_layout.addItem(spacer_1_item, 0, 1) project_path_layout.addWidget(self.project_path_label, 1, 1) project_path_layout.addWidget(self.project_path, 2, 1) spacer_2_item = QtWidgets.QSpacerItem(20, 20) project_path_layout.addItem(spacer_2_item, 3, 1) # handles property handles_layout = QtWidgets.QGridLayout() handles_layout.addWidget(self.handles, 1, 1) handles_layout.addWidget(self.handles_label, 1, 0) # resolution property resolution_layout = QtWidgets.QGridLayout() resolution_layout.addWidget(self.resolution_w_label, 1, 1) resolution_layout.addWidget(self.resolution_w, 2, 1) resolution_layout.addWidget(self.resolution_h_label, 1, 2) resolution_layout.addWidget(self.resolution_h, 2, 2) # form project property layout p_layout = QtWidgets.QGridLayout() p_layout.addLayout(storage_layout, 1, 0) p_layout.addLayout(schema_layout, 2, 0) p_layout.addLayout(project_dir_layout, 3, 0) p_layout.addLayout(fps_layout, 4, 0) p_layout.addLayout(handles_layout, 5, 0) p_layout.addLayout(resolution_layout, 6, 0) p_layout.addWidget(devider, 7, 0) spacer_item = QtWidgets.QSpacerItem(150, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) p_layout.addItem(spacer_item, 8, 0) # form with list to one layout with project property list_layout = QtWidgets.QGridLayout() list_layout.addLayout(p_layout, 1, 0) list_layout.addWidget(self.listWidget, 1, 1) root_layout = QtWidgets.QVBoxLayout() root_layout.addLayout(project_path_layout) root_layout.addWidget(devider) root_layout.addLayout(list_layout) root_layout.addLayout(action_layout) self.setLayout(root_layout)