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