Beispiel #1
0
    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)
Beispiel #2
0
    def __init__(self, parent=None, paths_dict=None, hide_on_find=False):
        QtWidgets.QWidget.__init__(self, parent)
        self.layout = QtWidgets.QVBoxLayout(self)
        self.globals_layout = QtWidgets.QGridLayout()
        self.paths_layout = QtWidgets.QGridLayout()
        self.vfx_paths_layout = QtWidgets.QGridLayout()
        self.user_dir = os.path.expanduser("~")
        self.user_name = self.get_user_name()
        self.cgl_dir = self.get_default_cgl_dir()
        self.user_globals_path = self.get_user_config(self.cgl_dir)
        self.globals_label = QtWidgets.QLabel('Globals Locations')
        self.globals_label.setProperty('class', 'ultra_title')
        self.paths_label = QtWidgets.QLabel('CGL Tool Paths')
        self.paths_label.setProperty('class', 'ultra_title')
        self.paths_label.hide()
        self.vfx_label = QtWidgets.QLabel('VFX Paths')
        self.vfx_label.setProperty('class', 'ultra_title')
        self.vfx_label.hide()
        # self.red_palette, self.green_palette, self.black_palette = define_palettes()
        self.cgl_tools_folder = None
        self.widget_dict = {}
        # Add User Globals, Root and The "Paths" label to the first slots.
        i = 0
        i = self.add_path_line(self.globals_layout, 'root', paths_dict, i,
                               hide_on_find)
        self.add_path_line(self.globals_layout, 'user_globals', paths_dict, i,
                           hide_on_find)

        self.layout.addWidget(self.paths_label)
        self.layout.addLayout(self.globals_layout)
        self.layout.addWidget(self.paths_label)
        self.layout.addLayout(self.paths_layout)
        self.layout.addWidget(self.vfx_label)
        self.layout.addLayout(self.vfx_paths_layout)

        default_paths = [
            'cgl_tools', 'code_root', 'dev_pkg', 'ffmpeg', 'ffplay', 'ffprobe',
            'magick', 'wget', 'globals'
        ]
        vfx_paths = ['ari_convert', 'maketx', 'mayapy', 'nuke']
        prow = 0
        vrow = 0

        for key in paths_dict:
            if key in default_paths:
                prow += 2
                self.add_path_line(self.paths_layout, key, paths_dict, prow,
                                   hide_on_find)
            elif key in vfx_paths:
                vrow += 2
                self.add_path_line(self.vfx_paths_layout, key, paths_dict,
                                   vrow, hide_on_find)
Beispiel #3
0
    def add_path_line(self, layout_, key, paths_dict, row, hide_on_find):
        """

        :param layout_:
        :param key:
        :param paths_dict:
        :param row:
        :param hide_on_find:
        :return:
        """
        label = QtWidgets.QLabel(key)
        line_edit = QtWidgets.QLineEdit()

        line_edit.setText(paths_dict[key])
        if key == 'root':
            line_edit.editingFinished.connect(self.on_root_set)

        folder_button = QtWidgets.QToolButton()
        if key == 'cgl_tools':
            self.cgl_tools_folder = folder_button
        folder_button.setIcon(QtGui.QIcon(self.icon_path('folder24px.png')))
        folder_button.line_edit = line_edit
        folder_button.label = label
        message = QtWidgets.QLabel('Path Not Found, Please Specify %s' % key)
        # message.setPalette(self.red_palette)
        folder_button.message = message
        self.widget_dict[key] = {
            'label': label,
            'line_edit': line_edit,
            'message': message
        }
        layout_.addWidget(label, row, 0)
        layout_.addWidget(line_edit, row, 1)
        layout_.addWidget(folder_button, row, 2)
        layout_.addWidget(message, row + 1, 1)
        folder_button.clicked.connect(self.on_path_chosen)
        self.check_path(key,
                        label,
                        line_edit,
                        message,
                        folder_button,
                        hide_on_find=hide_on_find)
        line_edit.textChanged.connect(lambda: self.on_line_edit_changed(key))
        return row + 2
Beispiel #4
0
    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)
Beispiel #5
0
    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, 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()
Beispiel #7
0
    def load_transcript(self):
        speaker_labels = self.transcript['results']['speaker_labels']
        previous_speaker = ''
        speakers = []
        row = -1
        for segment in speaker_labels['segments']:
            # find out if we're doing the same speaker or a new one:
            segment_list = []
            speaker = segment['speaker_label'].upper()
            start_time = float(segment['start_time'])
            end_time = float(segment['end_time'])
            for w in self.words:
                # find the start and end index for the 'segment'
                if 'start_time' in w.keys():
                    if float(w['start_time']) >= start_time:
                        in_segment = True
                        if float(w['start_time']) < end_time:
                            segment_list.append(w['alternatives'][0]['content'])
                        if float(w['start_time']) > end_time:
                            in_segment = False
                else:
                    if in_segment:
                        segment_list.append(w['alternatives'][0]['content'])
            if speaker != previous_speaker:
                if speaker not in speakers:
                    row += 1
                    speaker_label = QtWidgets.QLabel('%s NAME:' % speaker.upper())
                    speaker_line_edit = QtWidgets.QLineEdit('TYPE SPEAKER HERE')
                    speaker_line_edit.setProperty('class', 'screen_play_edit')
                    self.grid.addWidget(speaker_label, row, 0)
                    self.grid.addWidget(speaker_line_edit, row, 1)
                    speakers.append(speaker)

                self.screenplay_text_edit.append('\n\n%s' % speaker)
                self.screenplay_text_edit.setAlignment(QtCore.Qt.AlignCenter)
                # TODO is there any way for me to capture the correlation between the cursro position of the word i'm adding
                # and its index within the json file?
                self.screenplay_text_edit.append(string_from_segment_list(segment_list))
                self.screenplay_text_edit.setAlignment(QtCore.Qt.AlignLeft)
            else:
                self.screenplay_text_edit.moveCursor(QtGui.QTextCursor.End)
                self.screenplay_text_edit.insertPlainText(string_from_segment_list(segment_list))
                self.screenplay_text_edit.setAlignment(QtCore.Qt.AlignLeft)
                self.screenplay_text_edit.moveCursor(QtGui.QTextCursor.End)

            previous_speaker = speaker
Beispiel #8
0
    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)
Beispiel #9
0
    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()
Beispiel #10
0
    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()
Beispiel #11
0
    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)
Beispiel #12
0
    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()
Beispiel #13
0
    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()
Beispiel #14
0
    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)