Update file with changes for transient dialog changes

This commit is contained in:
Robert Fewell 2017-12-10 11:59:40 +00:00
parent 8ee6783b4b
commit 0534ba4f8b

View File

@ -704,13 +704,13 @@ CsvImpPriceAssist::file_confirm_cb ()
catch (std::ifstream::failure& e) catch (std::ifstream::failure& e)
{ {
/* File loading failed ... */ /* File loading failed ... */
gnc_error_dialog (GTK_WIDGET(csv_imp_asst), "%s", e.what()); gnc_error_dialog (GTK_WINDOW(csv_imp_asst), "%s", e.what());
return; return;
} }
catch (std::range_error &e) catch (std::range_error &e)
{ {
/* Parsing failed ... */ /* Parsing failed ... */
gnc_error_dialog (GTK_WIDGET(csv_imp_asst), "%s", e.what()); gnc_error_dialog (GTK_WINDOW(csv_imp_asst), "%s", e.what());
return; return;
} }
/* Get settings store and populate */ /* Get settings store and populate */
@ -818,7 +818,7 @@ CsvImpPriceAssist::preview_settings_load ()
price_imp->settings (*preset); price_imp->settings (*preset);
if (preset->m_load_error) if (preset->m_load_error)
gnc_error_dialog (GTK_WIDGET(csv_imp_asst), gnc_error_dialog (GTK_WINDOW(csv_imp_asst),
"%s", _("There were problems reading some saved settings, continuing to load.\n" "%s", _("There were problems reading some saved settings, continuing to load.\n"
"Please review and save again.")); "Please review and save again."));
@ -840,7 +840,7 @@ CsvImpPriceAssist::preview_settings_delete ()
auto model = gtk_combo_box_get_model (settings_combo); auto model = gtk_combo_box_get_model (settings_combo);
gtk_tree_model_get (model, &iter, SET_GROUP, &preset, -1); gtk_tree_model_get (model, &iter, SET_GROUP, &preset, -1);
auto response = gnc_ok_cancel_dialog (GTK_WIDGET(csv_imp_asst), auto response = gnc_ok_cancel_dialog (GTK_WINDOW(csv_imp_asst),
GTK_RESPONSE_CANCEL, GTK_RESPONSE_CANCEL,
"%s", _("Delete the Import Settings.")); "%s", _("Delete the Import Settings."));
if (response == GTK_RESPONSE_OK) if (response == GTK_RESPONSE_OK)
@ -875,7 +875,7 @@ CsvImpPriceAssist::preview_settings_save ()
if (preset && (preset->m_name == std::string(new_name))) if (preset && (preset->m_name == std::string(new_name)))
{ {
auto response = gnc_ok_cancel_dialog (GTK_WIDGET(csv_imp_asst), auto response = gnc_ok_cancel_dialog (GTK_WINDOW(csv_imp_asst),
GTK_RESPONSE_OK, GTK_RESPONSE_OK,
"%s", _("Setting name already exists, over write?")); "%s", _("Setting name already exists, over write?"));
if (response != GTK_RESPONSE_OK) if (response != GTK_RESPONSE_OK)
@ -890,7 +890,7 @@ CsvImpPriceAssist::preview_settings_save ()
/* All checks passed, let's save this preset */ /* All checks passed, let's save this preset */
if (!price_imp->save_settings()) if (!price_imp->save_settings())
{ {
gnc_info_dialog (GTK_WIDGET(csv_imp_asst), gnc_info_dialog (GTK_WINDOW(csv_imp_asst),
"%s", _("The settings have been saved.")); "%s", _("The settings have been saved."));
// Update the settings store // Update the settings store
@ -915,7 +915,7 @@ CsvImpPriceAssist::preview_settings_save ()
} }
} }
else else
gnc_error_dialog (GTK_WIDGET(csv_imp_asst), gnc_error_dialog (GTK_WINDOW(csv_imp_asst),
"%s", _("There was a problem saving the settings, please try again.")); "%s", _("There was a problem saving the settings, please try again."));
} }
@ -996,7 +996,7 @@ void CsvImpPriceAssist::preview_update_separators (GtkWidget* widget)
/* Warn the user there was a problem and try to undo what caused /* Warn the user there was a problem and try to undo what caused
* the error. (This will cause a reparsing and ideally a usable * the error. (This will cause a reparsing and ideally a usable
* configuration.) */ * configuration.) */
gnc_error_dialog (GTK_WIDGET(csv_imp_asst), "Error in parsing"); gnc_error_dialog (GTK_WINDOW(csv_imp_asst), "Error in parsing");
/* If we're here because the user changed the file format, we should just wait for the user /* If we're here because the user changed the file format, we should just wait for the user
* to update the configuration */ * to update the configuration */
if (!widget) if (!widget)
@ -1046,7 +1046,7 @@ void CsvImpPriceAssist::preview_update_file_format ()
catch (std::range_error &e) catch (std::range_error &e)
{ {
/* Parsing failed ... */ /* Parsing failed ... */
gnc_error_dialog (nullptr, "%s", e.what()); gnc_error_dialog (GTK_WINDOW (csv_imp_asst), "%s", e.what());
return; return;
} }
catch (...) catch (...)
@ -1082,7 +1082,7 @@ CsvImpPriceAssist::preview_update_encoding (const char* encoding)
catch (...) catch (...)
{ {
/* If it fails, change back to the old encoding. */ /* If it fails, change back to the old encoding. */
gnc_error_dialog (nullptr, "%s", _("Invalid encoding selected")); gnc_error_dialog (GTK_WINDOW (csv_imp_asst), "%s", _("Invalid encoding selected"));
go_charmap_sel_set_encoding (encselector, previous_encoding.c_str()); go_charmap_sel_set_encoding (encselector, previous_encoding.c_str());
} }
} }
@ -1319,7 +1319,7 @@ fixed_context_menu_handler_price (GnumericPopupMenuElement const *element,
} }
catch(std::range_error& e) catch(std::range_error& e)
{ {
gnc_error_dialog (nullptr, "%s", e.what()); gnc_error_dialog (GTK_WINDOW (info->csv_imp_asst), "%s", e.what());
return false; return false;
} }
info->preview_refresh_table (); info->preview_refresh_table ();
@ -1364,7 +1364,7 @@ CsvImpPriceAssist::preview_split_column (int col, int offset)
} }
catch (std::range_error& e) catch (std::range_error& e)
{ {
gnc_error_dialog (nullptr, "%s", e.what()); gnc_error_dialog (GTK_WINDOW (csv_imp_asst), "%s", e.what());
return; return;
} }
preview_refresh_table(); preview_refresh_table();
@ -1799,7 +1799,7 @@ CsvImpPriceAssist::assist_finish ()
/* Oops! This shouldn't happen when using the import assistant ! /* Oops! This shouldn't happen when using the import assistant !
* Inform the user and go back to the preview page. * Inform the user and go back to the preview page.
*/ */
gnc_error_dialog (GTK_WIDGET(csv_imp_asst), gnc_error_dialog (GTK_WINDOW(csv_imp_asst),
_("An unexpected error has occurred while creating prices. Please report this as a bug.\n\n" _("An unexpected error has occurred while creating prices. Please report this as a bug.\n\n"
"Error message:\n%s"), err.what()); "Error message:\n%s"), err.what());
gtk_assistant_set_current_page (csv_imp_asst, 2); gtk_assistant_set_current_page (csv_imp_asst, 2);