+
    Ki4  c                   s|    ^ RI HtHt ^ RIHtHt ^ RIHt ^ RIH	t	  ! R R4      t
 ! R R]P                  4      tR	# )
    )CallableOptional)GtkPango)schedule_repeating_at_idle)loggerc                   s|   a  ] tR t^	t o RtRV 3R lR llt]RV 3R lR ll4       t]V 3R lR l4       t	R	 t
R
tV tR# )ProgressInfoa  Contains the current state of a process being monitored. This can also provide
for stopping the process via a function you can provide.

Processes sometimes cannot be stopped after a certain point; at that point they start
providing Progress objects with no stop-function.Nc                s<   < V ^8  d   QhRS[ RS[RS[S[,          /# )   progresslabel_markupstop_function)Zfloatstrr   r   Zformat__classdict__   "D/usr/lib/python3.14/site-packages/lutris/gui/widgets/progress_box.py__annotate__ProgressInfo.__annotate__   s)       # S[\dSe     c                s8    Wn         W n        W0n        R V n        R# )FN)r	   r
   r   	has_ended)selfr	   r
   r   s   &&&&r   __init__ZProgressInfo.__init__   s     (*r   c                $   < V ^8  d   QhRS[ RR/# )r   r
   returnr   r   r   r   r   r   r      s       n r   c                s(    V ! RVR7      pRVn         V# )zcCreates a ProgressInfo whose has_ended flag is set, to indicate that
the monitored process is over.g      ?)r
   T)r   )Zclsr
   Zinfos   && r   endedZProgressInfo.ended   s     3\2r   c                    < V ^8  d   QhRS[ /# r   r   boolr   r   r   r   r      s     ( ($ (r   c                s,    \        V P                  4      # )z1Called to check if the stop button should appear.)r   r   )r   s   &r   can_stopZProgressInfo.can_stop   s     D&&''r   c                s    V P                   '       d    V P                  4        R# R#   \         d#   p\        P                  ! RT4        Rp?R# Rp?ii ; i)z&Called whe the stop button is clicked.z"Error during progress box stop: %sN)r   	Exceptionr   	exceptionr   Zex   & r   stopZProgressInfo.stop#   sM    K""$   K  !ErJJKs   ( AAA)r   r
   r	   r   )r     N)r%   )__name__
__module____qualname____firstlineno____doc__r   Zclassmethodr   Zpropertyr   r$   __static_attributes____classdictcell__)r   s   @r   r   r   	   sM     9     ( (K Kr   r   c                   s   a a ] tR t^,t oRt]. R3,          tV3R lV 3R lltV3R lR ltV3R lR lt	V3R	 lR
 lt
V3R lR ltV3R lR ltV3R lR ltRtVtV ;t# )ProgressBoxzSimple, small progress bar used to monitor the update of runtime or runner components.
This class needs only a function that returns a Progress object, which describes the current
progress and optionally can stop the update.r   c                r   )r   progress_function)ProgressFunctionr   r   r   r   ProgressBox.__annotate__3   s     1 1*: 1r   c           	     s  < \         SV `  ! RR \        P                  P                  RRR^/VB  Wn        \        R4      V n        \        P                  ! \        P                  P                  R^\        P                  P                  R7      p\        P                  ! RRR\        P                  P                  ^ R7      V n        VP#                  V P                   RR^ 4       \        P$                  ! R	RR
7      V n        V P&                  P)                  \        P                  P                  4       VP#                  V P&                  RR^ 4       V P#                  VRR^ 4       \        P*                  P-                  R\        P.                  P0                  4      V n        V P2                  P5                  4        V P2                  P7                  4       P9                  R4       V P2                  P;                  RV P<                  4       V P#                  V P2                  RR^ 4       RV n        V PA                  \        RR4      4       \C        V PD                  RR7      V n#        V P;                  RV PH                  4       R# )orientationZno_show_allTspacingg        )r1   visibler2   Zvalignr%   F)labelr3   ZwrapZ	ellipsizeZxaligng?)Z
pulse_stepr3   zmedia-playback-stop-symbolicZcircularZclickedzPlease wait...g      ?)Zinterval_secondsZdestroyN )%Zsuperr   r   ZOrientationZ
HORIZONTALr.   r   r	   BoxZVERTICALZAlignZCENTERZLabelr   ZEllipsizeModeZMIDDLEr4   Z
pack_startZProgressBarprogressbarZ
set_valignZButtonZnew_from_icon_nameZIconSizeZBUTTONstop_buttonhideZget_style_contextZ	add_classZconnecton_stop_clicked
_destroyed_apply_progressr   on_update_progress_timer_task
on_destroy)r   r.   ZkwargsZvbox	__class__s   &&, r   r   ZProgressBox.__init__3   s   gS__%?%?gTg[\g`fg!2$S)ww3??#;#;TST]`]f]f]m]mnYYRTUM`M`MgMgpqr


E5!4??c4H##CII$4$45((%:dD!,::889WY\YeYeYlYlm**,66zB  D,@,@A((%:\#/?@A5d6M6M`cdY0r   c                   < V ^8  d   QhRR/# r   r   Nr5   r   r   r   r   r0   O   s     ! !$ !r   c                sv    V P                   P                  '       d   V P                   P                  4        R # R # N)r	   r   r$   r   Z_widget   &&r   r:   ZProgressBox.on_stop_clickedO   s'    ==!!!MM  "r   c                rA   rB   r5   r   r   r   r   r0   S   s     & &T &r   c                sH    R V n         V P                  P                  4        R# )TN)r;   r>   Z
unschedulerD   rE   r   r?   ZProgressBox.on_destroyS   s    ##%r   c                r   r   r   r   r   r   r   r0   W   s      D r   c                s     V P                  4        R #   \         d#   p\        P                  ! RT4        Rp?R# Rp?ii ; i)Tz&Unable to obtain a progress update: %sNF)update_progressr    r   r!   r"   r#   r   r=   ZProgressBox.on_update_progressW   s:    	  " 	ErJ	s    A<Ac                rA   rB   r5   r   r   r   r   r0   _   s     ' ' 'r   c                sH    V P                  4       pV P                  V4       R# )zInvokes the progress function and displays what it returns;
this can be called to ensure the box is immediately up-to-date,
without waiting for idle-time.N)r.   r<   r   r	   r#   r   rF   ZProgressBox.update_progress_   s      ))+X&r   c                r   )r   r	   )r   r   r   r   r   r0   f   s     8 8 8r   c                s~   V P                   '       d   R # Wn        VP                  f   V P                  P                  4        M/V P                  P	                  \        VP                  ^4      4       T P                  VP                  ;'       g    R4       V P                  P                  VP                  4       R # )Nr%   )r;   r	   r7   ZpulseZset_fractionZmin
_set_labelr
   r8   Zset_visibler   rG   rE   r   r<   ZProgressBox._apply_progressf   s    ??? $""$))#h.?.?*CD--334$$X%6%67r   c                r   )r   markupr   Nr   r   r   r   r   r0   t   s        r   c                s    V'       dV   WP                   P                  4       8w  d   V P                   P                  V4       V P                   P                  4        R # V P                   P	                  4        R # rC   )r4   Zget_textZ
set_markupZshowr9   )r   rI   rE   r   rH   ZProgressBox._set_labelt   sF    ,,..

%%f-JJOOJJOOr   )r;   r>   r4   r	   r.   r7   r8   )r&   r'   r(   r)   r*   r   r/   r   r:   r?   r=   rF   r<   rH   r+   r,   Z__classcell__)r@   r   s   @@r   r-   r-   ,   sg     4  N 231 18! !& & ' '8 8  r   r-   N)Ztypingr   r   Zgi.repositoryr   r   Zlutris.util.jobsr   Zlutris.util.logr   r   r6   r-   r5   r   r   <module>rJ      s0    % $ 7 " K  KFN#'' Nr   