def do_presetAdd(self):

        newpre = xtools.showInputBox(self, "Add Preset", "Preset Name", "")
        mpath = xtools.getString(self.ui_mayapath)
        margs = xtools.getString(self.ui_basecommand)

        if newpre != 0 and mpath != "" and margs != "":
            self.xm_addpreset(newpre, mpath, margs)
    def do_presetAdd(self):

        newpre = xtools.showInputBox(self,"Add Preset","Preset Name","")
        mpath = xtools.getString(self.ui_mayapath)
        margs = xtools.getString(self.ui_basecommand)

        if newpre!=0 and mpath!="" and margs!="":
            self.xm_addpreset(newpre,mpath,margs)
    def melGenereater(self):
        x = ""
        x = xtools.getString(self.windowx.textEdit)

        IN1 = xtools.getString(self.windowx.lineEdit_1)
        IN2 = xtools.getString(self.windowx.lineEdit_2)
        IN3 = xtools.getString(self.windowx.lineEdit_3)
        IN4 = xtools.getString(self.windowx.lineEdit_4)
        IN5 = xtools.getString(self.windowx.lineEdit_5)
        IN5 = xtools.getString(self.windowx.lineEdit_5)

        if IN1 != None: x = x.replace("[INPUT1]", IN1)
        if IN2 != None: x = x.replace("[INPUT2]", IN2)
        if IN3 != None: x = x.replace("[INPUT3]", IN3)
        if IN4 != None: x = x.replace("[INPUT4]", IN4)
        if IN5 != None: x = x.replace("[INPUT5]", IN5)

        x = x.replace("\\", "/")

        fileName = QtGui.QFileDialog.getSaveFileName(
            self, "Save Customized Script to...", "CustomizedMEL",
            "Maya MEL (*.mel);;All Files (*)")

        if fileName != "" and x != "":

            fileObj = open(fileName, "w")
            fileObj.write(x)
            fileObj.close()

            xtools.messagebox(
                self, "Done!",
                "Customized Script Generated and Saved. Please... Reload the script, if needed!"
            )

        self.do_listscripts()
    def melGenereater(self):
        x = ""
        x = xtools.getString(self.windowx.textEdit)

        IN1 = xtools.getString(self.windowx.lineEdit_1)
        IN2 = xtools.getString(self.windowx.lineEdit_2)
        IN3 = xtools.getString(self.windowx.lineEdit_3)
        IN4 = xtools.getString(self.windowx.lineEdit_4)
        IN5 = xtools.getString(self.windowx.lineEdit_5)
        IN5 = xtools.getString(self.windowx.lineEdit_5)

        if IN1!=None:        x = x.replace("[INPUT1]",IN1)
        if IN2!=None:        x = x.replace("[INPUT2]",IN2)
        if IN3!=None:        x = x.replace("[INPUT3]",IN3)
        if IN4!=None:        x = x.replace("[INPUT4]",IN4)
        if IN5!=None:        x = x.replace("[INPUT5]",IN5)

        x = x.replace("\\","/")

        fileName = QtGui.QFileDialog.getSaveFileName(self,"Save Customized Script to...","CustomizedMEL","Maya MEL (*.mel);;All Files (*)")


        if fileName!="" and x!="":

                fileObj = open(fileName,"w")
                fileObj.write(x)
                fileObj.close()

                xtools.messagebox(self,"Done!","Customized Script Generated and Saved. Please... Reload the script, if needed!")

        self.do_listscripts()
    def previews(self):
        x = ""
        x = xtools.getString(self.windowx.textEdit)

        IN1 = xtools.getString(self.windowx.lineEdit_1)
        IN2 = xtools.getString(self.windowx.lineEdit_2)
        IN3 = xtools.getString(self.windowx.lineEdit_3)
        IN4 = xtools.getString(self.windowx.lineEdit_4)
        IN5 = xtools.getString(self.windowx.lineEdit_5)

        if IN1 != None: x = x.replace("[INPUT1]", IN1)
        if IN2 != None: x = x.replace("[INPUT2]", IN2)
        if IN3 != None: x = x.replace("[INPUT3]", IN3)
        if IN4 != None: x = x.replace("[INPUT4]", IN4)
        if IN5 != None: x = x.replace("[INPUT5]", IN5)

        x = x.replace("\\", "/")

        xtools.putString(self.windowx.textEdit_2, x)
    def previews(self):
        x = ""
        x = xtools.getString(self.windowx.textEdit)

        IN1 = xtools.getString(self.windowx.lineEdit_1)
        IN2 = xtools.getString(self.windowx.lineEdit_2)
        IN3 = xtools.getString(self.windowx.lineEdit_3)
        IN4 = xtools.getString(self.windowx.lineEdit_4)
        IN5 = xtools.getString(self.windowx.lineEdit_5)

        if IN1!=None:        x = x.replace("[INPUT1]",IN1)
        if IN2!=None:        x = x.replace("[INPUT2]",IN2)
        if IN3!=None:        x = x.replace("[INPUT3]",IN3)
        if IN4!=None:        x = x.replace("[INPUT4]",IN4)
        if IN5!=None:        x = x.replace("[INPUT5]",IN5)

        x = x.replace("\\","/")

        xtools.putString(self.windowx.textEdit_2,x)
    def __init__(self, *args):
        QMainWindow.__init__(self, *args)
        self.setupUi(self, *args)
        self.setGeometry(100, 100, 700, 500)

        self.presets = []
        self.allexepath = []
        self.allargpath = []

        self.myqp = QProcess(self)
        self.skinbox.addItems(QtGui.QStyleFactory.keys())
        self.addDockWidget(Qt.RightDockWidgetArea, self.dockWidget_2)
        self.addDockWidget(Qt.TopDockWidgetArea, self.dockWidget)
        xtools.appstyle(self)

        self.configs = configINI("Settings.ini")
        self.read_settings()
        self.windowx = None

        batchtotalfiles = 0
        batchcurrentfile = 0
        batchtotaldone = 0
        batchtotalerror = 0
        batchtotalskip = 0

        self.lastsearch = ""

        #Replacing old QObjectS with new DRAG/DROPABLE QObjects

        xtools.updaterchk(self, "Execute.exe")

        #List widget for collecting Drag Dropped filesfor Batch Process....
        sip.delete(self.listWidget)
        self.listWidget = DroppableListWidget(self.tab_batch)
        self.listWidget.setFrameShape(QtGui.QFrame.Box)
        self.listWidget.setObjectName("listWidget")
        self.gridLayout_5.addWidget(self.listWidget, 1, 0, 1, 1)
        self.listWidget.__class__.dropEvent = self.batchdragdropped

        QObject.connect(self.pushButton, SIGNAL("clicked()"),
                        self.mysignalrunner)
        QObject.connect(self.myqp, SIGNAL("finished(int)"), self.endofprocess)
        QObject.connect(self.myqp, SIGNAL("readyRead()"), self.processcapture)
        QObject.connect(self.myqp, SIGNAL("started()"), self.started)
        QObject.connect(self.myqp, SIGNAL("stateChanged()"), self.stateChanged)
        QObject.connect(self.myqp, SIGNAL("error(QProcess::ProcessError)"),
                        self.someerror)
        QObject.connect(self.myqp, SIGNAL("readyReadStandardError()"),
                        self.errorcatcher)

        self.do_listscripts()
        self.toolButton_4.setEnabled(0)
        self.tabWidget.setCurrentIndex(0)
        self.tabWidget_2.setCurrentIndex(0)
        self.toolBox.setCurrentIndex(0)
        self.textEdit.setReadOnly(True)
        self.displayer.setReadOnly(True)
        self.lineEdit.setReadOnly(True)
        self.infodisp.clear()
        self.do_changeskin(self.skinbox.currentText())
        self.do_smoothtab(self.checkBox_3.checkState())
        self.do_bgstyle(self.skinbox_2.currentText())
        self.infodisp.hide()

        #Loading CommandLine presets
        self.xm_presetDesign()

        #Adding Default Preset
        if self.presets.count("Default") == 0:
            mpath = str(xtools.getString(self.ui_mayapath))
            margs = str(xtools.getString(self.ui_basecommand))
            self.xm_addpreset("Default", mpath, margs)
    def __init__(self, *args):
        QMainWindow.__init__(self, *args)
        self.setupUi(self, *args)
        self.setGeometry(100,100,700,500)


        self.presets = []
        self.allexepath = []
        self.allargpath = []

        self.myqp = QProcess(self)
        self.skinbox.addItems(QtGui.QStyleFactory.keys())
        self.addDockWidget(Qt.RightDockWidgetArea,self.dockWidget_2)
        self.addDockWidget(Qt.TopDockWidgetArea,self.dockWidget)
        xtools.appstyle(self)


        self.configs = configINI("Settings.ini")
        self.read_settings()
        self.windowx = None

        batchtotalfiles=0
        batchcurrentfile=0
        batchtotaldone=0
        batchtotalerror=0
        batchtotalskip=0

        self.lastsearch=""

        #Replacing old QObjectS with new DRAG/DROPABLE QObjects

        xtools.updaterchk(self,"Execute.exe")


        #List widget for collecting Drag Dropped filesfor Batch Process....
        sip.delete(self.listWidget)
        self.listWidget = DroppableListWidget(self.tab_batch)
        self.listWidget.setFrameShape(QtGui.QFrame.Box)
        self.listWidget.setObjectName("listWidget")
        self.gridLayout_5.addWidget(self.listWidget, 1, 0, 1, 1)
        self.listWidget.__class__.dropEvent = self.batchdragdropped


        QObject.connect(self.pushButton, SIGNAL("clicked()"), self.mysignalrunner)
        QObject.connect(self.myqp,SIGNAL("finished(int)"),self.endofprocess)
        QObject.connect(self.myqp,SIGNAL("readyRead()"),self.processcapture)
        QObject.connect(self.myqp,SIGNAL("started()"),self.started)
        QObject.connect(self.myqp,SIGNAL("stateChanged()"),self.stateChanged)
        QObject.connect(self.myqp,SIGNAL("error(QProcess::ProcessError)"),self.someerror)
        QObject.connect(self.myqp,SIGNAL("readyReadStandardError()"),self.errorcatcher)

        self.do_listscripts()
        self.toolButton_4.setEnabled(0)
        self.tabWidget.setCurrentIndex(0)
        self.tabWidget_2.setCurrentIndex(0)
        self.toolBox.setCurrentIndex(0)
        self.textEdit.setReadOnly(True)
        self.displayer.setReadOnly(True)
        self.lineEdit.setReadOnly(True)
        self.infodisp.clear()
        self.do_changeskin(self.skinbox.currentText())
        self.do_smoothtab(self.checkBox_3.checkState())
        self.do_bgstyle(self.skinbox_2.currentText())
        self.infodisp.hide()



        #Loading CommandLine presets
        self.xm_presetDesign()

        #Adding Default Preset
        if self.presets.count("Default")==0:
            mpath = str(xtools.getString(self.ui_mayapath))
            margs = str(xtools.getString(self.ui_basecommand))
            self.xm_addpreset("Default",mpath,margs)