panels: enforced setting an object name by using a mandatory constructor parameter

This commit is contained in:
itsmattkc
2020-04-19 01:35:48 +10:00
parent f2bff5f150
commit 2716cfa7f5
19 changed files with 23 additions and 58 deletions
+1 -4
View File
@@ -23,11 +23,8 @@
OLIVE_NAMESPACE_ENTER
AudioMonitorPanel::AudioMonitorPanel(QWidget *parent) :
PanelWidget(parent)
PanelWidget(QStringLiteral("AudioMonitor"), parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("AudioMonitor");
audio_monitor_ = new AudioMonitor(this);
setWidget(audio_monitor_);
+1 -4
View File
@@ -23,11 +23,8 @@
OLIVE_NAMESPACE_ENTER
CurvePanel::CurvePanel(QWidget *parent) :
TimeBasedPanel(parent)
TimeBasedPanel(QStringLiteral("CurvePanel"), parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("CurvePanel");
// Create main widget and set it
SetTimeBasedWidget(new CurveWidget());
+1 -4
View File
@@ -25,11 +25,8 @@
OLIVE_NAMESPACE_ENTER
FootageViewerPanel::FootageViewerPanel(QWidget *parent) :
ViewerPanelBase(parent)
ViewerPanelBase(QStringLiteral("FootageViewerPanel"), parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("FootageViewerPanel");
// Set ViewerWidget as the central widget
SetTimeBasedWidget(new FootageViewerWidget());
+1 -4
View File
@@ -23,11 +23,8 @@
OLIVE_NAMESPACE_ENTER
NodePanel::NodePanel(QWidget *parent) :
PanelWidget(parent)
PanelWidget(QStringLiteral("NodePanel"), parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("NodePanel");
// Create NodeView widget
node_view_ = new NodeView(this);
+1 -4
View File
@@ -23,11 +23,8 @@
OLIVE_NAMESPACE_ENTER
ParamPanel::ParamPanel(QWidget* parent) :
TimeBasedPanel(parent)
TimeBasedPanel(QStringLiteral("ParamPanel"), parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("ParamPanel");
NodeParamView* view = new NodeParamView();
connect(view, &NodeParamView::SelectedInputChanged, this, &ParamPanel::SelectedInputChanged);
connect(view, &NodeParamView::TimeTargetChanged, this, &ParamPanel::TimeTargetChanged);
+1 -4
View File
@@ -23,11 +23,8 @@
OLIVE_NAMESPACE_ENTER
PixelSamplerPanel::PixelSamplerPanel(QWidget *parent) :
PanelWidget(parent)
PanelWidget(QStringLiteral("ProjectPanel"), parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("ProjectPanel");
sampler_widget_ = new ManagedPixelSamplerWidget();
setWidget(sampler_widget_);
+1 -4
View File
@@ -35,11 +35,8 @@
OLIVE_NAMESPACE_ENTER
ProjectPanel::ProjectPanel(QWidget *parent) :
PanelWidget(parent)
PanelWidget(QStringLiteral("ProjectPanel"), parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("ProjectPanel");
// Create main widget and its layout
QWidget* central_widget = new QWidget(this);
QVBoxLayout* layout = new QVBoxLayout(central_widget);
+1 -4
View File
@@ -23,11 +23,8 @@
OLIVE_NAMESPACE_ENTER
SequenceViewerPanel::SequenceViewerPanel(QWidget *parent) :
ViewerPanel(parent)
ViewerPanel(QStringLiteral("SequenceViewerPanel"), parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("SequenceViewerPanel");
// Set strings
Retranslate();
}
+1 -4
View File
@@ -25,11 +25,8 @@
OLIVE_NAMESPACE_ENTER
TaskManagerPanel::TaskManagerPanel(QWidget* parent) :
PanelWidget(parent)
PanelWidget(QStringLiteral("TaskManagerPanel"), parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("TaskManagerPanel");
// Create task view
view_ = new TaskView(this);
+2 -2
View File
@@ -22,8 +22,8 @@
OLIVE_NAMESPACE_ENTER
TimeBasedPanel::TimeBasedPanel(QWidget *parent) :
PanelWidget(parent),
TimeBasedPanel::TimeBasedPanel(const QString &object_name, QWidget *parent) :
PanelWidget(object_name, parent),
widget_(nullptr)
{
}
+1 -1
View File
@@ -30,7 +30,7 @@ class TimeBasedPanel : public PanelWidget
{
Q_OBJECT
public:
TimeBasedPanel(QWidget *parent = nullptr);
TimeBasedPanel(const QString& object_name, QWidget *parent = nullptr);
void ConnectViewerNode(ViewerOutput* node);
+1 -4
View File
@@ -26,11 +26,8 @@
OLIVE_NAMESPACE_ENTER
TimelinePanel::TimelinePanel(QWidget *parent) :
TimeBasedPanel(parent)
TimeBasedPanel(QStringLiteral("TimelinePanel"), parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("TimelinePanel");
TimelineWidget* tw = new TimelineWidget();
SetTimeBasedWidget(tw);
+1 -4
View File
@@ -26,11 +26,8 @@
OLIVE_NAMESPACE_ENTER
ToolPanel::ToolPanel(QWidget *parent) :
PanelWidget(parent)
PanelWidget(QStringLiteral("ToolPanel"), parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("ToolPanel");
Toolbar* t = new Toolbar(this);
t->SetTool(Core::instance()->tool());
+2 -5
View File
@@ -22,12 +22,9 @@
OLIVE_NAMESPACE_ENTER
ViewerPanel::ViewerPanel(QWidget *parent) :
ViewerPanelBase(parent)
ViewerPanel::ViewerPanel(const QString &object_name, QWidget *parent) :
ViewerPanelBase(object_name, parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("ViewerPanel");
// Set ViewerWidget as the central widget
SetTimeBasedWidget(new ViewerWidget());
+1 -1
View File
@@ -33,7 +33,7 @@ OLIVE_NAMESPACE_ENTER
class ViewerPanel : public ViewerPanelBase {
Q_OBJECT
public:
ViewerPanel(QWidget* parent);
ViewerPanel(const QString& object_name, QWidget* parent);
protected:
virtual void Retranslate() override;
+2 -2
View File
@@ -22,8 +22,8 @@
OLIVE_NAMESPACE_ENTER
ViewerPanelBase::ViewerPanelBase(QWidget *parent) :
TimeBasedPanel(parent)
ViewerPanelBase::ViewerPanelBase(const QString& object_name, QWidget *parent) :
TimeBasedPanel(object_name, parent)
{
}
+1 -1
View File
@@ -31,7 +31,7 @@ class ViewerPanelBase : public TimeBasedPanel
{
Q_OBJECT
public:
ViewerPanelBase(QWidget* parent = nullptr);
ViewerPanelBase(const QString& object_name, QWidget* parent = nullptr);
virtual void PlayPause() override;
+2 -1
View File
@@ -29,11 +29,12 @@
OLIVE_NAMESPACE_ENTER
PanelWidget::PanelWidget(QWidget *parent) :
PanelWidget::PanelWidget(const QString &object_name, QWidget *parent) :
QDockWidget(parent),
border_visible_(false),
signal_instead_of_close_(false)
{
setObjectName(object_name);
setFocusPolicy(Qt::ClickFocus);
connect(this, &PanelWidget::visibilityChanged, this, &PanelWidget::PanelVisibilityChanged);
+1 -1
View File
@@ -42,7 +42,7 @@ public:
* The PanelWidget's parent, enforced to help with memory handling. Most of the time this will be an instance of
* MainWindow.
*/
PanelWidget(QWidget* parent);
PanelWidget(const QString& object_name, QWidget* parent);
/**
* @brief Set whether panel movement is locked or not