diff --git a/vn.trader/uiMainWindow.py b/vn.trader/uiMainWindow.py index 4f9fa02e..1624d651 100644 --- a/vn.trader/uiMainWindow.py +++ b/vn.trader/uiMainWindow.py @@ -22,6 +22,7 @@ class MainWindow(QtGui.QMainWindow): self.widgetDict = {} # 用来保存子窗口的字典 self.initUi() + self.loadWindowSettings() #---------------------------------------------------------------------- def initUi(self): @@ -273,6 +274,8 @@ class MainWindow(QtGui.QMainWindow): if reply == QtGui.QMessageBox.Yes: for widget in self.widgetDict.values(): widget.close() + self.saveWindowSettings() + self.mainEngine.exit() event.accept() else: diff --git a/vn.trader/vtMain.py b/vn.trader/vtMain.py index 554b1fd7..bf52abe3 100644 --- a/vn.trader/vtMain.py +++ b/vn.trader/vtMain.py @@ -10,13 +10,13 @@ from uiMainWindow import * #---------------------------------------------------------------------- def main(): """主程序入口""" - # 设置底部任务栏图标,win7以下请注释掉 - if platform.uname() == 'Windows': - ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.py demo') - - # Reload sys, Set default encode to UTF8 + # 重载sys模块,设置默认字符串编码方式为utf8 reload(sys) sys.setdefaultencoding('utf8') + + # 设置Windows底部任务栏图标 + if platform.uname() == 'Windows': + ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.trader') # 初始化Qt应用对象 app = QtGui.QApplication(sys.argv)