X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditorSound.cpp;h=276abe78031bd99dfafaa14f10e7948e3ed21117;hb=10f49df37ad495d12b4edb62efbffc0bf2d1d57b;hp=cad57b3180aa7b9a6140357bd0e05c186cac6f07;hpb=e93aa9af2a9f8eaee9dcaa793c049e305b90081e;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditorSound.cpp b/source/contacteditor/frmContactEditorSound.cpp index cad57b3..276abe7 100644 --- a/source/contacteditor/frmContactEditorSound.cpp +++ b/source/contacteditor/frmContactEditorSound.cpp @@ -18,14 +18,6 @@ #include "frmContactEditorSound.h" -#include -#include -#include - -#include "../common/textprocessing.h" -#include "../common/base64.h" -#include "../common/mime.h" - frmContactEditorSound::frmContactEditorSound( wxWindow* parent ) : frmContactEditorSoundADT( parent ) @@ -34,7 +26,8 @@ frmContactEditorSoundADT( parent ) // Setup the window. EditorMode = FALSE; - sliPriority->Disable(); + priorityCtrl = new XABPriorityCtrl(tabGeneral); + szrGeneral->Add(priorityCtrl, 1, wxEXPAND, 5); cmbType->Append(wxT("")); cmbType->Append(_("Home")); @@ -42,19 +35,6 @@ frmContactEditorSoundADT( parent ) } -void frmContactEditorSound::EnablePriority( wxCommandEvent& event ) -{ - - // Enable/disable the priority setting. - - if (chkUsePref->IsChecked()){ - sliPriority->Enable(); - } else { - sliPriority->Disable(); - } - -} - void frmContactEditorSound::ProcessData( wxCommandEvent& event ) { @@ -78,11 +58,9 @@ void frmContactEditorSound::ProcessData( wxCommandEvent& event ) if (AudioFile.Open(wxSAudioFilename, wxFile::read)){ - ssize_t flen; len = AudioFile.Length(); unsigned char* AudioFileData = new unsigned char[len]; - flen = AudioFile.Read(AudioFileData, (size_t)len); wxSAudioMIMEType = GetMIME(wxSAudioFilename); @@ -137,9 +115,9 @@ void frmContactEditorSound::ProcessData( wxCommandEvent& event ) // Setup Organisation Priority. - if (chkUsePref->IsChecked()){ + if (priorityCtrl->IsPriorityChecked()){ - SoundListPrefPtr->insert(std::make_pair(SoundListIndex, sliPriority->GetValue())); + SoundListPrefPtr->insert(std::make_pair(SoundListIndex, priorityCtrl->GetValue())); } else { @@ -178,9 +156,9 @@ void frmContactEditorSound::ProcessData( wxCommandEvent& event ) } - if (chkUsePref->IsChecked()){ + if (priorityCtrl->IsPriorityChecked()){ - SoundListCtrlPtr->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), sliPriority->GetValue())); + SoundListCtrlPtr->SetItem(ListCtrlIndex, 2, wxString::Format(wxT("%i"), priorityCtrl->GetValue())); } @@ -213,9 +191,9 @@ void frmContactEditorSound::ProcessData( wxCommandEvent& event ) SoundListPrefPtr->erase(SoundListIndex); - if (chkUsePref->IsChecked()){ + if (priorityCtrl->IsPriorityChecked()){ - SoundListPrefPtr->insert(std::make_pair(SoundListIndex, sliPriority->GetValue())); + SoundListPrefPtr->insert(std::make_pair(SoundListIndex, priorityCtrl->GetValue())); } else { @@ -236,9 +214,9 @@ void frmContactEditorSound::ProcessData( wxCommandEvent& event ) SoundListCtrlPtr->SetItem(longSelected, 0, wxT("Sound")); SoundListCtrlPtr->SetItem(longSelected, 1, strValue); - if (chkUsePref->IsChecked()){ + if (priorityCtrl->IsPriorityChecked()){ - SoundListCtrlPtr->SetItem(longSelected, 2, wxString::Format(wxT("%i"), sliPriority->GetValue())); + SoundListCtrlPtr->SetItem(longSelected, 2, wxString::Format(wxT("%i"), priorityCtrl->GetValue())); } else { @@ -317,9 +295,8 @@ void frmContactEditorSound::SetEditorMode(bool EditMode) if (intiter->first == SoundListIndex && intiter->second > 0 && intiter != SoundListPrefPtr->end()){ - sliPriority->SetValue(intiter->second); - sliPriority->Enable(); - chkUsePref->SetValue(TRUE); + priorityCtrl->SetValue(intiter->second); + priorityCtrl->EnablePriority(true); }