Commit cb658d63 authored by Luci Stanescu's avatar Luci Stanescu

Replaced use of Blink with QApplication where appropriate

parent 225dbc57
......@@ -14,7 +14,7 @@ from functools import partial
from PyQt4 import uic
from PyQt4.QtCore import Qt, QAbstractListModel, QByteArray, QEvent, QMimeData, QModelIndex, QObject, QSize, QStringList, QTimer, pyqtSignal
from PyQt4.QtGui import QAction, QBrush, QColor, QDrag, QLinearGradient, QListView, QMenu, QPainter, QPen, QPixmap, QStyle, QStyledItemDelegate
from PyQt4.QtGui import QAction, QApplication, QBrush, QColor, QDrag, QLinearGradient, QListView, QMenu, QPainter, QPen, QPixmap, QStyle, QStyledItemDelegate
from application.notification import IObserver, NotificationCenter
from application.python.util import Null, Singleton
......@@ -1935,12 +1935,11 @@ class SessionManager(object):
bisect.insort_right(self.incoming_sessions, incoming_session)
incoming_session.accepted.connect(partial(self._SH_IncomingSessionAccepted, incoming_session))
incoming_session.rejected.connect(partial(self._SH_IncomingSessionRejected, incoming_session))
from blink import Blink
try:
position = self.dialog_positions.pop(0)
except IndexError:
position = None
incoming_session.dialog.show(activate=Blink().activeWindow() is not None and self.incoming_sessions.index(incoming_session)==0, position=position)
incoming_session.dialog.show(activate=QApplication.activeWindow() is not None and self.incoming_sessions.index(incoming_session)==0, position=position)
self.update_ringtone()
def _NH_SIPSessionGotProposal(self, notification):
......@@ -1975,12 +1974,11 @@ class SessionManager(object):
bisect.insort_right(self.incoming_sessions, incoming_session)
incoming_session.accepted.connect(partial(self._SH_IncomingSessionAccepted, incoming_session))
incoming_session.rejected.connect(partial(self._SH_IncomingSessionRejected, incoming_session))
from blink import Blink
try:
position = self.dialog_positions.pop(0)
except IndexError:
position = None
incoming_session.dialog.show(activate=Blink().activeWindow() is not None and self.incoming_sessions.index(incoming_session)==0, position=position)
incoming_session.dialog.show(activate=QApplication.activeWindow() is not None and self.incoming_sessions.index(incoming_session)==0, position=position)
self.update_ringtone()
def _NH_SIPSessionDidFail(self, notification):
......
......@@ -16,9 +16,8 @@ class QSingleton(Singleton, type(QObject)):
def call_in_gui_thread(function, *args, **kw):
from blink import Blink
blink = Blink()
blink.postEvent(blink, CallFunctionEvent(function, args, kw))
application = QApplication.instance()
application.postEvent(application, CallFunctionEvent(function, args, kw))
def call_later(interval, function, *args, **kw):
......@@ -30,9 +29,8 @@ def call_later(interval, function, *args, **kw):
def run_in_gui_thread(func):
@preserve_signature(func)
def wrapper(*args, **kw):
from blink import Blink
blink = Blink()
blink.postEvent(blink, CallFunctionEvent(func, args, kw))
application = QApplication.instance()
application.postEvent(application, CallFunctionEvent(func, args, kw))
return wrapper
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment