Ñò ur™Vc @s´dZddkZddkZddklZddklZddklZl Z l Z ddk l Z ddk lZddklZdd klZd efd „ƒYZdS( s Window that represents the entire terminal, and 'top-level' functions, such as capturing keystrokes that will change the screen iÿÿÿÿN(t ColorTheme(t ErrorWindow(t textwidthtcenter_columnst get_encoding(t InnerWindow(tListItem(t ScrollWindow(t WindowAreat MainWindowcBsÑeZdZded„Zd„Zd„Zd„Zd„Z d„Z e d„ƒZ e d„ƒZ e d „ƒZe d „ƒZd „Zd „Zd „Zd„Zeigd„Zd„Zdd„ZRS(s„Represent initscr (the whole screen), and break it into a border, header, and central region. Map F# keystrokes to Actions cCsÏ|dj o ||_ntd|ƒ|_||_||_|iƒdddf|_|i|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_||_d|_|iƒdS(skSet the theme, and call reset to initialize the terminal to prepare for the first screen. tforce_bwiiN(tNonetthemeRt screen_listtinitscrtgetmaxyxtdefault_cursor_post cursor_postfootertheadert_cur_header_textt central_areat popup_wint error_linet _active_wintactionst_default_actionstdefault_actionstreset(tselfRR RR R ((s../main_window.pyt__init__2s$               cCs\|iiƒ|iiƒ|iiƒ|iiƒ|i|ijo|iiƒndS(sCompletely repaint the screenN(Rt redrawwinRRRRR(R((s../main_window.pyRTs     cCs!ti|iƒŒtiƒdS(sWrapper to curses.doupdate()N(tcursestsetsyxtget_cursor_loctdoupdate(R((s../main_window.pyt do_update]scCs-|iiƒ}|djo |i}n|S(sRRetrieve the current cursor position from the active UI element. N(RR"R R(Rtcursor((s../main_window.pyR"bs  c Cs |iiƒ}|d}|d}td||ddƒ}t|d|id|iiƒ|_|iid|ddƒ}|ii|ddddƒ}|ii|ddd|dƒ}|||g|i_|ii |iiƒtd|dddƒ}t|d|id|ii ƒ|_ t|d|dddƒ} t| ddd|iƒ|_ |i |_ t| i d| id d d| i dƒ} t| d |i d|iid |iiƒ|_td|d|ddƒ} t| d|iƒ|_|iƒd S(ssCreate the InnerWindows representing the header, footer/border, error line, and main central_area iit color_themetcoloriit border_sizei iitwindowthighlight_colorN(ii(RRRRR tborderRtderwint more_windowst set_colorRRRtlinestcolumnsRt error_msgRRRt reset_actions( Rt window_sizet win_size_yt win_size_xt footer_areattoptlefttrightt header_areatcentral_win_areatpopup_win_areat error_area((s../main_window.pyRls8  #     cCsDg}|iD]}|ti|ƒq~}||_|iƒdS(sqReset the actions to the defaults, clearing any custom actions registered by individual screens N(RtcopyRtset_default_actions(Rt_[1]tactionR((s../main_window.pyR2Žs- cCs|itiS(N(RR tKEY_F2(R((s../main_window.pytcontinue_action™scCs|itiS(N(RR tKEY_F3(R((s../main_window.pyt back_actionscCs|itiS(N(RR tKEY_F6(R((s../main_window.pyt help_action¡scCs|itiS(N(RR tKEY_F9(R((s../main_window.pyt quit_action¥scCsB|iiƒ|iiƒ|iiƒ|iiƒ|iƒdS(s*Clear all InnerWindows and reset_actions()N(RtclearRRRt clear_errR2(R((s../main_window.pyRJ©s     cCs9t||iiidƒ}|ii|ƒ||_dS(sSet the header_textiN(RRtareaR0tadd_textR(Rt header_textttext((s../main_window.pytset_header_text±scCs1h|_x!|iD]}||i|iR t&solaris_install.terminalui.color_themeRt'solaris_install.terminalui.error_windowRtsolaris_install.terminalui.i18nRRRt'solaris_install.terminalui.inner_windowRt$solaris_install.terminalui.list_itemRt(solaris_install.terminalui.scroll_windowRt&solaris_install.terminalui.window_areaRtobjectR (((s../main_window.pyts