File indexing completed on 2025-01-05 05:14:48

0001 /*
0002 SPDX-FileCopyrightText: 2021 Hamed Masafi <hamed.masfi@gmail.com>
0003 
0004 SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #include "appdialog.h"
0008 
0009 #include "gitmanager.h"
0010 #include <QDesktopServices>
0011 #include <QEvent>
0012 #include <QWhatsThisClickedEvent>
0013 
0014 AppDialog::AppDialog(QWidget *parent, Qt::WindowFlags f)
0015     : QDialog(parent, f)
0016     , mGit(Git::Manager::instance())
0017 {
0018 }
0019 
0020 AppDialog::AppDialog(Git::Manager *git, QWidget *parent, Qt::WindowFlags f)
0021     : QDialog(parent, f)
0022     , mGit(git)
0023 {
0024 }
0025 
0026 bool AppDialog::event(QEvent *event)
0027 {
0028     if (event->type() == QEvent::WhatsThisClicked) {
0029         event->accept();
0030         auto whatsThisEvent = static_cast<QWhatsThisClickedEvent *>(event);
0031         QDesktopServices::openUrl(QUrl(whatsThisEvent->href()));
0032         return true;
0033     }
0034     return QDialog::event(event);
0035 }
0036 
0037 #include "moc_appdialog.cpp"