26 #include <libsigrokcxx/libsigrokcxx.hpp>
34 using std::shared_ptr;
36 using sigrok::Context;
37 using sigrok::OutputFormat;
43 std::vector<QAction *>open_actions) :
50 if (!open_actions.empty()) {
51 bool first_action =
true;
52 for (
auto open_action : open_actions) {
53 addAction(open_action);
57 setDefaultAction(open_action);
63 const map<string, shared_ptr<OutputFormat> > formats =
64 context->output_formats();
66 for (
const pair<
string, shared_ptr<OutputFormat> > &f : formats) {
67 if (f.first ==
"srzip")
71 QAction *
const action = addAction(tr(
"Export %1...")
72 .arg(QString::fromStdString(f.second->description())));
73 action->setData(qVariantFromValue((
void*)f.second.get()));
74 mapper_.setMapping(action, action);
75 connect(action, SIGNAL(triggered()), &
mapper_, SLOT(map()));
86 const map<string, shared_ptr<OutputFormat> > formats =
88 const auto iter = find_if(formats.cbegin(), formats.cend(),
89 [&](
const pair<string, shared_ptr<OutputFormat> > &f) {
90 return f.second.get() ==
91 ((QAction*)action)->data().value<
void*>(); });
92 if (iter == formats.cend())