Commit 28edbac2 authored by Saul Ibarra's avatar Saul Ibarra

Save and restore main window geometry across restarts

parent 1d70bc8f
......@@ -97,6 +97,12 @@ class Blink(QApplication):
self.setAttribute(Qt.AA_DontShowIconsInMenus, False)
self.application = SIPApplication()
self.first_run = False
self.setOrganizationDomain("ag-projects.com")
self.setOrganizationName("AG Projects")
self.setApplicationName("Blink")
self.setApplicationVersion(__version__)
self.main_window = MainWindow()
self.ip_address_monitor = IPAddressMonitor()
self.log_manager = LogManager()
......
......@@ -9,7 +9,7 @@ import os
from functools import partial
from PyQt4 import uic
from PyQt4.QtCore import Qt, QUrl
from PyQt4.QtCore import Qt, QSettings, QUrl
from PyQt4.QtGui import QAction, QActionGroup, QDesktopServices, QShortcut
from PyQt4.QtGui import QFileDialog, QIcon, QStyle, QStyleOptionComboBox, QStyleOptionFrameV2
......@@ -64,6 +64,11 @@ class MainWindow(base_class, ui_class):
self.setWindowTitle('Blink')
self.setWindowIconText('Blink')
qt_settings = QSettings()
geometry = qt_settings.value("main_window/geometry")
if geometry:
self.restoreGeometry(geometry)
self.default_icon_path = Resources.get('icons/default-avatar.png')
self.default_icon = QIcon(self.default_icon_path)
self.last_icon_directory = os.path.expanduser('~')
......@@ -209,6 +214,8 @@ class MainWindow(base_class, ui_class):
self.identity.setStyleSheet("""QComboBox { padding: 0px 4px 0px 4px; }""" if wide_padding else "")
def closeEvent(self, event):
qt_settings = QSettings()
qt_settings.setValue("main_window/geometry", self.saveGeometry())
super(MainWindow, self).closeEvent(event)
self.about_panel.close()
self.conference_dialog.close()
......
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