#NEWLINE# def __init__( self , parent , title = 'Language selection' , name = 'Language codes' , instruction = 'Click button when you are done' ) : #NEWLINE# #INDENT# super ( LanguageSelector , self ) . __init__ ( None , ( QtCore . Qt . WindowSystemMenuHint | QtCore . Qt . WindowTitleHint ) ) #NEWLINE# self . qm_files_choices = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . parent = parent #NEWLINE# qm_files = utils . find_qm_files ( ) #NEWLINE# group_box = QtGui . QGroupBox ( name ) #NEWLINE# group_box_layout = QtGui . QGridLayout ( ) #NEWLINE# for ( i , locale ) in enumerate ( qm_files ) : #NEWLINE# #INDENT# check_box = QtGui . QCheckBox ( locale ) #NEWLINE# check_box . setAutoExclusive ( True ) #NEWLINE# self . qm_files_choices [ check_box ] = locale #NEWLINE# check_box . toggled . connect ( self . check_box_toggled ) #NEWLINE# group_box_layout . addWidget ( check_box , ( i / 4 ) , ( i % 4 ) ) #NEWLINE# #UNINDENT# check_box = QtGui . QCheckBox ( 'default' ) #NEWLINE# check_box . setAutoExclusive ( True ) #NEWLINE# self . qm_files_choices [ check_box ] = 'default' #NEWLINE# check_box . toggled . connect ( self . check_box_toggled ) #NEWLINE# i = len ( qm_files ) #NEWLINE# group_box_layout . addWidget ( check_box , ( i / 4 ) , ( i % 4 ) ) #NEWLINE# group_box . setLayout ( group_box_layout ) #NEWLINE# button_box = QtGui . QDialogButtonBox ( ) #NEWLINE# confirm_button = button_box . addButton ( QtGui . QDialogButtonBox . Ok ) #NEWLINE# confirm_button . clicked . connect ( self . confirm ) #NEWLINE# main_layout = QtGui . QVBoxLayout ( ) #NEWLINE# main_layout . addWidget ( group_box ) #NEWLINE# main_layout . addWidget ( QtGui . QLabel ( instruction ) ) #NEWLINE# main_layout . addWidget ( button_box ) #NEWLINE# self . setLayout ( main_layout ) #NEWLINE# self . setWindowTitle ( title ) #NEWLINE# self . show ( ) #NEWLINE# self . raise_ ( )