Move NetworkException formatting into NotificationEngine
This commit is contained in:
committed by
Keith Winstein
parent
1b86532a99
commit
9dddcd8566
@@ -137,12 +137,28 @@ namespace Overlay {
|
||||
bool need_countup( uint64_t ts ) const { return server_late( ts ) || reply_late( ts ); }
|
||||
void adjust_message( void );
|
||||
void apply( Framebuffer &fb ) const;
|
||||
void set_notification_string( const wstring &s_message, bool permanent = false ) { message = s_message; if ( permanent ) { message_expiration = -1; } else { message_expiration = timestamp() + 1000; } }
|
||||
const wstring &get_notification_string( void ) const { return message; }
|
||||
void server_heard( uint64_t s_last_word ) { last_word_from_server = s_last_word; }
|
||||
void server_acked( uint64_t s_last_acked ) { last_acked_state = s_last_acked; }
|
||||
uint64_t get_message_expiration( void ) const { return message_expiration; }
|
||||
|
||||
void set_notification_string( const wstring &s_message, bool permanent = false )
|
||||
{
|
||||
message = s_message;
|
||||
if ( permanent ) {
|
||||
message_expiration = -1;
|
||||
} else {
|
||||
message_expiration = timestamp() + 1000;
|
||||
}
|
||||
}
|
||||
|
||||
void set_network_exception( const NetworkException &e )
|
||||
{
|
||||
wchar_t tmp[ 128 ];
|
||||
swprintf( tmp, 128, L"%s: %s", e.function.c_str(), strerror( e.the_errno ) );
|
||||
set_notification_string( wstring( tmp ) );
|
||||
}
|
||||
|
||||
NotificationEngine();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user