- Timestamp:
- Nov 3, 2016 10:55:38 AM (8 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:
- 469b4622
- Parents:
- e4676c8
- 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 324 324 Freeze selected theory rows. 325 325 326 "Freezing" means taking the plottable data from the filenameitem327 and copying it to a separate top-level item .328 """ 329 # Figure out which _inner_rows are checked326 "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 330 330 # Use 'while' so the row count is forced at every iteration 331 331 outer_index = -1 332 332 theories_copied = 0 333 while outer_index < self. model.rowCount():333 while outer_index < self.theory_model.rowCount(): 334 334 outer_index += 1 335 outer_item = self. model.item(outer_index)335 outer_item = self.theory_model.item(outer_index) 336 336 if not outer_item: 337 337 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() 352 348 353 349 freeze_msg = "" … … 355 351 return 356 352 elif theories_copied == 1: 357 freeze_msg = "1 theory copied tothe Theory tab as a data set"353 freeze_msg = "1 theory copied from the Theory tab as a data set" 358 354 elif theories_copied > 1: 359 freeze_msg = "%i theories copied tothe Theory tab as data sets" % theories_copied355 freeze_msg = "%i theories copied from the Theory tab as data sets" % theories_copied 360 356 else: 361 357 freeze_msg = "Unexpected number of theories copied: %i" % theories_copied -
src/sas/qtgui/UI/DataExplorerUI.ui
r8cb6cd6 rca8b853 143 143 <layout class="QHBoxLayout" name="horizontalLayout"> 144 144 <item> 145 <widget class="QPushButton" name="cmdFreeze">146 <property name="text">147 <string>Freeze Theory</string>148 </property>149 </widget>150 </item>151 <item>152 145 <spacer name="horizontalSpacer"> 153 146 <property name="orientation"> … … 295 288 <layout class="QHBoxLayout" name="horizontalLayout_3"> 296 289 <item> 290 <widget class="QPushButton" name="cmdFreeze"> 291 <property name="text"> 292 <string>Freeze Theory</string> 293 </property> 294 </widget> 295 </item> 296 <item> 297 297 <spacer name="horizontalSpacer_5"> 298 298 <property name="orientation"> … … 301 301 <property name="sizeHint" stdset="0"> 302 302 <size> 303 <width> 353</width>303 <width>218</width> 304 304 <height>20</height> 305 305 </size>
Note: See TracChangeset
for help on using the changeset viewer.