From e61d69a840886d188fcb9a7a03ec1139c0d99fb2 Mon Sep 17 00:00:00 2001 From: ArsenArsen Date: Thu, 22 Jun 2017 17:41:29 +0200 Subject: [PATCH] Move settings to a seperate dialog, add about box It contains licensing information! --- KShare.pro | 14 +- aboutbox.cpp | 11 ++ aboutbox.hpp | 21 +++ aboutbox.ui | 291 +++++++++++++++++++++++++++++++++ icon.qrc | 1 + icons/icon.svg | 64 ++++++++ main.cpp | 33 +++- mainwindow.cpp | 177 ++++---------------- mainwindow.hpp | 30 +--- mainwindow.ui | 147 +++-------------- notifications.cpp | 7 + notifications.hpp | 1 + recording/recordingformats.cpp | 7 +- screenshotter.cpp | 4 +- settingsdialog.cpp | 145 ++++++++++++++++ settingsdialog.hpp | 38 +++++ settingsdialog.ui | 180 ++++++++++++++++++++ 17 files changed, 874 insertions(+), 297 deletions(-) create mode 100644 aboutbox.cpp create mode 100644 aboutbox.hpp create mode 100644 aboutbox.ui create mode 100644 icons/icon.svg create mode 100644 settingsdialog.cpp create mode 100644 settingsdialog.hpp create mode 100644 settingsdialog.ui diff --git a/KShare.pro b/KShare.pro index a9138ef..8f46910 100644 --- a/KShare.pro +++ b/KShare.pro @@ -11,6 +11,8 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = KShare TEMPLATE = app +CONFIG += c++11 + # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the @@ -55,7 +57,9 @@ SOURCES += main.cpp\ formats.cpp \ recording/encoders/encoder.cpp \ recording/encoders/encodersettings.cpp \ - recording/encoders/encodersettingsdialog.cpp + recording/encoders/encodersettingsdialog.cpp \ + settingsdialog.cpp \ + aboutbox.cpp HEADERS += mainwindow.hpp \ cropeditor/cropeditor.hpp \ @@ -91,7 +95,9 @@ HEADERS += mainwindow.hpp \ formats.hpp \ recording/encoders/encoder.hpp \ recording/encoders/encodersettings.hpp \ - recording/encoders/encodersettingsdialog.hpp + recording/encoders/encodersettingsdialog.hpp \ + settingsdialog.hpp \ + aboutbox.hpp LIBS += -lavcodec -lavformat -lavutil -lswscale -lavutil @@ -117,7 +123,9 @@ mac { FORMS += mainwindow.ui \ cropeditor/settings/brushpenselection.ui \ cropeditor/settings/blurdialog.ui \ - recording/encoders/encodersettingsdialog.ui + recording/encoders/encodersettingsdialog.ui \ + settingsdialog.ui \ + aboutbox.ui DISTFILES += \ README.md \ diff --git a/aboutbox.cpp b/aboutbox.cpp new file mode 100644 index 0000000..7e31d98 --- /dev/null +++ b/aboutbox.cpp @@ -0,0 +1,11 @@ +#include "aboutbox.hpp" +#include "ui_aboutbox.h" + +AboutBox::AboutBox(QWidget *parent) : QDialog(parent), ui(new Ui::AboutBox) { + ui->setupUi(this); + ui->label->setText(ui->label->text().arg(QApplication::applicationVersion())); +} + +AboutBox::~AboutBox() { + delete ui; +} diff --git a/aboutbox.hpp b/aboutbox.hpp new file mode 100644 index 0000000..d0d9df1 --- /dev/null +++ b/aboutbox.hpp @@ -0,0 +1,21 @@ +#ifndef ABOUTBOX_HPP +#define ABOUTBOX_HPP + +#include + +namespace Ui { +class AboutBox; +} + +class AboutBox : public QDialog { + Q_OBJECT + +public: + explicit AboutBox(QWidget *parent = 0); + ~AboutBox(); + +private: + Ui::AboutBox *ui; +}; + +#endif // ABOUTBOX_HPP diff --git a/aboutbox.ui b/aboutbox.ui new file mode 100644 index 0000000..dd9ce53 --- /dev/null +++ b/aboutbox.ui @@ -0,0 +1,291 @@ + + + AboutBox + + + + 0 + 0 + 531 + 231 + + + + About KShare + + + + + + <p style="vertical-align:middle;"><img src=":/icons/icon.svg" width="50"/><span style="font-weight:600;"> KShare</span> - The open source and cross platform screen sharing software</p><p>Version %0<br>Links: <a href="https://github.com/ArsenArsen/KShare">Source code</a>, <a href="https://github.com/ArsenArsen/KShare/issues">Issue tracker</a>, <a href="http://kshare.arsenarsen.com">Website</a>, <a href="https://patreon.com/arsen">Patreon</a></body></html> + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This software uses and possibly bundles Qt, OpenSSL, and FFMpeg, whose licenses are respectively:</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">------------------------------ </span><a href="http://code.qt.io/cgit/qt/qt5.git/tree/LICENSE.LGPLv3"><span style=" font-family:'Noto Mono'; text-decoration: underline; color:#007af4;">Qt</span></a><span style=" font-family:'Noto Mono';">:</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">GNU LESSER GENERAL PUBLIC LICENSE</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">Contact: </span><a href="http://www.qt.io/licensing/"><span style=" font-family:'Noto Mono'; text-decoration: underline; color:#007af4;">http://www.qt.io/licensing/</span></a></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">You may use, distribute and copy the Qt Toolkit under the terms of</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">GNU Lesser General Public License version 3, which is displayed below.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">This license makes reference to the version 3 of the GNU General</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">Public License, which you can find in the </span><a href="http://code.qt.io/cgit/qt/qt5.git/tree/LICENSE.LGPLv3"><span style=" font-family:'Noto Mono'; text-decoration: underline; color:#007af4;">LICENSE.GPLv3</span></a><span style=" font-family:'Noto Mono';"> file.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">------------------------------ </span><a href="https://www.openssl.org/source/license.html"><span style=" text-decoration: underline; color:#007af4;">OpenSSL</span></a><span style=" font-family:'Noto Mono';">:</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">LICENSE ISSUES</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">==============</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">The OpenSSL toolkit stays under a double license, i.e. both the conditions of</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">the OpenSSL License and the original SSLeay license apply to the toolkit.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">See below for the actual license texts.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">OpenSSL License</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">---------------</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">/* ====================================================================</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* Copyright (c) 1998-2017 The OpenSSL Project. All rights reserved.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">*</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* Redistribution and use in source and binary forms, with or without</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* modification, are permitted provided that the following conditions</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* are met:</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">*</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* 1. Redistributions of source code must retain the above copyright</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* notice, this list of conditions and the following disclaimer. </span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">*</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* 2. Redistributions in binary form must reproduce the above copyright</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* notice, this list of conditions and the following disclaimer in</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* the documentation and/or other materials provided with the</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* distribution.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">*</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* 3. All advertising materials mentioning features or use of this</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* software must display the following acknowledgment:</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* &quot;This product includes software developed by the OpenSSL Project</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* for use in the OpenSSL Toolkit. (http://www.openssl.org/)&quot;</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">*</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* 4. The names &quot;OpenSSL Toolkit&quot; and &quot;OpenSSL Project&quot; must not be used to</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* endorse or promote products derived from this software without</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* prior written permission. For written permission, please contact</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* openssl-core@openssl.org.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">*</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* 5. Products derived from this software may not be called &quot;OpenSSL&quot;</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* nor may &quot;OpenSSL&quot; appear in their names without prior written</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* permission of the OpenSSL Project.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">*</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* 6. Redistributions of any form whatsoever must retain the following</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* acknowledgment:</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* &quot;This product includes software developed by the OpenSSL Project</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* for use in the OpenSSL Toolkit (http://www.openssl.org/)&quot;</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">*</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* OF THE POSSIBILITY OF SUCH DAMAGE.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* ====================================================================</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">*</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* This product includes cryptographic software written by Eric Young</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* (eay@cryptsoft.com). This product includes software written by Tim</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* Hudson (tjh@cryptsoft.com).</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">*</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">*/</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">Original SSLeay License</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">-----------------------</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* All rights reserved.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">*</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* This package is an SSL implementation written</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* by Eric Young (eay@cryptsoft.com).</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* The implementation was written so as to conform with Netscapes SSL.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* </span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* This library is free for commercial and non-commercial use as long as</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* the following conditions are aheared to. The following conditions</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* apply to all code found in this distribution, be it the RC4, RSA,</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* lhash, DES, etc., code; not just the SSL code. The SSL documentation</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* included with this distribution is covered by the same copyright terms</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* except that the holder is Tim Hudson (tjh@cryptsoft.com).</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* </span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* Copyright remains Eric Young's, and as such any Copyright notices in</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* the code are not to be removed.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* If this package is used in a product, Eric Young should be given attribution</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* as the author of the parts of the library used.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* This can be in the form of a textual message at program startup or</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* in documentation (online or textual) provided with the package.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* </span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* Redistribution and use in source and binary forms, with or without</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* modification, are permitted provided that the following conditions</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* are met:</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* 1. Redistributions of source code must retain the copyright</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* notice, this list of conditions and the following disclaimer.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* 2. Redistributions in binary form must reproduce the above copyright</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* notice, this list of conditions and the following disclaimer in the</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* documentation and/or other materials provided with the distribution.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* 3. All advertising materials mentioning features or use of this software</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* must display the following acknowledgement:</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* &quot;This product includes cryptographic software written by</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* Eric Young (eay@cryptsoft.com)&quot;</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* The word 'cryptographic' can be left out if the rouines from the library</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* being used are not cryptographic related :-).</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* 4. If you include any Windows specific code (or a derivative thereof) from </span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* the apps directory (application code) you must include an acknowledgement:</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* &quot;This product includes software written by Tim Hudson (tjh@cryptsoft.com)&quot;</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* </span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* SUCH DAMAGE.</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* </span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* The licence and distribution terms for any publically available version or</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* derivative of this code cannot be changed. i.e. this code cannot simply be</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* copied and put under another distribution licence</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">* [including the GNU Public Licence.]</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">*/</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">------------------------------ </span><a href="https://github.com/FFmpeg/FFmpeg/blob/master/LICENSE.md"><span style=" text-decoration: underline; color:#007af4;">FFMpeg</span></a>:</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:xx-large; font-weight:600;">License</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Most files in FFmpeg are under the GNU Lesser General Public License version 2.1 or later (LGPL v2.1+). Read the file <span style=" font-family:'Noto Mono';">COPYING.LGPLv2.1</span> for details. Some other files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to FFmpeg.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Some optional parts of FFmpeg are licensed under the GNU General Public License version 2 or later (GPL v2+). See the file <span style=" font-family:'Noto Mono';">COPYING.GPLv2</span> for details. None of these parts are used by default, you have to explicitly pass <span style=" font-family:'Noto Mono';">--enable-gpl</span> to configure to activate them. In this case, FFmpeg's license changes to GPL v2+.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Specifically, the GPL parts of FFmpeg are:</p> +<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">libpostproc</li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">optional x86 optimization in the files </li> +<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 2;"><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">libavcodec/x86/flac_dsp_gpl.asm</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">libavcodec/x86/idct_mmx.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">libavfilter/x86/vf_removegrain.asm</span></li></ul> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">the following building and testing tools </li> +<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 2;"><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">compat/solaris/make_sunver.pl</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">doc/t2h.pm</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">doc/texi2pod.pl</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">libswresample/swresample-test.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">tests/checkasm/*</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">tests/tiny_ssim.c</span></li></ul> +<li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">the following filters in libavfilter: </li></ul> +<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 2;"><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_blackframe.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_boxblur.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_colormatrix.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_cover_rect.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_cropdetect.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_delogo.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_eq.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_find_rect.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_fspp.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_geq.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_histeq.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_hqdn3d.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_interlace.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_kerndeint.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_mcdeint.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_mpdecimate.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_owdenoise.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_perspective.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_phase.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_pp.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_pp7.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_pullup.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_repeatfields.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_sab.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_smartblur.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_spp.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_stereo3d.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_super2xsai.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_tinterlace.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vf_uspp.c</span></li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">vsrc_mptestsrc.c</span></li></ul> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then the configure parameter <span style=" font-family:'Noto Mono';">--enable-version3</span> will activate this licensing option for you. Read the file <span style=" font-family:'Noto Mono';">COPYING.LGPLv3</span> or, if you have enabled GPL parts, <span style=" font-family:'Noto Mono';">COPYING.GPLv3</span> to learn the exact legal terms that apply in this case.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">There are a handful of files under other licensing terms, namely:</p> +<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The files <span style=" font-family:'Noto Mono';">libavcodec/jfdctfst.c</span>, <span style=" font-family:'Noto Mono';">libavcodec/jfdctint_template.c</span> and <span style=" font-family:'Noto Mono';">libavcodec/jrevdct.c</span> are taken from libjpeg, see the top of the files for licensing details. Specifically note that you must credit the IJG in the documentation accompanying your program if you only distribute executables. You must also indicate any changes including additions and deletions to those three files in the documentation.</li> +<li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Mono';">tests/reference.pnm</span> is under the expat license.</li></ul> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="user-content-external-libraries"></a><span style=" font-size:x-large; font-weight:600;">E</span><span style=" font-size:x-large; font-weight:600;">xternal libraries</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">FFmpeg can be combined with a number of external libraries, which sometimes affect the licensing of binaries resulting from the combination.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="user-content-compatible-libraries"></a><span style=" font-size:large; font-weight:600;">C</span><span style=" font-size:large; font-weight:600;">ompatible libraries</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The following libraries are under GPL:</p> +<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">frei0r</li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">libcdio</li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">librubberband</li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">libvidstab</li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">libx264</li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">libx265</li> +<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">libxavs</li> +<li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">libxvid</li></ul> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by passing <span style=" font-family:'Noto Mono';">--enable-gpl</span> to configure.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The OpenCORE and VisualOn libraries are under the Apache License 2.0. That license is incompatible with the LGPL v2.1 and the GPL v2, but not with version 3 of those licenses. So to combine these libraries with FFmpeg, the license version needs to be upgraded by passing <span style=" font-family:'Noto Mono';">--enable-version3</span> to configure.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="user-content-incompatible-libraries"></a><span style=" font-size:large; font-weight:600;">I</span><span style=" font-size:large; font-weight:600;">ncompatible libraries</span></p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">There are certain libraries you can combine with FFmpeg whose licenses are not compatible with the GPL and/or the LGPL. If you wish to enable these libraries, even in circumstances that their license may be incompatible, pass <span style=" font-family:'Noto Mono';">--enable-nonfree</span> to configure. But note that if you enable any of these libraries the resulting binary will be under a complex license mix that is more restrictive than the LGPL and that may result in additional obligations. It is possible that these restrictions cause the resulting binary to be unredistributable.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The Fraunhofer FDK AAC and OpenSSL libraries are under licenses which are incompatible with the GPLv2 and v3. To the best of our knowledge, they are compatible with the LGPL.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The NVENC library, while its header file is licensed under the compatible MIT license, requires a proprietary binary blob at run time, and is deemed to be incompatible with the GPL. We are not certain if it is compatible with the LGPL, but we require <span style=" font-family:'Noto Mono';">--enable-nonfree</span> even with LGPL configurations in case it is not.</p></body></html> + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + AboutBox + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AboutBox + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/icon.qrc b/icon.qrc index 2900c9f..1e85526 100644 --- a/icon.qrc +++ b/icon.qrc @@ -1,5 +1,6 @@ icons/icon.png + icons/icon.svg diff --git a/icons/icon.svg b/icons/icon.svg new file mode 100644 index 0000000..08c8ae7 --- /dev/null +++ b/icons/icon.svg @@ -0,0 +1,64 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/main.cpp b/main.cpp index ff53863..90b404f 100644 --- a/main.cpp +++ b/main.cpp @@ -2,6 +2,7 @@ #include "screenshotutil.hpp" #include #include +#include #include #include #include @@ -9,29 +10,48 @@ extern "C" { #include #include } +#include "ui_mainwindow.h" +#include #include #include bool verbose = false; +// I've experiments to run +// There is research to be done +// On the people who are +// still alive +bool stillAlive = true; + +#define LOGACT(lvl) \ + std::cout << lvl << stdMsg << "\n"; \ + if (stillAlive && MainWindow::inst() && MainWindow::inst()->valid()) { \ + MainWindow::inst()->ui->logBox->addItem(lvl + msg); \ + } + void handler(QtMsgType type, const QMessageLogContext &, const QString &msg) { std::string stdMsg = msg.toStdString(); switch (type) { case QtDebugMsg: - if (verbose) std::cout << "DEBUG: " << stdMsg << "\n"; + if (verbose) { + LOGACT("DEBUG: ") + } break; case QtInfoMsg: - std::cout << "INFO: " << stdMsg << "\n"; + LOGACT("INFO: ") + if (stillAlive) notifications::notifyNolog("KShare", msg); break; case QtWarningMsg: - std::cerr << "WARN: " << stdMsg << "\n"; + LOGACT("WARN: ") + if (stillAlive) notifications::notifyNolog("KShare Warning", msg, QSystemTrayIcon::Warning); break; case QtCriticalMsg: - std::cerr << "CRIT: " << stdMsg << "\n"; + LOGACT("CRIT: ") + if (stillAlive) notifications::notifyNolog("KShare Critical Error", msg, QSystemTrayIcon::Critical); break; case QtFatalMsg: - std::cerr << "FATAL: " << stdMsg << "\n"; - notifications::notify("KShare Fatal Error", msg, QSystemTrayIcon::Critical); + LOGACT("FATAL: ") + if (stillAlive) notifications::notifyNolog("KShare Fatal Error", msg, QSystemTrayIcon::Critical); break; } } @@ -65,6 +85,7 @@ int main(int argc, char *argv[]) { MainWindow w; Worker::init(); a.connect(&a, &QApplication::aboutToQuit, Worker::end); + a.connect(&a, &QApplication::aboutToQuit, [] { stillAlive = false; }); if (!parser.isSet(h)) w.show(); return a.exec(); } diff --git a/mainwindow.cpp b/mainwindow.cpp index 47bd51a..20af60c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,38 +1,19 @@ #include "mainwindow.hpp" +#include "aboutbox.hpp" #include "screenshotter.hpp" #include "screenshotutil.hpp" +#include "settingsdialog.hpp" #include "ui_mainwindow.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include +#include #include -#include #include #include #include MainWindow *MainWindow::instance; -void addHotkeyItem(QString text, QString name, std::function func, QString def = QString()) { - QListWidgetItem *item = new QListWidgetItem(text, MainWindow::inst()->ui->hotkeys); - item->setData(Qt::UserRole + 1, name); - MainWindow::inst()->fncs.insert(name, func); - hotkeying::load(name, func, def); -} - void MainWindow::rec() { if (controller->isRunning()) return; auto f @@ -49,10 +30,14 @@ void MainWindow::rec() { controller->start(ctx); } +void addHotkey(QString name, std::function action) { + hotkeying::load(name, action); +} + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { instance = this; ui->setupUi(this); - setWindowIcon(QIcon(":/icons/icon.png")); + setWindowIcon(QIcon(":/icons/icon.svg")); tray = new QSystemTrayIcon(windowIcon(), this); tray->setToolTip("KShare"); tray->setVisible(true); @@ -80,67 +65,28 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi connect(area, &QAction::triggered, this, [] { screenshotter::areaDelayed(); }); connect(rec, &QAction::triggered, this, &MainWindow::rec); connect(recoff, &QAction::triggered, [this] { controller->end(); }); + connect(ui->settings, &QPushButton::clicked, this, &MainWindow::on_actionSettings_triggered); + tray->setContextMenu(menu); - ui->uploaderList->setSelectionBehavior(QAbstractItemView::SelectRows); - ui->uploaderList->setSelectionMode(QAbstractItemView::SingleSelection); - - // Add items to uploader selection - for (Uploader *u : UploaderSingleton::inst().uploaderList()) newUploader(u); - connect(&UploaderSingleton::inst(), &UploaderSingleton::newUploader, this, &MainWindow::newUploader); - - // Set filename scheme - if ((settings::settings().contains("fileFormat"))) - setScheme(settings::settings().value("fileFormat").toString()); - else - setScheme("Screenshot %(yyyy-MM-dd HH:mm:ss)date"); + addHotkey("fullscreen", [] { screenshotter::fullscreen(); }); + addHotkey("area", [] { screenshotter::area(); }); + addHotkey("picker", [] { ColorPickerScene::showPicker(); }); + addHotkey("recordingstop", [&] { controller->end(); }); + addHotkey("recordingstart", [&] { this->rec(); }); auto errors = UploaderSingleton::inst().errors(); - if (errors.length() == 1) - statusBar()->showMessage(errors.at(0).what()); - else - statusBar()->showMessage(QString("Errors visible in console (if present). Count: " + QString::number(errors.size()))); - - // Set delay - if ((settings::settings().contains("delay"))) - ui->delay->setValue(settings::settings().value("delay").toDouble()); - else - ui->delay->setValue(0.25); - - ui->hotkeys->setSelectionMode(QListWidget::SingleSelection); - - addHotkeyItem("Fullscreen image", "fullscreen", [] { screenshotter::fullscreen(); }); - addHotkeyItem("Area image", "area", [] { screenshotter::area(); }); - addHotkeyItem("Color picker", "picker", [] { ColorPickerScene::showPicker(); }); - addHotkeyItem("Stop Recording", "recordingstop", [&] { controller->end(); }); - addHotkeyItem("Start Recording", "recordingstart", [&] { this->rec(); }); - - ui->quickMode->setChecked(settings::settings().value("quickMode", false).toBool()); - ui->hideToTray->setChecked(settings::settings().value("hideOnClose", true).toBool()); - ui->captureCursor->setChecked(settings::settings().value("captureCursor", true).toBool()); - - for (int i = 0; i < (int)formats::Recording::None; i++) { - ui->formatBox->addItem(formats::recordingFormatName(static_cast(i))); - } - - for (int i = 0; i < (int)formats::Normal::None; i++) { - ui->imageFormatBox->addItem(formats::normalFormatName(static_cast(i))); - } - - ui->formatBox->addItem("None"); - ui->formatBox->setCurrentIndex(settings::settings().value("recording/format", (int)formats::Recording::None).toInt()); + for (auto err : errors) ui->logBox->addItem(QString("ERROR: ") + err.what()); + setWindowTitle("KShare v" + QApplication::applicationVersion()); + val = true; } MainWindow::~MainWindow() { delete ui; } -void MainWindow::setScheme(QString scheme) { - ui->nameScheme->setText(scheme); -} - -QDoubleSpinBox *MainWindow::delay() { - return ui->delay; +bool MainWindow::valid() { + return val; } MainWindow *MainWindow::inst() { @@ -150,7 +96,7 @@ MainWindow *MainWindow::inst() { void MainWindow::closeEvent(QCloseEvent *event) { if (settings::settings().value("hideOnClose", true).toBool()) { event->ignore(); - QTimer::singleShot(0, this, &MainWindow::hide); + hide(); } else QApplication::exit(0); } @@ -168,13 +114,6 @@ void MainWindow::toggleVisible() { } } -void MainWindow::newUploader(Uploader *u) { - QListWidgetItem *item = new QListWidgetItem(u->name()); - item->setToolTip(u->description()); - ui->uploaderList->addItem(item); - if (u->name() == UploaderSingleton::inst().selectedUploader()) item->setSelected(true); -} - void MainWindow::on_actionQuit_triggered() { quit(); } @@ -187,66 +126,6 @@ void MainWindow::on_actionArea_triggered() { screenshotter::areaDelayed(); } -void MainWindow::on_uploaderList_clicked(const QModelIndex &) { - QList index = ui->uploaderList->selectedItems(); - if (index.size() == 1) { - UploaderSingleton::inst().set(index.at(0)->text()); - } -} - -void MainWindow::on_nameScheme_textEdited(const QString &arg1) { - settings::settings().setValue("fileFormat", arg1); -} - -void MainWindow::on_delay_valueChanged(double arg1) { - settings::settings().setValue("delay", arg1); -} - -void MainWindow::on_hotkeys_doubleClicked(const QModelIndex &) { - if (ui->hotkeys->selectedItems().length() == 1) { - QListWidgetItem *i = ui->hotkeys->selectedItems().at(0); - QString str = i->data(Qt::UserRole + 1).toString(); - bool ok; - QString seq = QInputDialog::getText(ui->centralWidget, "Hotkey Input", "Insert hotkey:", QLineEdit::Normal, - hotkeying::sequence(str), &ok); - if (ok && hotkeying::valid(seq)) hotkeying::hotkey(str, QKeySequence(seq), fncs.value(str)); - } -} - -void MainWindow::on_settingsButton_clicked() { - QDesktopServices::openUrl(QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/KShare")); -} - -void MainWindow::on_quickMode_clicked(bool checked) { - settings::settings().setValue("quickMode", checked); -} - -void MainWindow::on_hideToTray_clicked(bool checked) { - settings::settings().setValue("hideOnClose", checked); -} - -void MainWindow::on_actionColor_Picker_triggered() { - ColorPickerScene::showPicker(); -} - -void MainWindow::on_captureCursor_clicked(bool checked) { - settings::settings().setValue("captureCursor", checked); -} - -void MainWindow::on_formatBox_currentIndexChanged(int index) { - if (isVisible()) settings::settings().setValue("recording/format", index); -} - -void MainWindow::on_imageFormatBox_currentIndexChanged(int index) { - if (isVisible()) settings::settings().setValue("imageformat", index); -} - -void MainWindow::on_pushButton_clicked() { - auto a = new EncoderSettingsDialog(); - a->setAttribute(Qt::WA_DeleteOnClose); - a->show(); -} - void MainWindow::on_actionStart_triggered() { rec(); } @@ -254,3 +133,15 @@ void MainWindow::on_actionStart_triggered() { void MainWindow::on_actionStop_triggered() { controller->end(); } + +void MainWindow::on_actionSettings_triggered() { + SettingsDialog *dialog = new SettingsDialog(this); + dialog->setAttribute(Qt::WA_DeleteOnClose); + dialog->show(); +} + +void MainWindow::on_actionAbout_triggered() { + AboutBox *box = new AboutBox(this); + box->setAttribute(Qt::WA_DeleteOnClose); + box->show(); +} diff --git a/mainwindow.hpp b/mainwindow.hpp index 636c7cf..90c091d 100644 --- a/mainwindow.hpp +++ b/mainwindow.hpp @@ -19,44 +19,32 @@ class MainWindow : public QMainWindow { private slots: void quit(); void toggleVisible(); - void newUploader(Uploader *u); void on_actionQuit_triggered(); void on_actionFullscreen_triggered(); void on_actionArea_triggered(); - void on_uploaderList_clicked(const QModelIndex &); - void on_nameScheme_textEdited(const QString &arg1); - void on_delay_valueChanged(double arg1); - void on_hotkeys_doubleClicked(const QModelIndex &index); - void on_settingsButton_clicked(); - void on_quickMode_clicked(bool checked); - void on_hideToTray_clicked(bool checked); - void on_actionColor_Picker_triggered(); - void on_captureCursor_clicked(bool checked); - void on_formatBox_currentIndexChanged(int index); - void on_imageFormatBox_currentIndexChanged(int index); void on_actionStart_triggered(); void on_actionStop_triggered(); - void on_pushButton_clicked(); + void on_actionSettings_triggered(); + + void on_actionAbout_triggered(); public: + static MainWindow *inst(); explicit MainWindow(QWidget *parent = 0); ~MainWindow(); + bool valid(); Ui::MainWindow *ui; + RecordingController *controller = new RecordingController; QSystemTrayIcon *tray; - void setScheme(QString scheme); - QDoubleSpinBox *delay(); - - static MainWindow *inst(); - QMap> fncs; +public slots: + void rec(); private: + bool val = false; static MainWindow *instance; - RecordingController *controller = new RecordingController; -private slots: - void rec(); protected: void closeEvent(QCloseEvent *event); diff --git a/mainwindow.ui b/mainwindow.ui index 9d46bfe..18d3526 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 483 - 512 + 352 + 220 @@ -25,129 +25,23 @@ - - - - http://doc.qt.io/qt-5/qdatetime.html#toString - + + - Screenshot %(yyyy-MM-dd HH:mm:ss)date - - - - - - - Quick mode (mouse release screenshots) + Settings - - - Uploader selection: - - - - - - - Open settings directory - - - - - - - Delay before taking a screenshot - - - - - - - <a href="https://github.com/ArsenArsen/KShare">Source code available free for everyone. Forever.</a> - - - - - - - - - In seconds - - - A delay before taking a screenshot, in seconds - - - s - - - - - - - Hotkeys - - - - - - - - - - - - - File name scheme: - - - - - - - Recording format - - - - - - - Still image format - - - - - - - Pressing <X> hides to tray - - - - - - - Capture cursor - - - - - - - - - - -1 - - - - - - - Encoder settings + + + Log + + + + + @@ -157,7 +51,7 @@ 0 0 - 483 + 352 25 @@ -165,6 +59,9 @@ Fi&le + + + @@ -223,6 +120,16 @@ Stop + + + Settings + + + + + About + + diff --git a/notifications.cpp b/notifications.cpp index 1fedd55..ce8aa0a 100644 --- a/notifications.cpp +++ b/notifications.cpp @@ -1,9 +1,16 @@ #include "notifications.hpp" #include "mainwindow.hpp" +#include "ui_mainwindow.h" #include void notifications::notify(QString title, QString body, QSystemTrayIcon::MessageIcon icon) { + if (!MainWindow::inst() || !MainWindow::inst()->valid()) return; + notifyNolog(title, body, icon); + MainWindow::inst()->ui->logBox->addItem(title + ": " + body); +} + +void notifications::notifyNolog(QString title, QString body, QSystemTrayIcon::MessageIcon icon) { if (!MainWindow::inst()) return; MainWindow::inst()->tray->showMessage(title, body, icon, 5000); MainWindow::inst()->statusBar()->showMessage(title + ": " + body); diff --git a/notifications.hpp b/notifications.hpp index e060483..137d31a 100644 --- a/notifications.hpp +++ b/notifications.hpp @@ -6,6 +6,7 @@ namespace notifications { void notify(QString title, QString body, QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information); +void notifyNolog(QString title, QString body, QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information); } #endif // NOTIFICATIONS_HPP diff --git a/recording/recordingformats.cpp b/recording/recordingformats.cpp index 6cd5397..115dcf1 100644 --- a/recording/recordingformats.cpp +++ b/recording/recordingformats.cpp @@ -37,6 +37,7 @@ RecordingFormats::RecordingFormats(formats::Recording f) { } QFile res(path); if (!res.open(QFile::ReadOnly)) { + qCritical().noquote() << "Could not open resulting file: " << res.errorString(); return QByteArray(); } QByteArray data = res.readAll(); @@ -53,7 +54,8 @@ RecordingFormats::RecordingFormats(formats::Recording f) { return false; } } catch (std::runtime_error e) { - notifications::notify("KShare Video Encoder Error", e.what(), QSystemTrayIcon::Critical); + // notifications::notify("KShare Video Encoder Error", e.what(), + // QSystemTrayIcon::Critical); qCritical() << "Encoder error: " << e.what(); interrupt = true; delete enc; @@ -66,7 +68,8 @@ RecordingFormats::RecordingFormats(formats::Recording f) { if (!interrupt) try { enc->addFrame(img); } catch (std::runtime_error e) { - notifications::notify("KShare Video Encoder Error", e.what(), QSystemTrayIcon::Critical); + // notifications::notify("KShare Video Encoder Error", e.what(), + // QSystemTrayIcon::Critical); qCritical() << "Encoder error: " << e.what(); interrupt = true; } diff --git a/screenshotter.cpp b/screenshotter.cpp index 322ba31..4f2101d 100644 --- a/screenshotter.cpp +++ b/screenshotter.cpp @@ -20,9 +20,9 @@ void screenshotter::fullscreen() { } void screenshotter::areaDelayed() { - QTimer::singleShot(MainWindow::inst()->delay()->value() * 1000, &screenshotter::area); + QTimer::singleShot(settings::settings().value("delay", 0.5).toFloat() * 1000, &screenshotter::area); } void screenshotter::fullscreenDelayed() { - QTimer::singleShot(MainWindow::inst()->delay()->value() * 1000, &screenshotter::fullscreen); + QTimer::singleShot(settings::settings().value("delay", 0.5).toFloat() * 1000, &screenshotter::fullscreen); } diff --git a/settingsdialog.cpp b/settingsdialog.cpp new file mode 100644 index 0000000..5ee5af1 --- /dev/null +++ b/settingsdialog.cpp @@ -0,0 +1,145 @@ +#include "settingsdialog.hpp" +#include "mainwindow.hpp" +#include "ui_settingsdialog.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QMap> fncs; + +void addHotkeyItem(QListWidget *hotkeys, QString text, QString name, std::function func, QString def = QString()) { + QListWidgetItem *item = new QListWidgetItem(text, hotkeys); + item->setData(Qt::UserRole + 1, name); + hotkeys->addItem(item); + fncs.insert(name, func); + hotkeying::load(name, func, def); +} + +SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SettingsDialog) { + ui->setupUi(this); + + ui->uploaderList->setSelectionBehavior(QAbstractItemView::SelectRows); + ui->uploaderList->setSelectionMode(QAbstractItemView::SingleSelection); + + // Add items to uploader selection + for (Uploader *u : UploaderSingleton::inst().uploaderList()) newUploader(u); + + // Set filename scheme + if ((settings::settings().contains("fileFormat"))) + setScheme(settings::settings().value("fileFormat").toString()); + else + setScheme("Screenshot %(yyyy-MM-dd HH:mm:ss)date"); + + // Set delay + if ((settings::settings().contains("delay"))) + ui->delay->setValue(settings::settings().value("delay").toDouble()); + else + ui->delay->setValue(0.25); + + ui->hotkeys->setSelectionMode(QListWidget::SingleSelection); + + addHotkeyItem(ui->hotkeys, "Fullscreen image", "fullscreen", [] { screenshotter::fullscreen(); }); + addHotkeyItem(ui->hotkeys, "Area image", "area", [] { screenshotter::area(); }); + addHotkeyItem(ui->hotkeys, "Color picker", "picker", [] { ColorPickerScene::showPicker(); }); + addHotkeyItem(ui->hotkeys, "Stop Recording", "recordingstop", [&] { MainWindow::inst()->controller->end(); }); + addHotkeyItem(ui->hotkeys, "Start Recording", "recordingstart", [&] { MainWindow::inst()->rec(); }); + + ui->quickMode->setChecked(settings::settings().value("quickMode", false).toBool()); + ui->hideToTray->setChecked(settings::settings().value("hideOnClose", true).toBool()); + ui->captureCursor->setChecked(settings::settings().value("captureCursor", true).toBool()); + for (int i = 0; i < (int)formats::Recording::None; i++) { + ui->formatBox->addItem(formats::recordingFormatName(static_cast(i))); + } + + for (int i = 0; i < (int)formats::Normal::None; i++) { + ui->imageFormatBox->addItem(formats::normalFormatName(static_cast(i))); + } + + ui->formatBox->addItem("None"); + ui->formatBox->setCurrentIndex(settings::settings().value("recording/format", (int)formats::Recording::None).toInt()); + setWindowTitle("Settings"); +} + +void SettingsDialog::setScheme(QString scheme) { + ui->nameScheme->setText(scheme); +} + +SettingsDialog::~SettingsDialog() { + delete ui; +} + +void SettingsDialog::newUploader(Uploader *u) { + QListWidgetItem *uploader = new QListWidgetItem(u->name(), ui->uploaderList); + uploader->setToolTip(u->description()); + ui->uploaderList->addItem(uploader); +} + +void SettingsDialog::on_uploaderList_clicked(const QModelIndex &) { + QList index = ui->uploaderList->selectedItems(); + if (index.size() == 1) { + UploaderSingleton::inst().set(index.at(0)->text()); + } +} + +void SettingsDialog::on_nameScheme_textEdited(const QString &arg1) { + settings::settings().setValue("fileFormat", arg1); +} + +void SettingsDialog::on_delay_valueChanged(double arg1) { + settings::settings().setValue("delay", arg1); +} + +void SettingsDialog::on_hotkeys_doubleClicked(const QModelIndex &) { + if (ui->hotkeys->selectedItems().length() == 1) { + QListWidgetItem *i = ui->hotkeys->selectedItems().at(0); + QString str = i->data(Qt::UserRole + 1).toString(); + bool ok; + QString seq = QInputDialog::getText(MainWindow::inst(), "Hotkey Input", "Insert hotkey:", QLineEdit::Normal, + hotkeying::sequence(str), &ok); + if (ok && hotkeying::valid(seq)) hotkeying::hotkey(str, QKeySequence(seq), fncs.value(str)); + } +} + +void SettingsDialog::on_settingsButton_clicked() { + QDesktopServices::openUrl(QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/KShare")); +} + +void SettingsDialog::on_quickMode_clicked(bool checked) { + settings::settings().setValue("quickMode", checked); +} + +void SettingsDialog::on_hideToTray_clicked(bool checked) { + settings::settings().setValue("hideOnClose", checked); +} + +void SettingsDialog::on_actionColor_Picker_triggered() { + ColorPickerScene::showPicker(); +} + +void SettingsDialog::on_captureCursor_clicked(bool checked) { + settings::settings().setValue("captureCursor", checked); +} + +void SettingsDialog::on_formatBox_currentIndexChanged(int index) { + if (isVisible()) settings::settings().setValue("recording/format", index); +} + +void SettingsDialog::on_imageFormatBox_currentIndexChanged(int index) { + if (isVisible()) settings::settings().setValue("imageformat", index); +} + +void SettingsDialog::on_pushButton_clicked() { + auto a = new EncoderSettingsDialog(); + a->setAttribute(Qt::WA_DeleteOnClose); + a->show(); +} diff --git a/settingsdialog.hpp b/settingsdialog.hpp new file mode 100644 index 0000000..ad0a0fc --- /dev/null +++ b/settingsdialog.hpp @@ -0,0 +1,38 @@ +#ifndef SETTINGSDIALOG_HPP +#define SETTINGSDIALOG_HPP + +#include + +#include + +namespace Ui { +class SettingsDialog; +} + +class SettingsDialog : public QDialog { + Q_OBJECT + +public: + explicit SettingsDialog(QWidget *parent = 0); + ~SettingsDialog(); + void setScheme(QString scheme); + void newUploader(Uploader *u); + + void on_uploaderList_clicked(const QModelIndex &); + void on_nameScheme_textEdited(const QString &arg1); + void on_delay_valueChanged(double arg1); + void on_hotkeys_doubleClicked(const QModelIndex &index); + void on_settingsButton_clicked(); + void on_quickMode_clicked(bool checked); + void on_hideToTray_clicked(bool checked); + void on_actionColor_Picker_triggered(); + void on_captureCursor_clicked(bool checked); + void on_formatBox_currentIndexChanged(int index); + void on_imageFormatBox_currentIndexChanged(int index); + void on_pushButton_clicked(); + +private: + Ui::SettingsDialog *ui; +}; + +#endif // SETTINGSDIALOG_HPP diff --git a/settingsdialog.ui b/settingsdialog.ui new file mode 100644 index 0000000..96ab539 --- /dev/null +++ b/settingsdialog.ui @@ -0,0 +1,180 @@ + + + SettingsDialog + + + + 0 + 0 + 483 + 470 + + + + Dialog + + + + + + + + + Quick mode (mouse release screenshots) + + + + + + + Delay before taking a screenshot + + + + + + + In seconds + + + A delay before taking a screenshot, in seconds + + + s + + + + + + + + + + Hotkeys + + + + + + + Encoder settings + + + + + + + Still image format + + + + + + + + + + Recording format + + + + + + + Capture cursor + + + + + + + http://doc.qt.io/qt-5/qdatetime.html#toString + + + Screenshot %(yyyy-MM-dd HH:mm:ss)date + + + + + + + File name scheme: + + + + + + + Pressing <X> hides to tray + + + + + + + -1 + + + + + + + Open settings directory + + + + + + + Uploader selection: + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + SettingsDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + SettingsDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +