@ -238,16 +238,17 @@ bool Notebook::open(const boost::filesystem::path &file_path_, Position position
if ( show_dialog ) {
show_dialog = false ;
// Install rust-analyzer
Gtk : : MessageDialog dialog ( * static_cast < Gtk : : Window * > ( get_toplevel ( ) ) , " Install Rust language server? " , false , Gtk : : MESSAGE_QUESTION , Gtk : : BUTTONS_YES_NO ) ;
Dialog : : MessageDialog dialog ( * static_cast < Gtk : : Window * > ( get_toplevel ( ) ) , " Install Rust language server? " , false , Gtk : : MESSAGE_QUESTION , Gtk : : BUTTONS_YES_NO ) ;
Gtk : : Image image ;
image . set_from_icon_name ( " dialog-question " , Gtk : : BuiltinIconSize : : ICON_SIZE_DIALOG ) ;
dialog . set_image ( image ) ;
dialog . set_default_response ( Gtk : : RESPONSE_YES ) ;
dialog . set_secondary_text ( " Rust language server not found. Would you like to install rust-analyzer? " ) ;
dialog . show_all ( ) ;
int result = dialog . run ( ) ;
dialog . present ( ) ;
int response = dialog . run ( ) ;
dialog . hide ( ) ;
if ( result = = Gtk : : RESPONSE_YES ) {
if ( response = = Gtk : : RESPONSE_YES ) {
bool canceled = false ;
Dialog : : Message message ( " Installing rust-analyzer " , [ & canceled ] {
canceled = true ;
@ -611,16 +612,17 @@ void Notebook::install_rust() {
static bool show_dialog = true ;
if ( show_dialog ) {
show_dialog = false ;
Gtk : : MessageDialog dialog ( * static_cast < Gtk : : Window * > ( get_toplevel ( ) ) , " Install Rust? " , false , Gtk : : MESSAGE_QUESTION , Gtk : : BUTTONS_YES_NO ) ;
Dialog : : MessageDialog dialog ( * static_cast < Gtk : : Window * > ( get_toplevel ( ) ) , " Install Rust? " , false , Gtk : : MESSAGE_QUESTION , Gtk : : BUTTONS_YES_NO ) ;
Gtk : : Image image ;
image . set_from_icon_name ( " dialog-question " , Gtk : : BuiltinIconSize : : ICON_SIZE_DIALOG ) ;
dialog . set_image ( image ) ;
dialog . set_default_response ( Gtk : : RESPONSE_YES ) ;
dialog . set_secondary_text ( " Rust not found. Would you like to install Rust? " ) ;
dialog . show_all ( ) ;
int result = dialog . run ( ) ;
dialog . present ( ) ;
int response = dialog . run ( ) ;
dialog . hide ( ) ;
if ( result = = Gtk : : RESPONSE_YES ) {
if ( response = = Gtk : : RESPONSE_YES ) {
bool canceled = false ;
Dialog : : Message message ( " Installing Rust " , [ & canceled ] {
canceled = true ;
@ -924,17 +926,18 @@ void Notebook::set_current_view(Source::View *view) {
}
bool Notebook : : save_modified_dialog ( size_t index ) {
Gtk : : MessageDialog dialog ( * static_cast < Gtk : : Window * > ( get_toplevel ( ) ) , " Save file? " , false , Gtk : : MESSAGE_QUESTION , Gtk : : BUTTONS_YES_NO ) ;
Dialog : : MessageDialog dialog ( * static_cast < Gtk : : Window * > ( get_toplevel ( ) ) , " Save file? " , false , Gtk : : MESSAGE_QUESTION , Gtk : : BUTTONS_YES_NO ) ;
Gtk : : Image image ;
image . set_from_icon_name ( " document-save " , Gtk : : BuiltinIconSize : : ICON_SIZE_DIALOG ) ;
dialog . set_image ( image ) ;
dialog . set_default_response ( Gtk : : RESPONSE_YES ) ;
dialog . set_secondary_text ( " Do you want to save " + filesystem : : get_short_path ( get_view ( index ) - > file_path ) . string ( ) + " ? " ) ;
dialog . show_all ( ) ;
int result = dialog . run ( ) ;
if ( result = = Gtk : : RESPONSE_YES )
dialog . present ( ) ;
int response = dialog . run ( ) ;
if ( response = = Gtk : : RESPONSE_YES )
return save ( index ) ;
else if ( result = = Gtk : : RESPONSE_NO )
else if ( response = = Gtk : : RESPONSE_NO )
return true ;
return false ;
}