Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

virtual void Impala::Application::SDash::AlertWindow::ButtonSelectionEvent ( Button src,
void *  userData 
) [inline, virtual]

Reimplemented from OglGui::ButtonListener.

Definition at line 162 of file AlertWindow.h.

References AddFieldToMsg(), EscapePipes(), OglGui::RadioGroup::GetActiveRadio(), OglGui::OglWindow::GetOGLWND(), OglGui::TextEdit::GetText(), Impala::Application::SDash::AlertRelay::IsReady(), mAddAllButton, MakeCsv(), Impala::MakeString(), mAlertRelay, mAttachStrip, mCancelButton, mFadeOut, mFreeText, mFromText, mLastLocations, mMailToCheckBoxes, mMailToStatus, mPane, mSubjectLine, mSubmitButton, mUrgencyRadioGroup, mUrgencyStrings, Impala::Application::DemoCamera2d::oglWnd, Impala::Application::SDash::AlertRelay::Relay(), OglGui::OglWindow::SetBackground(), Impala::StringToLower(), TaggedToAttachments(), and OglGui::TextEditLineScroller::TextEditor().

00163     {
00164         if (src == mSubmitButton)
00165         {
00166             std::string msg;
00167             std::string subjectText = mSubjectLine->TextEditor()->GetText();
00168 
00169             AddFieldToMsg(msg, EscapePipes(subjectText.substr(0, 20))); // lenth may excess 20 as a result of inserting esc chars
00170 
00171             // bepaal file naam vd kaart obv. geselecteerde (beschikbare) agenten en beschikbare jpg's ?!
00172             int demoReceiverId = 0;
00173             for (int i = 0; i < mMailToCheckBoxes.size(); i++)
00174                 if (mMailToCheckBoxes[i]->GetSelected())
00175                 {
00176                     demoReceiverId = i;
00177                     break;
00178                 }
00179             //AddFieldToMsg(msg, "politie" + MakeString(demoReceiverId) + ".png");
00180             AddFieldToMsg(msg, "politie" + MakeString(demoReceiverId) + ".jpg");
00181 
00185             //if (mTargetCamLocation <= 6 || mTargetCamLocation == 12)
00186             //    demoReceiverId = 1;
00187             //else
00188             //    demoReceiverId = 2;
00189             //AddFieldToMsg(msg, "p" + MakeString(demoReceiverId) + "_cam" + MakeString(mTargetCamLocation) + ".png");
00190 
00191             AddFieldToMsg(msg, MakeCsv(EscapePipes((mFromText->GetText()))));
00192 
00193             int urgencyId = mUrgencyRadioGroup->GetActiveRadio();
00194             std::string urgency = mUrgencyStrings[urgencyId];
00195             StringToLower(urgency);
00196             AddFieldToMsg(msg, urgency);
00197 
00198             const std::string& locations = mLastLocations->GetText();
00199             int lastLocSep = locations.find_last_of("\n"); // last location only
00200             std::string lastLocation = locations.substr(lastLocSep + 1);
00201             int endPosOfAddressPrefix = lastLocation.find_first_of("]");
00202             AddFieldToMsg(msg, lastLocation.substr(endPosOfAddressPrefix + 2));
00203 
00204             AddFieldToMsg(msg, EscapePipes(subjectText));
00205 
00206             AddFieldToMsg(msg, lastLocation.substr(0, endPosOfAddressPrefix + 1) + "\n" + EscapePipes(mFreeText->GetText()));
00207 
00208             // collect attachment file info
00209             char buffer[128];
00210             std::string attachmentNames;
00211             OGLWND* oglWnd = mAttachStrip->GetOGLWND();
00212             LIST* obj;
00213             int cnt = 0;
00214             ForAllElements(obj, oglWnd->objectList)
00215             {
00216                 OGLVIEW* srcView = (OGLVIEW*) obj->info;
00217                 int videoId = (int)(long long) srcView->UserData1;
00218                 int frameNr = (int)(long long) srcView->UserData2;
00219                 int roiNr = (int)(long long) srcView->UserData3;
00220                 sprintf(buffer, "video%i/roi_%i_%i_%i.jpg", videoId, videoId, frameNr, roiNr);
00221                 if (cnt++ > 0)
00222                     attachmentNames += ",";
00223                 attachmentNames += std::string(buffer);
00224             }
00225             AddFieldToMsg(msg, attachmentNames);
00226 
00227             // extra field; currently static value;
00228             // rework once we take selected officers into account
00229             AddFieldToMsg(msg, mMailToStatus[demoReceiverId] == 1 ? "beschikbaar" : "onbeschikbaar");
00230 #ifndef RICHARD
00231             if (mAlertRelay.IsReady())
00232                 mAlertRelay.Relay(msg);
00233 
00234             //{
00235             //    AlertRelay relay(mIpAddress);
00236             //    if (relay.IsReady())
00237             //        relay.Relay(msg);
00238             //}
00239 #endif
00240         }
00241 
00242         if (src == mSubmitButton || src == mCancelButton)
00243         {
00244             mPane->SetBackground(oglGUI_BG & 0x00ffffff);
00245             mFadeOut = true;
00246         }
00247 
00248         if (src == mAddAllButton)
00249             TaggedToAttachments(visibleTag);
00250     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:15:58 2011 for ImpalaSrc by  doxygen 1.5.1