Changeset ca8b853 in sasview


Ignore:
Timestamp:
Nov 3, 2016 10:55:38 AM (8 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:
469b4622
Parents:
e4676c8
Message:

Modified behaviour of theory freeze

Location:
src/sas/qtgui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/DataExplorer.py

    • Property mode changed from 100755 to 100644
    r630155bd rca8b853  
    324324        Freeze selected theory rows. 
    325325 
    326         "Freezing" means taking the plottable data from the filename item 
    327         and copying it to a separate top-level item. 
    328         """ 
    329         # Figure out which _inner_ rows are checked 
     326        "Freezing" means taking the plottable data from the Theory item 
     327        and copying it to a separate top-level item in Data. 
     328        """ 
     329        # Figure out which rows are checked 
    330330        # Use 'while' so the row count is forced at every iteration 
    331331        outer_index = -1 
    332332        theories_copied = 0 
    333         while outer_index < self.model.rowCount(): 
     333        while outer_index < self.theory_model.rowCount(): 
    334334            outer_index += 1 
    335             outer_item = self.model.item(outer_index) 
     335            outer_item = self.theory_model.item(outer_index) 
    336336            if not outer_item: 
    337337                continue 
    338             # Should be just two rows: data and Info 
    339             for inner_index in xrange(outer_item.rowCount()): 
    340                 subitem = outer_item.child(inner_index) 
    341                 if subitem and \ 
    342                    subitem.isCheckable() and \ 
    343                    subitem.checkState() == QtCore.Qt.Checked: 
    344                     theories_copied += 1 
    345                     new_item = self.recursivelyCloneItem(subitem) 
    346                     # Append a "unique" descriptor to the name 
    347                     time_bit = str(time.time())[7:-1].replace('.', '') 
    348                     new_name = new_item.text() + '_@' + time_bit 
    349                     new_item.setText(new_name) 
    350                     self.theory_model.appendRow(new_item) 
    351             self.theory_model.reset() 
     338            if outer_item.isCheckable() and \ 
     339                   outer_item.checkState() == QtCore.Qt.Checked: 
     340                theories_copied += 1 
     341                new_item = self.recursivelyCloneItem(outer_item) 
     342                # Append a "unique" descriptor to the name 
     343                time_bit = str(time.time())[7:-1].replace('.', '') 
     344                new_name = new_item.text() + '_@' + time_bit 
     345                new_item.setText(new_name) 
     346                self.model.appendRow(new_item) 
     347            self.model.reset() 
    352348 
    353349        freeze_msg = "" 
     
    355351            return 
    356352        elif theories_copied == 1: 
    357             freeze_msg = "1 theory copied to the Theory tab as a data set" 
     353            freeze_msg = "1 theory copied from the Theory tab as a data set" 
    358354        elif theories_copied > 1: 
    359             freeze_msg = "%i theories copied to the Theory tab as data sets" % theories_copied 
     355            freeze_msg = "%i theories copied from the Theory tab as data sets" % theories_copied 
    360356        else: 
    361357            freeze_msg = "Unexpected number of theories copied: %i" % theories_copied 
  • src/sas/qtgui/UI/DataExplorerUI.ui

    r8cb6cd6 rca8b853  
    143143        <layout class="QHBoxLayout" name="horizontalLayout"> 
    144144         <item> 
    145           <widget class="QPushButton" name="cmdFreeze"> 
    146            <property name="text"> 
    147             <string>Freeze Theory</string> 
    148            </property> 
    149           </widget> 
    150          </item> 
    151          <item> 
    152145          <spacer name="horizontalSpacer"> 
    153146           <property name="orientation"> 
     
    295288        <layout class="QHBoxLayout" name="horizontalLayout_3"> 
    296289         <item> 
     290          <widget class="QPushButton" name="cmdFreeze"> 
     291           <property name="text"> 
     292            <string>Freeze Theory</string> 
     293           </property> 
     294          </widget> 
     295         </item> 
     296         <item> 
    297297          <spacer name="horizontalSpacer_5"> 
    298298           <property name="orientation"> 
     
    301301           <property name="sizeHint" stdset="0"> 
    302302            <size> 
    303              <width>353</width> 
     303             <width>218</width> 
    304304             <height>20</height> 
    305305            </size> 
Note: See TracChangeset for help on using the changeset viewer.