int ret = app.exec();
- // TODO: do this on-demand instead, from a menu
- export_to_json(db, "ultimate.json");
-
return ret;
}
QShortcut *key_delete = new QShortcut(QKeySequence(Qt::Key_Delete), this);
connect(key_delete, &QShortcut::activated, [this]() { ui->delete_->animateClick(); });
connect(ui->delete_, &QPushButton::clicked, [this]() { delete_current_event(); });
+
+ // Menus.
+ connect(ui->action_exit, &QAction::triggered, [this] { close(); });
+ connect(ui->action_export_json, &QAction::triggered, [db] { export_to_json(db, "ultimate.json"); });
}
void MainWindow::position_changed(uint64_t pos)
<height>23</height>
</rect>
</property>
+ <widget class="QMenu" name="menu_File">
+ <property name="title">
+ <string>&File</string>
+ </property>
+ <addaction name="action_export_json"/>
+ <addaction name="action_exit"/>
+ </widget>
+ <addaction name="menu_File"/>
</widget>
+ <action name="action_export_json">
+ <property name="text">
+ <string>Export &JSON</string>
+ </property>
+ </action>
+ <action name="action_exit">
+ <property name="text">
+ <string>E&xit</string>
+ </property>
+ </action>
</widget>
<customwidgets>
<customwidget>