Ejemplo n.º 1
0
    def __init__(self):
        super().__init__()
        
        resolution = Qt.QDesktopWidget().screenGeometry()
        self.resize(resolution.width() // 1.5, resolution.height() // 1.5)
        self.setWindowIcon(Qt.QIcon('pythonlogo.png'))
        self.setWindowTitle("Spectr")
        self.mode = 'Dual beam mode'
        self.exporters = exporters
        self.old_val_bar = False
        self.q_stop = Queue()
        self.q_bar = Queue()
        self.q_str = Queue()
        self.speed_nm = 128
        work_data = '\data'
        self.start = False  
        path = os.getcwd()
        self.work_space = path + work_data
        print(path)
        try:              
            os.mkdir(self.work_space)
            
        except OSError:  
            print ("Creation of the directory %s failed" % path)   
                     
        print(self.work_space)
#         print('data'in work_space)
        self.j = 0
        self.init_gui()
Ejemplo n.º 2
0
def run_example(example, size, title):
    if title is None:
        title = '%s - %s - %s' % (example.__name__, 'ModernGL', 'PyQt5')

    fmt = Q.QSurfaceFormat.defaultFormat()
    fmt.setVersion(4, 5)
    fmt.setProfile(fmt.CoreProfile)
    fmt.setDepthBufferSize(24)
    Q.QSurfaceFormat.setDefaultFormat(fmt)
    Q.QCoreApplication.setAttribute(Q.Qt.AA_ShareOpenGLContexts)

    qtapp = Q.QApplication([])

    with SignalWakeupHandler(qtapp):
        signal.signal(signal.SIGINT, lambda *a: qtapp.quit())
        wnd = QGLControllerWidget(example)
        wnd.setWindowTitle(title)

        if size == 'fullscreen':
            wnd.showFullScreen()

        else:
            wnd.setFixedSize(size[0], size[1])
            wnd.move(Q.QDesktopWidget().rect().center() - wnd.rect().center())
            wnd.show()

        sys.exit(qtapp.exec_())
Ejemplo n.º 3
0
 def __init__(self):
     super().__init__()
     resolution = Qt.QDesktopWidget().screenGeometry()
     self.resize(resolution.width() // 2, resolution.height() // 2)
     self.setWindowTitle("Spectr")
     self.setWindowIcon(
         Qt.QIcon('C:\\Users\\FRostNOva\\Desktop\\Python\\pythonlogo.png'))
     self.init_gui()
Ejemplo n.º 4
0
    def _show_progress_main_window(self):
        res = Qt.QDesktopWidget().screenGeometry()

        self._main_wnd_progress = QProgressMainWindow(self._addr)
        x = (res.width() - self._main_wnd_progress.width()) // 2
        y = (res.height() - self._main_wnd_progress.height()) // 2

        self._main_wnd_progress.move(Qt.QPoint(x, y))
        self._main_wnd_progress.set_waiting()
        self._main_wnd_progress.show()
Ejemplo n.º 5
0
    def addWidgets(self):
        self.mainWidget = Qt.QWidget(self)
        box = Qt.QVBoxLayout(self.mainWidget)

        menubar = self.menuBar()

        actionLoad = Qt.QAction(self.tr("Load Addons"), self)
        actionLoad.setShortcut("Ctrl+L")
        actionLoad.setStatusTip(self.tr("Re/Load your addons configuration"))
        actionLoad.triggered.connect(self.loadAddons)

        actionSave = Qt.QAction(self.tr("Save Addons"), self)
        actionSave.setShortcut("Ctrl+S")
        actionSave.setStatusTip(self.tr("Save your addons configuration"))
        actionSave.triggered.connect(self.saveAddons)

        actionImport = Qt.QAction(self.tr("Import Addons"), self)
        actionImport.setStatusTip(self.tr("Import Addons from WoW installation"))
        actionImport.triggered.connect(self.importAddons)

        actionPrefs = Qt.QAction(self.tr("Preferences"), self)
        actionPrefs.setShortcut("Ctrl+P")
        actionPrefs.setStatusTip(self.tr("Change preferences like wow install folder"))
        actionPrefs.triggered.connect(self.openPreferences)

        actionExit = Qt.QAction(self.tr("Exit"), self)
        actionExit.setShortcuts(Qt.QKeySequence.Quit)
        actionExit.setStatusTip(self.tr("Exit application"))
        actionExit.triggered.connect(self.close)

        menuFile = menubar.addMenu(self.tr("General"))
        menuFile.addAction(actionLoad)
        menuFile.addAction(actionSave)
        menuFile.addAction(actionImport)
        menuFile.addSeparator()
        menuFile.addAction(actionPrefs)
        menuFile.addSeparator()
        menuFile.addAction(actionExit)
        self.addAction(actionLoad)
        self.addAction(actionSave)
        self.addAction(actionPrefs)
        self.addAction(actionExit)

        actionCheckAll = Qt.QAction(self.tr("Check all addons"), self)
        actionCheckAll.setShortcut('Ctrl+Shift+A')
        actionCheckAll.setStatusTip(self.tr("Check all addons for new version"))
        actionCheckAll.triggered.connect(self.checkAddonsForUpdate)

        actionCheck = Qt.QAction(self.tr("Check addon"), self)
        actionCheck.setShortcut('Ctrl+A')
        actionCheck.setStatusTip(self.tr("Check currently selected addon for new version"))
        actionCheck.triggered.connect(self.checkAddonForUpdate)

        actionUpdateAll = Qt.QAction(self.tr("Update all addons"), self)
        actionUpdateAll.setShortcut("Ctrl+Shift+U")
        actionUpdateAll.setStatusTip(self.tr("Update all addons which need an update"))
        actionUpdateAll.triggered.connect(self.updateAddons)

        actionUpdate = Qt.QAction(self.tr("Update addon"), self)
        actionUpdate.setShortcut("Ctrl+U")
        actionUpdate.setStatusTip(self.tr("Update currently selected addons if needed"))
        actionUpdate.triggered.connect(self.updateAddon)

        actionAdd = Qt.QAction(self.tr("Add addon"), self)
        actionAdd.setStatusTip(self.tr("Add a new addon"))
        actionAdd.triggered.connect(self.addAddon)

        actionRemove = Qt.QAction(self.tr("Remove addon"), self)
        actionRemove.setStatusTip(self.tr("Remove currently selected addon"))
        actionRemove.triggered.connect(self.removeAddon)

        actionForceUpdate = Qt.QAction(self.tr("Force update addon"), self)
        actionForceUpdate.setShortcut("Ctrl+F")
        actionForceUpdate.setStatusTip(self.tr("Force update of currently selected addon"))
        actionForceUpdate.triggered.connect(self.forceUpdateAddon)

        menuAddons = menubar.addMenu(self.tr("Addons"))
        menuAddons.addAction(actionCheckAll)
        menuAddons.addAction(actionCheck)
        menuAddons.addSeparator()
        menuAddons.addAction(actionUpdateAll)
        menuAddons.addAction(actionUpdate)
        menuAddons.addSeparator()
        menuAddons.addAction(actionAdd)
        menuAddons.addAction(actionRemove)
        menuAddons.addAction(actionForceUpdate)
        toolbar = self.addToolBar(self.tr("Addons"))
        toolbar.addAction(actionUpdateAll)
        toolbar.addAction(actionAdd)
        self.addAction(actionCheckAll)
        self.addAction(actionCheck)
        self.addAction(actionUpdateAll)
        self.addAction(actionUpdate)
        self.addAction(actionForceUpdate)

        actionCatalogUpdate = Qt.QAction(self.tr("Update Catalog"), self)
        actionCatalogUpdate.setStatusTip(self.tr("Retrieve a list of available addons"))
        actionCatalogUpdate.triggered.connect(self.updateCatalog)
        menuCatalog = menubar.addMenu(self.tr("Catalog"))
        menuCatalog.addAction(actionCatalogUpdate)
        toolbar = self.addToolBar(self.tr("Catalog"))
        toolbar.addAction(actionCatalogUpdate)

        self.addonList = Grid(self)

        self.addonList.setColumnCount(6)
        self.addonList.setHorizontalHeaderLabels(["Name", "Url", "Version", "Toc", "Allow Beta", "Classic"])

        self.resize(1070, 815)
        screen = Qt.QDesktopWidget().screenGeometry()
        size = self.geometry()
        self.move((screen.width() - size.width()) / 2, (screen.height() - size.height()) / 5)
        self.setWindowTitle('WoW!Curse ' + '(TOC: ' + defines.TOC +')')

        box.addWidget(self.addonList)
        self.statusBar().showMessage(self.tr("Ready"))
        self.setCentralWidget(self.mainWidget)
        self.show()
Ejemplo n.º 6
0
    def addWidgets(self):
        self.mainWidget = Qt.QWidget(self)
        box = Qt.QVBoxLayout(self.mainWidget)

        menubar = self.menuBar()

        actionLoad = Qt.QAction(self.tr("Load Addons"), self)
        actionLoad.setShortcut("Ctrl+L")
        actionLoad.setStatusTip(self.tr("Re/Load your addons configuration"))
        actionLoad.triggered.connect(self.loadAddons)

        actionSave = Qt.QAction(self.tr("Save Addons"), self)
        actionSave.setShortcut("Ctrl+S")
        actionSave.setStatusTip(self.tr("Save your addons configuration"))
        actionSave.triggered.connect(self.saveAddons)

        actionImport = Qt.QAction(self.tr("Import Addons"), self)
        actionImport.setStatusTip(
            self.tr("Import Addons from WoW installation"))
        actionImport.triggered.connect(self.importAddons)

        actionPrefs = Qt.QAction(self.tr("Preferences"), self)
        actionPrefs.setShortcut("Ctrl+P")
        actionPrefs.setStatusTip(
            self.tr("Change preferences like wow install folder"))
        actionPrefs.triggered.connect(self.openPreferences)

        actionExit = Qt.QAction(self.tr("Exit"), self)
        actionExit.setShortcuts(Qt.QKeySequence.Quit)
        actionExit.setStatusTip(self.tr("Exit application"))
        actionExit.triggered.connect(self.close)

        actionClearCell = Qt.QAction(
            self.tr("Remove selected addon information"), self)
        actionClearCell.setShortcut("Backspace")
        actionClearCell.setStatusTip(
            self.tr("Clear specific addon information"))
        actionClearCell.triggered.connect(self.clearCell)

        menuFile = menubar.addMenu(self.tr("General"))
        menuFile.addAction(actionLoad)
        menuFile.addAction(actionSave)
        menuFile.addAction(actionImport)
        menuFile.addSeparator()
        menuFile.addAction(actionPrefs)
        menuFile.addSeparator()
        menuFile.addAction(actionExit)
        self.addAction(actionLoad)
        self.addAction(actionSave)
        self.addAction(actionPrefs)
        self.addAction(actionExit)
        self.addAction(actionClearCell)

        actionCheckAll = Qt.QAction(self.tr("Check all addons"), self)
        actionCheckAll.setShortcut('Ctrl+Shift+A')
        actionCheckAll.setStatusTip(
            self.tr("Check all addons for new version"))
        actionCheckAll.triggered.connect(self.checkAllAddonsForUpdate)

        actionCheck = Qt.QAction(self.tr("Check addon"), self)
        actionCheck.setShortcut('Ctrl+A')
        actionCheck.setStatusTip(
            self.tr("Check currently selected addon for new version"))
        actionCheck.triggered.connect(self.checkAddonsForUpdate)

        actionUpdateAll = Qt.QAction(self.tr("Update all addons"), self)
        actionUpdateAll.setShortcut("Ctrl+Shift+U")
        actionUpdateAll.setStatusTip(
            self.tr("Update all addons which need an update"))
        actionUpdateAll.triggered.connect(self.updateAllAddons)

        actionUpdate = Qt.QAction(self.tr("Update addon"), self)
        actionUpdate.setShortcut("Ctrl+U")
        actionUpdate.setStatusTip(
            self.tr("Update currently selected addons if needed"))
        actionUpdate.triggered.connect(self.updateAddons)

        actionRemovefromlist = Qt.QAction(self.tr("Remove addon from list"),
                                          self)
        actionRemovefromlist.setShortcut(Qt.QKeySequence.Delete)
        actionRemovefromlist.setStatusTip(
            self.tr("Leave all files unaltered, useful for subaddons"))
        actionRemovefromlist.triggered.connect(self.removeFromList)

        actionAdd = Qt.QAction(self.tr("Add addon"), self)
        actionAdd.setStatusTip(self.tr("Add a new addon"))
        actionAdd.triggered.connect(self.addAddon)

        actionRemove = Qt.QAction(self.tr("Remove addon"), self)
        actionRemove.setShortcut("Shift+Del")
        actionRemove.setStatusTip(self.tr("Remove currently selected addon"))
        actionRemove.triggered.connect(self.removeAddon)

        actionForceUpdate = Qt.QAction(self.tr("Force update addon"), self)
        actionForceUpdate.setShortcut("Ctrl+F")
        actionForceUpdate.setStatusTip(
            self.tr("Force update of currently selected addon"))
        actionForceUpdate.triggered.connect(self.forceUpdateAddon)

        menuAddons = menubar.addMenu(self.tr("Addons"))
        menuAddons.addAction(actionCheckAll)
        menuAddons.addAction(actionCheck)
        menuAddons.addSeparator()
        menuAddons.addAction(actionUpdateAll)
        menuAddons.addAction(actionUpdate)
        menuAddons.addAction(actionRemovefromlist)
        menuAddons.addSeparator()
        menuAddons.addAction(actionAdd)
        menuAddons.addAction(actionRemove)
        menuAddons.addAction(actionForceUpdate)
        toolbar = self.addToolBar(self.tr("Addons"))
        toolbar.addAction(actionUpdateAll)
        toolbar.addAction(actionAdd)
        self.addAction(actionCheckAll)
        self.addAction(actionCheck)
        self.addAction(actionUpdateAll)
        self.addAction(actionUpdate)
        self.addAction(actionForceUpdate)

        actionCatalogUpdate = Qt.QAction(self.tr("Update Catalog"), self)
        actionCatalogUpdate.setStatusTip(
            self.tr("Retrieve a list of available addons"))
        actionCatalogUpdate.triggered.connect(self.updateCatalog)
        menuCatalog = menubar.addMenu(self.tr("Catalog"))
        menuCatalog.addAction(actionCatalogUpdate)
        toolbar = self.addToolBar(self.tr("Catalog"))
        toolbar.addAction(actionCatalogUpdate)

        wowVersions = self.getWowVersions()
        if len(wowVersions) > 1:
            wowVersionSelector = Qt.QComboBox()
            wowVersionSelector.addItems(wowVersions)
            wowVersionSelector.currentTextChanged.connect(
                self.setActiveWowVersion)
            toolbar = self.addToolBar(self.tr("WoW Version"))
            toolbar.addWidget(wowVersionSelector)

        self.addonList = Grid(self)

        self.addonList.setColumnCount(5)
        self.addonList.setHorizontalHeaderLabels(
            ["Name", "Url", "Version", "Toc", "Allow Beta"])

        self.resize(1070, 815)
        screen = Qt.QDesktopWidget().screenGeometry()
        size = self.geometry()
        self.move((screen.width() - size.width()) / 2,
                  (screen.height() - size.height()) / 5)

        box.addWidget(self.addonList)
        self.statusBar().showMessage(self.tr("Ready"))
        self.setCentralWidget(self.mainWidget)
        self.show()
Ejemplo n.º 7
0
    def addWidgets(self):
        self.mainWidget = Qt.QWidget(self)
        box = Qt.QVBoxLayout(self.mainWidget)

        menubar = self.menuBar()

        actionLoad = Qt.QAction(self.tr("Charger les Addons"), self)
        actionLoad.setShortcut("Ctrl+L")
        actionLoad.setStatusTip(
            self.tr("Re/Charger votre configuration des addons"))
        actionLoad.triggered.connect(self.loadAddons)

        actionSave = Qt.QAction(self.tr("Sauver les Addons"), self)
        actionSave.setShortcut("Ctrl+S")
        actionSave.setStatusTip(
            self.tr("Sauver votre configuration des addons"))
        actionSave.triggered.connect(self.saveAddons)

        actionImport = Qt.QAction(self.tr("Importer les Addons déjà présent"),
                                  self)
        actionImport.setStatusTip(
            self.
            tr("Importer les Addons déjà présent à partir du dossier d'installation de Wow"
               ))
        actionImport.triggered.connect(self.importAddons)

        actionPrefs = Qt.QAction(self.tr("Préférences"), self)
        actionPrefs.setShortcut("Ctrl+P")
        actionPrefs.setStatusTip(
            self.
            tr("Modifier les préférences, dossier d'installation Wow par exemple"
               ))
        actionPrefs.triggered.connect(self.openPreferences)

        actionExit = Qt.QAction(self.tr("Terminer"), self)
        actionExit.setShortcuts(Qt.QKeySequence.Quit)
        actionExit.setStatusTip(self.tr("Sortir de l'application"))
        actionExit.triggered.connect(self.close)

        actionClearCell = Qt.QAction(
            self.tr("Effacer information addon sélectionné"), self)
        actionClearCell.setShortcut("Barre Espace")
        actionClearCell.setStatusTip(
            self.tr("Effacer information spécifique de cet addon"))
        actionClearCell.triggered.connect(self.clearCell)

        menuFile = menubar.addMenu(self.tr("Général"))
        menuFile.addAction(actionLoad)
        menuFile.addAction(actionSave)
        menuFile.addAction(actionImport)
        menuFile.addSeparator()
        menuFile.addAction(actionPrefs)
        menuFile.addSeparator()
        menuFile.addAction(actionExit)
        self.addAction(actionLoad)
        self.addAction(actionSave)
        self.addAction(actionPrefs)
        self.addAction(actionExit)
        self.addAction(actionClearCell)

        actionCheckAll = Qt.QAction(self.tr("Vérifier tous les Addons"), self)
        actionCheckAll.setShortcut('Ctrl+Shift+A')
        actionCheckAll.setStatusTip(
            self.tr("Vérifier les Addons sélectionnés pour nouvelle version"))
        actionCheckAll.triggered.connect(self.checkAddonsForUpdate)

        actionCheck = Qt.QAction(self.tr("Vérifier Addon"), self)
        actionCheck.setShortcut('Ctrl+A')
        actionCheck.setStatusTip(
            self.tr("Vérifier Addon sélectionné pour nouvelle version"))
        actionCheck.triggered.connect(self.checkAddonForUpdate)

        actionUpdateAll = Qt.QAction(self.tr("Mise à jour de tous les Addons"),
                                     self)
        actionUpdateAll.setShortcut("Ctrl+Shift+U")
        actionUpdateAll.setStatusTip(
            self.tr("Mise à jour de tous les Addons, si nécessaire"))
        actionUpdateAll.triggered.connect(self.updateAddons)

        actionUpdate = Qt.QAction(self.tr("Mise à jour Addon"), self)
        actionUpdate.setShortcut("Ctrl+U")
        actionUpdate.setStatusTip(
            self.tr("Mise à jour des Addons sélectionnés, si nécessaire"))
        actionUpdate.triggered.connect(self.updateAddon)

        actionRemovefromlist = Qt.QAction(
            self.tr("Supprimer addon de la liste"), self)
        actionRemovefromlist.setShortcut(Qt.QKeySequence.Delete)
        actionRemovefromlist.setStatusTip(
            self.
            tr("Laisser inchanger tous les fichiers, utile pour les sous addons"
               ))
        actionRemovefromlist.triggered.connect(self.removeFromList)

        actionAdd = Qt.QAction(self.tr("Ajouter Addon"), self)
        actionAdd.setStatusTip(self.tr("Ajouter nouvel Addon"))
        actionAdd.triggered.connect(self.addAddon)

        actionRemove = Qt.QAction(self.tr("Supprimer Addon"), self)
        actionRemove.setShortcut("Shift+Suppr")
        actionRemove.setStatusTip(self.tr("Supprimer Addon sélectionné"))
        actionRemove.triggered.connect(self.removeAddon)

        actionForceUpdate = Qt.QAction(self.tr("Forcer la mise à jour Addon"),
                                       self)
        actionForceUpdate.setShortcut("Ctrl+F")
        actionForceUpdate.setStatusTip(
            self.tr("Forcer mise à jour Addon sélectionné"))
        actionForceUpdate.triggered.connect(self.forceUpdateAddon)

        menuAddons = menubar.addMenu(self.tr("Addons"))
        menuAddons.addAction(actionCheckAll)
        menuAddons.addAction(actionCheck)
        menuAddons.addSeparator()
        menuAddons.addAction(actionUpdateAll)
        menuAddons.addAction(actionUpdate)
        menuAddons.addAction(actionRemovefromlist)
        menuAddons.addSeparator()
        menuAddons.addAction(actionAdd)
        menuAddons.addAction(actionRemove)
        menuAddons.addAction(actionForceUpdate)
        toolbar = self.addToolBar(self.tr("Addons"))
        toolbar.addAction(actionUpdateAll)
        toolbar.addAction(actionAdd)
        self.addAction(actionCheckAll)
        self.addAction(actionCheck)
        self.addAction(actionUpdateAll)
        self.addAction(actionUpdate)
        self.addAction(actionForceUpdate)

        actionCatalogUpdate = Qt.QAction(self.tr("Mise à jour Catalogue"),
                                         self)
        actionCatalogUpdate.setStatusTip(
            self.tr("Extraire une liste des Addons disponibles"))
        actionCatalogUpdate.triggered.connect(self.updateCatalog)
        menuCatalog = menubar.addMenu(self.tr("Catalogue"))
        menuCatalog.addAction(actionCatalogUpdate)
        toolbar = self.addToolBar(self.tr("Catalogue"))
        toolbar.addAction(actionCatalogUpdate)

        wowVersions = self.getWowVersions()
        if len(wowVersions) > 1:
            wowVersionSelector = Qt.QComboBox()
            wowVersionSelector.addItems(wowVersions)
            wowVersionSelector.currentTextChanged.connect(
                self.setActiveWowVersion)
            toolbar = self.addToolBar(self.tr("WoW Version"))
            toolbar.addWidget(wowVersionSelector)

        self.addonList = Grid(self)

        self.addonList.setColumnCount(5)
        self.addonList.setHorizontalHeaderLabels(
            ["Nom", "Url", "Version", "Toc", "Béta permis"])

        self.resize(1070, 815)
        screen = Qt.QDesktopWidget().screenGeometry()
        size = self.geometry()
        self.move((screen.width() - size.width()) / 2,
                  (screen.height() - size.height()) / 5)

        box.addWidget(self.addonList)
        self.statusBar().showMessage(self.tr("Prêt"))
        self.setCentralWidget(self.mainWidget)
        self.show()
Ejemplo n.º 8
0
 def _width(self):
     screen = Qt.QDesktopWidget().screenGeometry()
     return screen.width()
Ejemplo n.º 9
0
 def _height(self):
     screen = Qt.QDesktopWidget().screenGeometry()
     return screen.height()
Ejemplo n.º 10
0
 def center(self):
     qr = self.frameGeometry()
     cp = Qt.QDesktopWidget().availableGeometry().center()
     #QtGui.QDesktopWidget().availableGeometry().center()
     qr.moveCenter(cp)
     self.move(qr.topLeft())