diff options
-rw-r--r-- | changes/feature_remove_qtreactor | 1 | ||||
-rw-r--r-- | pkg/requirements.pip | 1 | ||||
-rw-r--r-- | src/leap/bitmask/app.py | 17 | ||||
-rw-r--r-- | src/leap/bitmask/gui/mainwindow.py | 1 | ||||
-rw-r--r-- | src/leap/bitmask/gui/twisted_main.py | 18 |
5 files changed, 8 insertions, 30 deletions
diff --git a/changes/feature_remove_qtreactor b/changes/feature_remove_qtreactor new file mode 100644 index 00000000..5cf3a854 --- /dev/null +++ b/changes/feature_remove_qtreactor @@ -0,0 +1 @@ +- Remove qt4reactor as a dependency.
\ No newline at end of file diff --git a/pkg/requirements.pip b/pkg/requirements.pip index 04cd33de..c8f6b101 100644 --- a/pkg/requirements.pip +++ b/pkg/requirements.pip @@ -13,7 +13,6 @@ python-dateutil psutil ipaddr twisted -qt4reactor python-daemon # this should not be needed for Windows. keyring zope.proxy diff --git a/src/leap/bitmask/app.py b/src/leap/bitmask/app.py index 1146d1d0..a1f3a69f 100644 --- a/src/leap/bitmask/app.py +++ b/src/leap/bitmask/app.py @@ -58,6 +58,9 @@ from leap.bitmask.services.mail import plumber from leap.common.events import server as event_server from leap.mail import __version__ as MAIL_VERSION +from twisted.internet import reactor +from twisted.internet.task import LoopingCall + import codecs codecs.register(lambda name: codecs.lookup('utf-8') if name == 'cp65001' else None) @@ -74,12 +77,6 @@ def sigint_handler(*args, **kwargs): mainwindow.quit() -def install_qtreactor(logger): - import qt4reactor - qt4reactor.install() - logger.debug("Qt4 reactor installed") - - def add_logger_handlers(debug=False, logfile=None, replace_stdout=True): """ Create the logger and attach the handlers. @@ -274,9 +271,6 @@ def main(): app = QtGui.QApplication(sys.argv) - # install the qt4reactor. - install_qtreactor(logger) - # To test: # $ LANG=es ./app.py locale = QtCore.QLocale.system().name() @@ -319,8 +313,9 @@ def main(): #tx_app = leap_services() #assert(tx_app) - # Run main loop - twisted_main.start(app) + l = LoopingCall(QtCore.QCoreApplication.processEvents, 0, 10) + l.start(0.01) + reactor.run() if __name__ == "__main__": main() diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index eeab7e2b..9ee62e17 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -134,6 +134,7 @@ class MainWindow(QtGui.QMainWindow): :type bypass_checks: bool """ QtGui.QMainWindow.__init__(self) + self.menuBar().setNativeMenuBar(False) # register leap events ######################################## register(signal=proto.UPDATER_NEW_UPDATES, diff --git a/src/leap/bitmask/gui/twisted_main.py b/src/leap/bitmask/gui/twisted_main.py index e11af7bd..1e876c57 100644 --- a/src/leap/bitmask/gui/twisted_main.py +++ b/src/leap/bitmask/gui/twisted_main.py @@ -27,24 +27,6 @@ from twisted.internet import error logger = logging.getLogger(__name__) -def start(app): - """ - Start the mainloop. - - :param app: the main qt QApplication instance. - :type app: QtCore.QApplication - """ - from twisted.internet import reactor - logger.debug('starting twisted reactor') - - # this seems to be troublesome under some - # unidentified settings. - #reactor.run() - - reactor.runReturn() - app.exec_() - - def quit(app): """ Stop the mainloop. |