diff --git a/src/mainwindow.h b/src/mainwindow.h
index 73f7cdf..e52021a 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -1,87 +1,87 @@
/* Atelier KDE Printer Host for 3D Printing
Copyright (C) <2016>
Author: Lays Rodrigues - lays.rodrigues@kde.org
Chris Rizzitello - rizzitello@kde.org
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 this program. If not, see .
*/
#pragma once
#include
#include
#include
#include
#include
#include
#include
#include "widgets/gcodeeditorwidget.h"
struct LateralArea {
// Area with the the lateral buttons that will open the views.
// Kind like the KDevelop stuff but way simpler.
using Btn2Widget = QPair;
using WidgetMap = QMap;
QWidget *m_toolBar;
QStackedWidget *m_stack;
WidgetMap m_map;
template T *get(const QString &s)
{
return qobject_cast(m_map[s].second);
}
template T *getButton(const QString &s)
{
return qobject_cast(m_map[s].first);
}
};
class MainWindow : public KXmlGuiWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
protected:
- void closeEvent(QCloseEvent *event);
- void dragEnterEvent(QDragEnterEvent *event);
- void dropEvent(QDropEvent *event);
+ void closeEvent(QCloseEvent *event) override;
+ void dragEnterEvent(QDragEnterEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
private:
GCodeEditorWidget *m_gcodeEditor = nullptr;
KTextEditor::View *m_currEditorView = nullptr;
int m_currInstance;
LateralArea m_lateral;
QList m_openFiles;
QString m_theme;
QTabWidget *m_instances = nullptr;
bool askToClose();
bool askToSave(const QVector &fileList);
void atCoreInstanceNameChange(const QString &name);
QString getTheme();
void initWidgets();
void loadFile(const QUrl &fileName);
void newAtCoreInstance();
void openActionTriggered();
void processDropEvent(const QList &fileList);
void setupActions();
void setupLateralArea();
void toggleGCodeActions();
void updateBedSize(const QSize &newSize);
void updateClientFactory(KTextEditor::View *view);
signals:
void extruderCountChanged(int count);
void profilesChanged();
};
diff --git a/src/widgets/thermowidget.h b/src/widgets/thermowidget.h
index db38367..e0786ea 100644
--- a/src/widgets/thermowidget.h
+++ b/src/widgets/thermowidget.h
@@ -1,67 +1,67 @@
/* Atelier KDE Printer Host for 3D Printing
Copyright (C) <2018>
Author: Tomaz Canabrava - tcanabrava@kde.org
Chris Rizzitello - rizzitello@kde.org
Lays Rodrigues - lays.rodrigues@kde.org
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 this program. If not, see .
*/
#pragma once
-#include
-#include
+#include
+#include
class QKeyEvent;
class QPaintEvent;
class QFocusEvent;
class QWheelEvent;
class ThermoWidget : public QwtDial
{
Q_OBJECT
public:
ThermoWidget(QWidget *parent, const QString &name);
~ThermoWidget() = default;
void drawNeedle(QPainter *painter, const QPointF ¢er,
- double radius, double dir, QPalette::ColorGroup colorGroup) const;
+ double radius, double dir, QPalette::ColorGroup colorGroup) const override;
void setCurrentTemperature(double temperature);
void setTargetTemperature(int temperature);
signals:
void targetTemperatureChanged(double targetTemperature);
protected:
- void focusInEvent(QFocusEvent *event);
- void focusOutEvent(QFocusEvent *event);
- void keyPressEvent(QKeyEvent *event);
- void paintEvent(QPaintEvent *event);
- void wheelEvent(QWheelEvent *event);
+ void focusInEvent(QFocusEvent *event) override;
+ void focusOutEvent(QFocusEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
+ void wheelEvent(QWheelEvent *event) override;
private:
bool isEqual(double a = 0, double b = 0);
QwtDialSimpleNeedle *m_currentTemperatureNeedle;
QwtDialSimpleNeedle *m_targetTemperatureNeedle;
QString m_currentTemperatureTextFromEditor = QString("-");
QString m_name;
QTimer *m_cursorTimer = nullptr;
QTimer *m_tempChangedTimer = nullptr;
bool m_paintCursor = false;
int m_cursorPos = 0;
double m_currentTemperature;
int m_targetTemperature;
void resetTimer();
};