本文整理汇总了Python中theme.Theme.getTheme方法的典型用法代码示例。如果您正苦于以下问题:Python Theme.getTheme方法的具体用法?Python Theme.getTheme怎么用?Python Theme.getTheme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类theme.Theme
的用法示例。
在下文中一共展示了Theme.getTheme方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MyElement
# 需要导入模块: from theme import Theme [as 别名]
# 或者: from theme.Theme import getTheme [as 别名]
class MyElement (QObject):
hasLockChanged = pyqtSignal()
hasLoginChanged = pyqtSignal()
hasErrorChanged = pyqtSignal()
hasRegisterChanged = pyqtSignal()
varChanged = pyqtSignal()
themeChanged = pyqtSignal()
overlayChanged = pyqtSignal()
def __init__(self, parent=None):
super(MyElement, self).__init__()
self.setObjectName('mainObject')
self._users = []
self._index = 0
self._myTheme = Theme()
self._myColor = self._myTheme.getTheme()
self.mainProc = QProcess()
self.secondProc = QProcess()
self.mainProc.finished.connect(self.finishProc)
self.mainProc.started.connect(self.startProc)
self.secondProc.finished.connect(self.secondFinishProc)
self.secondProc.started.connect(self.startProc)
self.auth = Auth()
self._isiPesan = ""
self._judulPesan = "Error"
self._overlay = ""
self._isLock = False
self._hasRegister = False
self._hasLogin = False
self._hasError = False
self._userListData = UserItemModel()
self._userListData.addRootElement()
self.addNewUser()
@pyqtProperty(bool, notify=hasLockChanged)
def isLock(self):
return os.path.isfile("/var/ubezee/LOCKED")
def finishProc(self, exitCode):
if not exitCode:
self.setError(True, "Proses Berhasil", "Proses buka/tutup kunci telah berhasil, silakan hidupkan ulang komputer anda untuk mengimplementasikan perubahan.")
self._overlay = ""
self.hasLockChanged.emit()
else:
self.setError(True, "Proses Gagal", "Terjadi kesalahan saat akan melakukan proses buka/tutup kunci, silakan coba lagi.")
def secondFinishProc(self, exitCode):
if not exitCode:
self.setError(True, "Proses Berhasil", "Proses buka/tutup kunci pada pengguna telah berhasil, silakan hidupkan ulang komputer anda untuk mengimplementasikan perubahan.")
self._overlay = ""
h = self._userListData.index(self._index, 0)
if self._userListData.itemFromIndex(h).data(5):
self._userListData.itemFromIndex(h).setData(False, 5)
else:
self._userListData.itemFromIndex(h).setData(True, 5)
else:
self.setError(True, "Proses Gagal", "Terjadi kesalahan saat akan melakukan proses buka/tutup kunci, silakan coba lagi.")
def startProc(self):
self.setInfo("Harap Tunggu", "Proses buka/tutup pengunci sistem sedang berlangsung, mohon tunggu sebentar...")
self.setOverlay("loading")
@pyqtSlot(bool)
def changeLock(self, todo):
if todo:
self.mainProc.start("bash locker.sh -l sistem")
else:
self.mainProc.start("bash locker.sh -u sistem")
@pyqtSlot(int, str, bool)
def lockUser(self, index, nama, locked):
self._index = index
if not locked:
self.secondProc.start("bash locker.sh -l %s" % nama)
else:
self.secondProc.start("bash locker.sh -u %s" % nama)
@pyqtProperty(bool, notify=hasLoginChanged)
def hasLogin(self):
return self._hasLogin
@pyqtProperty(str, notify=themeChanged)
def myColor1(self):
return self._myColor[0]
@pyqtProperty(str, notify=themeChanged)
def myColor2(self):
return self._myColor[1]
@pyqtSlot(str)
def setTheme(self, theme):
self._myTheme.setTheme(theme)
self.themeChanged.emit()
@pyqtProperty(str, notify=varChanged)
def isiPesan(self):
return self._isiPesan
#.........这里部分代码省略.........