diff options
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | src/jalv_qt4.cpp | 19 | ||||
-rw-r--r-- | wscript | 2 |
3 files changed, 22 insertions, 5 deletions
@@ -1,3 +1,9 @@ +jalv (1.2.1) unstable; + + * Add menu bar and pass parent widget in Qt version for true UI embedding + + -- David Robillard <d@drobilla.net> Tue, 13 Nov 2012 22:02:45 -0500 + jalv (1.2.0) stable; * Tune UI update rate and ring size based on JACK rate and MIDI buffer size diff --git a/src/jalv_qt4.cpp b/src/jalv_qt4.cpp index c73bd9c..04bea72 100644 --- a/src/jalv_qt4.cpp +++ b/src/jalv_qt4.cpp @@ -17,8 +17,9 @@ #include "jalv_internal.h" #include <QApplication> -#include <QPushButton> #include <QMainWindow> +#include <QMenuBar> +#include <QPushButton> #include <QTimer> static QApplication* app = NULL; @@ -74,19 +75,29 @@ private: int jalv_open_ui(Jalv* jalv) { + QMainWindow* win = new QMainWindow(); + QMenu* file_menu = win->menuBar()->addMenu("&File"); + QAction* quit_action = new QAction("&Quit", win); + + QObject::connect(quit_action, SIGNAL(triggered()), win, SLOT(close())); + quit_action->setShortcuts(QKeySequence::Quit); + quit_action->setStatusTip("Quit Jalv"); + file_menu->addAction(quit_action); + if (jalv->ui) { - jalv_ui_instantiate(jalv, jalv_native_ui_type(jalv), NULL); + jalv_ui_instantiate(jalv, jalv_native_ui_type(jalv), win); } if (jalv->ui_instance) { QWidget* widget = (QWidget*)suil_instance_get_widget(jalv->ui_instance); - widget->show(); + win->setCentralWidget(widget); } else { QPushButton* button = new QPushButton("Close"); - button->show(); + win->setCentralWidget(button); QObject::connect(button, SIGNAL(clicked()), app, SLOT(quit())); } app->connect(app, SIGNAL(lastWindowClosed()), app, SLOT(quit())); + win->show(); Timer* timer = new Timer(jalv); timer->start(1000 / jalv->ui_update_hz); @@ -4,7 +4,7 @@ from waflib.extras import autowaf as autowaf import waflib.Options as Options # Version of this package (even if built as a child) -JALV_VERSION = '1.2.0' +JALV_VERSION = '1.2.1' # Variables for 'waf dist' APPNAME = 'jalv' |