Changeset 0849aec in sasview for src/sas/qtgui/MainWindow/GuiManager.py
- Timestamp:
- Oct 30, 2017 7:50:09 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:
- 304d082
- Parents:
- 99ea1b0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/GuiManager.py
r895e7359 r0849aec 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) … … 187 189 self._current_perspective = Perspectives.PERSPECTIVES[str(perspective_name)](parent=self) 188 190 189 self._workspace.workspace.addWindow(self._current_perspective) 191 self._workspace.workspace.addSubWindow(self._current_perspective) 192 190 193 # Resize to the workspace height 191 194 workspace_height = self._workspace.workspace.sizeHint().height() … … 257 260 # Display confirmation messagebox 258 261 quit_msg = "Are you sure you want to exit the application?" 259 reply = Q tGui.QMessageBox.question(262 reply = QMessageBox.question( 260 263 self._parent, 261 264 'Information', 262 265 quit_msg, 263 Q tGui.QMessageBox.Yes,264 Q tGui.QMessageBox.No)266 QMessageBox.Yes, 267 QMessageBox.No) 265 268 266 269 # Exit if yes 267 if reply == Q tGui.QMessageBox.Yes:270 if reply == QMessageBox.Yes: 268 271 reactor.callFromThread(reactor.stop) 269 272 return True … … 578 581 579 582 # Add the console window as another docked widget 580 self.ipDockWidget = Q tGui.QDockWidget("IPython", self._workspace)583 self.ipDockWidget = QDockWidget("IPython", self._workspace) 581 584 self.ipDockWidget.setObjectName("IPythonDockWidget") 582 585 self.ipDockWidget.setWidget(terminal) 583 self._workspace.addDockWidget(QtCore.Qt.RightDockWidgetArea, 584 self.ipDockWidget) 586 self._workspace.workspace.addSubWindow(self.ipDockWidget, Qt.RightDockWidgetArea) 585 587 586 588 def actionImage_Viewer(self): … … 695 697 TODO: use QNetworkAccessManager to assure _helpLocation is valid 696 698 """ 697 self._helpView.load(Q tCore.QUrl(self._helpLocation))699 self._helpView.load(QUrl(self._helpLocation)) 698 700 self._helpView.show() 699 701 … … 740 742 :param new_datalist_item: 741 743 """ 742 if not isinstance(new_item, Q tGui.QStandardItem) or \744 if not isinstance(new_item, QStandardItem) or \ 743 745 not isinstance(new_datalist_item, dict): 744 746 msg = "Wrong data type returned from calculations."
Note: See TracChangeset
for help on using the changeset viewer.