void undo_clear_all(GtkTextBuffer *buffer) { undo_list = undo_clear_info_list(undo_list); redo_list = undo_clear_info_list(redo_list); undo_reset_modified_step(buffer); gtk_widget_set_sensitive(undo_w, FALSE); gtk_widget_set_sensitive(redo_w, FALSE); ui_tmp->command = INS; undo_gstr = g_string_erase(undo_gstr, 0, -1); prev_keyval = 0; }
static void cb_modified_changed(GtkTextBuffer *buffer, GtkWidget *view) { gboolean modified_flag, exist_flag = FALSE; gchar *filename, *title; modified_flag = gtk_text_buffer_get_modified(buffer); filename = get_file_basename(pub->fi->filename, TRUE); if (modified_flag) title = g_strconcat("*", filename, NULL); else { title = g_strdup(filename); undo_reset_modified_step(buffer); } g_free(filename); gtk_window_set_title(GTK_WINDOW(gtk_widget_get_toplevel(view)), title); g_free(title); if (pub->fi->filename) exist_flag = g_file_test( g_filename_to_utf8(pub->fi->filename, -1, NULL, NULL, NULL), G_FILE_TEST_EXISTS); menu_sensitivity_from_modified_flag(modified_flag || !exist_flag); }