本文整理汇总了C++中MessageView::put方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageView::put方法的具体用法?C++ MessageView::put怎么用?C++ MessageView::put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageView
的用法示例。
在下文中一共展示了MessageView::put方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
bool ExtCommandItem::execute()
{
bool result = false;
MessageView* mv = MessageView::instance();
if(!command_.empty()){
terminate();
string actualCommand(command_);
#ifdef _WIN32
if(filesystem::path(actualCommand).extension() != ".exe"){
actualCommand += ".exe";
}
// quote the command string to support a path including spaces
process.start(QString("\"") + actualCommand.c_str() + "\"");
#else
process.start(actualCommand.c_str());
#endif
if(process.waitForStarted()){
mv->putln(fmt(_("External command \"%1%\" has been executed by item \"%2%\"."))
% actualCommand % name());
if(waitingTimeAfterStarted_ > 0.0){
msleep(waitingTimeAfterStarted_ * 1000.0);
}
result = true;
} else {
mv->put(fmt(_("External command \"%1%\" cannot be executed.")) % actualCommand);
if(!boost::filesystem::exists(actualCommand)){
mv->putln(_(" The command does not exist."));
} else {
mv->putln("");
}
}
}
return result;
}