Changeset 4992ff2 in sasview for src/sas/qtgui/MainWindow/GuiManager.py
- Timestamp:
- Nov 9, 2017 8:43:07 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 7969b9c
- Parents:
- 7fb471d
- git-author:
- Piotr Rozyczko <rozyczko@…> (10/30/17 07:50:09)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (11/09/17 08:43:07)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/GuiManager.py
rcee5c78 r4992ff2 6 6 import webbrowser 7 7 8 from PyQt4 import QtCore 9 from PyQt4 import QtGui 10 from PyQt4 import QtWebKit 8 from PyQt5.QtWidgets import * 9 from PyQt5.QtGui import * 10 from PyQt5.QtCore import Qt 11 from PyQt5.QtWebKitWidgets import QWebView 11 12 12 13 from twisted.internet import reactor … … 38 39 from sas.qtgui.MainWindow.DataExplorer import DataExplorerWindow 39 40 40 class Acknowledgements(Q tGui.QDialog, Ui_Acknowledgements):41 class Acknowledgements(QDialog, Ui_Acknowledgements): 41 42 def __init__(self, parent=None): 42 Q tGui.QDialog.__init__(self, parent)43 QDialog.__init__(self, parent) 43 44 self.setupUi(self) 44 45 … … 77 78 # Invoke the initial perspective 78 79 self.perspectiveChanged("Fitting") 79 80 80 self.addWidgets() 81 81 … … 94 94 # Show the Welcome panel 95 95 self.welcomePanel = WelcomePanel() 96 self._workspace.workspace.add Window(self.welcomePanel)96 self._workspace.workspace.addSubWindow(self.welcomePanel) 97 97 98 98 # Current help file 99 self._helpView = Q tWebKit.QWebView()99 self._helpView = QWebView() 100 100 # Needs URL like path, so no path.join() here 101 101 self._helpLocation = GuiUtils.HELP_DIRECTORY_LOCATION + "/index.html" … … 116 116 ObjectLibrary.addObject('DataExplorer', self.filesWidget) 117 117 118 self.dockedFilesWidget = QtGui.QDockWidget("Data Explorer", self._workspace) 118 self.dockedFilesWidget = QDockWidget("Data Explorer", self._workspace) 119 self.dockedFilesWidget.setFloating(True) 119 120 self.dockedFilesWidget.setWidget(self.filesWidget) 120 121 121 122 # Disable maximize/minimize and close buttons 122 self.dockedFilesWidget.setFeatures(QtGui.QDockWidget.NoDockWidgetFeatures) 123 self._workspace.addDockWidget(QtCore.Qt.LeftDockWidgetArea, 124 self.dockedFilesWidget) 123 self.dockedFilesWidget.setFeatures(QDockWidget.NoDockWidgetFeatures) 124 self.dockedFilesWidget.setFeatures(Qt.LeftDockWidgetArea) 125 126 self._workspace.workspace.addDockWidget(Qt.LeftDockWidgetArea, self.dockedFilesWidget) 125 127 126 128 # Add the console window as another docked widget 127 self.logDockWidget = Q tGui.QDockWidget("Log Explorer", self._workspace)129 self.logDockWidget = QDockWidget("Log Explorer", self._workspace) 128 130 self.logDockWidget.setObjectName("LogDockWidget") 129 self.listWidget = QtGui.QTextBrowser() 131 132 self.listWidget = QTextBrowser() 130 133 self.logDockWidget.setWidget(self.listWidget) 131 self._workspace.addDockWidget(QtCore.Qt.BottomDockWidgetArea, 132 self.logDockWidget) 134 self._workspace.workspace.addDockWidget(Qt.BottomDockWidgetAre, self.logDockWidget) 133 135 134 136 # Add other, minor widgets … … 152 154 Progress bar invisible until explicitly shown 153 155 """ 154 self.progress = Q tGui.QProgressBar()156 self.progress = QProgressBar() 155 157 self._workspace.statusbar.setSizeGripEnabled(False) 156 158 157 self.statusLabel = Q tGui.QLabel()159 self.statusLabel = QLabel() 158 160 self.statusLabel.setText("Welcome to SasView") 159 161 self._workspace.statusbar.addPermanentWidget(self.statusLabel, 1) … … 194 196 self._current_perspective = Perspectives.PERSPECTIVES[str(perspective_name)](parent=self) 195 197 196 self. setupPerspectiveMenubarOptions(self._current_perspective)197 self._workspace.workspace.addWindow(self._current_perspective) 198 self._workspace.workspace.addSubWindow(self._current_perspective) 199 198 200 # Resize to the workspace height 199 201 workspace_height = self._workspace.workspace.sizeHint().height() … … 265 267 # Display confirmation messagebox 266 268 quit_msg = "Are you sure you want to exit the application?" 267 reply = Q tGui.QMessageBox.question(269 reply = QMessageBox.question( 268 270 self._parent, 269 271 'Information', 270 272 quit_msg, 271 Q tGui.QMessageBox.Yes,272 Q tGui.QMessageBox.No)273 QMessageBox.Yes, 274 QMessageBox.No) 273 275 274 276 # Exit if yes 275 if reply == Q tGui.QMessageBox.Yes:277 if reply == QMessageBox.Yes: 276 278 reactor.callFromThread(reactor.stop) 277 279 return True … … 587 589 588 590 # Add the console window as another docked widget 589 self.ipDockWidget = Q tGui.QDockWidget("IPython", self._workspace)591 self.ipDockWidget = QDockWidget("IPython", self._workspace) 590 592 self.ipDockWidget.setObjectName("IPythonDockWidget") 591 593 self.ipDockWidget.setWidget(terminal) 592 self._workspace.addDockWidget(QtCore.Qt.RightDockWidgetArea, 593 self.ipDockWidget) 594 self._workspace.workspace.addSubWindow(self.ipDockWidget, Qt.RightDockWidgetArea) 594 595 595 596 def actionImage_Viewer(self): … … 716 717 TODO: use QNetworkAccessManager to assure _helpLocation is valid 717 718 """ 718 self._helpView.load(Q tCore.QUrl(self._helpLocation))719 self._helpView.load(QUrl(self._helpLocation)) 719 720 self._helpView.show() 720 721 … … 761 762 :param new_datalist_item: 762 763 """ 763 if not isinstance(new_item, Q tGui.QStandardItem) or \764 if not isinstance(new_item, QStandardItem) or \ 764 765 not isinstance(new_datalist_item, dict): 765 766 msg = "Wrong data type returned from calculations."
Note: See TracChangeset
for help on using the changeset viewer.