当前位置: 首页>>代码示例>>Python>>正文


Python Theme.getTheme方法代码示例

本文整理汇总了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
	
#.........这里部分代码省略.........
开发者ID:kurokid,项目名称:Ubezee,代码行数:103,代码来源:ubezee.py


注:本文中的theme.Theme.getTheme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。