Пример #1
0
    def add_project( self ):
        project_name = str( PyQt4.QtGui.QInputDialog.getText( self, 'Input Dialog', 'Project Name:' )[0] )  # @UndefinedVariable
        existing_projects = utilities.get_combo_items( self.project_combo )

        if any( i in project_name for i in existing_projects ) == False:
            if project_name != '':
                project_dir = PyQt4.QtGui.QFileDialog.getExistingDirectory( self, 'Set Project Folder' )

                if project_dir != '':
                    utilities.add_remove_combo( self.project_combo, add = True, data = project_name )

                    project_dir = project_dir.replace( "\\", '/' )


                    self.create_project_file( project_name, project_dir )
                    utilities.set_line( self.dir_line, '{0}/'.format( project_dir ) )

                    self.message_report( error_level = 0,
                                                 message = "Project is set to {0}".format( project_dir ) )

                else:
                    self.message_report( error_level = 2,
                                                     message = "Name is invalid!" )

            else:
                self.message_report( error_level = 2,
                                                 message = "Directory is invalid!" )

        else:
                self.message_report( error_level = 2,
                                                 message = "This project already exists!" )
Пример #2
0
    def set_browse_dir( self ):
        export_dir = str( self.dir_line.text() )

        browse_dir = PyQt4.QtGui.QFileDialog.getExistingDirectory( self, 'Set Project Folder', export_dir )
        browse_dir = browse_dir.replace( "\\", '/' )

        if browse_dir != '':
            utilities.set_line( self.dir_line, '{0}/'.format( browse_dir ) )
Пример #3
0
    def set_browse_dir(self):
        export_dir = str(self.dir_line.text())

        browse_dir = PyQt4.QtGui.QFileDialog.getExistingDirectory(
            self, 'Set Project Folder', export_dir)
        browse_dir = browse_dir.replace("\\", '/')

        if browse_dir != '':
            utilities.set_line(self.dir_line, '{0}/'.format(browse_dir))
Пример #4
0
    def set_project_dir( self ):
        project_name = str( self.project_combo.currentText() )

        if os.path.exists( '{0}{1}.project'.format( DATA_PATH, project_name ) ):
            directory = utilities.get_project_directory( '{0}{1}.project'.format( DATA_PATH, project_name ) )
            utilities.set_line( self.dir_line, '{0}/'.format( directory ) )

        else:
            self.message_report( error_level = 2,
                                 message = "Can't find current project!" )
Пример #5
0
    def set_project_dir(self):
        project_name = str(self.project_combo.currentText())

        if os.path.exists('{0}{1}.project'.format(DATA_PATH, project_name)):
            directory = utilities.get_project_directory(
                '{0}{1}.project'.format(DATA_PATH, project_name))
            utilities.set_line(self.dir_line, '{0}/'.format(directory))

        else:
            self.message_report(error_level=2,
                                message="Can't find current project!")
Пример #6
0
    def set_photoshop_dir( self, set_dir = False ):
        try:
            get_ps_dir = self.ps_app.ActiveDocument.path[:-1]
            get_ps_dir = get_ps_dir.replace( "\\", '/' )

            self.message_report( error_level = 0,
                                     message = "Exporter successfully connected to Photoshop!" )

        except:
            get_ps_dir = ''
            self.message_report( error_level = 2,
                                 message = "Can't find current Photoshop Directory. Make Sure to save the current Photoshop file!" )

        if set_dir:
            if get_ps_dir != '':
                utilities.set_line( self.dir_line, '{0}/'.format( get_ps_dir ) )

        return get_ps_dir
Пример #7
0
    def set_photoshop_dir(self, set_dir=False):
        try:
            get_ps_dir = self.ps_app.ActiveDocument.path[:-1]
            get_ps_dir = get_ps_dir.replace("\\", '/')

            self.message_report(
                error_level=0,
                message="Exporter successfully connected to Photoshop!")

        except:
            get_ps_dir = ''
            self.message_report(
                error_level=2,
                message=
                "Can't find current Photoshop Directory. Make Sure to save the current Photoshop file!"
            )

        if set_dir:
            if get_ps_dir != '':
                utilities.set_line(self.dir_line, '{0}/'.format(get_ps_dir))

        return get_ps_dir
Пример #8
0
    def add_project(self):
        project_name = str(
            PyQt4.QtGui.QInputDialog.getText(
                self, 'Input Dialog',
                'Project Name:')[0])  # @UndefinedVariable
        existing_projects = utilities.get_combo_items(self.project_combo)

        if any(i in project_name for i in existing_projects) == False:
            if project_name != '':
                project_dir = PyQt4.QtGui.QFileDialog.getExistingDirectory(
                    self, 'Set Project Folder')

                if project_dir != '':
                    utilities.add_remove_combo(self.project_combo,
                                               add=True,
                                               data=project_name)

                    project_dir = project_dir.replace("\\", '/')

                    self.create_project_file(project_name, project_dir)
                    utilities.set_line(self.dir_line,
                                       '{0}/'.format(project_dir))

                    self.message_report(
                        error_level=0,
                        message="Project is set to {0}".format(project_dir))

                else:
                    self.message_report(error_level=2,
                                        message="Name is invalid!")

            else:
                self.message_report(error_level=2,
                                    message="Directory is invalid!")

        else:
            self.message_report(error_level=2,
                                message="This project already exists!")
Пример #9
0
    def flip_line_values(self, lineA, lineB):
        lineA_value = str(lineA.text())
        lineB_value = str(lineB.text())

        utilities.set_line(lineA, lineB_value)
        utilities.set_line(lineB, lineA_value)
Пример #10
0
    def flip_line_values( self, lineA, lineB ):
        lineA_value = str( lineA.text() )
        lineB_value = str( lineB.text() )

        utilities.set_line( lineA, lineB_value )
        utilities.set_line( lineB, lineA_value )