summaryrefslogtreecommitdiff
path: root/src/ui/ui_contacts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/ui_contacts.cpp')
-rw-r--r--src/ui/ui_contacts.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui/ui_contacts.cpp b/src/ui/ui_contacts.cpp
index ff1f424..4e15bb1 100644
--- a/src/ui/ui_contacts.cpp
+++ b/src/ui/ui_contacts.cpp
@@ -28,7 +28,7 @@ static contact selected_for_removal;
static contact active_contact;
-void draw_address_form(address* buffer, a_err last_err)
+void draw_address_form(address* buffer, a_err last_err, bool active_countries_only = false)
{
ImGui::FormInputTextWithErrorHint(locale::get("contact.form.address1"), buffer->address1, IM_ARRAYSIZE(buffer->address1), last_err & A_ERR_MISSING_ADDRESS1);
ImGui::FormInputTextWithErrorHint(locale::get("contact.form.address2"), buffer->address2, IM_ARRAYSIZE(buffer->address2), 0);
@@ -36,7 +36,7 @@ void draw_address_form(address* buffer, a_err last_err)
ImGui::FormInputTextWithErrorHint(locale::get("contact.form.postal"), buffer->postal, IM_ARRAYSIZE(buffer->postal), last_err & A_ERR_MISSING_POSTAL);
ImGui::FormInputTextWithErrorHint(locale::get("contact.form.region"), buffer->region, IM_ARRAYSIZE(buffer->region), 0);
- ImGui::FormCountryCombo(buffer->country_code, IM_ARRAYSIZE(buffer->country_code));
+ ImGui::FormCountryCombo(buffer->country_code, IM_ARRAYSIZE(buffer->country_code), active_countries_only);
}
void ui::setup_contacts()
@@ -65,7 +65,7 @@ void draw_addressee_form_ex(delivery_info* buffer, bool viewing_only = false)
ImGui::PopID();
}
-void draw_contact_form_ex(contact* buffer, bool viewing_only = false, bool with_autocomplete = false)
+void draw_contact_form_ex(contact* buffer, bool viewing_only = false, bool with_autocomplete = false, bool active_countries_only = false)
{
a_err last_err = administration::contact_is_valid(*buffer);
@@ -79,7 +79,7 @@ void draw_contact_form_ex(contact* buffer, bool viewing_only = false, bool with_
if (with_autocomplete) ImGui::FormContactAutocomplete(buffer, last_err & A_ERR_MISSING_NAME);
else ImGui::FormInputTextWithErrorHint(locale::get("contact.form.fullname"), buffer->name, IM_ARRAYSIZE(buffer->name), last_err & A_ERR_MISSING_NAME);
- draw_address_form(&buffer->address, last_err);
+ draw_address_form(&buffer->address, last_err, active_countries_only);
ImGui::FormContactTypeCombo(&buffer->type);