Changeset 1543f0c in sasview for src


Ignore:
Timestamp:
Nov 10, 2017 5:24:52 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
f1f3e6a
Parents:
1ba88515
Message:

Updated GPUOptions for py3/qt5

Location:
src/sas/qtgui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/UI/MainWindowUI.ui

    r06ce180 r1543f0c  
    2525     <y>0</y> 
    2626     <width>915</width> 
    27      <height>26</height> 
     27     <height>21</height> 
    2828    </rect> 
    2929   </property> 
     
    504504    <string>GPU Options</string> 
    505505   </property> 
    506    <property name="softKeyRole"> 
    507     <enum>QAction::NoSoftKey</enum> 
    508    </property> 
    509506  </action> 
    510507 </widget> 
  • src/sas/qtgui/Perspectives/Fitting/GPUOptions.py

    rf629e62f r1543f0c  
    77 
    88import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    9 from PyQt4 import QtGui, QtCore, QtWebKit 
     9from PyQt5 import QtGui, QtCore, QtWebKit, QtWidgets 
    1010from sas.qtgui.Perspectives.Fitting.UI.GPUOptionsUI import Ui_GPUOptions 
    1111from sas.qtgui.Perspectives.Fitting.UI.GPUTestResultsUI import Ui_GPUTestResults 
     
    1818 
    1919try: 
    20     _encoding = QtGui.QApplication.UnicodeUTF8 
     20    _encoding = QtWidgets.QApplication.UnicodeUTF8 
    2121    def _translate(context, text, disambig): 
    22         return QtGui.QApplication.translate(context, text, disambig, _encoding) 
     22        return QtWidgets.QApplication.translate(context, text, disambig, _encoding) 
    2323except AttributeError: 
    2424    def _translate(context, text, disambig): 
    25         return QtGui.QApplication.translate(context, text, disambig) 
    26  
    27  
    28 class GPUOptions(QtGui.QDialog, Ui_GPUOptions): 
     25        return QtWidgets.QApplication.translate(context, text, disambig) 
     26 
     27 
     28class GPUOptions(QtWidgets.QDialog, Ui_GPUOptions): 
    2929    """ 
    3030    OpenCL Dialog to select the desired OpenCL driver 
     
    3939        self.setupUi(self) 
    4040        self.addOpenCLOptions() 
    41         self.setFixedSize(self.size()) 
    4241        self.createLinks() 
    4342 
     
    5150        for title, descr in cl_tuple: 
    5251            # Create an item for each openCL option 
    53             check_box = QtGui.QCheckBox() 
     52            check_box = QtWidgets.QCheckBox() 
    5453            check_box.setObjectName(_fromUtf8(descr)) 
    5554            check_box.setText(_translate("GPUOptions", descr, None)) 
     
    5958                check_box.click() 
    6059                self.clicked = True 
    61         self.openCLCheckBoxGroup.setMinimumWidth( 
    62             self.optionsLayout.sizeHint().width()) 
    63         self.setMinimumWidth(self.verticalLayout.sizeHint().width()) 
     60        self.openCLCheckBoxGroup.setMinimumWidth(self.optionsLayout.sizeHint().width()+10) 
    6461 
    6562    def createLinks(self): 
     
    6966        self.testButton.clicked.connect(self.testButtonClicked) 
    7067        self.helpButton.clicked.connect(self.helpButtonClicked) 
    71         for item in self.openCLCheckBoxGroup.findChildren(QtGui.QCheckBox): 
     68        for item in self.openCLCheckBoxGroup.findChildren(QtWidgets.QCheckBox): 
    7269            item.clicked.connect(self.checked) 
    7370 
     
    7774        """ 
    7875        checked = None 
    79         for box in self.openCLCheckBoxGroup.findChildren(QtGui.QCheckBox): 
     76        for box in self.openCLCheckBoxGroup.findChildren(QtWidgets.QCheckBox): 
    8077            if box.isChecked() and (str(box.text()) == self.sas_open_cl or ( 
    8178                    str(box.text()) == "No OpenCL" and self.sas_open_cl == "")): 
     
    103100        if 'sasmodels.kernelcl' in sys.modules: 
    104101            sasmodels.kernelcl.ENV = None 
     102        from importlib import reload # assumed Python > 3.3 
    105103        reload(sasmodels.core) 
    106104        return no_opencl_msg 
     
    199197 
    200198 
    201 class GPUTestResults(QtGui.QDialog, Ui_GPUTestResults): 
     199class GPUTestResults(QtWidgets.QDialog, Ui_GPUTestResults): 
    202200    """ 
    203201    OpenCL Dialog to modify the OpenCL options 
     
    207205        self.setupUi(self) 
    208206        self.resultsText.setText(_translate("GPUTestResults", msg, None)) 
    209         self.setFixedSize(self.size()) 
     207        #self.setFixedSize(self.size()) 
    210208        self.open() 
    211209 
  • src/sas/qtgui/Perspectives/Fitting/UI/GPUOptionsUI.ui

    rf629e62f r1543f0c  
    77    <x>0</x> 
    88    <y>0</y> 
    9     <width>432</width> 
    10     <height>241</height> 
     9    <width>424</width> 
     10    <height>245</height> 
    1111   </rect> 
    1212  </property> 
    1313  <property name="sizePolicy"> 
    14    <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 
     14   <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> 
    1515    <horstretch>0</horstretch> 
    1616    <verstretch>0</verstretch> 
     
    2222  <property name="windowIcon"> 
    2323   <iconset> 
    24     <normaloff>../../../UI/res/ball.ico</normaloff>../../../UI/res/ball.ico</iconset> 
     24    <normaloff>../../../../../../../../../../../Users/UI/res/ball.ico</normaloff>../../../../../../../../../../../Users/UI/res/ball.ico</iconset> 
    2525  </property> 
    26   <widget class="QWidget" name="verticalLayoutWidget_2"> 
    27    <property name="geometry"> 
    28     <rect> 
    29      <x>0</x> 
    30      <y>0</y> 
    31      <width>431</width> 
    32      <height>241</height> 
    33     </rect> 
    34    </property> 
    35    <layout class="QVBoxLayout" name="verticalLayout" stretch="5,1,0"> 
    36     <property name="sizeConstraint"> 
    37      <enum>QLayout::SetMinimumSize</enum> 
    38     </property> 
    39     <property name="margin"> 
    40      <number>10</number> 
    41     </property> 
    42     <item> 
    43      <widget class="QGroupBox" name="openCLCheckBoxGroup"> 
    44       <property name="title"> 
    45        <string>Available OpenCL Options</string> 
    46       </property> 
    47       <widget class="QWidget" name="verticalLayoutWidget"> 
    48        <property name="geometry"> 
    49         <rect> 
    50          <x>0</x> 
    51          <y>10</y> 
    52          <width>411</width> 
    53          <height>131</height> 
    54         </rect> 
     26  <layout class="QGridLayout" name="gridLayout_2"> 
     27   <item row="0" column="0"> 
     28    <layout class="QGridLayout" name="gridLayout"> 
     29     <item row="0" column="0" colspan="2"> 
     30      <widget class="QGroupBox" name="openCLCheckBoxGroup"> 
     31       <property name="sizePolicy"> 
     32        <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> 
     33         <horstretch>0</horstretch> 
     34         <verstretch>0</verstretch> 
     35        </sizepolicy> 
    5536       </property> 
    56        <layout class="QVBoxLayout" name="optionsLayout"> 
    57         <property name="sizeConstraint"> 
    58          <enum>QLayout::SetMinimumSize</enum> 
     37       <property name="minimumSize"> 
     38        <size> 
     39         <width>300</width> 
     40         <height>150</height> 
     41        </size> 
     42       </property> 
     43       <property name="title"> 
     44        <string>Available OpenCL Options</string> 
     45       </property> 
     46       <widget class="QWidget" name="verticalLayoutWidget"> 
     47        <property name="geometry"> 
     48         <rect> 
     49          <x>10</x> 
     50          <y>20</y> 
     51          <width>391</width> 
     52          <height>141</height> 
     53         </rect> 
    5954        </property> 
    60         <property name="bottomMargin"> 
    61          <number>0</number> 
    62         </property> 
    63        </layout> 
     55        <layout class="QVBoxLayout" name="optionsLayout"> 
     56         <property name="sizeConstraint"> 
     57          <enum>QLayout::SetMinimumSize</enum> 
     58         </property> 
     59         <property name="bottomMargin"> 
     60          <number>0</number> 
     61         </property> 
     62        </layout> 
     63       </widget> 
    6464      </widget> 
    65      </widget> 
    66     </item> 
    67     <item> 
    68      <widget class="QLabel" name="warningMessage"> 
    69       <property name="sizePolicy"> 
    70        <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> 
    71         <horstretch>0</horstretch> 
    72         <verstretch>0</verstretch> 
    73        </sizepolicy> 
    74       </property> 
    75       <property name="font"> 
    76        <font> 
    77         <pointsize>8</pointsize> 
    78        </font> 
    79       </property> 
    80       <property name="text"> 
    81        <string>WARNING: Running tests can take a few minutes!</string> 
    82       </property> 
    83       <property name="alignment"> 
    84        <set>Qt::AlignCenter</set> 
    85       </property> 
    86      </widget> 
    87     </item> 
    88     <item> 
    89      <layout class="QHBoxLayout" name="horizontalLayout"> 
    90       <property name="sizeConstraint"> 
    91        <enum>QLayout::SetMinimumSize</enum> 
    92       </property> 
    93       <item> 
    94        <widget class="QPushButton" name="okButton"> 
    95         <property name="text"> 
    96          <string>OK</string> 
    97         </property> 
    98        </widget> 
    99       </item> 
    100       <item> 
    101        <widget class="QPushButton" name="resetButton"> 
    102         <property name="text"> 
    103          <string>Reset</string> 
    104         </property> 
    105        </widget> 
    106       </item> 
    107       <item> 
    108        <widget class="QPushButton" name="testButton"> 
    109         <property name="text"> 
    110          <string>Test</string> 
    111         </property> 
    112        </widget> 
    113       </item> 
    114       <item> 
    115        <widget class="QPushButton" name="helpButton"> 
    116         <property name="text"> 
    117          <string>Help</string> 
    118         </property> 
    119         <property name="autoDefault"> 
    120          <bool>true</bool> 
    121         </property> 
    122        </widget> 
    123       </item> 
    124      </layout> 
    125     </item> 
    126    </layout> 
    127   </widget> 
     65     </item> 
     66     <item row="2" column="1"> 
     67      <layout class="QHBoxLayout" name="horizontalLayout"> 
     68       <property name="sizeConstraint"> 
     69        <enum>QLayout::SetMinimumSize</enum> 
     70       </property> 
     71       <item> 
     72        <widget class="QPushButton" name="okButton"> 
     73         <property name="text"> 
     74          <string>OK</string> 
     75         </property> 
     76        </widget> 
     77       </item> 
     78       <item> 
     79        <widget class="QPushButton" name="resetButton"> 
     80         <property name="text"> 
     81          <string>Reset</string> 
     82         </property> 
     83        </widget> 
     84       </item> 
     85       <item> 
     86        <widget class="QPushButton" name="testButton"> 
     87         <property name="text"> 
     88          <string>Test</string> 
     89         </property> 
     90        </widget> 
     91       </item> 
     92       <item> 
     93        <widget class="QPushButton" name="helpButton"> 
     94         <property name="text"> 
     95          <string>Help</string> 
     96         </property> 
     97         <property name="autoDefault"> 
     98          <bool>true</bool> 
     99         </property> 
     100        </widget> 
     101       </item> 
     102      </layout> 
     103     </item> 
     104     <item row="2" column="0"> 
     105      <spacer name="horizontalSpacer"> 
     106       <property name="orientation"> 
     107        <enum>Qt::Horizontal</enum> 
     108       </property> 
     109       <property name="sizeHint" stdset="0"> 
     110        <size> 
     111         <width>78</width> 
     112         <height>20</height> 
     113        </size> 
     114       </property> 
     115      </spacer> 
     116     </item> 
     117     <item row="1" column="0" colspan="2"> 
     118      <widget class="QLabel" name="warningMessage"> 
     119       <property name="sizePolicy"> 
     120        <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> 
     121         <horstretch>0</horstretch> 
     122         <verstretch>0</verstretch> 
     123        </sizepolicy> 
     124       </property> 
     125       <property name="font"> 
     126        <font> 
     127         <pointsize>8</pointsize> 
     128        </font> 
     129       </property> 
     130       <property name="text"> 
     131        <string>WARNING: Running tests can take a few minutes!</string> 
     132       </property> 
     133       <property name="alignment"> 
     134        <set>Qt::AlignCenter</set> 
     135       </property> 
     136      </widget> 
     137     </item> 
     138    </layout> 
     139   </item> 
     140  </layout> 
    128141 </widget> 
    129142 <resources/> 
    130143 <connections> 
     144  <connection> 
     145   <sender>resetButton</sender> 
     146   <signal>clicked()</signal> 
     147   <receiver>GPUOptions</receiver> 
     148   <slot>reject()</slot> 
     149   <hints> 
     150    <hint type="sourcelabel"> 
     151     <x>266</x> 
     152     <y>183</y> 
     153    </hint> 
     154    <hint type="destinationlabel"> 
     155     <x>219</x> 
     156     <y>88</y> 
     157    </hint> 
     158   </hints> 
     159  </connection> 
    131160  <connection> 
    132161   <sender>okButton</sender> 
     
    145174   </hints> 
    146175  </connection> 
    147   <connection> 
    148    <sender>resetButton</sender> 
    149    <signal>clicked()</signal> 
    150    <receiver>GPUOptions</receiver> 
    151    <slot>reject()</slot> 
    152    <hints> 
    153     <hint type="sourcelabel"> 
    154      <x>266</x> 
    155      <y>183</y> 
    156     </hint> 
    157     <hint type="destinationlabel"> 
    158      <x>219</x> 
    159      <y>88</y> 
    160     </hint> 
    161    </hints> 
    162   </connection> 
    163176 </connections> 
    164177</ui> 
  • src/sas/qtgui/Perspectives/Fitting/UI/GPUTestResultsUI.ui

    rc31d41e7 r1543f0c  
    77    <x>0</x> 
    88    <y>0</y> 
    9     <width>441</width> 
    10     <height>439</height> 
     9    <width>487</width> 
     10    <height>532</height> 
    1111   </rect> 
    1212  </property> 
     
    1818    <normaloff>../../../UI/res/ball.ico</normaloff>../../../UI/res/ball.ico</iconset> 
    1919  </property> 
    20   <widget class="QDialogButtonBox" name="okButton"> 
    21    <property name="geometry"> 
    22     <rect> 
    23      <x>10</x> 
    24      <y>400</y> 
    25      <width>411</width> 
    26      <height>32</height> 
    27     </rect> 
    28    </property> 
    29    <property name="orientation"> 
    30     <enum>Qt::Horizontal</enum> 
    31    </property> 
    32    <property name="standardButtons"> 
    33     <set>QDialogButtonBox::Ok</set> 
    34    </property> 
    35    <property name="centerButtons"> 
    36     <bool>false</bool> 
    37    </property> 
    38   </widget> 
    39   <widget class="QLabel" name="falingTestsNoOpenCL"> 
    40    <property name="geometry"> 
    41     <rect> 
    42      <x>20</x> 
    43      <y>330</y> 
    44      <width>401</width> 
    45      <height>31</height> 
    46     </rect> 
    47    </property> 
    48    <property name="text"> 
    49     <string>If tests fail on OpenCL devices, please select the No OpenCL option.</string> 
    50    </property> 
    51    <property name="alignment"> 
    52     <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> 
    53    </property> 
    54   </widget> 
    55   <widget class="QLabel" name="howToReportIssues"> 
    56    <property name="geometry"> 
    57     <rect> 
    58      <x>20</x> 
    59      <y>360</y> 
    60      <width>401</width> 
    61      <height>41</height> 
    62     </rect> 
    63    </property> 
    64    <property name="text"> 
    65     <string>In the case where many tests are failing, please consider sending the above report to help@sasview.org.</string> 
    66    </property> 
    67    <property name="alignment"> 
    68     <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> 
    69    </property> 
    70    <property name="wordWrap"> 
    71     <bool>true</bool> 
    72    </property> 
    73   </widget> 
    74   <widget class="QGroupBox" name="TestResultsBox"> 
    75    <property name="geometry"> 
    76     <rect> 
    77      <x>20</x> 
    78      <y>10</y> 
    79      <width>401</width> 
    80      <height>321</height> 
    81     </rect> 
    82    </property> 
    83    <property name="sizePolicy"> 
    84     <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 
    85      <horstretch>0</horstretch> 
    86      <verstretch>0</verstretch> 
    87     </sizepolicy> 
    88    </property> 
    89    <property name="title"> 
    90     <string>OpenCL test results</string> 
    91    </property> 
    92    <widget class="QLabel" name="resultsText"> 
    93     <property name="geometry"> 
    94      <rect> 
    95       <x>10</x> 
    96       <y>20</y> 
    97       <width>381</width> 
    98       <height>291</height> 
    99      </rect> 
    100     </property> 
    101     <property name="sizePolicy"> 
    102      <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 
    103       <horstretch>0</horstretch> 
    104       <verstretch>0</verstretch> 
    105      </sizepolicy> 
    106     </property> 
    107     <property name="frameShape"> 
    108      <enum>QFrame::StyledPanel</enum> 
    109     </property> 
    110     <property name="frameShadow"> 
    111      <enum>QFrame::Sunken</enum> 
    112     </property> 
    113     <property name="text"> 
    114      <string>TextLabel</string> 
    115     </property> 
    116     <property name="alignment"> 
    117      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> 
    118     </property> 
    119     <property name="wordWrap"> 
    120      <bool>true</bool> 
    121     </property> 
    122    </widget> 
    123   </widget> 
     20  <layout class="QGridLayout" name="gridLayout_3"> 
     21   <item row="0" column="0"> 
     22    <layout class="QGridLayout" name="gridLayout_2"> 
     23     <item row="0" column="0"> 
     24      <widget class="QGroupBox" name="TestResultsBox"> 
     25       <property name="sizePolicy"> 
     26        <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> 
     27         <horstretch>0</horstretch> 
     28         <verstretch>0</verstretch> 
     29        </sizepolicy> 
     30       </property> 
     31       <property name="title"> 
     32        <string>OpenCL test results</string> 
     33       </property> 
     34       <layout class="QGridLayout" name="gridLayout"> 
     35        <item row="0" column="0"> 
     36         <widget class="QTextEdit" name="resultsText"> 
     37          <property name="sizePolicy"> 
     38           <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> 
     39            <horstretch>0</horstretch> 
     40            <verstretch>0</verstretch> 
     41           </sizepolicy> 
     42          </property> 
     43          <property name="minimumSize"> 
     44           <size> 
     45            <width>300</width> 
     46            <height>300</height> 
     47           </size> 
     48          </property> 
     49          <property name="readOnly"> 
     50           <bool>true</bool> 
     51          </property> 
     52         </widget> 
     53        </item> 
     54       </layout> 
     55      </widget> 
     56     </item> 
     57     <item row="1" column="0"> 
     58      <widget class="QLabel" name="falingTestsNoOpenCL"> 
     59       <property name="text"> 
     60        <string>If tests fail on OpenCL devices, please select the No OpenCL option.</string> 
     61       </property> 
     62       <property name="alignment"> 
     63        <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> 
     64       </property> 
     65      </widget> 
     66     </item> 
     67     <item row="2" column="0"> 
     68      <widget class="QLabel" name="howToReportIssues"> 
     69       <property name="text"> 
     70        <string>In the case where many tests are failing, please consider sending the above report to help@sasview.org.</string> 
     71       </property> 
     72       <property name="alignment"> 
     73        <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> 
     74       </property> 
     75       <property name="wordWrap"> 
     76        <bool>true</bool> 
     77       </property> 
     78      </widget> 
     79     </item> 
     80     <item row="3" column="0"> 
     81      <layout class="QHBoxLayout" name="horizontalLayout"> 
     82       <item> 
     83        <spacer name="horizontalSpacer"> 
     84         <property name="orientation"> 
     85          <enum>Qt::Horizontal</enum> 
     86         </property> 
     87         <property name="sizeHint" stdset="0"> 
     88          <size> 
     89           <width>218</width> 
     90           <height>20</height> 
     91          </size> 
     92         </property> 
     93        </spacer> 
     94       </item> 
     95       <item> 
     96        <widget class="QDialogButtonBox" name="okButton"> 
     97         <property name="orientation"> 
     98          <enum>Qt::Horizontal</enum> 
     99         </property> 
     100         <property name="standardButtons"> 
     101          <set>QDialogButtonBox::Ok</set> 
     102         </property> 
     103         <property name="centerButtons"> 
     104          <bool>false</bool> 
     105         </property> 
     106        </widget> 
     107       </item> 
     108      </layout> 
     109     </item> 
     110    </layout> 
     111   </item> 
     112  </layout> 
    124113 </widget> 
    125114 <resources/> 
Note: See TracChangeset for help on using the changeset viewer.