#NEWLINE# def update_item_view( self ) : #NEWLINE# #INDENT# 'Update item details view with data from currently selected item.' #NEWLINE# try : #NEWLINE# #INDENT# selected = self . ui . items . selectedItems ( ) [ 0 ] . name #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# item = self . items . get_item ( selected ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# logging . warning ( ( 'Unable to load asset ' + selected ) ) #NEWLINE# return #NEWLINE# #UNINDENT# inv_icon_file = self . items . get_item_icon ( selected ) #NEWLINE# if ( inv_icon_file is not None ) : #NEWLINE# #INDENT# icon = QPixmap . fromImage ( ImageQt ( inv_icon_file ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# image_file = self . items . get_item_image ( selected ) #NEWLINE# if ( image_file is not None ) : #NEWLINE# #INDENT# icon = QPixmap . fromImage ( ImageQt ( image_file ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# icon = QPixmap . fromImage ( QImage . fromData ( self . assets . items ( ) . missing_icon ( ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# icon = self . scale_image_icon ( icon , 64 , 64 ) #NEWLINE# self . ui . item_icon . setPixmap ( icon ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# logging . warning ( ( 'Unable to load item image: ' + selected ) ) #NEWLINE# self . ui . item_icon . setPixmap ( QPixmap ( ) ) #NEWLINE# #UNINDENT# self . ui . short_desc . setText ( generate_item_info ( item [ 0 ] ) ) #NEWLINE# try : #NEWLINE# #INDENT# row = 0 #NEWLINE# self . ui . info . setRowCount ( len ( item [ 0 ] ) ) #NEWLINE# for key in sorted ( item [ 0 ] . keys ( ) ) : #NEWLINE# #INDENT# text = ( ( str ( key ) + ': ' ) + str ( item [ 0 ] [ key ] ) ) #NEWLINE# table_item = QTableWidgetItem ( text ) #NEWLINE# table_item . setToolTip ( text ) #NEWLINE# self . ui . info . setItem ( row , 0 , table_item ) #NEWLINE# row += 1 #NEWLINE# #UNINDENT# #UNINDENT# except TypeError : #NEWLINE# #INDENT# self . ui . info . setRowCount ( 0 ) #NEWLINE# logging . error ( 'No item data' ) #NEWLINE# #UNINDENT# self . item_browse_select = selected