mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-16 09:59:37 +02:00
Help and Tutorial dialogs are now not modal and not top-level. They can be minimized, but not maximized. All tests passe. (fixed #1655).
This commit is contained in:
@@ -1402,13 +1402,10 @@ void FWWindow::showTutorial(QString tutorial)
|
||||
if (fwbdebug)
|
||||
qDebug() << "FWWindow::showTutorial:" << tutorial;
|
||||
|
||||
TutorialDialog *dialog;
|
||||
if (tutorial.isEmpty())
|
||||
dialog= new TutorialDialog(
|
||||
sender()->objectName().remove(0,7).toLower(), this);
|
||||
TutorialDialog::showTutorial(sender()->objectName().remove(0,7).toLower());
|
||||
else
|
||||
dialog = new TutorialDialog(tutorial, this);
|
||||
dialog->show();
|
||||
TutorialDialog::showTutorial(tutorial);
|
||||
}
|
||||
|
||||
void FWWindow::showReleaseNotes()
|
||||
|
||||
+9
-4
@@ -39,8 +39,8 @@ using namespace std;
|
||||
|
||||
Help* Help::help_window = NULL;
|
||||
|
||||
Help::Help(QWidget *parent, const QString &title, bool _load_links_in_browser) :
|
||||
QDialog(parent)
|
||||
Help::Help(QWidget *, const QString &title, bool _load_links_in_browser) :
|
||||
QDialog(NULL)
|
||||
{
|
||||
load_links_in_browser = _load_links_in_browser;
|
||||
m_dialog = new Ui::HelpView_q;
|
||||
@@ -79,8 +79,13 @@ Help* Help::getHelpWindow(QWidget* w)
|
||||
if (help_window == NULL)
|
||||
{
|
||||
help_window = new Help(w, "Firewall Builder");
|
||||
help_window->setWindowFlags(Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowStaysOnTopHint | Qt::WindowCloseButtonHint);
|
||||
// help_window->setWindowFlags(help_window->windowFlags() | Qt::WindowMinimizeButtonHint);
|
||||
help_window->setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
help_window->showNormal();
|
||||
help_window->raise();
|
||||
}
|
||||
|
||||
//if (parent != mw) help_window->setParent(parent, help_window->flags);
|
||||
|
||||
+10
-7
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
|
||||
Firewall Builder
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
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.
|
||||
|
||||
|
||||
To get a copy of the GNU General Public License, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
@@ -31,12 +31,15 @@
|
||||
#include "ui_helpview_q.h"
|
||||
|
||||
#include "HttpGet.h"
|
||||
#include "global.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QStringList>
|
||||
#include <QUrl>
|
||||
#include <QByteArray>
|
||||
|
||||
#include <QWidget>
|
||||
#include <FWWindow.h>
|
||||
#include <QDebug>
|
||||
|
||||
class Help : public QDialog
|
||||
{
|
||||
@@ -48,10 +51,10 @@ class Help : public QDialog
|
||||
bool load_links_in_browser;
|
||||
HttpGet *http_getter;
|
||||
bool delayed_open;
|
||||
|
||||
|
||||
public:
|
||||
Ui::HelpView_q *m_dialog;
|
||||
|
||||
|
||||
Help(QWidget *parent, const QString &title, bool load_links_in_browser=true);
|
||||
virtual ~Help();
|
||||
|
||||
@@ -59,7 +62,7 @@ public:
|
||||
QString findHelpFile(const QString &file_base_name);
|
||||
|
||||
void setName(const QString &name);
|
||||
|
||||
|
||||
virtual void closeEvent(QCloseEvent *event);
|
||||
virtual void hideEvent(QHideEvent *event);
|
||||
virtual void showEvent(QShowEvent *event);
|
||||
@@ -72,4 +75,4 @@ public slots:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -31,15 +31,38 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include "FWBApplication.h"
|
||||
|
||||
TutorialDialog * TutorialDialog::dialog = NULL;
|
||||
|
||||
TutorialDialog::TutorialDialog(QString tutorial, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
QDialog(NULL),
|
||||
ui(new Ui::TutorialDialog_q)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowFlags(Qt::Dialog | Qt::WindowMinimizeButtonHint | Qt::WindowStaysOnTopHint | Qt::WindowCloseButtonHint);
|
||||
setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint);
|
||||
ui->contents->setOpenExternalLinks(true);
|
||||
|
||||
dialog = this;
|
||||
this->initializeTutorial(tutorial);
|
||||
}
|
||||
|
||||
void TutorialDialog::showTutorial(QString tutorial)
|
||||
{
|
||||
if (dialog != NULL)
|
||||
{
|
||||
dialog->initializeTutorial(tutorial);
|
||||
dialog->showNormal();
|
||||
dialog->raise();
|
||||
}
|
||||
else
|
||||
{
|
||||
(new TutorialDialog(tutorial))->show();
|
||||
}
|
||||
}
|
||||
|
||||
void TutorialDialog::initializeTutorial(QString tutorial)
|
||||
{
|
||||
this->tutorial = tutorial;
|
||||
doc = new QTextDocument(this);
|
||||
|
||||
@@ -54,17 +77,11 @@ TutorialDialog::TutorialDialog(QString tutorial, QWidget *parent) :
|
||||
}
|
||||
ui->contents->setDocument(doc);
|
||||
currentPage = 0;
|
||||
//this->setWindowModality(Qt::ApplicationModal);
|
||||
showPage(currentPage);
|
||||
|
||||
wfl->registerTutorialViewing(tutorial);
|
||||
}
|
||||
|
||||
void TutorialDialog::resizeEvent(QResizeEvent *)
|
||||
{
|
||||
// ui->contents->setMaximumWidth(ui->scrollArea->viewport()->width());
|
||||
}
|
||||
|
||||
TutorialDialog::~TutorialDialog()
|
||||
{
|
||||
delete ui;
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <QDialog>
|
||||
#include <QTextDocument>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class TutorialDialog_q;
|
||||
}
|
||||
@@ -38,6 +37,7 @@ class TutorialDialog : public QDialog {
|
||||
Q_OBJECT;
|
||||
public:
|
||||
TutorialDialog(QString tutorial, QWidget *parent = 0);
|
||||
|
||||
~TutorialDialog();
|
||||
QString tutorial;
|
||||
QString css_stylesheet;
|
||||
@@ -48,7 +48,8 @@ public:
|
||||
QString getResetForPage(int page);
|
||||
|
||||
void runScenario(QString scenario);
|
||||
void resizeEvent(QResizeEvent *);
|
||||
|
||||
static void showTutorial(QString tutorial);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
@@ -56,6 +57,8 @@ protected:
|
||||
private:
|
||||
Ui::TutorialDialog_q *ui;
|
||||
int currentPage;
|
||||
void initializeTutorial(QString tutorial);
|
||||
static TutorialDialog *dialog;
|
||||
|
||||
public slots:
|
||||
void previous();
|
||||
|
||||
Reference in New Issue
Block a user