def importProfile(self, filename=''): """ Exports the current profile to a file. :param filename | <str> """ if (not (filename and isinstance(filename, basestring))): filename = QFileDialog.getOpenFileName(self, 'Import Layout from...', QDir.currentPath(), 'XView (*.xview)') if type(filename) == tuple: filename = str(filename[0]) filename = str(filename) if not filename: return if not filename.endswith('.xview'): filename += '.xview' profile = XViewProfile.load(filename) if (not profile): return profile.restore(self)
def importProfile( self, filename = '' ): """ Exports the current profile to a file. :param filename | <str> """ if ( not (filename and isinstance(filename, basestring)) ): filename = QFileDialog.getOpenFileName( self, 'Import Layout from...', QDir.currentPath(), 'XView (*.xview)') if type(filename) == tuple: filename = str(filename[0]) filename = str(filename) if not filename: return if not filename.endswith('.xview'): filename += '.xview' profile = XViewProfile.load(filename) if ( not profile ): return profile.restore(self)
def importProfile(self, filename=None): """ Imports the profiles from the given filename. :param filename | <str> || None """ if not filename: filename = QFileDialog.getOpenFileName(self, 'Import Perspective', '', 'XML Files (*.xml)') if type(filename) == tuple: filename = nativestring(filename[0]) if not (filename and os.path.exists(filename)): return False prof = XViewProfile.load(filename) if prof: self.addProfile(prof)
def importProfile(self, filename=None): """ Imports the profiles from the given filename. :param filename | <str> || None """ if not filename: filename = QFileDialog.getOpenFileName( self, 'Import Perspective', '', 'XML Files (*.xml)') if type(filename) == tuple: filename = nativestring(filename[0]) if not (filename and os.path.exists(filename)): return False prof = XViewProfile.load(filename) if prof: self.addProfile(prof)