X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorNickname.cpp;h=c67302cffaf858dede32cdff5547e8119d1acd83;hb=d6023ac2bba9572d1bca7da3d5960f6c07082624;hp=52619693f91af4becd3365461c9aff40725810f4;hpb=45729fca56479bd9158486e0cda0c4a94b4dd1dc;p=xestiaab%2F.git
diff --git a/source/contacteditor/frmContactEditorNickname.cpp b/source/contacteditor/frmContactEditorNickname.cpp
index 5261969..c67302c 100644
--- a/source/contacteditor/frmContactEditorNickname.cpp
+++ b/source/contacteditor/frmContactEditorNickname.cpp
@@ -1,11 +1,40 @@
+// frmContactEditorNickname.cpp - frmContactEditorNickname form.
+//
+// (c) 2012-2015 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see
+
#include "frmContactEditorNickname.h"
-#include "../common/textprocessing.h"
frmContactEditorNickname::frmContactEditorNickname( wxWindow* parent )
:
frmContactEditorNicknameADT( parent )
{
+ std::vector LanguageCodeList = GetLanguageCodeList();
+
+ wxArrayString LanguageList;
+
+ for (auto LanguageItem : LanguageCodeList){
+
+ LanguageList.Add((wxString)LanguageItem, 1);
+
+ }
+
+ cmbLanguage->Append(LanguageList);
+
}
void frmContactEditorNickname::InitAddressEditor( wxInitDialogEvent& event )
@@ -15,15 +44,22 @@ void frmContactEditorNickname::InitAddressEditor( wxInitDialogEvent& event )
void frmContactEditorNickname::EnablePriority( wxCommandEvent& event )
{
+
+ // Enable/disable the priority.
+
if (chkUsePref->IsChecked()){
sliPriority->Enable();
} else {
sliPriority->Disable();
}
+
}
void frmContactEditorNickname::ProcessData( wxCommandEvent& event )
{
+
+ // Process the data.
+
long ListCtrlIndex;
if (EditorMode == FALSE){
@@ -139,11 +175,16 @@ void frmContactEditorNickname::ProcessData( wxCommandEvent& event )
void frmContactEditorNickname::CloseWindow( wxCommandEvent& event )
{
+
+ // Close this window.
+
this->Close();
+
}
void frmContactEditorNickname::SetEditorMode(bool EditMode, SectionType SectType)
{
+
// Set if the editor is adding or editing an address.
// FALSE = Add
// TRUE = Edit
@@ -180,7 +221,8 @@ void frmContactEditorNickname::SetEditorMode(bool EditMode, SectionType SectType
striter = NicknamesListLanguagePtr->find(NicknamesListIndex);
- if (striter->first == NicknamesListIndex){
+ if (striter->first == NicknamesListIndex &&
+ striter != NicknamesListLanguagePtr->end()){
strValue = striter->second;
@@ -193,7 +235,8 @@ void frmContactEditorNickname::SetEditorMode(bool EditMode, SectionType SectType
intiter = NicknamesListPrefPtr->find(NicknamesListIndex);
- if (intiter->first == NicknamesListIndex && intiter->second > 0){
+ if (intiter->first == NicknamesListIndex && intiter->second > 0 &&
+ intiter != NicknamesListPrefPtr->end()){
sliPriority->SetValue(intiter->second);
sliPriority->Enable();
@@ -218,6 +261,8 @@ void frmContactEditorNickname::SetupPointers(std::map *NicknamesL
int NicknamesIndex )
{
+ // Setup the pointers.
+
NicknamesListPtr = NicknamesList;
NicknamesListAltIDPtr = NicknamesListAltID;
NicknamesListPIDPtr = NicknamesListPID;