diff --git a/dialogs/demonotice.cpp b/dialogs/demonotice.cpp new file mode 100644 index 000000000..95826803a --- /dev/null +++ b/dialogs/demonotice.cpp @@ -0,0 +1,14 @@ +#include "demonotice.h" +#include "ui_demonotice.h" + +DemoNotice::DemoNotice(QWidget *parent) : + QDialog(parent), + ui(new Ui::DemoNotice) +{ + ui->setupUi(this); +} + +DemoNotice::~DemoNotice() +{ + delete ui; +} diff --git a/dialogs/demonotice.h b/dialogs/demonotice.h new file mode 100644 index 000000000..34cf6fcb2 --- /dev/null +++ b/dialogs/demonotice.h @@ -0,0 +1,22 @@ +#ifndef DEMONOTICE_H +#define DEMONOTICE_H + +#include + +namespace Ui { +class DemoNotice; +} + +class DemoNotice : public QDialog +{ + Q_OBJECT + +public: + explicit DemoNotice(QWidget *parent = 0); + ~DemoNotice(); + +private: + Ui::DemoNotice *ui; +}; + +#endif // DEMONOTICE_H diff --git a/dialogs/demonotice.ui b/dialogs/demonotice.ui new file mode 100644 index 000000000..fa7ff3e64 --- /dev/null +++ b/dialogs/demonotice.ui @@ -0,0 +1,97 @@ + + + DemoNotice + + + + 0 + 0 + 511 + 249 + + + + Welcome + + + + + + 12 + + + + + + 0 + 0 + + + + <html><head/><body><p><img src=":/icons/olive-splash.png"/></p></body></html> + + + + + + + <html><head/><body><p><span style=" font-size:14pt;">Welcome to Olive!</span></p><p>Olive is a free open-source video editor released under the GNU GPL. If you have paid for this software, you have been scammed.</p><p>This software is currently in ALPHA which means it is unstable and very likely to crash, have bugs, and have missing features. We offer no warranty so use at your own risk. Please report any bugs or feature requests at <a href="https://olivevideoeditor.org/"><span style=" text-decoration: underline; color:#007af4;">www.olivevideoeditor.org</span></a></p><p>Thank you for trying Olive and we hope you enjoy it!</p></body></html> + + + true + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + true + + + + + + + + + buttonBox + accepted() + DemoNotice + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DemoNotice + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index 454092cc2..e4bc4829a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -19,6 +19,7 @@ #include "dialogs/newsequencedialog.h" #include "dialogs/exportdialog.h" #include "dialogs/preferencesdialog.h" +#include "dialogs/demonotice.h" #include "playback/audio.h" #include "playback/playback.h" @@ -39,6 +40,7 @@ QTimer autorecovery_timer; QString config_dir; QString appName = "Olive (August 2018 | Alpha)"; +bool demoNoticeShown = false; void MainWindow::setup_layout() { panel_project->show(); @@ -139,7 +141,7 @@ MainWindow::MainWindow(QWidget *parent) : config_dir = data_dir + "/config.xml"; config.load(config_dir); } - } + } } MainWindow::~MainWindow() { @@ -367,7 +369,16 @@ void MainWindow::closeEvent(QCloseEvent *e) { e->accept(); } else { e->ignore(); - } + } +} + +void MainWindow::paintEvent(QPaintEvent *event) { + QMainWindow::paintEvent(event); + if (!demoNoticeShown) { + DemoNotice* d = new DemoNotice(this); + d->open(); + demoNoticeShown = true; + } } void MainWindow::on_action_Save_Project_triggered() diff --git a/mainwindow.h b/mainwindow.h index 8e4a25fe3..ea2855f86 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -21,7 +21,8 @@ public: ~MainWindow(); protected: - void closeEvent(QCloseEvent *); + void closeEvent(QCloseEvent *); + void paintEvent(QPaintEvent *event); private slots: void on_action_Import_triggered(); diff --git a/olive.pro b/olive.pro index c9a7cc0ed..8efa89f58 100644 --- a/olive.pro +++ b/olive.pro @@ -77,7 +77,8 @@ SOURCES += \ effects/video/cropeffect.cpp \ effects/video/flipeffect.cpp \ effects/audio/audionoiseeffect.cpp \ - effects/video/boxblureffect.cpp + effects/video/boxblureffect.cpp \ + dialogs/demonotice.cpp HEADERS += \ mainwindow.h \ @@ -131,7 +132,8 @@ HEADERS += \ effects/video/cropeffect.h \ effects/video/flipeffect.h \ effects/audio/audionoiseeffect.h \ - effects/video/boxblureffect.h + effects/video/boxblureffect.h \ + dialogs/demonotice.h FORMS += \ mainwindow.ui \ @@ -142,7 +144,8 @@ FORMS += \ dialogs/aboutdialog.ui \ dialogs/newsequencedialog.ui \ dialogs/exportdialog.ui \ - dialogs/preferencesdialog.ui + dialogs/preferencesdialog.ui \ + dialogs/demonotice.ui win32 { RC_ICONS = icons/olive.ico @@ -151,6 +154,7 @@ win32 { mac { LIBS += -L/usr/local/lib -lavutil -lavformat -lavcodec -lswscale -lswresample + ICON = icons/olive.icns INCLUDEPATH = /usr/local/include }