def __init__(self, parent=None, title='Setup'): LJDialog.__init__(self) print "hello" self.setWindowTitle("Setup") self.authorization = "" self.project_dict = {} self.project_names = self.get_projects() self.label_asana = QtWidgets.QLabel("Asana") self.edit_label = QtWidgets.QLabel("API_Key") self.project_label = QtWidgets.QLabel("Project") self.label_asana.setProperty('class', 'ultra_title') self.submit_button = QtWidgets.QPushButton("Submit") self.submit_button.setProperty('class', 'basic') self.user_line_edit = QtWidgets.QLineEdit() self.project_combo = AdvComboBox() self.project_combo.addItems("") num = self.project_combo.findText("") self.project_combo.setCurrentIndex(num) layout = QtWidgets.QFormLayout() user_id = QtWidgets.QHBoxLayout() user_id.addWidget(self.edit_label) user_id.addWidget(self.user_line_edit) project_row = QtWidgets.QHBoxLayout() project_row.addWidget(self.project_label) project_row.addWidget(self.project_combo) layout.addRow(self.label_asana) layout.addRow(user_id) layout.addRow(project_row) layout.addWidget(self.submit_button) self.setLayout(layout) self.submit_button.hide() self.user_line_edit.editingFinished.connect(self.set_projects) self.project_combo.currentIndexChanged.connect(self.get_project_id) self.submit_button.clicked.connect(self.submit_info)
def __init__(self, parent=None, path_object=None, element='task', pixmap=None): QtWidgets.QWidget.__init__(self, parent) self.element = element if path_object: self.path_object = path_object elements = self.path_object.glob_project_element(element) else: return self.project_management = CONFIG['account_info']['project_management'] self.schema = CONFIG['project_management'][ self.project_management]['api']['default_schema'] schema = CONFIG['project_management'][ self.project_management]['tasks'][self.schema] self.proj_man_tasks = schema['long_to_short'][self.path_object.scope] self.proj_man_tasks_short_to_long = schema['short_to_long'][ self.path_object.scope] self.panel = QtWidgets.QVBoxLayout(self) self.title_layout = QtWidgets.QHBoxLayout() self.task_button = QtWidgets.QToolButton() self.task_button.setText('add %s' % element) self.task_button.setProperty('class', 'add_button') if pixmap: self.icon = QtWidgets.QLabel() self.icon.setPixmap(pixmap) self.h_layout.addWidget(self.icon) self.title_layout.addWidget(pixmap) self.title = QtWidgets.QLabel('%ss' % element.title()) self.title.setProperty('class', 'ultra_title') self.title_layout.addWidget(self.title) self.title_layout.addStretch(1) self.title_layout.addWidget(self.task_button) self.panel.addLayout(self.title_layout) self.task_button.clicked.connect(self.add_button_clicked) for each in elements: if 'elem' in each: task = each else: try: task = self.proj_man_tasks_short_to_long[each] except KeyError: print('%s not found in short_to_long' % each) task = each button = LJButton(str(task)) # button.setIcon(QtGui.QIcon(QtGui.QPixmap(os.path.join(icon_path(), image_name)))) # button.setIconSize(QtCore.QSize(50, 50)) button.setProperty('class', 'ultra_button') self.panel.addWidget(button) button.clicked.connect(self.on_button_clicked) self.panel.addStretch(1)
def __init__(self, path_object): LJDialog.__init__(self) self.path_object = path_object if self.path_object.context == 'source': self.other_path_object = PathObject.copy(path_object, context='render') else: self.other_path_object = PathObject.copy(path_object, context='source') # TODO - i need something here to check if i'm in a task or not, if not send a popup task = path_object.task seq = path_object.seq shot = path_object.shot self.to_object = None self.root = '' all_ = r'%s/%s/%s' % (seq, shot, task) self.setWindowTitle('Export %s to drive' % all_) v_layout = QtWidgets.QVBoxLayout(self) grid_layout = QtWidgets.QGridLayout() button_layout = QtWidgets.QHBoxLayout() drive_label = QtWidgets.QLabel('External Drive:') self.drive_combo = AdvComboBox() root_label = QtWidgets.QLabel('External Drive Root:') self.root_line_edit = QtWidgets.QLineEdit() copy_from_label = QtWidgets.QLabel('copy from:') self.copy_from_path = QtWidgets.QLabel(path_object.path_root) copy_to_label = QtWidgets.QLabel('copy to') self.copy_to_path = QtWidgets.QLabel('') self.message = QtWidgets.QLabel('') self.cancel_button = QtWidgets.QPushButton('Cancel') self.ok_button = QtWidgets.QPushButton('Copy Task') grid_layout.addWidget(drive_label, 0, 0) grid_layout.addWidget(self.drive_combo, 0, 1) grid_layout.addWidget(root_label, 1, 0) grid_layout.addWidget(self.root_line_edit, 1, 1) grid_layout.addWidget(copy_from_label, 2, 0) grid_layout.addWidget(self.copy_from_path, 2, 1) grid_layout.addWidget(copy_to_label, 3, 0) grid_layout.addWidget(self.copy_to_path, 3, 1) button_layout.addStretch(1) button_layout.addWidget(self.cancel_button) button_layout.addWidget(self.ok_button) v_layout.addLayout(grid_layout) v_layout.addWidget(self.message) v_layout.addLayout(button_layout) self.drive_combo.currentIndexChanged.connect(self.on_drive_changed) self.root_line_edit.textChanged.connect(self.on_root_edited) self.cancel_button.clicked.connect(self.on_cancel_clicked) self.ok_button.clicked.connect(self.on_copy_clicked) self.get_available_drives()
def __init__(self, parent=None, path_object=None): QtWidgets.QFrame.__init__(self, parent) if path_object: self.path_object = cglpath.PathObject(path_object) self.path_root = self.path_object.path_root else: return layout = QtWidgets.QHBoxLayout(self) self.path_line_edit = QtWidgets.QLineEdit() self.path_line_edit.setMinimumHeight(ICON_WIDTH) self.text = self.path_object.path_root layout.addWidget(self.path_line_edit) # add css self.setProperty('class', 'light_grey') self.path_line_edit.setProperty('class', 'medium_grey')
def __init__(self, parent=None, path_object=None, user_email='', machine_user=None, show_import=False): QtWidgets.QWidget.__init__(self, parent) # self.setWidgetResizable(True) self.work_files = [] self.in_current_folder = False self.render_files_widget = None self.high_files = [] self.render_files = [] self.version_obj = None self.task = path_object.task self.task_widgets_dict = {} self.show_import = show_import self.path_object = path_object self.project_management = CONFIG['account_info']['project_management'] self.schema = CONFIG['project_management'][ self.project_management]['api']['default_schema'] schema = CONFIG['project_management'][ self.project_management]['tasks'][self.schema] self.user_info = CONFIG['project_management'][ self.project_management]['users'][current_user()] self.proj_man_tasks = schema['long_to_short'][self.path_object.scope] self.proj_man_tasks_short_to_long = schema['short_to_long'][ self.path_object.scope] self.current_location = path_object.data self.panel = QtWidgets.QVBoxLayout(self) self.tasks = QtWidgets.QHBoxLayout() self.in_file_tree = None self.user_changed_versions = False self.user_email = user_email if machine_user: self.user = machine_user else: self.user = current_user() self.project_management = CONFIG['account_info']['project_management'] self.on_task_selected(self.path_object) self.panel.addLayout(self.tasks) self.panel.addStretch(1) self.force_clear = False self.auto_publish_tasks = ['plate', 'element']
def __init__(self, parent, title, scope): QtWidgets.QWidget.__init__(self, parent) v_layout = QtWidgets.QVBoxLayout(self) h_layout = QtWidgets.QHBoxLayout(self) if scope == 'assets': self.category_row = LabelComboRow('%s Category' % scope.title(), button=False, bold=False) self.name_row = LabelComboRow('%s Name(s)' % scope.title(), button=False, bold=False) if scope == 'shots': self.category_row = LabelComboRow('Sequence', button=False, bold=False) self.name_row = LabelComboRow('Shot Name(s)', button=False, bold=False) self.label = title self.project_label = QtWidgets.QLabel( "<b>Create %s tasks For: %s</b>" % (scope.title(), title)) self.message = QtWidgets.QLabel("") h_layout.addWidget(self.project_label) h_layout.addItem( QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)) v_layout.addLayout(h_layout) v_layout.addItem( QtWidgets.QSpacerItem(0, 10, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)) v_layout.addLayout(self.category_row) v_layout.addLayout(self.name_row) v_layout.addWidget(self.message) self.message.hide()
def __init__(self, parent=None): QtWidgets.QDialog.__init__(self, parent) self.setMinimumWidth(1200) self.setMinimumHeight(800) self.setWindowTitle('Lumbermill Quick Setup') self.default_globals = DEFAULT_GLOBALS self.default_user_globals = DEFAULT_USER_GLOBALS self.default_root = DEFAULT_ROOT self.default_code_root = DEFAULT_CODE_ROOT size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) size_policy.setVerticalStretch(1) layout = QtWidgets.QVBoxLayout(self) #layout.setSizePolicy(size_policy) grid_layout = QtWidgets.QGridLayout() button_layout = QtWidgets.QHBoxLayout() company_label = QtWidgets.QLabel('Company Name') root_label = QtWidgets.QLabel('CGL Root') code_root_label = QtWidgets.QLabel('Code Root') self.sync_options_label = QtWidgets.QLabel('<b>Sync Folders:</b>') self.sync_folder_label = QtWidgets.QLabel('Production Folder') self.sync_folder_message = QtWidgets.QLabel( "<i>Don't worry you can edit this later</i>") self.sync_cgl_tools_label = QtWidgets.QLabel('CGL_TOOLS Folder') self.import_project_hint = QtWidgets.QLabel( '<i>hint: Z:\COMPANIES\loneCoconut\source\CGL_TESTPROJECT - copies one project,' ' Z:\COMPANIES\loneCoconut\source - copies all projects<\i>') self.import_project_hint.setSizePolicy(size_policy) self.import_project_hint.setWordWrap(True) self.company_line_edit = QtWidgets.QLineEdit() self.root_line_edit = QtWidgets.QLineEdit() self.code_root_line_edit = QtWidgets.QLineEdit() self.sync_folder_line_edit = QtWidgets.QLineEdit() self.sync_cgl_tools_line_edit = QtWidgets.QLineEdit() self.code_root_line_edit.setText(DEFAULT_CODE_ROOT) self.root_line_edit.setText(self.default_root) self.sync_cgl_tools_line_edit.setText( os.path.join(self.default_root, '_config', 'cgl_tools')) self.company_line_edit.setText('lone coconut') self.code_root_line_edit.setEnabled(False) # self.root_line_edit.setEnabled(False) self.sync_cgl_tools_line_edit.setEnabled(False) self.sync_folder_line_edit.setEnabled(False) self.aws_globals_label = QtWidgets.QLabel() self.projects_checkbox = QtWidgets.QCheckBox('Import a Project') self.sync_thing_checkbox = QtWidgets.QCheckBox('Set up Remote Syncing') self.import_label = QtWidgets.QLabel('Import Project From:') self.import_line_edit = QtWidgets.QLineEdit() self.import_button = QtWidgets.QToolButton() self.import_button.setText('...') self.sync_thing_checkbox.setChecked(True) self.projects_checkbox.setChecked(True) self.company_name = 'Lone Coconut' self.company_name_s3 = 'lone-coconut' self.company_name_disk = 'loneCoconut' self.cgl_tools_path = os.path.join(DEFAULT_HOME, 'downloads', 'cgl_tools.zip') self.globals_path = os.path.join(DEFAULT_HOME, 'downloads', 'globals.json') self.aws_globals = r'https://%s.s3.amazonaws.com/globals.json' % self.company_name_s3 self.check_for_globals_button = QtWidgets.QPushButton( 'Check for Globals') self.download_globals_button = QtWidgets.QPushButton( 'Set Up Lumbermill') button_layout.addStretch(1) button_layout.addWidget(self.download_globals_button) grid_layout.addWidget(root_label, 2, 0) grid_layout.addWidget(self.root_line_edit, 2, 1) grid_layout.addWidget(code_root_label, 3, 0) grid_layout.addWidget(self.code_root_line_edit, 3, 1) grid_layout.addWidget(self.import_label, 4, 0) grid_layout.addWidget(self.import_line_edit, 4, 1) grid_layout.addWidget(self.import_button, 4, 2) grid_layout.addWidget(self.import_project_hint, 5, 1) grid_layout.addWidget(self.sync_options_label, 6, 0) grid_layout.addWidget(self.sync_folder_label, 7, 0) grid_layout.addWidget(self.sync_folder_line_edit, 7, 1) grid_layout.addWidget(self.sync_folder_message, 8, 1) grid_layout.addWidget(self.sync_cgl_tools_label, 9, 0) grid_layout.addWidget(self.sync_cgl_tools_line_edit, 9, 1) layout.addWidget(company_label) layout.addWidget(self.company_line_edit) layout.addWidget(self.aws_globals_label) layout.addWidget(self.projects_checkbox) layout.addWidget(self.sync_thing_checkbox) layout.addLayout(grid_layout) layout.addLayout(button_layout) layout.addStretch(1) self.aws_globals_label.hide() self.on_projects_checkbox_clicked() self.on_sync_thing_checkbox_clicked() self.on_company_name_changed() self.company_line_edit.editingFinished.connect( self.on_company_name_changed) self.root_line_edit.textChanged.connect(self.on_root_changed) self.download_globals_button.clicked.connect(self.set_up_lumbermill) self.projects_checkbox.clicked.connect( self.on_projects_checkbox_clicked) self.sync_thing_checkbox.clicked.connect( self.on_sync_thing_checkbox_clicked) self.import_line_edit.editingFinished.connect( self.on_import_line_edit_changed)
def __init__(self, parent=None, company='', config_dict=None, root=r"C:\CGLUMBERJACK\COMPANIES"): QtWidgets.QDialog.__init__(self, parent) self.app_config = config_dict self.proj_management_label = QtWidgets.QLabel('Project Management') self.contents = {} self.company = company self.global_config = {} self.root = root self.user_name = self.get_user_name() self.api_key = '' self.api_script = '' self.api_user = '' self.project_management = '' self.api_server = '' self.setWindowTitle('Create Globals') layout = QtWidgets.QVBoxLayout(self) self.project_management_label = QtWidgets.QLabel('Project Management:') self.project_management_label.setProperty('class', 'ultra_title') self.proj_management_label = QtWidgets.QLabel('Software:') self.proj_management_combo = QtWidgets.QComboBox() self.proj_management_combo.addItems( ['lumbermill', 'ftrack', 'shotgun']) # self.red_palette, self.green_palette, self.black_palette = define_palettes() self.user_email_label = QtWidgets.QLabel('User Email:') self.user_email_line_edit = QtWidgets.QLineEdit() self.user_name_label = QtWidgets.QLabel('User Name:') self.user_name_line_edit = QtWidgets.QLineEdit() self.user_name_line_edit.setText(self.user_name) self.globals_label = QtWidgets.QLabel('Globals') self.globals_label.setProperty('class', 'ultra_title') self.paths_label = QtWidgets.QLabel('Paths') self.paths_label.setProperty('class', 'ultra_title') self.server_label = QtWidgets.QLabel('server url:') self.api_key_label = QtWidgets.QLabel('api key:') self.api_user_label = QtWidgets.QLabel('api user:'******'api script:') self.root_label = QtWidgets.QLabel('Production Root:') self.server_line_edit = QtWidgets.QLineEdit() self.api_key_line_edit = QtWidgets.QLineEdit() self.api_user_line_edit = QtWidgets.QLineEdit() self.api_script_line_edit = QtWidgets.QLineEdit() self.choose_folder_button = QtWidgets.QToolButton() self.choose_folder_button.setText('...') self.choose_root = QtWidgets.QToolButton() self.choose_root.setText('...') self.choose_code_root_button = QtWidgets.QToolButton() self.choose_code_root_button.setText('...') self.proj_man_grid = QtWidgets.QGridLayout() self.proj_man_grid.addWidget(self.proj_management_label, 0, 0) self.proj_man_grid.addWidget(self.proj_management_combo, 0, 1) self.proj_man_grid.addWidget(self.api_key_label, 1, 0) self.proj_man_grid.addWidget(self.api_key_line_edit, 1, 1) self.proj_man_grid.addWidget(self.api_user_label, 2, 0) self.proj_man_grid.addWidget(self.api_user_line_edit, 2, 1) self.proj_man_grid.addWidget(self.server_label, 3, 0) self.proj_man_grid.addWidget(self.server_line_edit, 3, 1) self.proj_man_grid.addWidget(self.api_script_label, 4, 0) self.proj_man_grid.addWidget(self.api_script_line_edit, 4, 1) self.proj_man_grid.addWidget(self.user_name_label, 5, 0) self.proj_man_grid.addWidget(self.user_name_line_edit, 5, 1) self.proj_man_grid.addWidget(self.user_email_label, 6, 0) self.proj_man_grid.addWidget(self.user_email_line_edit, 6, 1) self.cancel_button = QtWidgets.QPushButton('Cancel') self.ok_button = QtWidgets.QPushButton('Ok') self.button = '' self.ok_button.setEnabled(False) self.create_globals_button = QtWidgets.QPushButton('Create Globals') self.create_globals_button.setEnabled(False) # self.project_management = self.app_config['account_info']['project_management'] button_layout = QtWidgets.QHBoxLayout() button_layout.addStretch(1) button_layout.addWidget(self.cancel_button) button_layout.addWidget(self.create_globals_button) button_layout.addWidget(self.ok_button) # self.globals_tree_widget = DictionaryTreeWidget({}) this = __file__.split('cglumberjack')[0] if not self.app_config: dialog = QuickSync() dialog.exec_() globals_path = dialog.globals_path cgl_tools_path = dialog.cgl_tools_path if globals_path: dict_ = read_write.load_json(globals_path) self.inherited_globals = True else: self.inherited_globals = False this = __file__.split('cglumberjack')[0] dict_ = read_write.load_json( os.path.join(this, 'cglumberjack', 'cgl', 'cfg', 'globals_template.json')) self.proj_man_dict = dict_['project_management'] self.path_item_widget = PathItemWidget(paths_dict=dict_['paths'], hide_on_find=True) if self.path_item_widget.widget_dict['root']['line_edit'].text(): self.show_project_management_basics() else: self.hide_project_management_basics() self.widget_dict = self.path_item_widget.widget_dict layout.addWidget(self.globals_label) layout.addWidget(self.path_item_widget) layout.addWidget(self.project_management_label) layout.addLayout(self.proj_man_grid) # layout.addWidget(self.globals_tree_widget) # layout.addWidget(QHLine()) layout.addLayout(button_layout) layout.addStretch(1) # self.user_globals_line_edit.setEnabled(False) self.proj_management_combo.currentIndexChanged.connect( self.on_pm_changed) self.path_item_widget.line_edit_changed.connect( self.on_line_edits_changed) self.ok_button.clicked.connect(self.on_ok_clicked) self.ok_button.hide() self.cancel_button.clicked.connect(self.cancel_clicked) self.create_globals_button.clicked.connect( self.on_create_globals_clicked) self.path_item_widget.root_set.connect(self.on_root_line_edit_set) self.user_email_line_edit.textChanged.connect( self.check_ok_to_create_globals) self.user_name_line_edit.textChanged.connect( self.check_ok_to_create_globals) self.proj_management_combo.currentIndexChanged.connect( self.check_ok_to_create_globals) self.get_input() self.hide_api_info() self.set_proj_man() self.check_user_config() # self.globals_tree_widget.hide() self.on_globals_changed() self.set_some_stuff()
def __init__(self, parent=None, path_object=None): QtWidgets.QWidget.__init__(self, parent) if path_object: self.path_object = path_object else: print 'No Path Object found, exiting' return self.project_management = CONFIG['account_info']['project_management'] self.schema = CONFIG['project_management'][ self.project_management]['api']['default_schema'] self.schema_dict = CONFIG['project_management'][ self.project_management]['tasks'][self.schema] self.path_object_next = None self.panel = QtWidgets.QVBoxLayout(self) h_layout = QtWidgets.QHBoxLayout() self.title = 'Import to %s' % path_object.project self.task = None self.version = '000.000' self.latest_version = '000.000' self.user = None self.resolution = None self.root = None self.company = None self.project = None self.data_frame = None self.width_hint = 1300 self.height_hint = 1200 self.current_selection = None self.path_object.set_attr(scope='IO') self.path_object.set_attr(ingest_source='*') self.data_frame = None self.pandas_path = '' self.io_statuses = ['Imported', 'Tagged', 'Published'] self.file_tree = LJTreeWidget(self) #self.width_hint = self.file_tree.width_hint pixmap = QtGui.QPixmap(icon_path('back24px.png')) import_empty_icon = QtGui.QIcon(pixmap) self.source_widget = LJListWidget('Sources', pixmap=None) self.ingest_widget = LJListWidget('Ingests', pixmap=None, empty_state_text='Select Source', empty_state_icon=import_empty_icon) # self.import_events.hide()f self.tags_title = QtWidgets.QLineEdit( "<b>Select File(s) or Folder(s) to tag</b>") self.tags_title.setReadOnly(True) self.tags_title.setProperty('class', 'feedback') self.tags_button = QtWidgets.QPushButton('View Publish') self.tags_button.setProperty('class', 'basic') self.tags_button.setMaximumWidth(180) self.tags_title_row = QtWidgets.QHBoxLayout() self.tags_title_row.addWidget(self.tags_title) self.tags_title_row.addWidget(self.tags_button) self.tags_button.hide() self.scope_label = QtWidgets.QLabel('Scope') self.scope_combo = AdvComboBox() self.scope_combo.addItems(['', 'assets', 'shots']) self.seq_row = QtWidgets.QHBoxLayout() self.seq_row.addWidget(self.scope_label) self.seq_row.addWidget(self.scope_combo) self.feedback_area = QtWidgets.QLabel('') self.seq_label = QtWidgets.QLabel('Seq ') self.seq_combo = AdvComboBox() self.seq_row.addWidget(self.seq_label) self.seq_row.addWidget(self.seq_combo) self.shot_label = QtWidgets.QLabel('Shot') self.shot_combo = AdvComboBox() self.seq_row.addWidget(self.shot_label) self.seq_row.addWidget(self.shot_combo) self.task_label = QtWidgets.QLabel('Task') self.task_combo = AdvComboBox() self.task_combo.setEditable(False) self.seq_row.addWidget(self.task_label) self.seq_row.addWidget(self.task_combo) self.tags_label = QtWidgets.QLabel("Tags") self.tags_label.setWordWrap(True) self.tags_label.setMaximumWidth(100) self.tags_line_edit = QtWidgets.QLineEdit() self.tags_row = QtWidgets.QHBoxLayout() self.tags_row.addWidget(self.tags_label) self.tags_row.addWidget(self.tags_line_edit) # create buttons row self.buttons_row = QtWidgets.QHBoxLayout() self.publish_button = QtWidgets.QPushButton('Publish Selected') self.view_in_lumbermill = QtWidgets.QPushButton('View in Lumbermill') self.view_in_lumbermill.setMinimumWidth(220) self.refresh_button = QtWidgets.QPushButton('Refresh') self.refresh_button.hide() self.publish_button.setProperty('class', 'basic') self.view_in_lumbermill.setProperty('class', 'basic') self.refresh_button.setProperty('class', 'basic') self.buttons_row.addStretch(1) self.buttons_row.addWidget(self.refresh_button) self.buttons_row.addWidget(self.view_in_lumbermill) self.buttons_row.addWidget(self.publish_button) self.empty_state = EmptyStateWidgetIO(path_object=self.path_object) self.empty_state.setText( 'Select a Source:\n Click + to Create a new one') self.progress_bar = ProgressGif() self.progress_bar.hide() self.view_in_lumbermill.hide() h_layout.addWidget(self.source_widget) h_layout.addWidget(self.ingest_widget) self.panel.addLayout(h_layout) self.panel.addWidget(self.file_tree) self.panel.addWidget(self.empty_state) self.panel.addLayout(self.tags_title_row) self.panel.addWidget(self.progress_bar) self.panel.addLayout(self.seq_row) self.panel.addLayout(self.tags_row) self.panel.addLayout(self.buttons_row) self.panel.addWidget(self.feedback_area) self.panel.addStretch(1) self.load_companies() self.ingest_widget.empty_state.show() self.ingest_widget.list.hide() self.hide_tags() self.file_tree.hide() self.view_in_lumbermill.clicked.connect( self.on_view_in_lumbermill_clicked) self.refresh_button.clicked.connect(self.on_ingest_selected) self.scope_combo.currentIndexChanged.connect(self.on_scope_changed) self.seq_combo.currentIndexChanged.connect(self.on_seq_changed) self.file_tree.selected.connect(self.on_file_selected) self.seq_combo.currentIndexChanged.connect(self.edit_data_frame) self.shot_combo.currentIndexChanged.connect(self.edit_data_frame) self.task_combo.currentIndexChanged.connect(self.edit_data_frame) self.tags_line_edit.textChanged.connect(self.edit_tags) self.source_widget.add_button.clicked.connect( self.on_source_add_clicked) self.source_widget.list.clicked.connect(self.on_source_selected) self.ingest_widget.list.clicked.connect(self.on_ingest_selected) self.ingest_widget.add_button.clicked.connect(self.on_add_ingest_event) self.publish_button.clicked.connect(self.publish_selected_asset) self.empty_state.files_added.connect(self.new_files_dragged) logging.info('Testing the popup') self.on_scope_changed()
def __init__(self, parent=None, path_dict=None, task_mode=False): LJDialog.__init__(self, parent) self.task_mode = task_mode self.resize(300, 60) self.red_palette, self.green_palette, self.black_palette = define_palettes( ) if not path_dict: return self.path_object = PathObject(path_dict) self.scope = self.path_object.scope if task_mode: self.setWindowTitle('Create %s' % 'Task(s)') else: self.setWindowTitle('Create %s' % self.scope.title()) self.asset = None self.asset_message_string = '' self.asset_list = [] self.full_root = None self.regex = '' self.valid_categories_string = '' self.seq = None self.valid_categories = [] self.get_valid_categories() # Environment Stuff self.root = CONFIG['paths']['root'] self.project_management = CONFIG['account_info']['project_management'] self.schema = CONFIG['project_management'][ self.project_management]['api']['default_schema'] if self.scope == 'assets': self.asset_string_example = CONFIG['rules']['path_variables'][ 'asset']['example'] elif self.scope == 'shots': self.asset_string_example = CONFIG['rules']['path_variables'][ 'shotname']['example'] schema = CONFIG['project_management'][ self.project_management]['tasks'][self.schema] self.proj_man_tasks = schema['long_to_short'][self.scope.lower()] self.proj_man_tasks_short_to_long = schema['short_to_long'][ self.scope.lower()] self.v_layout = QtWidgets.QVBoxLayout(self) self.scope_row = QtWidgets.QHBoxLayout() self.asset_row = QtWidgets.QHBoxLayout(self) self.tasks = [] self.task_row = QtWidgets.QHBoxLayout(self) self.task_combo = AdvComboBox() self.clear_selection_button = QtWidgets.QPushButton('Clear Selection') self.defaults_radio = QtWidgets.QRadioButton('Select Defaults') self.none_radio = QtWidgets.QRadioButton('Select None') self.radio_layout = QtWidgets.QHBoxLayout() self.radio_layout.addItem( QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)) self.radio_layout.addWidget(self.defaults_radio) self.radio_layout.addWidget(self.none_radio) self.defaults_radio.setChecked(True) self.defaults_radio.hide() self.none_radio.hide() if self.task_mode: self.create_button = QtWidgets.QPushButton('Create %s' % 'Task(s)') else: self.create_button = QtWidgets.QPushButton('Create %s' % self.scope.title()) self.create_button.setEnabled(False) # asset & shot stuff self.asset_widget = AssetWidget(self, scope=self.scope, title=str(self.path_object.project)) self.asset_widget.name_row.combo.setEnabled(False) self.asset_row.addWidget(self.asset_widget) # task stuff self.task_layout = QtWidgets.QVBoxLayout(self) for each in self.proj_man_tasks: checkbox = QtWidgets.QCheckBox('%s (%s)' % (each, self.proj_man_tasks[each])) checkbox.stateChanged.connect(self.on_checkbox_clicked) self.task_layout.addWidget(checkbox) self.v_layout.addLayout(self.asset_row) self.v_layout.addLayout(self.radio_layout) self.v_layout.addLayout(self.task_layout) self.v_layout.addWidget(self.create_button) self.v_layout.addItem( QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)) self.asset_widget.message.hide() # self.asset_widget.message.setPalette(self.red_palette) self.load_categories() self.asset_widget.category_row.combo.currentIndexChanged.connect( self.on_category_selected) self.asset_widget.name_row.combo.editTextChanged.connect( self.process_asset_string) self.create_button.clicked.connect(self.on_create_clicked) if self.scope == 'shots': self.asset_widget.category_row.combo.editTextChanged.connect( self.on_seq_text_changed) self.hide_layout_items(self.task_layout) if self.task_mode: self.on_set_vars()
def __init__(self, parent=None, preflight_name='', preflight_step_name='', attrs=None, preflight_path='', menu_type='preflights'): # TODO - we need to choose better variable names, this is obviously "preflight" specific. QtWidgets.QWidget.__init__(self, parent) try: dialog = self.parent().parent().parent() print dialog self.software = dialog.software_combo.currentText() except AttributeError: # TODO - look into this a bit deeper, this is a fairly generic catch right now. dialog = self.parent().parent().parent().parent().parent() self.software = dialog.software_combo.currentText() self.menu_type = menu_type self.attrs = attrs self.name = preflight_step_name self.preflight_name = preflight_name self.preflight_path = preflight_path self.do_save = True # Create the Layouts layout = QtWidgets.QVBoxLayout(self) grid_layout = QtWidgets.QGridLayout() tool_row = QtWidgets.QHBoxLayout() # labels module_label = QtWidgets.QLabel('module') required_label = QtWidgets.QLabel('required') label_label = QtWidgets.QLabel('label') icon_button = QtWidgets.QToolButton() icon_button.setIcon(QtGui.QIcon(os.path.join(icon_path(), 'folder24px.png'))) self.icon_label = QtWidgets.QLabel('icon') name_label = QtWidgets.QLabel('name') # line edits self.command_line_edit = QtWidgets.QLineEdit() self.command_line_edit.setEnabled(False) self.required_line_edit = QtWidgets.QLineEdit() self.required_line_edit.setText('True') self.icon_path_line_edit = QtWidgets.QLineEdit() # self.required_line_edit.setEnabled(False) self.label_line_edit = QtWidgets.QLineEdit() self.name_line_edit = QtWidgets.QLineEdit() self.attrs_dict = {'module': self.command_line_edit, 'required': self.required_line_edit, 'label': self.label_line_edit, 'name': self.name_line_edit, 'icon': self.icon_path_line_edit} # tool buttons delete_button = QtWidgets.QPushButton('Delete') delete_button.setProperty('class', 'basic') open_button = QtWidgets.QPushButton('Open in Editor') open_button.setProperty('class', 'basic') self.save_button = QtWidgets.QPushButton('Save All') self.save_button.setProperty('class', 'basic') # Text Edit self.code_text_edit = QtWidgets.QPlainTextEdit() metrics = QtGui.QFontMetrics(self.code_text_edit.font()) self.code_text_edit.setTabStopWidth(4 * metrics.width(' ')) Highlighter(self.code_text_edit.document()) # Layout the Grid grid_layout.addWidget(label_label, 0, 0) grid_layout.addWidget(self.label_line_edit, 0, 1) grid_layout.addWidget(module_label, 1, 0) grid_layout.addWidget(self.command_line_edit, 1, 1) grid_layout.addWidget(required_label, 2, 0) grid_layout.addWidget(self.required_line_edit, 2, 1) grid_layout.addWidget(self.icon_label, 3, 0) grid_layout.addWidget(self.icon_path_line_edit, 3, 1) grid_layout.addWidget(icon_button, 3, 2) grid_layout.addWidget(name_label, 4, 0) grid_layout.addWidget(self.name_line_edit, 4, 1) name_label.hide() self.name_line_edit.hide() if self.menu_type != 'shelves': self.icon_label.hide() self.icon_path_line_edit.hide() icon_button.hide() else: self.required_line_edit.hide() required_label.hide() # Layout the tool row tool_row.addStretch(1) tool_row.addWidget(open_button) tool_row.addWidget(delete_button) tool_row.addWidget(self.save_button) # layout the widget layout.addLayout(grid_layout) layout.addWidget(self.code_text_edit) layout.addLayout(tool_row) # Signals and Slots self.code_text_edit.textChanged.connect(self.on_code_changed) icon_button.clicked.connect(self.on_icon_button_clicked) delete_button.clicked.connect(self.on_delete_clicked) open_button.clicked.connect(self.on_open_clicked) self.save_button.clicked.connect(self.on_save_clicked) self.load_attrs() self.label_line_edit.textChanged.connect(self.on_code_changed)
def __init__(self, parent=None, software=None, menu_type='menus', menu_name='', menu=None, menu_path=''): QtWidgets.QWidget.__init__(self, parent) # initialize variables self.menu_type = menu_type if self.menu_type == 'shelves': self.singular = 'shelf' elif self.menu_type == 'menus': self.singular = 'menu' elif self.menu_type == 'preflights': self.singular = 'preflight' elif self.menu_type == 'context-menus': self.singular = 'context-menu' else: self.singluar = 'not defined' self.software = software self.menu = menu self.menu_name = menu_name self.menu_path = menu_path self.new_button_widget = None # create layouts layout = QtWidgets.QVBoxLayout(self) title_layout = QtWidgets.QHBoxLayout() if menu_type != 'shelves': self.buttons_tab_widget = LJTabWidget() self.buttons_tab_widget.setProperty('class', 'vertical') self.buttons_tab_widget.tabBar().setProperty('class', 'vertical') else: self.buttons_tab_widget = QtWidgets.QTabWidget() self.title = '' if self.menu_type == 'menus': self.title = QtWidgets.QLabel('%s %s Buttons: (Drag to Reorder)' % (self.menu_name, self.menu_type.title())) elif self.menu_type == 'preflights': self.title = QtWidgets.QLabel('%s %s Steps: (Drag to Reorder)' % (self.menu_name, self.menu_type.title())) elif self.menu_type == 'shelves': self.title = QtWidgets.QLabel('%s Shelf Buttons: (Drag to Reorder)' % self.menu_name) elif self.menu_type == 'context-menus': self.title = QtWidgets.QLabel('Context Menu Buttons: (Drag to Reorder)') self.title.setProperty('class', 'title') if self.menu_type == 'shelves': self.add_button = QtWidgets.QPushButton('add shelf button') self.import_menu_button = QtWidgets.QPushButton('import shelf button') elif self.menu_type == 'preflights': self.add_button = QtWidgets.QPushButton('add preflight step') self.import_menu_button = QtWidgets.QPushButton('import preflight step') else: self.add_button = QtWidgets.QPushButton('add %s button' % self.singular) self.import_menu_button = QtWidgets.QPushButton('import %s button' % self.singular) self.add_submenu_button = QtWidgets.QPushButton('add submenu') self.add_submenu_button.hide() self.import_menu_button.hide() self.add_button.setProperty('class', 'add_button') self.add_submenu_button.setProperty('class', 'add_button') self.import_menu_button.setProperty('class', 'add_button') # set parameters self.buttons_tab_widget.setMovable(True) # layout the widget title_layout.addWidget(self.title) title_layout.addWidget(self.add_submenu_button) title_layout.addWidget(self.import_menu_button) title_layout.addWidget(self.add_button) title_layout.addStretch(1) layout.addLayout(title_layout) layout.addWidget(self.buttons_tab_widget) # connect SIGNALS and SLOTS self.add_button.clicked.connect(self.on_add_menu_button) self.add_submenu_button.clicked.connect(self.on_submenu_button_clicked) self.import_menu_button.clicked.connect(self.on_import_menu_button_clicked) self.load_buttons()
def __init__(self, parent=None): LJDialog.__init__(self, parent) self.setWindowTitle('RoboGary') trifecta_layout = QtWidgets.QHBoxLayout(self) trifecta_layout.setContentsMargins(0, 96, 0, 96) highlight_icon = os.path.join(icon_path(), 'highlight_24px.png') # self.transcript_file = r'B:\Users\tmiko\Downloads\tom_ahmed_conversation_12_10_2019.json' self.transcript_file = r'\\Mac\Home\Downloads\tom_ahmed_conversation_12_10_2019.json' self.transcript = load_json(self.transcript_file) self.words = self.transcript['results']['items'] self.next_words_length = 5 self.cgl_word_dict = self.create_cgl_word_dict() self.tools_layout = QtWidgets.QVBoxLayout() self.script_layout = QtWidgets.QVBoxLayout() self.title_line_edit = QtWidgets.QLineEdit() self.gridA = QtWidgets.QGridLayout() self.gridA.setContentsMargins(96, 0, 0, 12) self.grid = QtWidgets.QGridLayout() self.grid.setContentsMargins(96, 0, 0, 0) # Screenplay stuff self.title_label = QtWidgets.QLabel('TITLE:') self.title_line_edit.setProperty('class', 'screen_play_edit') self.title_line_edit.setText('TYPE TITLE HERE') self.screenplay_text_edit = ScreenPlayTextEdit() self.screenplay_text_edit.setProperty('class', 'screen_play') self.width = 816 self.screenplay_text_edit.setMinimumWidth(self.width) self.screenplay_text_edit.setMaximumWidth(self.width) self.punctuation = [',', '.', '?'] # Details stuff self.description_label = QtWidgets.QLabel("DESCRIPTION:") self.description_line_edit = QtWidgets.QLineEdit('TYPE DESCRIPTION HERE') self.description_line_edit.setProperty('class', 'screen_play_edit') self.location_label = QtWidgets.QLabel("LOCATION: ") self.location_line_edit = QtWidgets.QLineEdit('TYPE LOCATION HERE') self.location_line_edit.setProperty('class', 'screen_play_edit') self.date_label = QtWidgets.QLabel("DATE: ") self.date_line_edit = QtWidgets.QLineEdit('TYPE DATE HERE') self.date_line_edit.setProperty('class', 'screen_play_edit') self.selection_start_label = QtWidgets.QLabel("Start:") self.selection_start_line_edit = QtWidgets.QLineEdit() self.selection_end_label = QtWidgets.QLabel("End:") self.selection_end_line_edit = QtWidgets.QLineEdit() # grid self.gridA.addWidget(self.title_label, 10, 0) self.gridA.addWidget(self.title_line_edit, 10, 1) self.grid.addWidget(self.description_label, 11, 0) self.grid.addWidget(self.description_line_edit, 11, 1) self.grid.addWidget(self.location_label, 12, 0) self.grid.addWidget(self.location_line_edit, 12, 1) self.grid.addWidget(self.date_label, 13, 0) self.grid.addWidget(self.date_line_edit, 13, 1) self.grid.addWidget(self.selection_start_label, 14, 0) self.grid.addWidget(self.selection_start_line_edit, 14, 1) self.grid.addWidget(self.selection_end_label, 15, 0) self.grid.addWidget(self.selection_end_line_edit, 15, 1) # Toolbar toolbar = QtWidgets.QHBoxLayout() toolbar.setContentsMargins(96, 0, 0, 0) self.script_layout.addLayout(self.gridA) self.script_layout.addLayout(toolbar) self.script_layout.addWidget(self.screenplay_text_edit) self.tools_layout.addLayout(self.grid) self.highlight_button = QtWidgets.QToolButton() self.highlight_button.setIcon(QtGui.QIcon(highlight_icon)) toolbar.addWidget(self.highlight_button) toolbar.addStretch(1) trifecta_layout.addLayout(self.script_layout) trifecta_layout.addLayout(self.tools_layout) self.tools_layout.addStretch(1) self.highlight_button.clicked.connect(self.on_highlight_clicked) self.screenplay_text_edit.selectionChanged.connect(self.on_selected) self.load_transcript()
def __init__(self, parent=None, path_object=None): QtWidgets.QFrame.__init__(self, parent) if path_object: self.path_object = path_object else: return self.setProperty('class', 'light_grey') self.my_tasks_button = QtWidgets.QPushButton() self.my_tasks_button.setToolTip('My Tasks') tasks_icon = os.path.join(cglpath.icon_path(), 'star24px.png') self.my_tasks_button.setProperty('class', 'grey_border') self.my_tasks_button.setIcon(QtGui.QIcon(tasks_icon)) self.my_tasks_button.setIconSize(QtCore.QSize(ICON_WIDTH, ICON_WIDTH)) self.refresh_button = QtWidgets.QPushButton() self.refresh_button.setToolTip('Refresh') refresh_icon = os.path.join(cglpath.icon_path(), 'spinner11.png') self.refresh_button.setProperty('class', 'grey_border') self.refresh_button.setIcon(QtGui.QIcon(refresh_icon)) self.refresh_button.setIconSize(QtCore.QSize(ICON_WIDTH, ICON_WIDTH)) self.ingest_button = QtWidgets.QPushButton() self.ingest_button.setToolTip('My Tasks') self.ingest_button.setProperty('class', 'grey_border') ingest_icon = os.path.join(cglpath.icon_path(), 'ingest24px.png') self.ingest_button.setIcon(QtGui.QIcon(ingest_icon)) self.ingest_button.setIconSize(QtCore.QSize(ICON_WIDTH, ICON_WIDTH)) self.back_button = QtWidgets.QPushButton() self.back_button.setToolTip('Go back') self.projects_button = QtWidgets.QPushButton() self.projects_button.setToolTip('Go to Projects') self.companies_button = QtWidgets.QPushButton() self.companies_button.setToolTip('Go to Companies') self.my_tasks_button.setProperty('class', 'grey_border') self.back_button.setStyleSheet("background: transparent;") self.projects_button.setStyleSheet("background: transparent;") self.companies_button.setStyleSheet("background: transparent;") back_icon = os.path.join(cglpath.icon_path(), 'back24px.png') home_icon = os.path.join(cglpath.icon_path(), 'project24px.png') company_icon = os.path.join(cglpath.icon_path(), 'company24px.png') self.back_button.setIcon(QtGui.QIcon(back_icon)) self.back_button.setIconSize(QtCore.QSize(ICON_WIDTH, ICON_WIDTH)) self.companies_button.setIcon(QtGui.QIcon(company_icon)) self.companies_button.setIconSize(QtCore.QSize(ICON_WIDTH, ICON_WIDTH)) self.projects_button.setIcon(QtGui.QIcon(home_icon)) self.projects_button.setIconSize(QtCore.QSize(ICON_WIDTH, ICON_WIDTH)) self.current_location_line_edit = QtWidgets.QLineEdit() self.current_location_line_edit.setReadOnly(True) self.current_location_line_edit.setMinimumHeight(ICON_WIDTH * 1.28) self.current_location_line_edit.hide() self.search_box = LJSearchEdit(self) layout = QtWidgets.QVBoxLayout(self) self.cl_row = QtWidgets.QHBoxLayout() self.cl_row.addWidget(self.back_button) self.cl_row.addWidget(self.companies_button) self.cl_row.addWidget(self.projects_button) self.cl_row.addWidget(self.my_tasks_button) self.cl_row.addWidget(self.refresh_button) self.cl_row.addWidget(self.search_box) self.cl_row.addWidget(self.ingest_button) layout.addLayout(self.cl_row) layout.addWidget(self.current_location_line_edit) self.my_tasks_button.clicked.connect(self.my_tasks_pressed) self.ingest_button.clicked.connect(self.ingest_clicked) self.refresh_button.clicked.connect(self.refresh_clicked) self.back_button.clicked.connect(self.back_button_pressed) self.companies_button.clicked.connect(self.buttons_pressed) self.projects_button.clicked.connect(self.buttons_pressed) self.set_text(self.path_object.path_root)
def __init__(self, parent=None, type_=None, menu_path=None, pm_tasks=None): LJDialog.__init__(self, parent) self.type = type_ self.cgl_tools = get_cgl_tools() self.singular = '' self.menu_path = menu_path self.software = '' self.setWindowTitle('Pipeline Designer') self.schema = pm_tasks self.task_list = [] try: for each in self.schema['long_to_short']['assets']: if each not in self.task_list: self.task_list.append(each) for each in self.schema['long_to_short']['shots']: if each not in self.task_list: self.task_list.append(each) except TypeError: print 'Problems found in your globals "schema"' return self.task_list.sort() self.task_list.insert(0, '') # create layouts layout = QtWidgets.QVBoxLayout(self) tool_bar = QtWidgets.QHBoxLayout() self.title_widget = QtWidgets.QWidget() title_widget_layout = QtWidgets.QHBoxLayout() self.title_widget.setLayout(title_widget_layout) grid_layout = QtWidgets.QGridLayout() menu_type_row = QtWidgets.QHBoxLayout() # create widgets self.software_label = QtWidgets.QLabel('Software:') self.software_label.setProperty('class', 'title') self.software_combo = QtWidgets.QComboBox() self.menu_type_label = QtWidgets.QLabel('Menu Type:') self.menu_type_label.setProperty('class', 'title') self.menu_type_combo = QtWidgets.QComboBox() self.menu_type_combo.addItems(['', 'menus', 'context-menus', 'shelves', 'preflights']) self.new_software_button = QtWidgets.QPushButton('Add Software') self.new_software_button.setProperty('class', 'add_button') self.menus = QtWidgets.QTabWidget() self.menus.setMovable(True) self.title_label = QtWidgets.QLabel() self.title_label.setProperty('class', 'ultra_title') self.add_menu_button = QtWidgets.QPushButton('add') self.delete_menu_button = QtWidgets.QPushButton('delete') self.add_menu_button.setProperty('class', 'add_button') self.delete_menu_button.setProperty('class', 'add_button') # self.save_menu_button = QtWidgets.QPushButton('save menu') # self.save_menu_button.setProperty('class', 'add_button') self.title_widget.hide() # layout the GUI title_widget_layout.addWidget(self.title_label) title_widget_layout.addWidget(self.add_menu_button) title_widget_layout.addWidget(self.delete_menu_button) title_widget_layout.addStretch(1) # title_widget_layout.addWidget(self.save_menu_button) grid_layout.addWidget(self.software_label, 0, 0) grid_layout.addWidget(self.software_combo, 0, 1) grid_layout.addWidget(self.new_software_button, 0, 2) grid_layout.addWidget(self.menu_type_label, 1, 0) grid_layout.addWidget(self.menu_type_combo, 1, 1) tool_bar.addLayout(grid_layout) tool_bar.addStretch(1) layout.addLayout(tool_bar) layout.addWidget(self.title_widget) layout.addLayout(menu_type_row) layout.addWidget(self.menus) # SIGNALS AND SLOTS self.add_menu_button.clicked.connect(self.on_add_menu_clicked) self.delete_menu_button.clicked.connect(self.on_delete_menu_clicked) self.new_software_button.clicked.connect(self.on_new_software_clicked) # Load the Menu Designer self.load_software() self.software_combo.currentIndexChanged.connect(self.update_menu_path) self.menu_type_combo.currentIndexChanged.connect(self.update_menu_path)