eric6/UI/UserInterface.py

changeset 7959
44e15eda6506
parent 7955
567f2ec958c3
child 7960
e8fc383322f7
equal deleted inserted replaced
7958:a70ebfad3d0e 7959:44e15eda6506
31 QNetworkProxyFactory, QNetworkAccessManager, QNetworkRequest, QNetworkReply 31 QNetworkProxyFactory, QNetworkAccessManager, QNetworkRequest, QNetworkReply
32 ) 32 )
33 33
34 from .Info import Version, VersionOnly, BugAddress, Program, FeatureAddress 34 from .Info import Version, VersionOnly, BugAddress, Program, FeatureAddress
35 from . import Config 35 from . import Config
36 from .NotificationWidget import NotificationTypes
36 37
37 from E5Gui.E5SingleApplication import E5SingleApplicationServer 38 from E5Gui.E5SingleApplication import E5SingleApplicationServer
38 from E5Gui.E5Action import E5Action, createActionGroup 39 from E5Gui.E5Action import E5Action, createActionGroup
39 from E5Gui.E5ToolBarManager import E5ToolBarManager 40 from E5Gui.E5ToolBarManager import E5ToolBarManager
40 from E5Gui import E5MessageBox, E5FileDialog, E5ErrorMessage 41 from E5Gui import E5MessageBox, E5FileDialog, E5ErrorMessage
7415 7416
7416 ########################################## 7417 ##########################################
7417 ## Support for desktop notifications below 7418 ## Support for desktop notifications below
7418 ########################################## 7419 ##########################################
7419 7420
7420 def showNotification(self, icon, heading, text, timeout=None): 7421 def showNotification(self, icon, heading, text,
7422 kind=NotificationTypes.Information, timeout=None):
7421 """ 7423 """
7422 Public method to show a desktop notification. 7424 Public method to show a desktop notification.
7423 7425
7424 @param icon icon to be shown in the notification 7426 @param icon icon to be shown in the notification
7425 @type QPixmap 7427 @type QPixmap
7426 @param heading heading of the notification 7428 @param heading heading of the notification
7427 @type str 7429 @type str
7428 @param text text of the notification 7430 @param text text of the notification
7429 @type str 7431 @type str
7432 @param kind kind of notification to be shown
7433 @type NotificationTypes
7430 @param timeout time in seconds the notification should be shown 7434 @param timeout time in seconds the notification should be shown
7431 (None = use configured timeout, 0 = indefinitely) 7435 (None = use configured timeout, 0 = indefinitely)
7432 @type int 7436 @type int
7433 """ 7437 """
7434 if self.__notification is None: 7438 if self.__notification is None:
7435 from .NotificationWidget import NotificationWidget 7439 from .NotificationWidget import NotificationWidget
7436 self.__notification = NotificationWidget(parent=self) 7440 self.__notification = NotificationWidget(parent=self)
7437 if timeout is None: 7441 if timeout is None:
7438 timeout = Preferences.getUI("NotificationTimeout") 7442 timeout = Preferences.getUI("NotificationTimeout")
7439 self.__notification.showNotification(icon, heading, text, 7443 self.__notification.showNotification(icon, heading, text, kind=kind,
7440 timeout=timeout) 7444 timeout=timeout)
7441 7445
7442 ######################### 7446 #########################
7443 ## Support for IRC below 7447 ## Support for IRC below
7444 ######################### 7448 #########################

eric ide

mercurial