Exemplo n.º 1
0
    def __init__(self, _parent):
        MToolBar.__init__(self, _parent)
        _parent.addToolBar(Mt.TopToolBarArea, self)
        self.setWindowTitle(translate("ToolsBar", "Tools"))
        self.setObjectName("Tools")
        self.clearEmptyDirectories = MAction(
            MIcon("Images:clearEmptyDirectories.png"),
            translate("ToolsBar", "Clear Empty Directories"), self)
        self.clearEmptyDirectories.setObjectName("Clear Empty Directories")
        self.clearEmptyDirectories.setToolTip(
            translate("ToolsBar",
                      "Clears the folder contents based on the criteria set."))
        if uni.isActiveDirectoryCover:
            self.actCheckIcon = MAction(MIcon("Images:checkIcon.png"),
                                        translate("ToolsBar", "Check Icon"),
                                        self)
            self.actCheckIcon.setObjectName("Check Icon")
            self.actCheckIcon.setToolTip(
                translate(
                    "ToolsBar",
                    "Checks the icon for the folder you are currently in."))
        self.actHash = MAction(MIcon("Images:hash.png"),
                               translate("ToolsBar", "Hash"), self)
        self.actHash.setObjectName("Hash")
        self.actHash.setToolTip(translate("ToolsBar", "Hash manager"))
        self.actPack = MAction(MIcon("Images:pack.png"),
                               translate("ToolsBar", "Pack"), self)
        self.actPack.setObjectName("Pack")
        self.actPack.setToolTip(
            translate("ToolsBar", "Packs the current folder."))
        self.actFileTree = MAction(MIcon("Images:fileTree.png"),
                                   translate("ToolsBar", "File Tree"), self)
        self.actFileTree.setObjectName("File Tree")
        self.actFileTree.setToolTip(
            translate("ToolsBar", "Get file tree of current folder."))
        self.actClear = MAction(MIcon("Images:clear.png"),
                                translate("ToolsBar", "Clear"), self)
        self.actClear.setObjectName("Clear")
        self.actClear.setToolTip(
            translate("ToolsBar", "Clears the current folder."))
        self.actTextCorrector = MAction(
            MIcon("Images:textCorrector.png"),
            translate("ToolsBar", "Text Corrector"), self)
        self.actTextCorrector.setObjectName("Text Corrector")
        self.actTextCorrector.setToolTip(
            translate("ToolsBar", "Corrects text files."))
        self.actRemoveOnlySubFiles = MAction(
            MIcon("Images:removeOnlySubFiles.png"),
            translate("ToolsBar", "Remove Sub Files"), self)
        self.actRemoveOnlySubFiles.setObjectName("Remove Sub Files")
        self.actRemoveOnlySubFiles.setToolTip(
            translate(
                "ToolsBar",
                "Remove only all sub files.Do not will remove directory and subfolders."
            ))
        self.actSearch = MAction(MIcon("Images:search.png"),
                                 translate("ToolsBar", "Search"), self)
        self.actSearch.setObjectName("Search")
        self.actSearch.setToolTip(translate("ToolsBar", "Special search tool"))
        self.actScriptManager = MAction(
            MIcon("Images:scriptManager.png"),
            translate("ToolsBar", "Script Manager"), self)
        self.actScriptManager.setObjectName("Script Manager")
        self.actScriptManager.setToolTip(
            translate("ToolsBar", "You can do what you want."))
        if uni.getBoolValue("isSaveActions"):
            self.actLastActions = MAction(
                MIcon("Images:lastActions.png"),
                translate("ToolsBar", "Show Last Actions"), self)
            self.actLastActions.setObjectName("Show Last Actions")
            self.actLastActions.setToolTip(
                translate("ToolsBar", "You can see last actions."))
        if uni.isActiveAmarok and uni.getBoolValue("amarokIsUseHost") is False:
            self.actAmarokEmbeddedDBConfigurator = MAction(
                MIcon("Images:amarokEmbeddedDBConfigurator.png"),
                translate("ToolsBar", "Amarok Embedded Database Configurator"),
                self)
            self.actAmarokEmbeddedDBConfigurator.setObjectName(
                "Amarok Embedded Database Configurator")
            self.actAmarokEmbeddedDBConfigurator.setToolTip(
                translate("ToolsBar", "Packs the current folder."))
        self.addAction(self.actHash)
        self.addAction(self.actPack)
        self.addAction(self.actFileTree)
        self.addAction(self.actClear)
        self.addAction(self.actTextCorrector)
        self.addAction(self.actSearch)
        self.addAction(self.actScriptManager)
        if uni.getBoolValue("isSaveActions"):
            self.addAction(self.actLastActions)
        if uni.isActiveAmarok and uni.getBoolValue("amarokIsUseHost") is False:
            self.addAction(self.actAmarokEmbeddedDBConfigurator)
        self.addSeparator()
        self.addAction(self.clearEmptyDirectories)
        self.addAction(self.actRemoveOnlySubFiles)
        if uni.isActiveDirectoryCover:
            self.addAction(self.actCheckIcon)
        self.setIconSize(MSize(16, 16))
        getMainWindow().Menu.mTools = MMenu(translate("MenuBar", "Tools"),
                                            self)
        getMainWindow().Menu.mTools.setObjectName("Tools")
        getMainWindow().Menu.mTools.addAction(
            Bars.getCopyOfMAction(self.actHash))
        getMainWindow().Menu.mTools.addAction(
            Bars.getCopyOfMAction(self.actPack))
        getMainWindow().Menu.mTools.addAction(
            Bars.getCopyOfMAction(self.actFileTree))
        getMainWindow().Menu.mTools.addAction(
            Bars.getCopyOfMAction(self.actClear))
        getMainWindow().Menu.mTools.addAction(
            Bars.getCopyOfMAction(self.actTextCorrector))
        getMainWindow().Menu.mTools.addAction(
            Bars.getCopyOfMAction(self.actSearch))
        getMainWindow().Menu.mTools.addAction(
            Bars.getCopyOfMAction(self.actScriptManager))
        if uni.getBoolValue("isSaveActions"):
            getMainWindow().Menu.mTools.addAction(
                Bars.getCopyOfMAction(self.actLastActions))
        if uni.isActiveAmarok and uni.getBoolValue("amarokIsUseHost") is False:
            getMainWindow().Menu.mTools.addAction(
                Bars.getCopyOfMAction(self.actAmarokEmbeddedDBConfigurator))
        getMainWindow().Menu.mTools.addSeparator()
        getMainWindow().Menu.mTools.addAction(
            Bars.getCopyOfMAction(self.clearEmptyDirectories))
        getMainWindow().Menu.mTools.addAction(
            Bars.getCopyOfMAction(self.actRemoveOnlySubFiles))
        if uni.isActiveDirectoryCover:
            getMainWindow().Menu.mTools.addAction(
                Bars.getCopyOfMAction(self.actCheckIcon))
        getMainWindow().Menu.insertMenu(
            getMainWindow().Menu.mSettings.menuAction(),
            getMainWindow().Menu.mTools)
        self.createScriptsMenu(_parent)

        MObject.connect(self, SIGNAL("actionTriggered(QAction *)"),
                        Bars.clickedAnAction)
Exemplo n.º 2
0
    def __init__(self, _parent):
        MToolBar.__init__(self, _parent)
        _parent.addToolBar(Mt.TopToolBarArea, self)
        self.setWindowTitle(translate("ToolsBar", "Tools"))
        self.setObjectName("Tools")
        self.clearEmptyDirectories = MAction(MIcon("Images:clearEmptyDirectories.png"),
                                             translate("ToolsBar", "Clear Empty Directories"), self)
        self.clearEmptyDirectories.setObjectName("Clear Empty Directories")
        self.clearEmptyDirectories.setToolTip(
            translate("ToolsBar", "Clears the folder contents based on the criteria set."))
        if uni.isActiveDirectoryCover:
            self.actCheckIcon = MAction(MIcon("Images:checkIcon.png"),
                                        translate("ToolsBar", "Check Icon"), self)
            self.actCheckIcon.setObjectName("Check Icon")
            self.actCheckIcon.setToolTip(translate("ToolsBar", "Checks the icon for the folder you are currently in."))
        self.actHash = MAction(MIcon("Images:hash.png"),
                               translate("ToolsBar", "Hash"), self)
        self.actHash.setObjectName("Hash")
        self.actHash.setToolTip(translate("ToolsBar", "Hash manager"))
        self.actPack = MAction(MIcon("Images:pack.png"),
                               translate("ToolsBar", "Pack"), self)
        self.actPack.setObjectName("Pack")
        self.actPack.setToolTip(translate("ToolsBar", "Packs the current folder."))
        self.actFileTree = MAction(MIcon("Images:fileTree.png"),
                                   translate("ToolsBar", "File Tree"), self)
        self.actFileTree.setObjectName("File Tree")
        self.actFileTree.setToolTip(translate("ToolsBar", "Get file tree of current folder."))
        self.actClear = MAction(MIcon("Images:clear.png"),
                                translate("ToolsBar", "Clear"), self)
        self.actClear.setObjectName("Clear")
        self.actClear.setToolTip(translate("ToolsBar", "Clears the current folder."))
        self.actTextCorrector = MAction(MIcon("Images:textCorrector.png"),
                                        translate("ToolsBar", "Text Corrector"), self)
        self.actTextCorrector.setObjectName("Text Corrector")
        self.actTextCorrector.setToolTip(translate("ToolsBar", "Corrects text files."))
        self.actRemoveOnlySubFiles = MAction(MIcon("Images:removeOnlySubFiles.png"),
                                             translate("ToolsBar", "Remove Sub Files"), self)
        self.actRemoveOnlySubFiles.setObjectName("Remove Sub Files")
        self.actRemoveOnlySubFiles.setToolTip(
            translate("ToolsBar", "Remove only all sub files.Do not will remove directory and subfolders."))
        self.actSearch = MAction(MIcon("Images:search.png"),
                                 translate("ToolsBar", "Search"), self)
        self.actSearch.setObjectName("Search")
        self.actSearch.setToolTip(translate("ToolsBar", "Special search tool"))
        self.actScriptManager = MAction(MIcon("Images:scriptManager.png"),
                                        translate("ToolsBar", "Script Manager"), self)
        self.actScriptManager.setObjectName("Script Manager")
        self.actScriptManager.setToolTip(translate("ToolsBar", "You can do what you want."))
        if uni.getBoolValue("isSaveActions"):
            self.actLastActions = MAction(MIcon("Images:lastActions.png"),
                                          translate("ToolsBar", "Show Last Actions"), self)
            self.actLastActions.setObjectName("Show Last Actions")
            self.actLastActions.setToolTip(translate("ToolsBar", "You can see last actions."))
        if uni.isActiveAmarok and uni.getBoolValue("amarokIsUseHost") is False:
            self.actAmarokEmbeddedDBConfigurator = MAction(MIcon("Images:amarokEmbeddedDBConfigurator.png"),
                                                           translate("ToolsBar",
                                                                     "Amarok Embedded Database Configurator"), self)
            self.actAmarokEmbeddedDBConfigurator.setObjectName("Amarok Embedded Database Configurator")
            self.actAmarokEmbeddedDBConfigurator.setToolTip(translate("ToolsBar", "Packs the current folder."))
        self.addAction(self.actHash)
        self.addAction(self.actPack)
        self.addAction(self.actFileTree)
        self.addAction(self.actClear)
        self.addAction(self.actTextCorrector)
        self.addAction(self.actSearch)
        self.addAction(self.actScriptManager)
        if uni.getBoolValue("isSaveActions"):
            self.addAction(self.actLastActions)
        if uni.isActiveAmarok and uni.getBoolValue("amarokIsUseHost") is False:
            self.addAction(self.actAmarokEmbeddedDBConfigurator)
        self.addSeparator()
        self.addAction(self.clearEmptyDirectories)
        self.addAction(self.actRemoveOnlySubFiles)
        if uni.isActiveDirectoryCover:
            self.addAction(self.actCheckIcon)
        self.setIconSize(MSize(16, 16))
        getMainWindow().Menu.mTools = MMenu(translate("MenuBar", "Tools"), self)
        getMainWindow().Menu.mTools.setObjectName("Tools")
        getMainWindow().Menu.mTools.addAction(Bars.getCopyOfMAction(self.actHash))
        getMainWindow().Menu.mTools.addAction(Bars.getCopyOfMAction(self.actPack))
        getMainWindow().Menu.mTools.addAction(Bars.getCopyOfMAction(self.actFileTree))
        getMainWindow().Menu.mTools.addAction(Bars.getCopyOfMAction(self.actClear))
        getMainWindow().Menu.mTools.addAction(Bars.getCopyOfMAction(self.actTextCorrector))
        getMainWindow().Menu.mTools.addAction(Bars.getCopyOfMAction(self.actSearch))
        getMainWindow().Menu.mTools.addAction(Bars.getCopyOfMAction(self.actScriptManager))
        if uni.getBoolValue("isSaveActions"):
            getMainWindow().Menu.mTools.addAction(Bars.getCopyOfMAction(self.actLastActions))
        if uni.isActiveAmarok and uni.getBoolValue("amarokIsUseHost") is False:
            getMainWindow().Menu.mTools.addAction(Bars.getCopyOfMAction(self.actAmarokEmbeddedDBConfigurator))
        getMainWindow().Menu.mTools.addSeparator()
        getMainWindow().Menu.mTools.addAction(Bars.getCopyOfMAction(self.clearEmptyDirectories))
        getMainWindow().Menu.mTools.addAction(Bars.getCopyOfMAction(self.actRemoveOnlySubFiles))
        if uni.isActiveDirectoryCover:
            getMainWindow().Menu.mTools.addAction(Bars.getCopyOfMAction(self.actCheckIcon))
        getMainWindow().Menu.insertMenu(getMainWindow().Menu.mSettings.menuAction(), getMainWindow().Menu.mTools)
        self.createScriptsMenu(_parent)

        MObject.connect(self, SIGNAL("actionTriggered(QAction *)"), Bars.clickedAnAction)