GUI starts properly when ConfigurationWindow wasn't executed
This commit is contained in:
parent
ed4c8d1674
commit
c925515249
@ -8,6 +8,8 @@ from syncplay.players.playerFactory import PlayerFactory
|
|||||||
import codecs
|
import codecs
|
||||||
try:
|
try:
|
||||||
from syncplay.ui.GuiConfiguration import GuiConfiguration
|
from syncplay.ui.GuiConfiguration import GuiConfiguration
|
||||||
|
from PySide import QtGui #@UnresolvedImport
|
||||||
|
from PySide.QtCore import Qt, QCoreApplication
|
||||||
except ImportError:
|
except ImportError:
|
||||||
GuiConfiguration = None
|
GuiConfiguration = None
|
||||||
|
|
||||||
@ -243,6 +245,8 @@ class ConfigurationGetter(object):
|
|||||||
self._loadRelativeConfiguration()
|
self._loadRelativeConfiguration()
|
||||||
if(not self._config['noGui']):
|
if(not self._config['noGui']):
|
||||||
from syncplay.vendor import qt4reactor
|
from syncplay.vendor import qt4reactor
|
||||||
|
if QCoreApplication.instance() is None:
|
||||||
|
self.app = QtGui.QApplication(sys.argv)
|
||||||
qt4reactor.install()
|
qt4reactor.install()
|
||||||
return self._config
|
return self._config
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
from PySide import QtCore, QtGui
|
from PySide import QtCore, QtGui
|
||||||
from PySide.QtCore import QSettings, Qt
|
from PySide.QtCore import QSettings, Qt, QCoreApplication
|
||||||
from PySide.QtGui import QApplication, QLineEdit, QCursor, QLabel, QCheckBox, QDesktopServices, QIcon
|
from PySide.QtGui import QApplication, QLineEdit, QCursor, QLabel, QCheckBox, QDesktopServices, QIcon
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@ -12,7 +12,8 @@ class GuiConfiguration:
|
|||||||
self._availablePlayerPaths = []
|
self._availablePlayerPaths = []
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.app = QtGui.QApplication(sys.argv)
|
if QCoreApplication.instance() is None:
|
||||||
|
self.app = QtGui.QApplication(sys.argv)
|
||||||
dialog = ConfigDialog(self.config, self._availablePlayerPaths)
|
dialog = ConfigDialog(self.config, self._availablePlayerPaths)
|
||||||
dialog.exec_()
|
dialog.exec_()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user