ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
disclaimerDialog.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <ui_disclaimerDlg.h>
11 
12 // ECV_PLUGINS
13 #include <ecvMainAppInterface.h>
14 
15 // Qt
16 #include <QMainWindow>
17 
19 class DisclaimerDialog : public QDialog, public Ui::DisclaimerDialog {
20 public:
22  DisclaimerDialog(QWidget* parent = 0)
23  : QDialog(parent), Ui::DisclaimerDialog() {
24  setupUi(this);
25  }
26 };
27 
28 // whether disclaimer has already been displayed (and accepted) or not
29 static bool s_disclaimerAccepted = false;
30 
32  if (!s_disclaimerAccepted) {
33  // if the user "cancels" it, then he refuses the diclaimer!
35  DisclaimerDialog(app ? app->getMainWindow() : 0).exec();
36  }
37 
38  return s_disclaimerAccepted;
39 }
Dialog for displaying the BRGM disclaimer.
DisclaimerDialog(QWidget *parent=0)
Default constructor.
Main application interface (for plugins)
virtual QMainWindow * getMainWindow()=0
Returns main window.
static bool s_disclaimerAccepted
static bool ShowDisclaimer(ecvMainAppInterface *app)