Main window saves geometry properly.
This commit is contained in:
parent
dd24c257f8
commit
5ad04f8bb3
@ -355,6 +355,8 @@ class SyncplayClient(object):
|
|||||||
self.destroyProtocol()
|
self.destroyProtocol()
|
||||||
if self._player:
|
if self._player:
|
||||||
self._player.drop()
|
self._player.drop()
|
||||||
|
if self.ui:
|
||||||
|
self.ui.drop()
|
||||||
reactor.callLater(0.1, reactor.stop)
|
reactor.callLater(0.1, reactor.stop)
|
||||||
if(promptForAction):
|
if(promptForAction):
|
||||||
self.ui.promptFor(getMessage("en", "enter-to-exit-prompt"))
|
self.ui.promptFor(getMessage("en", "enter-to-exit-prompt"))
|
||||||
@ -608,5 +610,8 @@ class UiManager(object):
|
|||||||
|
|
||||||
def markEndOfUserlist(self):
|
def markEndOfUserlist(self):
|
||||||
self.__ui.markEndOfUserlist()
|
self.__ui.markEndOfUserlist()
|
||||||
|
|
||||||
|
def drop(self):
|
||||||
|
self.__ui.drop()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,9 @@ class ConsoleUI(threading.Thread):
|
|||||||
def addClient(self, client):
|
def addClient(self, client):
|
||||||
self._syncplayClient = client
|
self._syncplayClient = client
|
||||||
|
|
||||||
|
def drop(self):
|
||||||
|
pass
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
from PySide import QtGui #@UnresolvedImport
|
from PySide import QtGui #@UnresolvedImport
|
||||||
from PySide.QtCore import Qt #@UnresolvedImport
|
from PySide.QtCore import Qt, QSettings, QSize, QPoint #@UnresolvedImport
|
||||||
from syncplay import utils, constants
|
from syncplay import utils, constants
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
@ -119,7 +119,7 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
|
|
||||||
def closeEvent(self, event):
|
def closeEvent(self, event):
|
||||||
self.exitSyncplay()
|
self.exitSyncplay()
|
||||||
event.ignore()
|
self.saveSettings()
|
||||||
|
|
||||||
def _extractSign(self, m):
|
def _extractSign(self, m):
|
||||||
if(m):
|
if(m):
|
||||||
@ -156,6 +156,9 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
self.QtGui.QDesktopServices.openUrl("http://syncplay.pl/guide/windows/")
|
self.QtGui.QDesktopServices.openUrl("http://syncplay.pl/guide/windows/")
|
||||||
else:
|
else:
|
||||||
self.QtGui.QDesktopServices.openUrl("http://syncplay.pl/guide/")
|
self.QtGui.QDesktopServices.openUrl("http://syncplay.pl/guide/")
|
||||||
|
|
||||||
|
def drop(self):
|
||||||
|
self.close()
|
||||||
|
|
||||||
def addTopLayout(self, window):
|
def addTopLayout(self, window):
|
||||||
window.topSplit = QtGui.QSplitter(Qt.Horizontal)
|
window.topSplit = QtGui.QSplitter(Qt.Horizontal)
|
||||||
@ -312,6 +315,20 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
dropfilepath = unicode(urls[0].path())[1:] # Removes starting slash
|
dropfilepath = unicode(urls[0].path())[1:] # Removes starting slash
|
||||||
self._syncplayClient.openFile(dropfilepath)
|
self._syncplayClient.openFile(dropfilepath)
|
||||||
|
|
||||||
|
def saveSettings(self):
|
||||||
|
settings = QSettings("Syncplay", "MainWindow")
|
||||||
|
settings.beginGroup("MainWindow")
|
||||||
|
settings.setValue("size", self.size())
|
||||||
|
settings.setValue("pos", self.pos())
|
||||||
|
settings.endGroup()
|
||||||
|
|
||||||
|
def loadSettings(self):
|
||||||
|
settings = QSettings("Syncplay", "MainWindow")
|
||||||
|
settings.beginGroup("MainWindow")
|
||||||
|
self.resize(settings.value("size", QSize(700, 500)))
|
||||||
|
self.move(settings.value("pos", QPoint(200, 200)))
|
||||||
|
settings.endGroup()
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(MainWindow, self).__init__()
|
super(MainWindow, self).__init__()
|
||||||
self.QtGui = QtGui
|
self.QtGui = QtGui
|
||||||
@ -325,7 +342,7 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
self.addBottomLayout(self)
|
self.addBottomLayout(self)
|
||||||
self.addMenubar(self)
|
self.addMenubar(self)
|
||||||
self.addMainFrame(self)
|
self.addMainFrame(self)
|
||||||
self.resize(700,500)
|
self.loadSettings()
|
||||||
self.setWindowIcon(QtGui.QIcon(self.resourcespath + "syncplay.png"))
|
self.setWindowIcon(QtGui.QIcon(self.resourcespath + "syncplay.png"))
|
||||||
self.show()
|
self.show()
|
||||||
self.setAcceptDrops(True)
|
self.setAcceptDrops(True)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user