Changeset 33c0561 in sasview


Ignore:
Timestamp:
Jan 9, 2019 6:09:39 AM (5 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_sync_sascalc
Children:
cf9f39e
Parents:
bbcf9f0
Message:

Replace Apply button menu driven functionality with additional button.
Removed Cancel.
Removed the window system context help button from all affected widgets.
SASVIEW-1239

Location:
src/sas/qtgui
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Calculators/DataOperationUtilityPanel.py

    r42787fb r33c0561  
    2626        self.manager = parent 
    2727        self.communicator = self.manager.communicator() 
     28        # disable the context help icon 
     29        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    2830 
    2931        # To store input datafiles 
  • src/sas/qtgui/Calculators/DensityPanel.py

    rb6f47be r33c0561  
    4848        self.manager = parent 
    4949        self.setupUi() 
     50        # disable the context help icon 
     51        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
     52 
    5053        self.setupModel() 
    5154        self.setupMapper() 
  • src/sas/qtgui/Calculators/GenericScatteringCalculator.py

    r8c85ac1 r33c0561  
    3838        super(GenericScatteringCalculator, self).__init__() 
    3939        self.setupUi(self) 
     40        # disable the context help icon 
     41        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
     42 
    4043        self.manager = parent 
    4144        self.communicator = self.manager.communicator() 
  • src/sas/qtgui/Calculators/KiessigPanel.py

    rccdee50 r33c0561  
    1515        super(KiessigPanel, self).__init__() 
    1616        self.setupUi(self) 
     17        # disable the context help icon 
     18        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    1719 
    1820        self.setWindowTitle("Kiessig Thickness Calculator") 
  • src/sas/qtgui/Calculators/ResolutionCalculatorPanel.py

    r93c813f r33c0561  
    4141        super(ResolutionCalculatorPanel, self).__init__() 
    4242        self.setupUi(self) 
     43        # disable the context help icon 
     44        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
     45 
    4346        self.manager = parent 
    4447 
  • src/sas/qtgui/Calculators/SldPanel.py

    rbd39d6c r33c0561  
    8989 
    9090        self.setupUi() 
     91        # disable the context help icon 
     92        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
     93 
    9194        self.setupModel() 
    9295        self.setupMapper() 
  • src/sas/qtgui/Calculators/SlitSizeCalculator.py

    rfa05c6c1 r33c0561  
    2525        super(SlitSizeCalculator, self).__init__() 
    2626        self.setupUi(self) 
     27        # disable the context help icon 
     28        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    2729 
    2830        self.setWindowTitle("Slit Size Calculator") 
  • src/sas/qtgui/MainWindow/AboutBox.py

    r7385fec r33c0561  
    11import functools 
    2 from PyQt5 import QtWidgets 
     2from PyQt5 import QtWidgets, QtCore 
    33 
    44import sas.sasview 
     
    1414        super(AboutBox, self).__init__(parent) 
    1515        self.setupUi(self) 
     16        # disable the context help icon 
     17        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    1618 
    1719        self.setWindowTitle("About") 
  • src/sas/qtgui/MainWindow/CategoryManager.py

    r3d18691 r33c0561  
    135135        super(CategoryManager, self).__init__(parent) 
    136136        self.setupUi(self) 
     137 
     138        # disable the context help icon 
     139        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    137140 
    138141        self.communicator = manager.communicator() 
     
    327330        super(ChangeCategory, self).__init__(parent) 
    328331        self.setupUi(self) 
     332        # disable the context help icon 
     333        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    329334 
    330335        self.model = model 
  • src/sas/qtgui/MainWindow/GuiManager.py

    rd1ad101 r33c0561  
    5959        QDialog.__init__(self, parent) 
    6060        self.setupUi(self) 
     61        # disable the context help icon 
     62        self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) 
     63 
    6164 
    6265class GuiManager(object): 
  • src/sas/qtgui/MainWindow/MainWindow.py

    r09b7da68 r33c0561  
    6060    splash.show() 
    6161    app.setAttribute(Qt.AA_EnableHighDpiScaling) 
     62 
    6263    # fix for pyinstaller packages app to avoid ReactorAlreadyInstalledError 
    6364    import sys 
  • src/sas/qtgui/Perspectives/Fitting/ComplexConstraint.py

    r9c207f5 r33c0561  
    3030        self.setupUi(self) 
    3131        self.setModal(True) 
     32 
     33        # disable the context help icon 
     34        windowFlags = self.windowFlags() 
     35        self.setWindowFlags(windowFlags & ~QtCore.Qt.WindowContextHelpButtonHint) 
    3236 
    3337        # Useful globals 
     
    6165        self.cmdOK.clicked.connect(self.onApply) 
    6266        self.cmdHelp.clicked.connect(self.onHelp) 
     67        self.cmdAddAll.clicked.connect(self.onSetAll) 
     68 
    6369        self.txtConstraint.editingFinished.connect(self.validateFormula) 
    6470        self.cbModel1.currentIndexChanged.connect(self.onModelIndexChange) 
     
    7884        self.setupParamWidgets() 
    7985 
     86 
    8087        self.setupMenu() 
    8188 
    8289    def setupMenu(self): 
    83         # Add menu to the Apply button, if necessary 
     90        # Show Add All button, if necessary 
    8491        if self.cbModel1.currentText() ==self.cbModel2.currentText(): 
    85             self.cmdOK.setArrowType(QtCore.Qt.NoArrow) 
    86             self.cmdOK.setPopupMode(QtWidgets.QToolButton.DelayedPopup) 
    87             self.cmdOK.setMenu(None) 
    88             return 
    89         self.all_menu   = QtWidgets.QMenu() 
    90         self.actionAddAll = QtWidgets.QAction(self) 
    91         self.actionAddAll.setObjectName("actionAddAll") 
    92         self.actionAddAll.setText(QtCore.QCoreApplication.translate("self", "Add all")) 
    93         ttip = "Add constraints between all identically named parameters in both fitpages" 
    94         self.actionAddAll.setToolTip(ttip) 
    95         self.actionAddAll.triggered.connect(self.onSetAll) 
    96         self.all_menu.addAction(self.actionAddAll) 
    97         # https://bugreports.qt.io/browse/QTBUG-13663 
    98         self.all_menu.setToolTipsVisible(True) 
    99         self.cmdOK.setPopupMode(QtWidgets.QToolButton.MenuButtonPopup) 
    100         self.cmdOK.setArrowType(QtCore.Qt.DownArrow) 
    101         self.cmdOK.setMenu(self.all_menu) 
     92            self.cmdAddAll.setVisible(False) 
     93        else: 
     94            self.cmdAddAll.setVisible(True) 
     95        return 
    10296 
    10397    def setupParamWidgets(self): 
     
    127121        if len(items1)==0: 
    128122            self.cmdOK.setEnabled(False) 
     123            self.cmdAddAll.setEnabled(False) 
    129124            txt = "No parameters in model "+self.tab_names[0] +\ 
    130125                " are available for constraining." 
     
    132127        else: 
    133128            self.cmdOK.setEnabled(True) 
     129            self.cmdAddAll.setEnabled(True) 
    134130            txt = "" 
    135131            self.lblWarning.setText(txt) 
     
    193189        if not formula_is_valid: 
    194190            self.cmdOK.setEnabled(False) 
     191            self.cmdAddAll.setEnabled(False) 
    195192            self.txtConstraint.setStyleSheet("QLineEdit {background-color: red;}") 
    196193        else: 
    197194            self.cmdOK.setEnabled(True) 
     195            self.cmdAddAll.setEnabled(True) 
    198196            self.txtConstraint.setStyleSheet("QLineEdit {background-color: white;}") 
    199197 
  • src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py

    rbbcf9f0 r33c0561  
    112112        self.parent = parent 
    113113        self.setupUi(self) 
     114 
    114115        self.currentType = "FitPage" 
    115116        # Page id for fitting 
  • src/sas/qtgui/Perspectives/Fitting/FittingOptions.py

    r8873ab7 r33c0561  
    4141        super(FittingOptions, self).__init__(parent) 
    4242        self.setupUi(self) 
     43        # disable the context help icon 
     44        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    4345 
    4446        self.config = config 
  • src/sas/qtgui/Perspectives/Fitting/GPUOptions.py

    r8479735 r33c0561  
    4545        self.parent = parent 
    4646        self.setupUi(self) 
     47        # disable the context help icon 
     48        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    4749        self.addOpenCLOptions() 
    4850        self.createLinks() 
  • src/sas/qtgui/Perspectives/Fitting/MultiConstraint.py

    r09e0c32 r33c0561  
    1010 
    1111from PyQt5 import QtWidgets 
     12from PyQt5 import QtCore 
    1213 
    1314import sas.qtgui.Utilities.GuiUtils as GuiUtils 
     
    2930        self.setupUi(self) 
    3031        self.setModal(True) 
     32 
     33        # disable the context help icon 
     34        windowFlags = self.windowFlags() 
     35        self.setWindowFlags(windowFlags & ~QtCore.Qt.WindowContextHelpButtonHint) 
     36 
    3137        self.params = params 
    3238        self.parent = parent 
  • src/sas/qtgui/Perspectives/Fitting/UI/ComplexConstraintUI.ui

    r2e5081b r33c0561  
    139139       <property name="sizeHint" stdset="0"> 
    140140        <size> 
    141          <width>88</width> 
     141         <width>58</width> 
    142142         <height>20</height> 
    143143        </size> 
     
    146146     </item> 
    147147     <item> 
    148       <widget class="QToolButton" name="cmdOK"> 
     148      <widget class="QToolButton" name="cmdAddAll"> 
     149       <property name="sizePolicy"> 
     150        <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> 
     151         <horstretch>0</horstretch> 
     152         <verstretch>0</verstretch> 
     153        </sizepolicy> 
     154       </property> 
    149155       <property name="minimumSize"> 
    150156        <size> 
     
    154160       </property> 
    155161       <property name="toolTip"> 
     162        <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Add constraints between all identically named parameters in both fitpages&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> 
     163       </property> 
     164       <property name="text"> 
     165        <string>Add All</string> 
     166       </property> 
     167       <property name="popupMode"> 
     168        <enum>QToolButton::InstantPopup</enum> 
     169       </property> 
     170       <property name="toolButtonStyle"> 
     171        <enum>Qt::ToolButtonTextOnly</enum> 
     172       </property> 
     173       <property name="autoRaise"> 
     174        <bool>false</bool> 
     175       </property> 
     176       <property name="arrowType"> 
     177        <enum>Qt::DownArrow</enum> 
     178       </property> 
     179      </widget> 
     180     </item> 
     181     <item> 
     182      <widget class="QToolButton" name="cmdOK"> 
     183       <property name="sizePolicy"> 
     184        <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> 
     185         <horstretch>0</horstretch> 
     186         <verstretch>0</verstretch> 
     187        </sizepolicy> 
     188       </property> 
     189       <property name="minimumSize"> 
     190        <size> 
     191         <width>93</width> 
     192         <height>28</height> 
     193        </size> 
     194       </property> 
     195       <property name="toolTip"> 
    156196        <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Add the constraint as defined by the above expression.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> 
    157197       </property> 
     
    170210       <property name="arrowType"> 
    171211        <enum>Qt::DownArrow</enum> 
    172        </property> 
    173       </widget> 
    174      </item> 
    175      <item> 
    176       <widget class="QPushButton" name="cmdCancel"> 
    177        <property name="toolTip"> 
    178         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Close the window.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> 
    179        </property> 
    180        <property name="text"> 
    181         <string>Close</string> 
    182212       </property> 
    183213      </widget> 
     
    195225 </widget> 
    196226 <resources/> 
    197  <connections> 
    198   <connection> 
    199    <sender>cmdCancel</sender> 
    200    <signal>clicked()</signal> 
    201    <receiver>ComplexConstraintUI</receiver> 
    202    <slot>reject()</slot> 
    203    <hints> 
    204     <hint type="sourcelabel"> 
    205      <x>230</x> 
    206      <y>144</y> 
    207     </hint> 
    208     <hint type="destinationlabel"> 
    209      <x>179</x> 
    210      <y>82</y> 
    211     </hint> 
    212    </hints> 
    213   </connection> 
    214  </connections> 
     227 <connections/> 
    215228</ui> 
  • src/sas/qtgui/Plotting/AddText.py

    r53c771e r33c0561  
    1212        super(AddText, self).__init__(parent) 
    1313        self.setupUi(self) 
     14        # disable the context help icon 
     15        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    1416 
    1517        self._font = QtGui.QFont() 
  • src/sas/qtgui/Plotting/ColorMap.py

    r8fad50b r33c0561  
    2828        self.setupUi(self) 
    2929        assert(isinstance(data, Data2D)) 
     30        # disable the context help icon 
     31        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    3032 
    3133        self.data = data 
  • src/sas/qtgui/Plotting/LinearFit.py

    re4c475b7 r33c0561  
    3030 
    3131        self.setupUi(self) 
     32        # disable the context help icon 
     33        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
     34 
    3235        assert(isinstance(max_range, tuple)) 
    3336        assert(isinstance(fit_range, tuple)) 
  • src/sas/qtgui/Plotting/MaskEditor.py

    ra0ad146 r33c0561  
    33import numpy as np 
    44 
    5 from PyQt5 import QtWidgets 
     5from PyQt5 import QtWidgets, QtCore 
    66 
    77from sas.qtgui.Plotting.PlotterData import Data2D 
     
    2424 
    2525        self.setupUi(self) 
     26        # disable the context help icon 
     27        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    2628 
    2729        self.data = data 
  • src/sas/qtgui/Plotting/PlotProperties.py

    rfacf4ca r33c0561  
    1818        super(PlotProperties, self).__init__(parent) 
    1919        self.setupUi(self) 
     20        # disable the context help icon 
     21        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
     22 
    2023        self.setFixedSize(self.minimumSizeHint()) 
    2124 
  • src/sas/qtgui/Plotting/ScaleProperties.py

    r54492dc r33c0561  
    2727        super(ScaleProperties, self).__init__(parent) 
    2828        self.setupUi(self) 
     29        # disable the context help icon 
     30        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    2931 
    3032        # Set up comboboxes 
  • src/sas/qtgui/Plotting/SetGraphRange.py

    rd6b8a1d r33c0561  
    1717 
    1818        self.setupUi(self) 
     19        # disable the context help icon 
     20        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
     21 
    1922        assert(isinstance(x_range, tuple)) 
    2023        assert(isinstance(y_range, tuple)) 
  • src/sas/qtgui/Plotting/WindowTitle.py

    r4992ff2 r33c0561  
    33from "Graph_n" to any ASCII text. 
    44""" 
    5 from PyQt5 import QtWidgets 
     5from PyQt5 import QtWidgets, QtCore 
    66 
    77from sas.qtgui.Plotting.UI.WindowTitleUI import Ui_WindowTitle 
     
    1212        super(WindowTitle, self).__init__(parent) 
    1313        self.setupUi(self) 
     14        # disable the context help icon 
     15        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
     16 
    1417        self.txtTitle.setText(new_title) 
    1518 
  • src/sas/qtgui/Utilities/AddMultEditor.py

    r287d356 r33c0561  
    5656 
    5757        self.setupUi(self) 
     58        # disable the context help icon 
     59        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    5860 
    5961        #  uncheck self.chkOverwrite 
  • src/sas/qtgui/Utilities/ModelEditor.py

    rf2e199e r33c0561  
    1515        super(ModelEditor, self).__init__(parent) 
    1616        self.setupUi(self) 
     17        # disable the context help icon 
     18        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    1719 
    1820        self.is_python = is_python 
  • src/sas/qtgui/Utilities/PluginManager.py

    raed0532 r33c0561  
    33from shutil import copyfile 
    44 
    5 from PyQt5 import QtWidgets 
     5from PyQt5 import QtWidgets, QtCore 
    66 
    77from sas.sascalc.fit import models 
     
    2121        super(PluginManager, self).__init__(parent._parent) 
    2222        self.setupUi(self) 
     23 
     24        # disable the context help icon 
     25        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    2326 
    2427        self.parent = parent 
  • src/sas/qtgui/Utilities/ReportDialog.py

    r859d960 r33c0561  
    66from xhtml2pdf import pisa 
    77 
    8 from PyQt5 import QtWidgets 
     8from PyQt5 import QtWidgets, QtCore 
    99from PyQt5 import QtPrintSupport 
    1010 
     
    2323        super(ReportDialog, self).__init__(parent._parent) 
    2424        self.setupUi(self) 
     25        # disable the context help icon 
     26        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    2527 
    2628        assert isinstance(report_list, list) 
  • src/sas/qtgui/Utilities/TabbedModelEditor.py

    r59b925c1 r33c0561  
    66import traceback 
    77 
    8 from PyQt5 import QtWidgets 
     8from PyQt5 import QtWidgets, QtCore 
    99 
    1010from sas.sascalc.fit import models 
     
    2828 
    2929        self.setupUi(self) 
     30 
     31        # disable the context help icon 
     32        self.setWindowFlags(self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint) 
    3033 
    3134        # globals 
Note: See TracChangeset for help on using the changeset viewer.