Redo About Popup (#102)

* Redo About Popup

* Remove forum link
This commit is contained in:
Jeremy Bullock 2020-07-25 22:06:00 -07:00 committed by GitHub
parent 1d09e20c2f
commit 7e0ba3c713
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 167 additions and 34 deletions

View file

@ -0,0 +1,10 @@
Tahoma ships with FFmpeg, and uses FFmpeg through command line commands.
Tahoma does not directly use FFmpeg libraries or code.
As of July 2020, Tahoma is shipping with FFmpeg 4.3 LGPL version from https://ffmpeg.zeranoe.com/builds/
FFmpeg source code can be found at:
https://github.com/turtletooth/FFmpeg
or
https://github.com/FFmpeg/FFmpeg

View file

@ -322,7 +322,6 @@
<menu title="Help">
<command>MI_OpenOnlineManual</command>
<command>MI_OpenWhatsNew</command>
<command>MI_OpenCommunityForum</command>
<separator/>
<command>MI_OpenReportABug</command>
<separator/>

View file

@ -1,6 +1,7 @@
set(VERSION 1.4)
set(MOC_HEADERS
aboutpopup.h
addfilmstripframespopup.h
adjustlevelspopup.h
adjustthicknesspopup.h
@ -234,6 +235,7 @@ set(SOURCES
fileselection.cpp
filmstripselection.cpp
keyframeselection.cpp
aboutpopup.cpp
addfilmstripframespopup.cpp
camerasettingspopup.cpp
convertpopup.cpp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View file

@ -0,0 +1,96 @@
#include "aboutpopup.h"
#include "tenv.h"
#include "tsystem.h"
#include <QPushButton>
#include <QLabel>
#include <QApplication>
#include <QDesktopWidget>
#include <QTextEdit>
#include <QDesktopServices>
AboutClickableLabel::AboutClickableLabel(QWidget* parent, Qt::WindowFlags f)
: QLabel(parent) {
setStyleSheet("text-decoration: underline;");
}
AboutClickableLabel::~AboutClickableLabel() {}
void AboutClickableLabel::mousePressEvent(QMouseEvent* event) {
emit clicked();
}
AboutPopup::AboutPopup(QWidget* parent)
: DVGui::Dialog(parent, true, "About Tahoma") {
setFixedWidth(300);
setFixedHeight(350);
setWindowTitle(tr("About Tahoma"));
setTopMargin(0);
TFilePath baseLicensePath = TEnv::getStuffDir() + "doc/LICENSE";
TFilePath tahomaLicensePath = baseLicensePath + "LICENSE.txt";
QVBoxLayout* mainLayout = new QVBoxLayout(this);
QLabel* logo = new QLabel(this);
logo->setPixmap(QPixmap::fromImage(QImage(":Resources/startup.png")));
mainLayout->addWidget(logo);
QString name = QString::fromStdString(TEnv::getApplicationFullName());
name += "\nBuilt: " __DATE__;
mainLayout->addWidget(new QLabel(name));
QLabel* blankLabel = new QLabel(this);
blankLabel->setText(tr(" "));
blankLabel->setWordWrap(true);
mainLayout->addWidget(blankLabel);
AboutClickableLabel* licenseLink = new AboutClickableLabel(this);
licenseLink->setText(tr("Tahoma License"));
connect(licenseLink, &AboutClickableLabel::clicked, [=]() {
if (TSystem::isUNC(tahomaLicensePath))
QDesktopServices::openUrl(
QUrl(QString::fromStdWString(tahomaLicensePath.getWideString())));
else
QDesktopServices::openUrl(QUrl::fromLocalFile(
QString::fromStdWString(tahomaLicensePath.getWideString())));
});
mainLayout->addWidget(licenseLink);
AboutClickableLabel* thirdPartyLink = new AboutClickableLabel(this);
thirdPartyLink->setText(tr("Third Party Licenses"));
connect(thirdPartyLink, &AboutClickableLabel::clicked, [=]() {
if (TSystem::isUNC(baseLicensePath))
QDesktopServices::openUrl(
QUrl(QString::fromStdWString(baseLicensePath.getWideString())));
else
QDesktopServices::openUrl(QUrl::fromLocalFile(
QString::fromStdWString(baseLicensePath.getWideString())));
});
mainLayout->addWidget(thirdPartyLink);
QLabel* ffmpegLabel = new QLabel(this);
ffmpegLabel->setText(
tr("Tahoma ships with FFmpeg. \nFFmpeg is licensed under the LGPLv2.1"));
mainLayout->addWidget(ffmpegLabel);
mainLayout->addStretch();
QFrame* mainFrame = new QFrame(this);
mainFrame->setLayout(mainLayout);
mainFrame->setFixedWidth(300);
addWidget(mainFrame);
QPushButton* button = new QPushButton(tr("Close"), this);
button->setDefault(true);
addButtonBarWidget(button);
connect(button, SIGNAL(clicked()), this, SLOT(accept()));
}

View file

@ -0,0 +1,43 @@
#pragma once
#ifndef ABOUTPOPUP_H
#define ABOUTPOPUP_H
#include "toonzqt/dvdialog.h"
#include <QLabel>
#include <QWidget>
#include <Qt>
// forward declaration
class QPushButton;
class QLineEdit;
class AboutClickableLabel : public QLabel {
Q_OBJECT
public:
explicit AboutClickableLabel(QWidget* parent = Q_NULLPTR,
Qt::WindowFlags f = Qt::WindowFlags());
~AboutClickableLabel();
signals:
void clicked();
protected:
void mousePressEvent(QMouseEvent* event);
};
//=============================================================================
// AboutPopup
//-----------------------------------------------------------------------------
class AboutPopup final : public DVGui::Dialog {
Q_OBJECT
QPushButton* m_closeBtn;
public:
AboutPopup(QWidget* parent);
};
#endif // ABOUTPOPUP_H

View file

@ -14,6 +14,7 @@
#include "viewerpane.h"
#include "startuppopup.h"
#include "statusbar.h"
#include "aboutpopup.h"
// TnzTools includes
#include "tools/toolcommandids.h"
@ -410,6 +411,8 @@ centralWidget->setLayout(centralWidgetLayout);*/
m_statusBar->setVisible(ShowStatusBarAction == 1 ? true : false);
TApp::instance()->setStatusBar(m_statusBar);
m_aboutPopup = new AboutPopup(this);
// Leggo i settings
readSettings(argumentLayoutFileName);
@ -566,8 +569,8 @@ centralWidget->setLayout(centralWidgetLayout);*/
setCommandHandler(MI_About, this, &MainWindow::onAbout);
setCommandHandler(MI_OpenOnlineManual, this, &MainWindow::onOpenOnlineManual);
setCommandHandler(MI_OpenWhatsNew, this, &MainWindow::onOpenWhatsNew);
setCommandHandler(MI_OpenCommunityForum, this,
&MainWindow::onOpenCommunityForum);
// setCommandHandler(MI_OpenCommunityForum, this,
// &MainWindow::onOpenCommunityForum);
setCommandHandler(MI_OpenReportABug, this, &MainWindow::onOpenReportABug);
setCommandHandler(MI_MaximizePanel, this, &MainWindow::maximizePanel);
@ -1037,28 +1040,7 @@ void MainWindow::onUpgradeTabPro() {}
//-----------------------------------------------------------------------------
void MainWindow::onAbout() {
QLabel *label = new QLabel();
QPixmap pixmap = QIcon(":Resources/splash.svg").pixmap(QSize(610, 344));
pixmap.setDevicePixelRatio(QApplication::desktop()->devicePixelRatio());
label->setPixmap(pixmap);
DVGui::Dialog *dialog = new DVGui::Dialog(this, true);
dialog->setWindowTitle(tr("About Tahoma"));
dialog->setTopMargin(0);
dialog->addWidget(label);
QString name = QString::fromStdString(TEnv::getApplicationFullName());
name += " (built " __DATE__ " " __TIME__ ")";
dialog->addWidget(new QLabel(name));
QPushButton *button = new QPushButton(tr("Close"), dialog);
button->setDefault(true);
dialog->addButtonBarWidget(button);
connect(button, SIGNAL(clicked()), dialog, SLOT(accept()));
dialog->exec();
}
void MainWindow::onAbout() { m_aboutPopup->exec(); }
//-----------------------------------------------------------------------------
@ -1075,10 +1057,10 @@ void MainWindow::onOpenWhatsNew() {
//-----------------------------------------------------------------------------
void MainWindow::onOpenCommunityForum() {
QDesktopServices::openUrl(
QUrl(tr("https://groups.google.com/forum/#!forum/opentoonz_en")));
}
// void MainWindow::onOpenCommunityForum() {
// QDesktopServices::openUrl(
// QUrl(tr("https://groups.google.com/forum/#!forum/opentoonz_en")));
//}
//-----------------------------------------------------------------------------
@ -2228,7 +2210,7 @@ void MainWindow::defineActions() {
createMenuHelpAction(MI_OpenOnlineManual, tr("&Online Manual..."), "F1");
createMenuHelpAction(MI_OpenWhatsNew, tr("&What's New..."), "");
createMenuHelpAction(MI_OpenCommunityForum, tr("&Community Forum..."), "");
// createMenuHelpAction(MI_OpenCommunityForum, tr("&Community Forum..."), "");
createMenuHelpAction(MI_OpenReportABug, tr("&Report a Bug..."), "");
createMenuWindowsAction(MI_OpenGuidedDrawingControls,

View file

@ -22,6 +22,7 @@ class TPanel;
class UpdateChecker;
class TopBar;
class StatusBar;
class AboutPopup;
//-----------------------------------------------------------------------------
class Room final : public TMainWindow {
@ -65,7 +66,7 @@ class MainWindow final : public QMainWindow {
TopBar *m_topBar;
StatusBar *m_statusBar;
AboutPopup *m_aboutPopup;
QActionGroup *m_toolsActionGroup;
QStackedWidget *m_stackedWidget;
@ -100,7 +101,7 @@ public:
void onAbout();
void onOpenOnlineManual();
void onOpenWhatsNew();
void onOpenCommunityForum();
// void onOpenCommunityForum();
void onOpenReportABug();
void checkForUpdates();
int getRoomCount() const;

View file

@ -721,7 +721,7 @@ QMenuBar *StackedMenuBar::createFullMenuBar() {
QMenu *helpMenu = addMenu(tr("Help"), fullMenuBar);
addMenuItem(helpMenu, MI_OpenOnlineManual);
addMenuItem(helpMenu, MI_OpenWhatsNew);
addMenuItem(helpMenu, MI_OpenCommunityForum);
// addMenuItem(helpMenu, MI_OpenCommunityForum);
helpMenu->addSeparator();
addMenuItem(helpMenu, MI_OpenReportABug);
helpMenu->addSeparator();

View file

@ -429,7 +429,7 @@
#define MI_OpenOnlineManual "MI_OpenOnlineManual"
#define MI_OpenWhatsNew "MI_OpenWhatsNew"
#define MI_OpenCommunityForum "MI_OpenCommunityForum"
// #define MI_OpenCommunityForum "MI_OpenCommunityForum"
#define MI_OpenReportABug "MI_OpenReportABug"
#define MI_ClearCacheFolder "MI_ClearCacheFolder"