Skip to content

Commit

Permalink
wizard: fix save users changes after reviewing dump dir files
Browse files Browse the repository at this point in the history
If the user reviewed the dump dir's files during reporting the crash, the
changes was thrown away and original data was passed to the bugzilla bug
report.

report-gtk saves the first text view buffer and then reloads data from the
reported problem directory, which causes that the changes made to those text
views are thrown away.

Function save_text_if_changed(), except of saving text, also reload the files
from dump dir and update gui state from the dump dir. The commit moves the
reloading and updating gui functions away from this function.

Related to rhbz#1270235

Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
  • Loading branch information
Matej Habrnal committed Oct 12, 2015
1 parent 6f8b577 commit 257578a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/gui-wizard-gtk/wizard.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,6 @@ static void save_text_if_changed(const char *name, const char *new_value)

//FIXME: else: what to do with still-unsaved data in the widget??

This comment has been minimized.

Copy link
@sorki

sorki Oct 13, 2015

Contributor

FIXME left over?

This comment has been minimized.

Copy link
@jfilak

jfilak Oct 13, 2015

Contributor

Yea, thank you for the reminder! I've realized that we forgot to remove the comment the last night while I was half-sleeping :D
Fixed in e93bf5b

dd_close(dd);
problem_data_reload_from_dump_dir();
update_gui_state_from_problem_data(/* don't update selected event */ 0);
}
}

Expand Down Expand Up @@ -777,7 +775,11 @@ static void tv_details_row_activated(
load_text_to_text_view(GTK_TEXT_VIEW(textview), item_name);

if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
{
save_text_from_text_view(GTK_TEXT_VIEW(textview), item_name);
problem_data_reload_from_dump_dir();
update_gui_state_from_problem_data(/* don't update selected event */ 0);
}

gtk_widget_destroy(textview);
gtk_widget_destroy(scrolled);
Expand Down Expand Up @@ -2709,7 +2711,8 @@ static void on_page_prepare(GtkNotebook *assistant, GtkWidget *page, gpointer us
* these tabs will be lost */
save_items_from_notepad();
save_text_from_text_view(g_tv_comment, FILENAME_COMMENT);

problem_data_reload_from_dump_dir();
update_gui_state_from_problem_data(/* don't update selected event */ 0);

if (pages[PAGENO_SUMMARY].page_widget == page)
{
Expand Down

0 comments on commit 257578a

Please sign in to comment.