Exemplo n.º 1
0
Arquivo: gui.py Projeto: vertrex/DFF
class GUI(QApplication, UI):
    def __init__(self, arguments):
        """Launch GUI"""
        self.arguments = arguments
        QApplication.__init__(self, sys.argv)
        UI.__init__(self, arguments)
        self.translator = Translator()
        self.translator.addTranslationPath("dff/ui/gui/i18n/Dff_pro_")
        self.translator.addTranslationPath("dff/modules/i18n/Dff_pro_modules_")
        self.translator.loadLanguage()
        self.setApplicationName("Digital Forensics Framework")
        # Below are macros replaced by CMake using configure_file please don't
        # commit this file with macros replaced, view those macros definition
        # in the top level CMakeLists.txt
        self.setApplicationVersion(dff.VERSION)
        pixmap = QPixmap(":splash.png")
        self.splash = SplashScreen(pixmap, Qt.WindowStaysOnTopHint,
                                   self.applicationVersion())
        self.splash.setMask(pixmap.mask())

    def createMainWindow(self):
        return MainWindow(self, self.arguments.debug)

    def launch(self, modulesPaths=None, defaultConfig=None):
        self.splash.show()
        if modulesPaths or defaultConfig:
            self.loadModules(modulesPaths, self.splash.showMessage,
                             defaultConfig)

        self.mainWindow = self.createMainWindow()
        self.mainWindow.initDockWidgets()
        self.translator.loadLanguage()
        self.mainWindow.show()
        self.splash.finish(self.mainWindow)
        sys.exit(self.exec_())