Changeset d9e7792 in sasview for src/sas/qtgui


Ignore:
Timestamp:
Nov 30, 2018 4:57:46 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_sync_sascalc
Children:
99f8760, 11a336f, 9d23e4c
Parents:
5d75a181
Message:

Show Plot now restores minimized plots. SASVIEW-1221 == trac#13
Added "Minimize all plots" to Window menu
Changed draw → draw_idle to avoid weird numpy linalg errors

Location:
src/sas/qtgui
Files:
4 edited

Legend:

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

    r5d75a181 rd9e7792  
    11021102            if data.plot_role != Data1D.ROLE_DATA: 
    11031103                self.active_plots[data_id].replacePlot(data_id, data) 
     1104                # restore minimized window, if applicable 
     1105                self.active_plots[data_id].showNormal() 
    11041106            return True 
    11051107        elif data_id in ids_vals: 
    11061108            if data.plot_role != Data1D.ROLE_DATA: 
    11071109                list(self.active_plots.values())[ids_vals.index(data_id)].replacePlot(data_id, data) 
     1110                self.active_plots[data_id].showNormal() 
    11081111            return True 
    11091112        return False 
     
    16491652                logging.error("Closing of %s failed:\n %s" % (plot_id, str(ex))) 
    16501653 
     1654    def minimizeAllPlots(self): 
     1655        """ 
     1656        Minimize all currently displayed plots 
     1657        """ 
     1658        for plot_id in PlotHelper.currentPlots(): 
     1659            plotter = PlotHelper.plotById(plot_id) 
     1660            plotter.showMinimized() 
     1661 
    16511662    def closePlotsForItem(self, item): 
    16521663        """ 
  • src/sas/qtgui/MainWindow/GuiManager.py

    re5ae812 rd9e7792  
    521521        self._workspace.actionNext.triggered.connect(self.actionNext) 
    522522        self._workspace.actionPrevious.triggered.connect(self.actionPrevious) 
     523        self._workspace.actionMinimizePlots.triggered.connect(self.actionMinimizePlots) 
    523524        self._workspace.actionClosePlots.triggered.connect(self.actionClosePlots) 
    524525        # Analysis 
     
    994995        pass 
    995996 
     997    def actionMinimizePlots(self): 
     998        """ 
     999        Minimizes all Plotters and Plotter2Ds. 
     1000        """ 
     1001        self.filesWidget.minimizeAllPlots() 
     1002        pass 
     1003 
    9961004    #============ HELP ================= 
    9971005    def actionDocumentation(self): 
  • src/sas/qtgui/MainWindow/UI/MainWindowUI.ui

    r6bc0840 rd9e7792  
    128128    <addaction name="actionPrevious"/> 
    129129    <addaction name="separator"/> 
     130    <addaction name="actionMinimizePlots"/> 
    130131    <addaction name="actionClosePlots"/> 
    131132   </widget> 
     
    577578   </property> 
    578579  </action> 
     580  <action name="actionMinimizePlots"> 
     581   <property name="text"> 
     582    <string>Minimize All Plots</string> 
     583   </property> 
     584  </action> 
    579585 </widget> 
    580586 <resources/> 
  • src/sas/qtgui/Plotting/Plotter.py

    rc30822c rd9e7792  
    205205 
    206206        # refresh canvas 
    207         self.canvas.draw() 
     207        self.canvas.draw_idle() 
    208208 
    209209    def createContextMenu(self): 
     
    352352            # Update the list of annotations 
    353353            self.textList.append(new_text) 
    354             self.canvas.draw() 
     354            self.canvas.draw_idle() 
    355355 
    356356    def onRemoveText(self): 
     
    460460        self.ax.set_xlabel(xl) 
    461461        self.ax.set_ylabel(yl) 
    462         self.canvas.draw() 
     462        self.canvas.draw_idle() 
    463463 
    464464    def onFreeze(self, id): 
     
    694694        self.legend_pos_loc = tuple(loc_in_norm_axes) 
    695695        self.legend._loc = self.legend_pos_loc 
    696         # self.canvas.draw() 
    697696        self.canvas.draw_idle() 
    698697 
Note: See TracChangeset for help on using the changeset viewer.