diff edgui.cpp @ 381:71c830840691

More work.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 17 Oct 2012 03:59:33 +0300
parents feaeec4c6c55
children e4aad59fb407
line wrap: on
line diff
--- a/edgui.cpp	Wed Oct 17 03:46:40 2012 +0300
+++ b/edgui.cpp	Wed Oct 17 03:59:33 2012 +0300
@@ -5,6 +5,7 @@
 #include "edmain.h"
 
 #include <QCloseEvent>
+#include <QToolBar>
 #include <QMenuBar>
 #include <QStatusBar>
 #include <QMenu>
@@ -273,6 +274,10 @@
 //
 // Various menu actions
 //
+void DemoEditor::actionControlChanged(QAction *act)
+{
+//    view->setToolMode(act->data().toInt());
+}
 
 
 //
@@ -418,8 +423,37 @@
     MCONNECT(helpMenu, act, actionAboutBox());
 
 
+
+    //
+    // Controls toolbar
+    //
     qDebug() << "- Constructing toolbars";
 
+    actGroupControls = new QActionGroup(this);
+    actGroupControls->setExclusive(true);
+    connect(actGroupControls, SIGNAL(triggered(QAction*)), this, SLOT(actionControlChanged(QAction *)));
+    
+    createToolButton(actGroupControls, "Rewind", QIcon("rewind.png"),
+        "Rewind to start of the timeline", CTRL_REWIND);
+
+    createToolButton(actGroupControls, "Play start", QIcon("play1.png"),
+        "Play from start", CTRL_PLAY_START);
+
+    createToolButton(actGroupControls, "Play current", QIcon("play2.png"),
+        "Play from current position", CTRL_PLAY_CURRENT);
+
+    createToolButton(actGroupControls, "Pause", QIcon("pause.png"),
+        "Pause", CTRL_PAUSE);
+
+
+    QToolBar *toolBarTools = new QToolBar("Player controls", this);
+    toolBarTools->setMovable(false);
+    toolBarTools->setFloatable(false);
+    toolBarTools->setIconSize(QSize(CTRL_ICON_SIZE, CTRL_ICON_SIZE));
+    toolBarTools->setToolButtonStyle(Qt::ToolButtonIconOnly);
+    toolBarTools->addActions(actGroupControls->actions());
+
+
     //
     // Construct the main screen
     //
@@ -433,6 +467,7 @@
     QVBoxLayout *sideVBox = new QVBoxLayout(sideVBoxContainer);
     sideVBox->setSpacing(0);
     sideVBox->setContentsMargins(0, 0, 0, 0);
+    sideVBox->addWidget(toolBarTools);
 
 //    view = new MapView();