Esempio n. 1
0
def readMusicFile(_filePath, _isAlertWhenNotAvailable=True):
    _directoryPath = fu.getDirName(_filePath)
    isCanNoncompatible = False
    if fu.isReadableFileOrDir(_filePath):
        tagger = Taggers.getTagger()
        try:
            tagger.loadFile(_filePath)
        except:
            Dialogs.showError(translate("FileUtils/Musics", "Incorrect Tag"),
                              str(translate("FileUtils/Musics",
                                            "\"%s\" : this file has the incorrect tag so can't read tags.")
                              ) % Organizer.getLink(_filePath))
        if tagger.isAvailableFile() is False:
            isCanNoncompatible = True
        content = {}
        content["path"] = _filePath
        content["baseNameOfDirectory"] = fu.getBaseName(_directoryPath)
        content["baseName"] = fu.getBaseName(_filePath)
        content["artist"] = tagger.getArtist()
        content["title"] = tagger.getTitle()
        content["album"] = tagger.getAlbum()
        content["albumArtist"] = tagger.getAlbumArtist()
        content["trackNum"] = tagger.getTrackNum()
        content["year"] = tagger.getYear()
        content["genre"] = tagger.getGenre()
        content["firstComment"] = tagger.getFirstComment()
        content["firstLyrics"] = tagger.getFirstLyrics()
        content["images"] = tagger.getImages()
        if isCanNoncompatible and _isAlertWhenNotAvailable:
            Dialogs.show(translate("FileUtils/Musics", "Possible ID3 Mismatch"),
                         translate("FileUtils/Musics",
                                   "Some of the files presented in the table may not support ID3 technology.<br>Please check the files and make sure they support ID3 information before proceeding."))
        return content
Esempio n. 2
0
 def checkSource(self, _oldPath, _objectType="fileAndDirectory", _isCheckWritable=True):
     _path = fu.checkSource(_oldPath, _objectType, False)
     if _path is None:
         if _objectType == "file":
             answer = Dialogs.ask(translate("QuickMake", "Cannot Find File"),
                                  str(translate("FileUtils",
                                                "\"%s\" : cannot find a file with this name.<br>Are you want to organize parent directory with Hamsi Manager?")) % Organizer.getLink(
                                      _oldPath))
             if answer == Dialogs.Yes:
                 self.organizeWithHamsiManager(_oldPath)
             return None
         elif _objectType == "directory":
             answer = Dialogs.ask(translate("QuickMake", "Cannot Find Directory"),
                                  str(translate("FileUtils",
                                                "\"%s\" : cannot find a folder with this name.<br>Are you want to organize parent directory with Hamsi Manager?")) % Organizer.getLink(
                                      _oldPath))
             if answer == Dialogs.Yes:
                 self.organizeWithHamsiManager(_oldPath)
             return None
         else:
             answer = Dialogs.ask(translate("QuickMake", "Cannot Find File Or Directory"),
                                  str(translate("FileUtils",
                                                "\"%s\" : cannot find a file or directory with this name.<br>Are you want to organize parent directory with Hamsi Manager?")) % Organizer.getLink(
                                      _oldPath))
             if answer == Dialogs.Yes:
                 self.organizeWithHamsiManager(_oldPath)
             return None
     if _isCheckWritable:
         if fu.isWritableFileOrDir(_oldPath) is False:
             return None
     return _path
Esempio n. 3
0
def getTagger(_isAlertIfNotExist=False, _isReloadAgain=False):
    global loaddedTagger
    try:
        if not _isReloadAgain and loaddedTagger is not None:
            return loaddedTagger
        preferedTaggerModule = uni.MySettings["preferedTaggerModule"]
        taggerModule = __import__("Taggers." + preferedTaggerModule, globals(), locals(), ["isAvailable", "Tagger", preferedTaggerModule], 0)
        if taggerModule.isAvailable:
            loaddedTagger = taggerModule.Tagger()
            return loaddedTagger

        taggersNames = uni.getTaggersMachineNames()
        for tagger in taggersNames:
            taggerModule = __import__("Taggers." + tagger, globals(), locals(), ["isAvailable", "Tagger", tagger], 0)
            if taggerModule.isAvailable:
                uni.setMySetting("preferedTaggerModule", tagger)
                loaddedTagger = taggerModule.Tagger()
                return loaddedTagger
        if _isAlertIfNotExist:
            Dialogs.show(translate("Taggers", "You Have Not Any Tagger"),
                         translate("Taggers", "Not found any tagger in your system. "
                                              "Please install a tagger module. "
                                              "Now supporting only eyeD3 module (python-eyed3)."))
        return None
    except:
        ReportBug.ReportBug()
Esempio n. 4
0
 def addImage(self):
     try:
         if self.isActiveAddImage is False:
             self.isActiveAddImage = True
             self.pbtnAddImage.setText(translate("MusicDetails", "OK"))
             self.pbtnSelectImage.show()
             self.leImagePath.show()
             self.lblImagePath.show()
             self.lblImageType.show()
             self.cbImageType.show()
             self.pbtnCancelAddImage.show()
             self.pbtnDeleteImage.hide()
             self.pbtnSaveAsImage.hide()
         else:
             if fu.isFile(self.leImagePath.text()):
                 imageType = Taggers.getTagger().getImageTypesNo()[self.cbImageType.currentIndex()]
                 description = str(imageType)
                 Musics.writeMusicFile(self.musicValues, None, True, imageType, str(self.leImagePath.text()),
                                       description)
                 self.changeFile(self.musicFile)
                 self.cancelAddImage()
             else:
                 Dialogs.showError(translate("MusicDetails", "Image Does Not Exist"),
                                   str(translate("MusicDetails", "\"%s\" does not exist.")
                                   ) % Organizer.getLink(str(self.leImagePath.text())))
     except:
         ReportBug.ReportBug()
Esempio n. 5
0
def checkEmbeddedDB():
    global isAskEmbeddedDBConfiguration
    if uni.getBoolValue("isReadOnlyAmarokDB"):
        if (fu.isDir(fu.pathOfSettingsDirectory + "/Amarok/mysqle/amarok") and
                fu.isDir(fu.pathOfSettingsDirectory + "/Amarok/mysqle/mysql") and
                fu.isFile(fu.pathOfSettingsDirectory + "/Amarok/my.cnf")):
            return startReadOnlyEmbeddedDB()
        else:
            if isAskEmbeddedDBConfiguration:
                isAskEmbeddedDBConfiguration = False
                answer = Dialogs.ask(translate("Amarok", "Amarok Database Must Be Configure"),
                                     translate("Amarok",
                                               "Amarok database must be configure for Hamsi Manager. Are you want to configure Amarok database?"))
                if answer == Dialogs.Yes:
                    ReadOnlyEmbeddedDBConfigurator()
            else:
                return False
    else:
        if (fu.isFile(uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/mysql/db.frm") and
                fu.isFile(uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/my.cnf")):
            return startEmbeddedDB()
        else:
            if isAskEmbeddedDBConfiguration:
                isAskEmbeddedDBConfiguration = False
                answer = Dialogs.ask(translate("Amarok", "Amarok Database Must Be Configure"),
                                     translate("Amarok",
                                               "Amarok database must be configure for Hamsi Manager. Are you want to configure Amarok database?"))
                if answer == Dialogs.Yes:
                    EmbeddedDBConfigurator()
            else:
                return False
    return checkEmbeddedDB()
Esempio n. 6
0
    def refreshTable(self, _path):
        self.values = []
        fileAndDirectoryNames = fu.readDirectory(_path, "fileAndDirectory",
                                                 uni.getBoolValue("isShowHiddensInFolderTable"))
        allItemNumber = len(fileAndDirectoryNames)
        uni.startThreadAction()
        baseNameOfDirectory = fu.getBaseName(_path)
        rowNo = 0
        self.setRowCount(allItemNumber)
        for baseName in fileAndDirectoryNames:
            isContinueThreadAction = uni.isContinueThreadAction()
            if isContinueThreadAction:
                try:
                    if fu.isReadableFileOrDir(fu.joinPath(_path, baseName), False, True):
                        details = fu.getExtendedDetails(fu.joinPath(_path, baseName))
                        content = {}
                        content["path"] = fu.joinPath(_path, baseName)
                        content["baseNameOfDirectory"] = baseNameOfDirectory
                        content["baseName"] = baseName
                        content.update(details)
                        self.values.append(content)

                        newBaseNameOfDirectory = Organizer.emend(content["baseNameOfDirectory"], "directory")
                        self.createItem(rowNo, "baseNameOfDirectory", newBaseNameOfDirectory,
                                        content["baseNameOfDirectory"])

                        newBaseName = Organizer.emend(content["baseName"], fu.getObjectType(self.values[rowNo]["path"]))
                        self.createItem(rowNo, "baseName", newBaseName, content["baseName"])

                        self.createItem(rowNo, "size", Organizer.getCorrectedFileSize(content["size"]))

                        self.createItem(rowNo, "lastAccessed", Organizer.getCorrectedTime(content["lastAccessed"]))

                        self.createItem(rowNo, "lastModified", Organizer.getCorrectedTime(content["lastModified"]))

                        self.createItem(rowNo, "lastMetadataChanged",
                                        Organizer.getCorrectedTime(content["lastMetadataChanged"]))

                        if not uni.isWindows:
                            self.createItem(rowNo, "accessRights", content["accessRights"])

                            self.createItem(rowNo, "userIDOfOwner", content["userIDOfOwner"])

                            self.createItem(rowNo, "groupIDOfOwner", content["groupIDOfOwner"])

                            self.createItem(rowNo, "numberOfHardLinks", content["numberOfHardLinks"])

                        rowNo += 1
                    else:
                        allItemNumber -= 1
                except:
                    ReportBug.ReportBug()
                    allItemNumber -= 1
            else:
                allItemNumber = rowNo
            Dialogs.showState(translate("Tables", "Generating Table..."), rowNo, allItemNumber, True)
            if isContinueThreadAction is False:
                break
        uni.finishThreadAction()
        self.setRowCount(len(self.values))  # In case of Non Readable Files and Canceled process
Esempio n. 7
0
 def errorOccurred(self):
     self.isFileExist = False
     Dialogs.showError(
         translate("UpdateControl", "Cannot Read Source."),
         translate("UpdateControl",
                   "Cannot read source package. Please retry later."))
     self.close()
Esempio n. 8
0
    def save(self):
        try:
            filePath = str(self.leFilePath.text())
            if self.fileValues is not None:
                from Core import Records

                Records.setTitle(translate("TextCorrector", "Text File"))
                newFileValues = {}
                newFileValues["path"] = filePath
                newFileValues["content"] = str(
                    self.pteFileContent.toPlainText())
                newPath = fu.writeTextFile(self.fileValues, newFileValues,
                                           str(self.charSet.currentText()))
                if newPath != self.fileValues["path"]:
                    self.changeFile(newPath)
                if hasattr(getMainWindow(), "FileManager") and getMainWindow(
                ).FileManager is not None:
                    getMainWindow().FileManager.makeRefresh()
                Records.saveAllRecords()
            else:
                Dialogs.showError(
                    translate("TextCorrector", "File Does Not Exist"),
                    str(
                        translate(
                            "TextDetails",
                            "\"%s\" does not exist.<br>Please select an exist file and try again."
                        )) % Organizer.getLink(str(filePath)))
        except:
            ReportBug.ReportBug()
Esempio n. 9
0
def checkAmarok(_isAlertIfNotAvailable=True, _isUseReadOnly=True):
    global isAskEmbeddedDBConfiguration
    if isLoadedMysql and uni.isAvailableKDE4():
        if uni.getBoolValue("amarokIsUseHost"):
            if _isUseReadOnly or uni.getBoolValue(
                    "isReadOnlyAmarokDBHost") is False:
                return True
            else:
                if _isAlertIfNotAvailable:
                    answer = Dialogs.ask(
                        translate("Amarok", "This Feature Is Not Usable"),
                        translate(
                            "Amarok",
                            "This feature is not usable with read only Amarok database. <br>Are you want to give permission to read and write for Amarok database?"
                        ))
                    if answer == Dialogs.Yes:
                        uni.setMySetting("isReadOnlyAmarokDBHost", False)
                        return True
        else:
            isAskEmbeddedDBConfiguration = True
            return checkEmbeddedDB()
    else:
        if _isAlertIfNotAvailable:
            Dialogs.showError(
                translate("Amarok", "Amarok Module Is Not Usable"),
                translate("Amarok", "Please run Amarok once."))
        return False
    return False
Esempio n. 10
0
 def writeContents(self):
     self.changedValueNumber = 0
     changedArtistValues = []
     uni.startThreadAction()
     allItemNumber = len(self.values)
     Dialogs.showState(translate("FileUtils/Musics", "Writing Music Tags"), 0, allItemNumber, True)
     for rowNo in range(self.rowCount()):
         isContinueThreadAction = uni.isContinueThreadAction()
         if isContinueThreadAction:
             try:
                 if self.isRowHidden(rowNo) is False:
                     if self.isChangeableItem(rowNo, "correctedArtist", str(self.values[rowNo]["currentArtist"])):
                         changedArtistValues.append({})
                         changedArtistValues[-1]["id"] = str(self.values[rowNo]["id"])
                         value = str(self.item(rowNo, 1).text())
                         changedArtistValues[-1]["name"] = value
                         Records.add(str(translate("AmarokArtistTable", "Artist")),
                                     str(self.values[rowNo]["currentArtist"]), value)
                         self.changedValueNumber += 1
             except:
                 ReportBug.ReportBug()
         else:
             allItemNumber = rowNo + 1
         Dialogs.showState(translate("FileUtils/Musics", "Writing Music Tags"), rowNo + 1, allItemNumber, True)
         if isContinueThreadAction is False:
             break
     uni.finishThreadAction()
     Operations.changeArtistValues(changedArtistValues)
     return True
Esempio n. 11
0
 def addImage(self):
     try:
         if self.isActiveAddImage is False:
             self.isActiveAddImage = True
             self.pbtnAddImage.setText(translate("MusicDetails", "OK"))
             self.pbtnSelectImage.show()
             self.leImagePath.show()
             self.lblImagePath.show()
             self.lblImageType.show()
             self.cbImageType.show()
             self.pbtnCancelAddImage.show()
             self.pbtnDeleteImage.hide()
             self.pbtnSaveAsImage.hide()
         else:
             if fu.isFile(self.leImagePath.text()):
                 imageType = Taggers.getTagger().getImageTypesNo()[
                     self.cbImageType.currentIndex()]
                 description = str(imageType)
                 Musics.writeMusicFile(self.musicValues, None, True,
                                       imageType,
                                       str(self.leImagePath.text()),
                                       description)
                 self.changeFile(self.musicFile)
                 self.cancelAddImage()
             else:
                 Dialogs.showError(
                     translate("MusicDetails", "Image Does Not Exist"),
                     str(translate("MusicDetails",
                                   "\"%s\" does not exist.")) %
                     Organizer.getLink(str(self.leImagePath.text())))
     except:
         ReportBug.ReportBug()
Esempio n. 12
0
    def getFromAmarok(self):
        try:
            import Amarok

            Dialogs.showState(translate("CoverTable", "Checking For Amarok..."), 0, 1)
            if Amarok.checkAmarok():
                from Amarok import Operations

                directoriesAndValues = Operations.getDirectoriesAndValues()
                Dialogs.showState(translate("CoverTable", "Values Are Being Processed"), 1, 1)
                if directoriesAndValues is not None:
                    for rowNo in range(self.rowCount()):
                        if (getMainWindow().checkHiddenColumn("sourceCover") and
                                getMainWindow().checkHiddenColumn("destinationCover")):
                            if self.isChangeableItem(rowNo, "sourceCover"):
                                directoryPath = fu.joinPath(
                                    fu.getDirName(fu.getDirName(self.values[rowNo]["path"])),
                                    str(self.item(rowNo, 0).text()), str(self.item(rowNo, 1).text()))
                                if directoryPath in directoriesAndValues:
                                    directoryAndValues = directoriesAndValues[directoryPath]
                                    self.item(rowNo, 3).setText(
                                        directoryAndValues["coverPath"][0].replace(directoryPath, "."))
                                    self.item(rowNo, 4).setText("./" + Organizer.getIconName(
                                        directoryAndValues["artist"][0],
                                        directoryAndValues["album"][0],
                                        directoryAndValues["genre"][0],
                                        directoryAndValues["year"][0]))
        except:
            ReportBug.ReportBug()
Esempio n. 13
0
 def emendDirectoryWithContents(self):
     try:
         _path = self.checkSource(str(QuickMakeParameters[1]), "directory")
         if _path is not None:
             if uni.getBoolValue("isShowQuickMakeWindow"):
                 newEmendedName = str(self.leNewValue.text())
             else:
                 newEmendedName = Organizer.emend(_path, fu.getObjectType(_path))
             fu.activateSmartCheckIcon()
             oldFileName = _path
             newDirName = fu.moveOrChange(oldFileName, newEmendedName, "directory")
             if newDirName != oldFileName:
                 fileAndDirectoryNames = fu.readDirectory(newDirName, "fileAndDirectory")
                 for fileAndDirs in fileAndDirectoryNames:
                     objectType = fu.getObjectType(fu.joinPath(newDirName, fileAndDirs))
                     fu.moveOrChange(fu.joinPath(newDirName, fileAndDirs),
                                     fu.joinPath(newDirName, Organizer.emend(fileAndDirs, objectType)), objectType)
                 if uni.isActiveDirectoryCover and uni.getBoolValue(
                     "isActiveAutoMakeIconToDirectory") and uni.getBoolValue(
                     "isAutoMakeIconToDirectoryWhenFileMove"):
                     fu.checkIcon(newDirName)
                 if fu.isDir(newDirName):
                     fu.completeSmartCheckIcon()
                 Dialogs.show(translate("QuickMake", "Directory And Contents Emended"),
                              str(translate("QuickMake",
                                            "\"%s\" is emended based on the criteria you set.This directory is \"%s\" now.")) %
                              (Organizer.getLink(_path), Organizer.getLink(newDirName)))
         self.close()
     except:
         ReportBug.ReportBug()
Esempio n. 14
0
def createReadOnlyEmbeddedDB(_isNoAlertIfSuccessfully=True):
    stopReadOnlyEmbeddedDB()
    if fu.isDir(fu.pathOfSettingsDirectory + "/Amarok"):
        fu.removeFileOrDir(fu.pathOfSettingsDirectory + "/Amarok")
    fu.makeDirs(fu.pathOfSettingsDirectory + "/Amarok/mysqle")
    fu.copyFileOrDir(
        fu.HamsiManagerDirectory + "/Amarok/EmbeddedDBFiles/mysql",
        fu.pathOfSettingsDirectory + "/Amarok/mysqle/mysql",
    )
    fu.copyFileOrDir(
        fu.HamsiManagerDirectory + "/Amarok/EmbeddedDBFiles/my-readOnly.cnf",
        fu.pathOfSettingsDirectory + "/Amarok/my.cnf")
    MyConfigure.reConfigureFile(fu.pathOfSettingsDirectory + "/Amarok/my.cnf")
    fu.makeDirs(fu.pathOfSettingsDirectory + "/Amarok/mysqle/amarok")
    fu.copyFileOrDir(
        uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/ib_logfile0",
        fu.pathOfSettingsDirectory + "/Amarok/mysqle/ib_logfile0")
    fu.copyFileOrDir(
        uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/ib_logfile1",
        fu.pathOfSettingsDirectory + "/Amarok/mysqle/ib_logfile1")
    fu.copyFileOrDir(
        uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/ibdata1",
        fu.pathOfSettingsDirectory + "/Amarok/mysqle/ibdata1")
    generateReadOnlyEmbeddedD()
    if _isNoAlertIfSuccessfully is False:
        Dialogs.show(
            translate("EmbeddedDBCore", "Created Embedded Server"),
            translate(
                "EmbeddedDBCore",
                "Embedded Amarok database server created and generated."))
    return True
Esempio n. 15
0
    def search(self, _searchValue=""):
        try:
            import re

            if self.setSourceToSearch(False):
                if self.cckbIsRegExp.checkState() == Mt.Checked:
                    searchValueList = [str(self.leSearch.text())]
                else:
                    searchValueList = self.getSearchValueList()
                if len(searchValueList) != 0:
                    searchValueListForToolTip = ""
                    resultOfSearch = ""
                    arrayOfSource = str(self.sourceToSearch).split("\n\r")
                    if len(arrayOfSource) == 1: arrayOfSource = str(self.sourceToSearch).split("\n")
                    if len(arrayOfSource) == 1: arrayOfSource = str(self.sourceToSearch).split("<br>")
                    if len(arrayOfSource) == 1: arrayOfSource = str(self.sourceToSearch).split("<br/>")
                    if len(arrayOfSource) == 1: arrayOfSource = str(self.sourceToSearch).split("<br >")
                    if len(arrayOfSource) == 1: arrayOfSource = str(self.sourceToSearch).split("<br />")
                    for row in arrayOfSource:
                        for searchVal in searchValueList:
                            if self.cckbIsRegExp.checkState() == Mt.Checked:
                                try:
                                    if self.cckbIsCaseInsensitive.checkState() == Mt.Checked:
                                        pattern = re.compile(uni.trUnicode(searchVal), re.I | re.U)
                                        if re.search(pattern, uni.trUnicode(row)) is not None:
                                            resultOfSearch += row + "\n"
                                            break
                                    else:
                                        pattern = re.compile(uni.trUnicode(searchVal), re.U)
                                        if re.search(pattern, uni.trUnicode(row)) is not None:
                                            resultOfSearch += row + "\n"
                                            break
                                except:
                                    Dialogs.show(translate("Searcher", "Incorrect Syntax"), translate("Searcher",
                                                                                                      "Search value is not correct for Regular Expression (RegExp). Please check it and try again."))
                                    return False
                            else:
                                if row.find(searchVal) != -1:
                                    resultOfSearch += row + "\n"
                                    break
                                if self.cckbIsCaseInsensitive.checkState() == Mt.Checked:
                                    pattern = re.compile(re.escape(uni.trUnicode(searchVal)), re.I | re.U)
                                    if re.search(pattern, uni.trUnicode(row)) is not None:
                                        resultOfSearch += row + "\n"
                                        break
                                else:
                                    pattern = re.compile(re.escape(uni.trUnicode(searchVal)), re.U)
                                    if re.search(pattern, uni.trUnicode(row)) is not None:
                                        resultOfSearch += row + "\n"
                                        break
                    for searchVal in searchValueList:
                        searchValueListForToolTip += "'" + searchVal + "', "
                    self.lblSearchListValues.setText(str(searchValueListForToolTip[0:-2]))
                else:
                    resultOfSearch = str(self.sourceToSearch)
                    self.lblSearchListValues.setText(str(""))
                self.teSearchResult.setText(str(resultOfSearch))
        except:
            ReportBug.ReportBug()
Esempio n. 16
0
 def __init__(self, _filePath, _isOpenDetailsOnNewWindow):
     global currentDialogs
     _filePath = fu.checkSource(_filePath, "file")
     if _filePath is not None:
         if _isOpenDetailsOnNewWindow is False:
             isHasOpenedDialog = False
             for dialog in currentDialogs:
                 if dialog.isVisible():
                     isHasOpenedDialog = True
                     dialog.changeFile(_filePath)
                     dialog.activateWindow()
                     dialog.raise_()
                     break
             if isHasOpenedDialog is False:
                 _isOpenDetailsOnNewWindow = True
         if _isOpenDetailsOnNewWindow:
             currentDialogs.append(self)
             MDialog.__init__(self, MApplication.activeWindow())
             if isActivePyKDE4:
                 self.setButtons(MDialog.NoDefault)
             self.charSet = MComboBox()
             self.charSet.addItems(uni.getCharSets())
             self.charSet.setCurrentIndex(self.charSet.findText(uni.MySettings["fileSystemEncoding"]))
             self.infoLabels = {}
             self.infoValues = {}
             self.fileValues = {}
             pbtnClose = MPushButton(translate("TextDetails", "Close"))
             pbtnSave = MPushButton(translate("TextDetails", "Save Changes"))
             pbtnSave.setIcon(MIcon("Images:save.png"))
             MObject.connect(pbtnClose, SIGNAL("clicked()"), self.close)
             MObject.connect(pbtnSave, SIGNAL("clicked()"), self.save)
             self.labels = [translate("TextDetails", "File Path : "),
                            translate("TextDetails", "Content : ")]
             self.pnlMain = MWidget()
             self.vblMain = MVBoxLayout(self.pnlMain)
             self.pnlClearable = None
             self.changeFile(_filePath, True)
             HBOXs, VBOXs = [], []
             VBOXs.append(MVBoxLayout())
             HBOXs.append(MHBoxLayout())
             HBOXs[-1].addWidget(self.charSet, 1)
             HBOXs[-1].addWidget(pbtnSave, 4)
             VBOXs[0].addLayout(HBOXs[-1])
             VBOXs[0].addWidget(pbtnClose)
             self.vblMain.addLayout(VBOXs[0], 1)
             if isActivePyKDE4:
                 self.setMainWidget(self.pnlMain)
             else:
                 self.setLayout(self.vblMain)
             self.show()
             self.setMinimumWidth(700)
             self.setMinimumHeight(500)
     else:
         Dialogs.showError(translate("TextDetails", "File Does Not Exist"),
                           str(translate("TextDetails",
                                         "\"%s\" does not exist.<br>Table will be refreshed automatically!<br>Please retry.")
                           ) % Organizer.getLink(str(_filePath)))
         if hasattr(getMainWindow(),
                    "FileManager") and getMainWindow().FileManager is not None: getMainWindow().FileManager.makeRefresh()
Esempio n. 17
0
def whatDoesSpecialCommandDo(_actionCommand, _isShowAlert=False, _isReturnDetails=False):
    splitterIndex = _actionCommand.index("~||~")
    leftKeys = _actionCommand[:splitterIndex]
    rightKeys = _actionCommand[splitterIndex + 1:]
    if len(leftKeys) > 0 and len(rightKeys) > 0:
        details = ""
        leftNames = ""
        rightNames = ""
        for objectNameAndPoint in leftKeys:
            objectNameAndPointList = objectNameAndPoint.split("~|~")
            objectName = objectNameAndPointList[0]
            point = ""
            if len(objectNameAndPointList) > 1:
                point = objectNameAndPointList[1]
            if objectName.find("Concatenate") == -1:
                leftNames += getMainTable().getColumnNameFromKey(objectName)
            else:
                leftNames += translate("Organizer", "Concatenate")
            if point != "":
                if objectName.find("Concatenate") == -1:
                    leftNames += " " + (str(translate("Organizer", "(can be separated by \"%s\")")) % (point))
                else:
                    leftNames += " " + (str(translate("Organizer", "(can be concatenated by \"%s\")")) % (point))
            if leftKeys[-1] != objectNameAndPoint:
                leftNames += " ,"
        for objectNameAndPoint in rightKeys:
            objectNameAndPointList = objectNameAndPoint.split("~|~")
            objectName = objectNameAndPointList[0]
            point = ""
            if len(objectNameAndPointList) > 1:
                point = objectNameAndPointList[1]
            if objectName.find("Concatenate") == -1:
                rightNames += getMainTable().getColumnNameFromKey(objectName)
            else:
                rightNames += translate("Organizer", "Concatenate")
            if point != "":
                if objectName.find("Concatenate") == -1:
                    rightNames += " " + (str(translate("Organizer", "(can be separated by \"%s\")")) % (point))
                else:
                    rightNames += " " + (str(translate("Organizer", "(can be concatenated by \"%s\")")) % (point))
            if rightKeys[-1] != objectNameAndPoint:
                rightNames += " ,"

        details = str(translate("Organizer",
                                "\"%s\" will be concatenated and/or separated then it will be set as \"%s\" respectively.")) % (
                      leftNames, rightNames)

        if _isShowAlert:
            Dialogs.show(translate("Organizer", "What Does This Command Do?"), str(details))
        if _isReturnDetails is False:
            return True
        else:
            return details
    else:
        Dialogs.showError(translate("Organizer", "Missing Command"),
                          translate("Organizer", "You have to add at least a \"Column\"!.."))
        return False
Esempio n. 18
0
 def showInTable(self):
     try:
         if uni.tableType in ["0", "1", "2", "3", "4", "9"]:
             getMainTable().refresh(self.getCurrentDirectoryPath())
         else:
             Dialogs.toast(translate("Tables", "Please edit query and click to Apply Query Icon."))
             getMainWindow().StatusBar.setTableInfo(uni.getTableTypesNames()[uni.tableType] + str(" : ~ "))
     except:
         ReportBug.ReportBug()
Esempio n. 19
0
 def cellDoubleClickedTable(self, _row, _column):
     try:
         if uni.getBoolValue("isRunOnDoubleClick"):
             self.showTableDetails(_row, _column)
     except:
         Dialogs.showError(translate("SubFolderTable", "Cannot Open File"),
                           str(translate("SubFolderTable",
                                         "\"%s\" : cannot be opened. Please make sure that you selected a text file.")
                           ) % Organizer.getLink(self.values[_row]["path"]))
Esempio n. 20
0
 def backup(self):
     backupEmbeddedDB()
     Dialogs.show(
         translate("EmbeddedDBConfigurator", "Backup Completed"),
         translate(
             "EmbeddedDBConfigurator",
             "Backup successfully completed.<br> You can restore when you want."
         ))
     self.pbtnRestore.setEnabled(isHasEmbeddedDBBackup())
Esempio n. 21
0
 def copyPath(self):
     try:
         _path = self.checkSource(str(QuickMakeParameters[1]), "fileAndDirectory", False)
         if _path is not None:
             MApplication.clipboard().setText(str(_path))
             Dialogs.show(translate("QuickMake", "Copied To Clipboard"),
                          str(translate("QuickMake", "\"%s\" copied to clipboard.")) % Organizer.getLink(_path))
         self.close()
     except:
         ReportBug.ReportBug()
Esempio n. 22
0
 def sourceCharSetChanged(self):
     try:
         if self.isChangeSourceCharSetChanged:
             self.fillValues()
     except:
         self.pbtnSave.setEnabled(False)
         Dialogs.showError(translate("TextCorrector", "Incorrect File Encoding"),
                           str(translate("TextCorrector",
                                         "File can not decode by \"%s\" codec.<br>Please select another file encoding type.")
                           ) % str(self.sourceCharSet.currentText()))
Esempio n. 23
0
 def sourceCharSetChanged(self):
     try:
         self.fileValues = fu.readTextFile(self.fileValues["path"], str(self.sourceCharSet.currentText()))
         self.infoValues["content"].setPlainText(
             str(Organizer.emend(self.fileValues["content"], "text", False, True)))
     except:
         Dialogs.showError(translate("TextDetails", "Incorrect File Encoding"),
                           str(translate("TextDetails",
                                         "File can not decode by \"%s\" codec.<br>Please select another file encoding type.")
                           ) % str(self.sourceCharSet.currentText()))
Esempio n. 24
0
def generateReadOnlyEmbeddedD(_isNoAlertIfSuccessfully=True):
    stopReadOnlyEmbeddedDB()
    if fu.isExist(fu.pathOfSettingsDirectory + "/Amarok/mysqle/amarok"):
        fu.removeFileOrDir(fu.pathOfSettingsDirectory + "/Amarok/mysqle/amarok")
    fu.copyFileOrDir(uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/amarok",
                     fu.pathOfSettingsDirectory + "/Amarok/mysqle/amarok")
    if _isNoAlertIfSuccessfully is False:
        Dialogs.show(translate("EmbeddedDBCore", "Generated Embedded Server"),
                     translate("EmbeddedDBCore", "Embedded Amarok database server generated."))
    return True
Esempio n. 25
0
    def checkScriptManager(_isAlertIfNotAvailable=True):
        try:
            from PyQt4.Qsci import QsciScintilla

            return True
        except:
            if _isAlertIfNotAvailable:
                Dialogs.showError(translate("MenuBar", "Qsci Is Not Installed"),
                                  translate("MenuBar",
                                            "Qsci is not installed on your systems.<br>Please install Qsci on your system and try again."))
            return False
Esempio n. 26
0
 def checkReadOnlyColumn(self, _columnKey, _isAlert=True):
     if _columnKey in self.tableReadOnlyColumnsKey:
         if _isAlert:
             Dialogs.show(
                 translate("Tables", "Read Only Column"),
                 str(
                     translate("Tables",
                               "%s is read only so you can't change it.")) %
                 self.tableColumns[self.tableColumnsKey.index(_columnKey)])
         return False
     return True
Esempio n. 27
0
def findExecutablePath(_executableName, _isAlertIfNotFound=True):
    executableBaseName = findExecutableBaseName(_executableName)
    if executableBaseName is not None:
        return fu.joinPath(fu.HamsiManagerDirectory, executableBaseName)
    if _isAlertIfNotFound:
        from Core import Dialogs

        Dialogs.showError(translate("Execute", "Cannot Find Executable File"),
                          str(translate("Execute",
                                        "\"%s\" : cannot find an executable file matched this name in directory of Hamsi Manager.<br>Please make sure that it exists and retry.")) % _executableName)
    return None
Esempio n. 28
0
 def restore(self):
     answer = Dialogs.ask(translate("Amarok", "Restore Amarok Database"),
                          translate("Amarok", "Are you want to restore backup database?"))
     if answer == Dialogs.Yes:
         if isRunning():
             self.stopEmbeddedDB(True)
         Dialogs.show(translate("EmbeddedDBConfigurator", "Close Amarok"),
                      translate("EmbeddedDBConfigurator", "Please close Amarok if it is running."))
         restoreEmbeddedDB()
         Dialogs.show(translate("EmbeddedDBConfigurator", "Restore Completed"), translate("EmbeddedDBConfigurator",
                                                                                          "Restore successfully completed.<br> You can run Amarok now if you want."))
         self.checkRunState()
Esempio n. 29
0
 def checkIcon(self):
     try:
         _path = self.checkSource(str(QuickMakeParameters[1]), "directory")
         if _path is not None:
             fu.checkIcon(_path)
             Dialogs.show(translate("QuickMake", "Directory Icon Checked"),
                          str(translate("QuickMake",
                                        "\"%s\"`s icon checked.<br>The default action based on the data is executed.")) % Organizer.getLink(
                              _path))
         self.close()
     except:
         ReportBug.ReportBug()
Esempio n. 30
0
 def clearIgnoreds(self):
     try:
         _path = self.checkSource(str(QuickMakeParameters[1]), "directory")
         if _path is not None:
             fu.clearIgnoreds(_path)
             Dialogs.show(translate("QuickMake", "Directory Cleaned"),
                          str(translate("QuickMake",
                                        "\"%s\" is cleaned based on the criteria you set.")) % Organizer.getLink(
                              _path))
         self.close()
     except:
         ReportBug.ReportBug()
Esempio n. 31
0
 def showDetails(self):
     try:
         rowNo = self.currentRow()
         if rowNo != -1:
             self.showTableDetails(rowNo, self.currentColumn())
         else:
             Dialogs.toast(
                 translate("Tables", "Please Select A Row"),
                 translate("Tables",
                           "Please select a row to show details."))
     except:
         ReportBug.ReportBug()
Esempio n. 32
0
def configureEmbeddedDB(_isNoAlertIfSuccessfully=True):
    stopEmbeddedDB()
    backupEmbeddedDB()
    fu.copyDirContent(fu.HamsiManagerDirectory + "/Amarok/EmbeddedDBFiles/mysql",
                      uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/mysql")
    fu.copyFileOrDir(fu.HamsiManagerDirectory + "/Amarok/EmbeddedDBFiles/my.cnf",
                     uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/my.cnf")
    MyConfigure.reConfigureFile(uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/my.cnf")
    if _isNoAlertIfSuccessfully is False:
        Dialogs.show(translate("EmbeddedDBCore", "Created Embedded Server"),
                     translate("EmbeddedDBCore", "Embedded Amarok database server created and generated."))
    return True
Esempio n. 33
0
def stopReadOnlyEmbeddedDB(_isNoAlertIfSuccessfully=True):
    global isReadOnlyStarted
    if isReadOnlyStarted is False:
        return True
    isReadOnlyStarted = False
    mysqldPID = getReadOnlyPID()
    if mysqldPID is not None:
        Execute.execute(["kill", "-TERM", str(mysqldPID)])
        Dialogs.sleep(translate("EmbeddedDBCore", "Stopping Embedded Server..."), 3)
    if _isNoAlertIfSuccessfully is False:
        Dialogs.show(translate("EmbeddedDBCore", "Stopped Embedded Server"),
                     translate("EmbeddedDBCore", "Embedded Amarok database server stopped."))
    return True
Esempio n. 34
0
 def showInTable(self):
     try:
         if uni.tableType in ["0", "1", "2", "3", "4", "9"]:
             getMainTable().refresh(self.getCurrentDirectoryPath())
         else:
             Dialogs.toast(
                 translate(
                     "Tables",
                     "Please edit query and click to Apply Query Icon."))
             getMainWindow().StatusBar.setTableInfo(
                 uni.getTableTypesNames()[uni.tableType] + str(" : ~ "))
     except:
         ReportBug.ReportBug()
Esempio n. 35
0
 def sourceCharSetChanged(self):
     try:
         if self.isChangeSourceCharSetChanged:
             self.fillValues()
     except:
         self.pbtnSave.setEnabled(False)
         Dialogs.showError(
             translate("TextCorrector", "Incorrect File Encoding"),
             str(
                 translate(
                     "TextCorrector",
                     "File can not decode by \"%s\" codec.<br>Please select another file encoding type."
                 )) % str(self.sourceCharSet.currentText()))
Esempio n. 36
0
 def hash(self):
     sourceFile = str(self.lePathOfPackage.text())
     sourceFile = fu.checkSource(sourceFile, "file")
     if sourceFile is not None:
         hashType = str(self.cbHash.currentText())
         if hashType is not None:
             hashDigestContent = fu.getHashDigest(sourceFile, hashType)
             if hashDigestContent is not False:
                 self.teHashDigest.setText(str(hashDigestContent))
                 if self.cbHashOutput.currentIndex() == 1:
                     if fu.createHashDigestFile(sourceFile, str(self.leHashDigestFile.text()), hashType, False,
                                                hashDigestContent):
                         Dialogs.show(translate("Hasher", "Hash Digest File Created"),
                                      str(translate("Hasher", "Hash digest writed into %s")) % str(
                                          self.leHashDigestFile.text()))
                     else:
                         Dialogs.showError(translate("Hasher", "Hash Digest File Is Not Created"),
                                           translate("Hasher", "Hash digest file not cteated."))
                 elif self.cbHashOutput.currentIndex() == 2:
                     MApplication.clipboard().setText(str(hashDigestContent))
                     Dialogs.show(translate("Hasher", "Hash Digest Copied To Clipboard"),
                                  str(translate("Hasher",
                                                "Hash digest copied to clipboard.Hash digest is : <br>%s")) % hashDigestContent)
             else:
                 Dialogs.showError(translate("Hasher", "Hash Digest Is Not Created"),
                                   translate("Hasher", "Hash digest not cteated."))
Esempio n. 37
0
 def isReadOnlyRunning(self):
     try:
         if isReadOnlyRunning():
             self.pbtnStopEmbeddedDB.setEnabled(True)
             self.pbtnStartEmbeddedDB.setEnabled(False)
             Dialogs.show(translate("EmbeddedDBConfigurator", "Running Embedded Server"),
                          translate("EmbeddedDBConfigurator", "Embedded Amarok database server is running."))
         else:
             self.pbtnStopEmbeddedDB.setEnabled(False)
             self.pbtnStartEmbeddedDB.setEnabled(True)
             Dialogs.show(translate("EmbeddedDBConfigurator", "Not Running Embedded Server"),
                          translate("EmbeddedDBConfigurator", "Embedded Amarok database server is not running."))
     except:
         ReportBug.ReportBug()
Esempio n. 38
0
    def install(self, _fileName):
        if self.isNotInstall is False and uni.isBuilt():
            self.setWindowTitle(translate("UpdateControl", "Installing The Latest Release"))
            self.lblInfo.setText(translate("UpdateControl", "Latest release downloaded, initializing installation."))
            from Core.Execute import openWith

            openWith([str(_fileName)])
            self.close()
            self.parent().close()
        else:
            Dialogs.show(translate("UpdateControl", "The New Version Downloaded"),
                         translate("UpdateControl",
                                   "New version of Hamsi Manager downloaded, you can install it manually."))
            self.close()
Esempio n. 39
0
 def sendFinished(self, _nrpBack):
     try:
         Dialogs.showState(translate("SuggestIdea", "Sending Your Idea"),
                           100, 100)
         if _nrpBack.error() == MNetworkReply.NoError:
             Dialogs.show(
                 translate("SuggestIdea",
                           "Suggestion Received Successfully"),
                 translate(
                     "SuggestIdea",
                     "Thank you for sending us your idea. You have contributed a lot to make the next release even better."
                 ))
             self.close()
         elif _nrpBack.error() == MNetworkReply.OperationCanceledError:
             Dialogs.show(
                 translate("SuggestIdea", "Suggestion Canceled"),
                 translate("SuggestIdea",
                           "Suggestion canceled successfully."))
         else:
             Dialogs.show(
                 translate("SuggestIdea", "An Error Has Occurred."),
                 translate(
                     "SuggestIdea",
                     "An unknown error has occurred. Please try again."))
         uni.isCanBeShowOnMainWindow = True
         self.namMain = None
         self.nrqPost = None
         self.nrpBack = None
     except:
         ReportBug.ReportBug()
Esempio n. 40
0
def generateReadOnlyEmbeddedD(_isNoAlertIfSuccessfully=True):
    stopReadOnlyEmbeddedDB()
    if fu.isExist(fu.pathOfSettingsDirectory + "/Amarok/mysqle/amarok"):
        fu.removeFileOrDir(fu.pathOfSettingsDirectory +
                           "/Amarok/mysqle/amarok")
    fu.copyFileOrDir(
        uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/amarok",
        fu.pathOfSettingsDirectory + "/Amarok/mysqle/amarok")
    if _isNoAlertIfSuccessfully is False:
        Dialogs.show(
            translate("EmbeddedDBCore", "Generated Embedded Server"),
            translate("EmbeddedDBCore",
                      "Embedded Amarok database server generated."))
    return True
Esempio n. 41
0
def changeArtistValues(_values):
    uni.startThreadAction()
    allItemNumber = len(_values)
    Dialogs.showState(translate("Amarok/Operations", "Writing Music Tags"), 0, allItemNumber, True)
    for x, value in enumerate(_values):
        isContinueThreadAction = uni.isContinueThreadAction()
        if isContinueThreadAction:
            try:
                musicFilePathAndArtist = Commands.changeArtistValue(value)
                if musicFilePathAndArtist is not None:
                    artistName = musicFilePathAndArtist[0]
                    for musicFilePath in musicFilePathAndArtist[1]:
                        if fu.isWritableFileOrDir(musicFilePath, False, True):
                            Records.add(str(translate("Amarok/Operations", "File will be updated")), str(musicFilePath))
                            currentArtistName = ""
                            tagger = Taggers.getTagger()
                            if tagger is not None:
                                try:
                                    tagger.loadFileForWrite(musicFilePath)
                                    currentArtistName = tagger.getArtist()
                                except:
                                    tagger.loadFileForWrite(musicFilePath)
                                tagger.setArtist(artistName)
                                tagger.update()
                                Records.add(str(translate("Amarok/Operations", "Artist")), str(currentArtistName),
                                            artistName)
                    for musicFilePath in musicFilePathAndArtist[2]:
                        if fu.isWritableFileOrDir(musicFilePath, False, True):
                            Records.add(str(translate("Amarok/Operations", "File will be updated")), str(musicFilePath))
                            currentArtistName = ""
                            tagger = Taggers.getTagger()
                            if tagger is not None:
                                try:
                                    tagger.loadFileForWrite(musicFilePath)
                                    currentArtistName = tagger.getAlbumArtist()
                                except:
                                    tagger.loadFileForWrite(musicFilePath)
                                tagger.setAlbumArtist(artistName)
                                tagger.update()
                                Records.add(str(translate("Amarok/Operations", "albumArtist")), str(currentArtistName),
                                            artistName)
            except:
                ReportBug.ReportBug()
        else:
            allItemNumber = x + 1
        Dialogs.showState(translate("Amarok/Operations", "Writing Music Tags"), x + 1, allItemNumber, True)
        if isContinueThreadAction is False:
            break
    uni.finishThreadAction()
Esempio n. 42
0
def findExecutablePath(_executableName, _isAlertIfNotFound=True):
    executableBaseName = findExecutableBaseName(_executableName)
    if executableBaseName is not None:
        return fu.joinPath(fu.HamsiManagerDirectory, executableBaseName)
    if _isAlertIfNotFound:
        from Core import Dialogs

        Dialogs.showError(
            translate("Execute", "Cannot Find Executable File"),
            str(
                translate(
                    "Execute",
                    "\"%s\" : cannot find an executable file matched this name in directory of Hamsi Manager.<br>Please make sure that it exists and retry."
                )) % _executableName)
    return None
Esempio n. 43
0
def startReadOnlyEmbeddedDB(_isNoAlertIfSuccessfully=True):
    global isReadOnlyStarted
    if isReadOnlyStarted:
        return True
    if uni.checkMysqldSafe():
        Execute.executeWithThread(
            [uni.MySettings["pathOfMysqldSafe"], "--defaults-file=" + fu.pathOfSettingsDirectory + "/Amarok/my.cnf"])
        Dialogs.sleep(translate("EmbeddedDBCore", "Starting Embedded Server..."), 3)
        if _isNoAlertIfSuccessfully is False:
            Dialogs.show(translate("EmbeddedDBCore", "Started Embedded Server"),
                         translate("EmbeddedDBCore", "Embedded Amarok database server started."))
        isReadOnlyStarted = True
        return True
    isReadOnlyStarted = False
    return False
Esempio n. 44
0
 def selectInstallationDirectory(self):
     insDir = Dialogs.getExistingDirectory(
         translate("Install",
                   "Please select a folder for installation."),
         self.leInstallationDirectory.text())
     if insDir is not None:
         self.leInstallationDirectory.setText(str(insDir))
Esempio n. 45
0
 def checkUnSavedValues(self, _isForceToCheck=False):
     if uni.getBoolValue("isCheckUnSavedValues") or _isForceToCheck:
         isClose = True
         for rowNo in range(self.rowCount()):
             if isClose is False:
                 break
             if self.isRowHidden(rowNo):
                 isClose = False
                 break
             for columnNo in range(len(self.tableColumns)):
                 if self.isColumnHidden(columnNo) is False:
                     if self.item(rowNo, columnNo) is not None:
                         if self.item(rowNo,
                                      columnNo).background() == MBrush(
                                          MColor(142, 199, 255)):
                             isClose = False
                             break
                     else:
                         break
         if isClose is False:
             answer = Dialogs.ask(
                 translate("Tables", "There Are Unsaved Values"),
                 translate(
                     "Tables",
                     "Do you want to save these values?<br>If you click to Yes : Table will be saved without any other question or option.<br>If you click to No : Application will be closed without doing any process.<br>If you click to Cancel : Application won't be closed."
                 ), True)
             if answer == Dialogs.Yes:
                 self.save()
             elif answer == Dialogs.Cancel:
                 return False
     return True
Esempio n. 46
0
def stopReadOnlyEmbeddedDB(_isNoAlertIfSuccessfully=True):
    global isReadOnlyStarted
    if isReadOnlyStarted is False:
        return True
    isReadOnlyStarted = False
    mysqldPID = getReadOnlyPID()
    if mysqldPID is not None:
        Execute.execute(["kill", "-TERM", str(mysqldPID)])
        Dialogs.sleep(
            translate("EmbeddedDBCore", "Stopping Embedded Server..."), 3)
    if _isNoAlertIfSuccessfully is False:
        Dialogs.show(
            translate("EmbeddedDBCore", "Stopped Embedded Server"),
            translate("EmbeddedDBCore",
                      "Embedded Amarok database server stopped."))
    return True
Esempio n. 47
0
 def triggered(self, _action):
     try:
         if _action.objectName() == "Edit Bookmarks":
             getMainWindow().FileManager.bookmarks.makeRefresh()
             getMainWindow().FileManager.bookmarks.show()
             return
         for info in BookmarksOfDirectories.fetchAll():
             if info[1] == str(_action.objectName()):
                 if fu.isDir(str(info[2])):
                     getMainWindow().FileManager.goTo(str(info[2]))
                     return
                 else:
                     answer = Dialogs.ask(
                         translate("BookmarksMenu", "Cannot Find Folder"),
                         str(
                             translate(
                                 "BookmarksMenu",
                                 "\"%s\" cannot be found.<br>Delete this folder from the bookmarks?"
                             )) % Organizer.getLink(info[1]))
                     if answer == Dialogs.Yes:
                         BookmarksOfDirectories.delete(str(info[0]))
                         self.makeRefresh()
                         getMainWindow().FileManager.bookmarks.makeRefresh()
         getMainWindow().FileManager.makeRefreshOnlyFileList()
         getMainWindow().FileManager.makeRefreshOnlyFileListByTree()
     except:
         ReportBug.ReportBug()
Esempio n. 48
0
 def closeEvent(self, _event):
     if self.isInstallFinished is False:
         currentAnswer = Dialogs.ask(
             translate("Install", "Finalizing Installation"),
             translate("Install", "Are You Sure You Want To Quit?"))
         if currentAnswer != Dialogs.Yes:
             _event.ignore()