<s> '''<STR_LIT>''' <EOL> import clr <EOL> import i18n <EOL> from resources import Resources <EOL> from cvform import CVForm <EOL> from configform import ConfigForm <EOL> clr . AddReference ( '<STR_LIT>' ) <EOL> from System . Windows . Forms import AutoScaleMode , Button , DialogResult , Label <EOL> clr . AddReference ( '<STR_LIT>' ) <EOL> from System . Drawing import Point , Size <EOL> class WelcomeForm ( CVForm ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , scraper , books ) : <EOL> '''<STR_LIT>''' <EOL> CVForm . __init__ ( self , scraper . comicrack . MainWindow , "<STR_LIT>" ) <EOL> self . __build_gui ( books ) ; <EOL> def __build_gui ( self , books ) : <EOL> '''<STR_LIT>''' <EOL> label = self . __build_label ( books ) <EOL> ok = self . __build_okbutton ( ) <EOL> settings = self . __build_settingsbutton ( ) <EOL> cancel = self . __build_cancelbutton ( ) <EOL> self . AcceptButton = ok <EOL> self . CancelButton = cancel <EOL> self . AutoScaleMode = AutoScaleMode . Font <EOL> self . Text = Resources . SCRIPT_FULLNAME <EOL> self . ClientSize = Size ( <NUM_LIT> , <NUM_LIT:100> ) <EOL> self . Controls . Add ( label ) <EOL> self . Controls . Add ( ok ) <EOL> self . Controls . Add ( cancel ) <EOL> self . Controls . Add ( settings ) <EOL> ok . TabIndex = <NUM_LIT:0> <EOL> cancel . TabIndex = <NUM_LIT:1> <EOL> label . TabIndex = <NUM_LIT:2> <EOL> settings . TabIndex = <NUM_LIT:3> <EOL> def __build_label ( self , books ) : <EOL> '''<STR_LIT>''' <EOL> plural = len ( books ) != <NUM_LIT:1> <EOL> label = Label ( ) <EOL> label . UseMnemonic = False <EOL> label . AutoSize = True <EOL> label . Location = Point ( <NUM_LIT:9> , <NUM_LIT:10> ) <EOL> label . Size = Size ( <NUM_LIT> , <NUM_LIT> ) <EOL> label . Text = i18n . get ( "<STR_LIT>" ) . format ( len ( books ) ) if plural else i18n . get ( "<STR_LIT>" ) <EOL> return label <EOL> def __build_okbutton ( self ) : <EOL> '''<STR_LIT>''' <EOL> button = Button ( ) <EOL> button . DialogResult = DialogResult . OK <EOL> button . Location = Point ( <NUM_LIT:10> , <NUM_LIT> ) <EOL> button . Size = Size ( <NUM_LIT> , <NUM_LIT> ) <EOL> button . Text = i18n . get ( "<STR_LIT>" ) <EOL> button . UseVisualStyleBackColor = True <EOL> return button <EOL> def __build_settingsbutton ( self ) : <EOL> '''<STR_LIT>''' <EOL> button = Button ( ) <EOL> button . Click += self . __show_configform <EOL> button . Location = Point ( <NUM_LIT> , <NUM_LIT> ) <EOL> button . Size = Size ( <NUM_LIT:100> , <NUM_LIT> ) <EOL> button . Text = i18n . get ( "<STR_LIT>" ) <EOL> button . UseVisualStyleBackColor = True <EOL> return button <EOL> def __build_cancelbutton ( self ) : <EOL> '''<STR_LIT>''' <EOL> button = Button ( ) <EOL> button . DialogResult = DialogResult . Cancel <EOL> button . Location = Point ( <NUM_LIT> , <NUM_LIT> ) <EOL> button . Size = Size ( <NUM_LIT> , <NUM_LIT> ) <EOL> button . Text = i18n . get ( "<STR_LIT>" ) <EOL> button . UseVisualStyleBackColor = True <EOL> return button <EOL> def show_form ( self ) : <EOL> '''<STR_LIT>''' <EOL> dialogAnswer = self . ShowDialog ( self . Owner ) <EOL> return dialogAnswer == DialogResult . OK ; <EOL> def __show_configform ( self , sender , args ) : <EOL> '''<STR_LIT>''' <EOL> with ConfigForm ( self ) as config_form : <EOL> config_form . show_form ( ) </s>
