Changeset - ab6bc6d4e2f6
[Not reviewed]
recording
0 4 0
Hasan Yavuz Ă–ZDERYA - 9 years ago 2017-02-07 15:11:09
hy@ozderya.net
added record toolbar
4 files changed with 25 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/mainwindow.cpp
Show inline comments
 
@@ -68,24 +68,25 @@ MainWindow::MainWindow(QWidget *parent) 
 
    ui->setupUi(this);
 

	
 
    plotMan = new PlotManager(ui->plotArea, channelMan.infoModel());
 

	
 
    ui->tabWidget->insertTab(0, &portControl, "Port");
 
    ui->tabWidget->insertTab(1, &dataFormatPanel, "Data Format");
 
    ui->tabWidget->insertTab(2, &plotControlPanel, "Plot");
 
    ui->tabWidget->insertTab(3, &commandPanel, "Commands");
 
    ui->tabWidget->insertTab(4, &recordPanel, "Record");
 
    ui->tabWidget->setCurrentIndex(0);
 
    auto tbPortControl = portControl.toolBar();
 
    addToolBar(tbPortControl);
 
    addToolBar(recordPanel.toolbar());
 

	
 
    ui->plotToolBar->addAction(snapshotMan.takeSnapshotAction());
 
    ui->menuBar->insertMenu(ui->menuHelp->menuAction(), snapshotMan.menu());
 
    ui->menuBar->insertMenu(ui->menuHelp->menuAction(), commandPanel.menu());
 

	
 
    connect(&commandPanel, &CommandPanel::focusRequested, [this]()
 
            {
 
                this->ui->tabWidget->setCurrentWidget(&commandPanel);
 
            });
 

	
 
    tbPortControl->setObjectName("tbPortControl");
 
    ui->plotToolBar->setObjectName("tbPlot");
src/recordpanel.cpp
Show inline comments
 
@@ -11,23 +11,38 @@
 
  serialplot is distributed in the hope that it will be useful,
 
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  GNU General Public License for more details.
 

	
 
  You should have received a copy of the GNU General Public License
 
  along with serialplot.  If not, see <http://www.gnu.org/licenses/>.
 
*/
 

	
 
#include "recordpanel.h"
 
#include "ui_recordpanel.h"
 

	
 
#include <QIcon>
 

	
 
RecordPanel::RecordPanel(QWidget *parent) :
 
    QWidget(parent),
 
    ui(new Ui::RecordPanel)
 
    ui(new Ui::RecordPanel),
 
    recordToolBar(tr("Record Toolbar")),
 
    recordAction(QIcon::fromTheme("media-record"), tr("Record"), this)
 
{
 
    ui->setupUi(this);
 

	
 
    recordAction.setCheckable(true);
 
    recordToolBar.addAction(&recordAction);
 
    ui->pbRecord->setDefaultAction(&recordAction);
 

	
 
    recordToolBar.setObjectName("tbRecord");
 
}
 

	
 
RecordPanel::~RecordPanel()
 
{
 
    delete ui;
 
}
 

	
 
QToolBar* RecordPanel::toolbar()
 
{
 
    return &recordToolBar;
 
}
src/recordpanel.h
Show inline comments
 
@@ -12,30 +12,36 @@
 
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  GNU General Public License for more details.
 

	
 
  You should have received a copy of the GNU General Public License
 
  along with serialplot.  If not, see <http://www.gnu.org/licenses/>.
 
*/
 

	
 
#ifndef RECORDPANEL_H
 
#define RECORDPANEL_H
 

	
 
#include <QWidget>
 
#include <QToolBar>
 
#include <QAction>
 

	
 
namespace Ui {
 
class RecordPanel;
 
}
 

	
 
class RecordPanel : public QWidget
 
{
 
    Q_OBJECT
 

	
 
public:
 
    explicit RecordPanel(QWidget *parent = 0);
 
    ~RecordPanel();
 

	
 
    QToolBar* toolbar();
 

	
 
private:
 
    Ui::RecordPanel *ui;
 
    QToolBar recordToolBar;
 
    QAction recordAction;
 
};
 

	
 
#endif // RECORDPANEL_H
src/recordpanel.ui
Show inline comments
 
@@ -20,25 +20,25 @@
 
      <layout class="QHBoxLayout" name="horizontalLayout">
 
       <item>
 
        <widget class="QPushButton" name="cbBrowse">
 
         <property name="toolTip">
 
          <string>Select record file</string>
 
         </property>
 
         <property name="text">
 
          <string>Browse</string>
 
         </property>
 
        </widget>
 
       </item>
 
       <item>
 
        <widget class="QLabel" name="label">
 
        <widget class="QLabel" name="lbFileName">
 
         <property name="sizePolicy">
 
          <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
 
           <horstretch>0</horstretch>
 
           <verstretch>0</verstretch>
 
          </sizepolicy>
 
         </property>
 
         <property name="text">
 
          <string>Select file...</string>
 
         </property>
 
        </widget>
 
       </item>
 
      </layout>
 
@@ -78,43 +78,37 @@
 
        <size>
 
         <width>20</width>
 
         <height>40</height>
 
        </size>
 
       </property>
 
      </spacer>
 
     </item>
 
    </layout>
 
   </item>
 
   <item>
 
    <layout class="QVBoxLayout" name="verticalLayout_2">
 
     <item>
 
      <widget class="QToolButton" name="toolButton_2">
 
      <widget class="QToolButton" name="pbRecord">
 
       <property name="minimumSize">
 
        <size>
 
         <width>85</width>
 
         <height>50</height>
 
        </size>
 
       </property>
 
       <property name="toolTip">
 
        <string>Start/Stop Recording</string>
 
       </property>
 
       <property name="text">
 
        <string>Record</string>
 
       </property>
 
       <property name="icon">
 
        <iconset theme="media-record"/>
 
       </property>
 
       <property name="checkable">
 
        <bool>true</bool>
 
       </property>
 
      </widget>
 
     </item>
 
     <item>
 
      <spacer name="verticalSpacer_2">
 
       <property name="orientation">
 
        <enum>Qt::Vertical</enum>
 
       </property>
 
       <property name="sizeHint" stdset="0">
 
        <size>
 
         <width>20</width>
 
         <height>40</height>
 
        </size>
0 comments (0 inline, 0 general)