void TeamcityMessages::testIgnored(std::string name, std::string message) { openMsg("testIgnored"); writeProperty("name", name); writeProperty("message", message); closeMsg(); }
void TeamcityMessages::testFailed(string name, string message, string details) { openMsg("testFailed"); writeProperty("name", name); writeProperty("message", message); writeProperty("details", details); closeMsg(); }
void TeamcityMessages::testStarted(string name, string flowid) { openMsg("testStarted"); writeProperty("name", name); if(flowid.length() > 0) { writeProperty("flowId", flowid); } closeMsg(); }
void TeamcityMessages::testFailed(string name, string message, string details, string flowid) { openMsg("testFailed"); writeProperty("name", name); writeProperty("message", message); writeProperty("details", details); if(flowid.length() > 0) { writeProperty("flowId", flowid); } closeMsg(); }
void TeamcityMessages::testFinished(string name, int durationMs, string flowid) { openMsg("testFinished"); writeProperty("name", name); if(flowid.length() > 0) { writeProperty("flowId", flowid); } if(durationMs >= 0) { stringstream out; out << durationMs; writeProperty("duration", out.str()); } closeMsg(); }
//============================================================================= // METHOD: SPELLserverCif::openSubprocedure //============================================================================= std::string SPELLserverCif::openSubprocedure( const std::string& procId, const std::string& args, bool automatic, bool blocking, bool visible ) { std::string openModeStr = "{"; DEBUG("[CIF] Open subprocedure options: " + BSTR(automatic) + "," + BSTR(blocking) + "," + BSTR(visible)); openModeStr += (automatic ? (LanguageModifiers::Automatic + ":" + PythonConstants::True) : (LanguageModifiers::Automatic + ":" + PythonConstants::False)) + ","; openModeStr += (blocking ? (LanguageModifiers::Blocking + ":" + PythonConstants::True) : (LanguageModifiers::Blocking+ ":" + PythonConstants::False)) + ","; openModeStr += (visible ? (LanguageModifiers::Visible + ":" + PythonConstants::True) : (LanguageModifiers::Visible + ":" + PythonConstants::False)) + "}"; std::string parent = SPELLexecutor::instance().getProcId(); // Request first an available instance number SPELLipcMessage instanceMsg(ContextMessages::REQ_INSTANCE_ID); instanceMsg.setType(MSG_TYPE_REQUEST); instanceMsg.set(MessageField::FIELD_PROC_ID, procId); SPELLipcMessage* response = sendCTXRequest( &instanceMsg, SPELL_CIF_CTXREQUEST_TIMEOUT_SEC ); std::string subprocId = ""; subprocId = response->get(MessageField::FIELD_INSTANCE_ID); delete response; DEBUG("[CIF] Request context to open subprocedure " + subprocId + " in mode " + openModeStr); SPELLipcMessage openMsg(ContextMessages::REQ_OPEN_EXEC); openMsg.setType(MSG_TYPE_REQUEST); openMsg.set(MessageField::FIELD_PROC_ID, parent); openMsg.set(MessageField::FIELD_SPROC_ID, subprocId); openMsg.set(MessageField::FIELD_OPEN_MODE, openModeStr); openMsg.set(MessageField::FIELD_ARGS, args); response = sendCTXRequest( &openMsg, SPELL_CIF_OPENPROC_TIMEOUT_SEC ); delete response; /** \todo failure handle */ return subprocId; }
void TeamcityMessages::testStarted(string name) { openMsg("testStarted"); writeProperty("name", name); closeMsg(); }
void TeamcityMessages::suiteFinished(string name) { openMsg("testSuiteFinished"); writeProperty("name", name); closeMsg(); }
void MainWindow::MessageReceived(BMessage* message) { switch (message->what) { case MSG_LAUNCH: { BView* pointer; if (message->FindPointer("be:source", (void**)&pointer) < B_OK) break; LaunchButton* button = dynamic_cast<LaunchButton*>(pointer); if (button == NULL) break; BString errorMessage; bool launchedByRef = false; if (button->Ref()) { BEntry entry(button->Ref(), true); if (entry.IsDirectory()) { // open in Tracker BMessenger messenger("application/x-vnd.Be-TRAK"); if (messenger.IsValid()) { BMessage trackerMessage(B_REFS_RECEIVED); trackerMessage.AddRef("refs", button->Ref()); status_t ret = messenger.SendMessage(&trackerMessage); if (ret < B_OK) { errorMessage = B_TRANSLATE("Failed to send " "'open folder' command to Tracker.\n\nError: "); errorMessage << strerror(ret); } else launchedByRef = true; } else errorMessage = ("Failed to open folder - is Tracker " "running?"); } else { status_t ret = be_roster->Launch(button->Ref()); if (ret < B_OK && ret != B_ALREADY_RUNNING) { BString errStr(B_TRANSLATE("Failed to launch '%1'.\n" "\nError:")); BPath path(button->Ref()); if (path.InitCheck() >= B_OK) errStr.ReplaceFirst("%1", path.Path()); else errStr.ReplaceFirst("%1", button->Ref()->name); errorMessage << errStr.String() << " "; errorMessage << strerror(ret); } else launchedByRef = true; } } if (!launchedByRef && button->AppSignature()) { status_t ret = be_roster->Launch(button->AppSignature()); if (ret != B_OK && ret != B_ALREADY_RUNNING) { BString errStr(B_TRANSLATE("\n\nFailed to launch application " "with signature '%2'.\n\nError:")); errStr.ReplaceFirst("%2", button->AppSignature()); errorMessage << errStr.String() << " "; errorMessage << strerror(ret); } else { // clear error message on success (might have been // filled when trying to launch by ref) errorMessage = ""; } } else if (!launchedByRef) { errorMessage = B_TRANSLATE("Failed to launch 'something', " "error in Pad data."); } if (errorMessage.Length() > 0) { BAlert* alert = new BAlert("error", errorMessage.String(), B_TRANSLATE("Bummer"), NULL, NULL, B_WIDTH_FROM_WIDEST); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE); alert->Go(NULL); } break; } case MSG_ADD_SLOT: { LaunchButton* button; if (message->FindPointer("be:source", (void**)&button) >= B_OK) { fPadView->AddButton(new LaunchButton("launch button", NULL, new BMessage(MSG_LAUNCH)), button); } break; } case MSG_CLEAR_SLOT: { LaunchButton* button; if (message->FindPointer("be:source", (void**)&button) >= B_OK) button->SetTo((entry_ref*)NULL); break; } case MSG_REMOVE_SLOT: { LaunchButton* button; if (message->FindPointer("be:source", (void**)&button) >= B_OK) { if (fPadView->RemoveButton(button)) delete button; } break; } case MSG_SET_DESCRIPTION: { LaunchButton* button; if (message->FindPointer("be:source", (void**)&button) >= B_OK) { const char* name; if (message->FindString("name", &name) >= B_OK) { // message comes from a previous name panel button->SetDescription(name); BRect namePanelFrame; if (message->FindRect("frame", &namePanelFrame) == B_OK) { ((App*)be_app)->SetNamePanelSize( namePanelFrame.Size()); } } else { // message comes from pad view entry_ref* ref = button->Ref(); if (ref) { BString helper(B_TRANSLATE("Description for '%3'")); helper.ReplaceFirst("%3", ref->name); // Place the name panel besides the pad, but give it // the user configured size. BPoint origin = B_ORIGIN; BSize size = ((App*)be_app)->NamePanelSize(); NamePanel* panel = new NamePanel(helper.String(), button->Description(), this, this, new BMessage(*message), size); panel->Layout(true); size = panel->Frame().Size(); BScreen screen(this); BPoint mousePos; uint32 buttons; fPadView->GetMouse(&mousePos, &buttons, false); fPadView->ConvertToScreen(&mousePos); if (fPadView->Orientation() == B_HORIZONTAL) { // Place above or below the pad origin.x = mousePos.x - size.width / 2; if (screen.Frame().bottom - Frame().bottom > size.height + 20) { origin.y = Frame().bottom + 10; } else { origin.y = Frame().top - 10 - size.height; } } else { // Place left or right of the pad origin.y = mousePos.y - size.height / 2; if (screen.Frame().right - Frame().right > size.width + 20) { origin.x = Frame().right + 10; } else { origin.x = Frame().left - 10 - size.width; } } panel->MoveTo(origin); panel->Show(); } } } break; } case MSG_ADD_WINDOW: { BMessage settings('sett'); SaveSettings(&settings); message->AddMessage("window", &settings); be_app->PostMessage(message); break; } case MSG_SHOW_BORDER: SetLook(B_TITLED_WINDOW_LOOK); break; case MSG_HIDE_BORDER: SetLook(B_BORDERED_WINDOW_LOOK); break; case MSG_TOGGLE_AUTORAISE: ToggleAutoRaise(); break; case MSG_SHOW_ON_ALL_WORKSPACES: fShowOnAllWorkspaces = !fShowOnAllWorkspaces; if (fShowOnAllWorkspaces) SetWorkspaces(B_ALL_WORKSPACES); else SetWorkspaces(1L << current_workspace()); break; case MSG_OPEN_CONTAINING_FOLDER: { LaunchButton* button; if (message->FindPointer("be:source", (void**)&button) == B_OK && button->Ref() != NULL) { entry_ref target = *button->Ref(); BEntry openTarget(&target); BMessage openMsg(B_REFS_RECEIVED); BMessenger tracker("application/x-vnd.Be-TRAK"); openTarget.GetParent(&openTarget); openTarget.GetRef(&target); openMsg.AddRef("refs",&target); tracker.SendMessage(&openMsg); } } break; case B_SIMPLE_DATA: case B_REFS_RECEIVED: case B_PASTE: case B_MODIFIERS_CHANGED: break; default: BWindow::MessageReceived(message); break; } }
void ArpDocumentButton::MessageReceived(BMessage* message) { if( !message ) return; ArpD(cdb << ADH << "ArpDocumentButton::MessageReceived: " << *message << endl); if( message->WasDropped() ) { ArpD(cdb << ADH << "This was a dropped message." << endl); mDropped = false; Invalidate(); switch( message->what ) { case B_SIMPLE_DATA: { entry_ref ref; BMessage data; if( GetDropRef(&ref, message, mDropped) == B_OK ) { // Forward to target as an "open" action. ArpD(cdb << ADH << "Sending to target as B_REFS_RECEIVED." << endl); BMessage openMsg(*message); openMsg.what = B_REFS_RECEIVED; Invoke(&openMsg); } else if( GetDropAction(&data, message, mDropped) == B_OK ) { // Only if we are not the one who sent the message... BMessenger source; if( message->FindMessenger("ARP:source", &source) == B_OK ) { if( source == BMessenger(this) ) return; } // Tell the sender what format we would like the data in, and // have it send the final reply containing that data to our // target. ArpD(cdb << ADH << "Replying with desired action: " << data << endl); message->SendReply(&data, Messenger()); } } break; default: ArpD(cdb << ADH << "Not a drop I understand." << endl); inherited::MessageReceived(message); } return; } // If this action is one of the allowed ones in our prototype, forward // it to the target handler. int32 action=0; int i; for( i=0; mDragPrototype.FindInt32("be:actions", i, &action)==B_OK; i++ ) { if( static_cast<type_code>(action) == message->what ) { ArpD(cdb << ADH << "Forwarding this action to target." << endl); // Forward message on to target, making that target's reply // go back to the originator. InvokeReply(message); //Messenger().SendMessage(message, message->ReturnAddress()); //Invoke(message); return; } } // Forward any other data received to the target. Using the official // drag and drop protocol, this should never happen -- we redirect the // data message directly to our target, when responding to the initial // drop. However, just in case, we also catch data messages here. if( message->what == B_MIME_DATA ) { ArpD(cdb << ADH << "Forwarding this data to target." << endl); InvokeReply(message); return; } ArpD(cdb << ADH << "Not a message I understand." << endl); inherited::MessageReceived(message); }