Changeset 9e426c1 in sasview for src/sas/qtgui/DataExplorer.py


Ignore:
Timestamp:
Jun 21, 2016 8:07:33 AM (8 years ago)
Author:
Piotr Rozyczko <piotr.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:
f82ab8c
Parents:
1042dba
Message:

More main window items, system close, update checker, doc viewer etc.

File:
1 edited

Legend:

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

    r1042dba r9e426c1  
    8585        """ 
    8686        dir = QtGui.QFileDialog.getExistingDirectory(self, "Choose a directory", "", 
    87               QtGui.QFileDialog.ShowDirsOnly) 
     87              QtGui.QFileDialog.ShowDirsOnly | QtGui.QFileDialog.DontUseNativeDialog) 
    8888        if dir is None: 
    8989            return 
     
    171171        """ 
    172172        Create a new matplotlib chart from selected data 
     173 
     174        TODO: Add 2D-functionality 
    173175        """ 
    174176 
     
    192194        # Location is automatically saved - no need to keep track of the last dir 
    193195        # But only with Qt built-in dialog (non-platform native) 
    194         paths = QtGui.QFileDialog.getOpenFileName(self, "Choose a file", "", 
     196        paths = QtGui.QFileDialog.getOpenFileNames(self, "Choose a file", "", 
    195197                wlist, None, QtGui.QFileDialog.DontUseNativeDialog) 
    196198        if paths is None: 
    197199            return 
    198200 
     201        if type(paths) == QtCore.QStringList: 
     202            paths = [str(f) for f in paths] 
     203 
    199204        if paths.__class__.__name__ != "list": 
    200205            paths = [paths] 
    201206 
    202         path_str=[] 
    203         for path in paths: 
    204             if str(path): 
    205                 path_str.append(str(path)) 
    206  
    207         return path_str 
     207        return paths 
    208208 
    209209    def readData(self, path): 
     
    402402        Post message to status bar and update the data manager 
    403403        """ 
     404        # Don't show "empty" rows with data objects 
     405        self.proxy.setFilterRegExp(r"[^()]") 
     406 
     407        # Reset the model so the view gets updated. 
    404408        self.model.reset() 
    405         assert(type(output), tuple) 
     409        assert type(output)== tuple 
    406410 
    407411        output_data = output[0] 
     
    433437        checkbox_item.setText(os.path.basename(p_file)) 
    434438 
    435         # Add "Info" item 
    436         # info_item = QtGui.QStandardItem("Info") 
    437  
    438439        # Add the actual Data1D/Data2D object 
    439440        object_item = QtGui.QStandardItem() 
     
    443444 
    444445        # Add rows for display in the view 
    445         # self.addExtraRows(info_item, data) 
    446446        info_item = infoFromData(data) 
    447447 
     
    452452        self.model.appendRow(checkbox_item) 
    453453         
    454         # Don't show "empty" rows with data objects 
    455         self.proxy.setFilterRegExp(r"[^()]") 
    456  
    457454    def updateModelFromPerspective(self, model_item): 
    458455        """ 
Note: See TracChangeset for help on using the changeset viewer.