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


Python Systray.setToolTip方法代码示例

本文整理汇总了Python中systray.Systray.setToolTip方法的典型用法代码示例。如果您正苦于以下问题:Python Systray.setToolTip方法的具体用法?Python Systray.setToolTip怎么用?Python Systray.setToolTip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在systray.Systray的用法示例。


在下文中一共展示了Systray.setToolTip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Snakefire

# 需要导入模块: from systray import Systray [as 别名]
# 或者: from systray.Systray import setToolTip [as 别名]

#.........这里部分代码省略.........

    def _notify(self, room, message, user):
        raise NotImplementedError("_notify() must be implemented")

    def _updateRoomLayout(self):
        room = self.getCurrentRoom()
        if room:
            canUpload = not self._rooms[room.id]["upload"]
            uploadButton = self._rooms[room.id]["uploadButton"]
            if (
                (canUpload and not uploadButton.isEnabled()) or
                (not canUpload and uploadButton.isEnabled())
            ):
                uploadButton.setEnabled(canUpload)

    def _updateLayout(self):
        self._menus["file"]["connect"].setEnabled(not self._connected and self._canConnect and not self._connecting)
        self._menus["file"]["disconnect"].setEnabled(self._connected)

        roomsEmpty = self._toolBar["rooms"].count() == 1 and self._toolBar["rooms"].itemData(0).isNull()
        if not roomsEmpty and (not self._connected or not self._toolBar["rooms"].count()):
            self._toolBar["rooms"].clear()
            self._toolBar["rooms"].addItem(self._("No rooms available"))
            self._toolBar["rooms"].setEnabled(False)
        elif not roomsEmpty:
            self._toolBar["rooms"].setEnabled(True)

        self._toolBar["roomsLabel"].setEnabled(self._toolBar["rooms"].isEnabled())
        self._toolBar["join"].setEnabled(self._toolBar["rooms"].isEnabled())

    def _setupRoomUI(self, room):
        topic = room.topic if room.topic else ""
        topicLabel = ClickableQLabel(topic)
        topicLabel.setToolTip(self._("Click here to change room's topic"))
        topicLabel.setWordWrap(True)
        self.connect(topicLabel, QtCore.SIGNAL("clicked()"), self.changeTopic)

        view = SnakeFireWebView(self)
        view.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        frame = view.page().mainFrame()

        #Send all link clicks to systems web browser
        view.page().setLinkDelegationPolicy(QtWebKit.QWebPage.DelegateAllLinks)
        def linkClicked(url):
            QtGui.QDesktopServices.openUrl(url)
        view.connect(view, QtCore.SIGNAL("linkClicked (const QUrl&)"), linkClicked)

        # Support auto scroll when needed
        def autoScroll(size):
            frame.scroll(0, size.height())
        frame.connect(frame, QtCore.SIGNAL("contentsSizeChanged (const QSize&)"), autoScroll)

        usersList = QtGui.QListWidget()

        filesLabel = QtGui.QLabel("")
        filesLabel.setOpenExternalLinks(True)
        filesLabel.setWordWrap(True)
        filesLabel.hide()

        uploadButton = QtGui.QPushButton(self._("&Upload new file"))
        self.connect(uploadButton, QtCore.SIGNAL("clicked()"), self.uploadFile)

        uploadProgressBar = QtGui.QProgressBar()
        uploadProgressLabel = QtGui.QLabel(self._("Uploading:"))

        uploadCancelButton = QtGui.QPushButton(self._("Cancel"))
开发者ID:yattom,项目名称:snakefire,代码行数:70,代码来源:mainframe.py

示例2: Snakefire

# 需要导入模块: from systray import Systray [as 别名]
# 或者: from systray.Systray import setToolTip [as 别名]

#.........这里部分代码省略.........
			centralWidget.show()

	def _notify(self, room, message):
		raise NotImplementedError("_notify() must be implemented")

	def _updateRoomLayout(self):
		room = self.getCurrentRoom()
		if room:
			canUpload = not self._rooms[room.id]["upload"]
			uploadButton = self._rooms[room.id]["uploadButton"]
			if (
				(canUpload and not uploadButton.isEnabled()) or
				(not canUpload and uploadButton.isEnabled())
			):
				uploadButton.setEnabled(canUpload)

	def _updateLayout(self):
		self._menus["file"]["connect"].setEnabled(not self._connected and self._canConnect and not self._connecting)
		self._menus["file"]["disconnect"].setEnabled(self._connected)

		roomsEmpty = self._toolBar["rooms"].count() == 1 and self._toolBar["rooms"].itemData(0).isNull()
		if not roomsEmpty and (not self._connected or not self._toolBar["rooms"].count()):
			self._toolBar["rooms"].clear()
			self._toolBar["rooms"].addItem(self._("No rooms available"))
			self._toolBar["rooms"].setEnabled(False)
		elif not roomsEmpty:
			self._toolBar["rooms"].setEnabled(True)

		self._toolBar["roomsLabel"].setEnabled(self._toolBar["rooms"].isEnabled())
		self._toolBar["join"].setEnabled(self._toolBar["rooms"].isEnabled())

	def _setupRoomUI(self, room):
		topicLabel = ClickableQLabel(room.topic)
		topicLabel.setToolTip(self._("Click here to change room's topic"))
		topicLabel.setWordWrap(True)
		self.connect(topicLabel, QtCore.SIGNAL("clicked()"), self.changeTopic)

		editor = QtGui.QTextBrowser()
		editor.setOpenExternalLinks(True)

		usersList = QtGui.QListWidget()

		filesLabel = QtGui.QLabel("")
		filesLabel.setOpenExternalLinks(True)
		filesLabel.setWordWrap(True)
		filesLabel.hide()

		uploadButton = QtGui.QPushButton(self._("&Upload new file"))
		self.connect(uploadButton, QtCore.SIGNAL("clicked()"), self.uploadFile)

		uploadProgressBar = QtGui.QProgressBar()
		uploadProgressLabel = QtGui.QLabel(self._("Uploading:"))

		uploadCancelButton = QtGui.QPushButton(self._("Cancel"))
		self.connect(uploadCancelButton, QtCore.SIGNAL("clicked()"), self.uploadCancel)

		uploadLayout = QtGui.QHBoxLayout()
		uploadLayout.addWidget(uploadProgressLabel)
		uploadLayout.addWidget(uploadProgressBar)
		uploadLayout.addWidget(uploadCancelButton)

		uploadWidget = QtGui.QWidget()
		uploadWidget.setLayout(uploadLayout)
		uploadWidget.hide()

		leftFrameLayout = QtGui.QVBoxLayout()
开发者ID:zambot,项目名称:snakefire,代码行数:70,代码来源:mainframe.py

示例3: Snakefire

# 需要导入模块: from systray import Systray [as 别名]
# 或者: from systray.Systray import setToolTip [as 别名]

#.........这里部分代码省略.........

    def _notify(self, room, message):
        raise NotImplementedError("_notify() must be implemented")

    def _updateRoomLayout(self):
        room = self.getCurrentRoom()
        if room:
            canUpload = not self._rooms[room.id]["upload"]
            uploadButton = self._rooms[room.id]["uploadButton"]
            if (
                (canUpload and not uploadButton.isEnabled()) or
                (not canUpload and uploadButton.isEnabled())
            ):
                uploadButton.setEnabled(canUpload)

    def _updateLayout(self):
        self._menus["file"]["connect"].setEnabled(not self._connected and self._canConnect and not self._connecting)
        self._menus["file"]["disconnect"].setEnabled(self._connected)

        roomsEmpty = self._toolBar["rooms"].count() == 1 and self._toolBar["rooms"].itemData(0).isNull()
        if not roomsEmpty and (not self._connected or not self._toolBar["rooms"].count()):
            self._toolBar["rooms"].clear()
            self._toolBar["rooms"].addItem(self._("No rooms available"))
            self._toolBar["rooms"].setEnabled(False)
        elif not roomsEmpty:
            self._toolBar["rooms"].setEnabled(True)

        self._toolBar["roomsLabel"].setEnabled(self._toolBar["rooms"].isEnabled())
        self._toolBar["join"].setEnabled(self._toolBar["rooms"].isEnabled())

    def _setupRoomUI(self, room):
        topic = room.topic if room.topic else ""
        topicLabel = ClickableQLabel(topic)
        topicLabel.setToolTip(self._("Click here to change room's topic"))
        topicLabel.setWordWrap(True)
        self.connect(topicLabel, QtCore.SIGNAL("clicked()"), self.changeTopic)

        view = SnakeFireWebView(self)
        view.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        frame = view.page().mainFrame()

        #Send all link clicks to systems web browser
        view.page().setLinkDelegationPolicy(QtWebKit.QWebPage.DelegateAllLinks)
        def linkClicked(url): webbrowser.open(str(url.toString()))
        view.connect(view, QtCore.SIGNAL("linkClicked (const QUrl&)"), linkClicked)

        # Support auto scroll when needed
        def autoScroll(size): frame.scroll(0, size.height())
        frame.connect(frame, QtCore.SIGNAL("contentsSizeChanged (const QSize&)"), autoScroll)

        usersList = QtGui.QListWidget()

        filesLabel = QtGui.QLabel("")
        filesLabel.setOpenExternalLinks(True)
        filesLabel.setWordWrap(True)
        filesLabel.hide()

        uploadButton = QtGui.QPushButton(self._("&Upload new file"))
        self.connect(uploadButton, QtCore.SIGNAL("clicked()"), self.uploadFile)

        uploadProgressBar = QtGui.QProgressBar()
        uploadProgressLabel = QtGui.QLabel(self._("Uploading:"))

        uploadCancelButton = QtGui.QPushButton(self._("Cancel"))
        self.connect(uploadCancelButton, QtCore.SIGNAL("clicked()"), self.uploadCancel)
开发者ID:coredump,项目名称:snakefire,代码行数:69,代码来源:mainframe.py


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