Commit cd4d510df3028dca74981eaf45ff877519dd5294
1 parent
307fb7a2
Show active device in main window title. Dock windows need a parent. Fixes #75
Showing
2 changed files
with
11 additions
and
9 deletions
openhantek/src/dockwindows.h
| @@ -45,7 +45,7 @@ class HorizontalDock : public QDockWidget { | @@ -45,7 +45,7 @@ class HorizontalDock : public QDockWidget { | ||
| 45 | Q_OBJECT | 45 | Q_OBJECT |
| 46 | 46 | ||
| 47 | public: | 47 | public: |
| 48 | - HorizontalDock(DsoSettings *settings, QWidget *parent = 0, | 48 | + HorizontalDock(DsoSettings *settings, QWidget *parent, |
| 49 | Qt::WindowFlags flags = 0); | 49 | Qt::WindowFlags flags = 0); |
| 50 | ~HorizontalDock(); | 50 | ~HorizontalDock(); |
| 51 | 51 | ||
| @@ -114,7 +114,7 @@ class TriggerDock : public QDockWidget { | @@ -114,7 +114,7 @@ class TriggerDock : public QDockWidget { | ||
| 114 | 114 | ||
| 115 | public: | 115 | public: |
| 116 | TriggerDock(DsoSettings *settings, const QStringList *specialTriggers, | 116 | TriggerDock(DsoSettings *settings, const QStringList *specialTriggers, |
| 117 | - QWidget *parent = 0, Qt::WindowFlags flags = 0); | 117 | + QWidget *parent, Qt::WindowFlags flags = 0); |
| 118 | ~TriggerDock(); | 118 | ~TriggerDock(); |
| 119 | 119 | ||
| 120 | int setMode(Dso::TriggerMode mode); | 120 | int setMode(Dso::TriggerMode mode); |
| @@ -162,7 +162,7 @@ class VoltageDock : public QDockWidget { | @@ -162,7 +162,7 @@ class VoltageDock : public QDockWidget { | ||
| 162 | Q_OBJECT | 162 | Q_OBJECT |
| 163 | 163 | ||
| 164 | public: | 164 | public: |
| 165 | - VoltageDock(DsoSettings *settings, QWidget *parent = 0, | 165 | + VoltageDock(DsoSettings *settings, QWidget *parent, |
| 166 | Qt::WindowFlags flags = 0); | 166 | Qt::WindowFlags flags = 0); |
| 167 | ~VoltageDock(); | 167 | ~VoltageDock(); |
| 168 | 168 | ||
| @@ -215,7 +215,7 @@ class SpectrumDock : public QDockWidget { | @@ -215,7 +215,7 @@ class SpectrumDock : public QDockWidget { | ||
| 215 | Q_OBJECT | 215 | Q_OBJECT |
| 216 | 216 | ||
| 217 | public: | 217 | public: |
| 218 | - SpectrumDock(DsoSettings *settings, QWidget *parent = 0, | 218 | + SpectrumDock(DsoSettings *settings, QWidget *parent, |
| 219 | Qt::WindowFlags flags = 0); | 219 | Qt::WindowFlags flags = 0); |
| 220 | ~SpectrumDock(); | 220 | ~SpectrumDock(); |
| 221 | 221 |
openhantek/src/mainwindow.cpp
| @@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
| 18 | #include "dataanalyzer.h" | 18 | #include "dataanalyzer.h" |
| 19 | #include "dockwindows.h" | 19 | #include "dockwindows.h" |
| 20 | #include "hantekdsocontrol.h" | 20 | #include "hantekdsocontrol.h" |
| 21 | +#include "usb/usbdevice.h" | ||
| 21 | #include "dsowidget.h" | 22 | #include "dsowidget.h" |
| 22 | #include "hantek/hantekdsocontrol.h" | 23 | #include "hantek/hantekdsocontrol.h" |
| 23 | #include "settings.h" | 24 | #include "settings.h" |
| @@ -32,7 +33,7 @@ OpenHantekMainWindow::OpenHantekMainWindow(std::shared_ptr<HantekDsoControl> dso | @@ -32,7 +33,7 @@ OpenHantekMainWindow::OpenHantekMainWindow(std::shared_ptr<HantekDsoControl> dso | ||
| 32 | 33 | ||
| 33 | // Window title | 34 | // Window title |
| 34 | setWindowIcon(QIcon(":openhantek.png")); | 35 | setWindowIcon(QIcon(":openhantek.png")); |
| 35 | - setWindowTitle(tr("OpenHantek")); | 36 | + setWindowTitle(tr("OpenHantek - Device %1").arg(QString::fromStdString(dsoControl->getDevice()->getModel().name))); |
| 36 | 37 | ||
| 37 | // Application settings | 38 | // Application settings |
| 38 | settings = new DsoSettings(); | 39 | settings = new DsoSettings(); |
| @@ -40,6 +41,7 @@ OpenHantekMainWindow::OpenHantekMainWindow(std::shared_ptr<HantekDsoControl> dso | @@ -40,6 +41,7 @@ OpenHantekMainWindow::OpenHantekMainWindow(std::shared_ptr<HantekDsoControl> dso | ||
| 40 | readSettings(); | 41 | readSettings(); |
| 41 | 42 | ||
| 42 | // Create dock windows before the dso widget, they fix messed up settings | 43 | // Create dock windows before the dso widget, they fix messed up settings |
| 44 | + setDockOptions(dockOptions() | QMainWindow::GroupedDragging); | ||
| 43 | createDockWindows(); | 45 | createDockWindows(); |
| 44 | 46 | ||
| 45 | // Central oszilloscope widget | 47 | // Central oszilloscope widget |
| @@ -249,10 +251,10 @@ void OpenHantekMainWindow::createStatusBar() { | @@ -249,10 +251,10 @@ void OpenHantekMainWindow::createStatusBar() { | ||
| 249 | 251 | ||
| 250 | /// \brief Create all docking windows. | 252 | /// \brief Create all docking windows. |
| 251 | void OpenHantekMainWindow::createDockWindows() { | 253 | void OpenHantekMainWindow::createDockWindows() { |
| 252 | - horizontalDock = new HorizontalDock(settings); | ||
| 253 | - triggerDock = new TriggerDock(settings, dsoControl->getSpecialTriggerSources()); | ||
| 254 | - spectrumDock = new SpectrumDock(settings); | ||
| 255 | - voltageDock = new VoltageDock(settings); | 254 | + horizontalDock = new HorizontalDock(settings, this); |
| 255 | + triggerDock = new TriggerDock(settings, dsoControl->getSpecialTriggerSources(), this); | ||
| 256 | + spectrumDock = new SpectrumDock(settings, this); | ||
| 257 | + voltageDock = new VoltageDock(settings, this); | ||
| 256 | } | 258 | } |
| 257 | 259 | ||
| 258 | /// \brief Connect general signals and device management signals. | 260 | /// \brief Connect general signals and device management signals. |