Ejemplo n.º 1
0
    def Init(self):
        if config.CanWaifu2x:
            import waifu2x
            stat = waifu2x.Init(config.Encode, config.Waifu2xThread)
            if stat < 0:
                self.msgForm.ShowError("waifu2x初始化错误")
            gpuInfo = waifu2x.GetGpuInfo()
            if gpuInfo:
                self.settingForm.SetGpuInfos(gpuInfo)
            Log.Info("waifu2x初始化: " + str(stat) + " encode: " + str(config.Encode))
        else:
            self.msgForm.ShowError("waifu2x无法启用, "+config.ErrorMsg)
            self.settingForm.checkBox.setEnabled(False)
            self.qtReadImg.frame.qtTool.checkBox.setEnabled(False)
            self.downloadForm.autoConvert = False
            self.downloadForm.radioButton.setEnabled(False)
            QtImgMgr().obj.radioButton.setEnabled(False)
            QtImgMgr().obj.changeButton.setEnabled(False)
            QtImgMgr().obj.changeButton.setEnabled(False)
            QtImgMgr().obj.comboBox.setEnabled(False)
            config.IsOpenWaifu = 0

        self.InitUpdate()
        self.loginForm.Init()
        return
Ejemplo n.º 2
0
 def eventFilter(self, obj, event):
     if event.type() == QEvent.MouseButtonPress:
         if event.button() == Qt.LeftButton:
             if self.picData and (obj == self.label
                                  or obj == self.picLabel):
                 QtImgMgr().ShowImg(self.picData)
             elif self.data and obj == self.commentLabel:
                 QtImgMgr().ShowImg(self.data)
             return True
         else:
             return False
     else:
         return super(self.__class__, self).eventFilter(obj, event)
Ejemplo n.º 3
0
 def eventFilter(self, obj, event):
     if event.type() == QEvent.MouseButtonPress:
         if event.button() == Qt.LeftButton:
             if obj.pixmap() and not obj.text():
                 QtImgMgr().ShowImg(obj.pixmap())
             return True
         else:
             return False
     else:
         return super(self.__class__, self).eventFilter(obj, event)
Ejemplo n.º 4
0
 def eventFilter(self, obj, event):
     if event.type() == QEvent.MouseButtonPress:
         if event.button() == Qt.LeftButton:
             if self.pictureData:
                 QtImgMgr().ShowImg(self.pictureData)
             return True
         else:
             return False
     else:
         return super(self.__class__, self).eventFilter(obj, event)
Ejemplo n.º 5
0
 def OpenAbout(self, action):
     if action.text() == "about":
         self.aboutForm.show()
     elif action.text() == "img convert":
         QtImgMgr().ShowImg("")
     pass
Ejemplo n.º 6
0
 def OpenPicture(self):
     selected = self.selectedItems()
     for item in selected:
         widget = self.itemWidget(item)
         QtImgMgr().ShowImg(widget.pictureData)
         return