From d17110d1b811c7c9c7aeb1565de90421a677e6f8 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Mon, 1 Jul 2013 17:42:14 +0200 Subject: [PATCH] Added BSD license text for QtSingleApplication. --- CMakeLists.txt | 1 + resources/text/COPYING_BSD | 30 +++++++++++ src/gui/dynamicshortcutswidget.cpp | 4 +- src/gui/formabout.cpp | 14 ++++- src/gui/formabout.ui | 86 ++++++++++++++++++++++++++---- src/gui/shortcutcatcher.cpp | 12 ++--- src/gui/shortcutcatcher.h | 11 ++-- 7 files changed, 133 insertions(+), 25 deletions(-) create mode 100644 resources/text/COPYING_BSD diff --git a/CMakeLists.txt b/CMakeLists.txt index e2daa9454..9d43db312 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,6 +236,7 @@ set(APP_MISC resources/text/CHANGELOG resources/text/COPYING_GNU_GPL resources/text/COPYING_GNU_GPL_HTML + resources/text/COPYING_BSD ) # Wrap files, create moc files. diff --git a/resources/text/COPYING_BSD b/resources/text/COPYING_BSD new file mode 100644 index 000000000..076139365 --- /dev/null +++ b/resources/text/COPYING_BSD @@ -0,0 +1,30 @@ +Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +Contact: http://www.qt-project.org/legal +QtSingleApplication is part of the Qt Solutions component. + +You may use this file under the terms of the BSD license as follows: + +"Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names + of its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." \ No newline at end of file diff --git a/src/gui/dynamicshortcutswidget.cpp b/src/gui/dynamicshortcutswidget.cpp index b98efc787..764d6a525 100644 --- a/src/gui/dynamicshortcutswidget.cpp +++ b/src/gui/dynamicshortcutswidget.cpp @@ -19,7 +19,7 @@ DynamicShortcutsWidget::~DynamicShortcutsWidget() { void DynamicShortcutsWidget::updateShortcuts() { foreach (ActionBinding binding, m_actionBindings) { - binding.first->setShortcut(binding.second->keySequence()); + binding.first->setShortcut(binding.second->shortcut()); } } @@ -29,7 +29,7 @@ void DynamicShortcutsWidget::populate(const QList actions) { foreach (QAction *action, actions) { // Create shortcut catcher for this action and set default shortcut. ShortcutCatcher *catcher = new ShortcutCatcher(this); - catcher->setKeySequence(action->shortcut()); + catcher->setShortcut(action->shortcut()); // Store information for re-initialization of shortcuts // of actions when widget gets "confirmed". diff --git a/src/gui/formabout.cpp b/src/gui/formabout.cpp index 4818b9532..9b9f2d985 100644 --- a/src/gui/formabout.cpp +++ b/src/gui/formabout.cpp @@ -26,6 +26,15 @@ FormAbout::FormAbout(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormAbout) } file.close(); + file.setFileName(APP_INFO_PATH + "/COPYING_BSD"); + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { + m_ui->m_txtLicenseBsd->setText(str.readAll()); + } + else { + m_ui->m_txtLicenseBsd->setText(tr("License not found.")); + } + file.close(); + file.setFileName(APP_INFO_PATH + "/CHANGELOG"); if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { m_ui->m_txtChangelog->setText(str.readAll()); @@ -53,8 +62,9 @@ FormAbout::FormAbout(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormAbout) m_ui->m_txtThanks->setText(tr("" "Authors and contributors:" "" "")); diff --git a/src/gui/formabout.ui b/src/gui/formabout.ui index 25d605d89..d12e6e87b 100644 --- a/src/gui/formabout.ui +++ b/src/gui/formabout.ui @@ -135,8 +135,8 @@ <!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:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html> +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> false @@ -169,8 +169,8 @@ p, li { white-space: pre-wrap; } 0 0 - 685 - 230 + 687 + 180 @@ -227,8 +227,8 @@ p, li { white-space: pre-wrap; } <!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:'DejaVu Sans Mono'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html> +</style></head><body style=" font-family:'DejaVu Sans Mono'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"><br /></p></body></html> Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse @@ -237,6 +237,72 @@ p, li { white-space: pre-wrap; } + + + BSD License (applies to QtSingleApplication component) + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + DejaVu Sans Mono + + + + + + + QFrame::NoFrame + + + Qt::ScrollBarAlwaysOff + + + QTextEdit::AutoNone + + + false + + + QTextEdit::WidgetWidth + + + true + + + <!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:'DejaVu Sans Mono'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"><br /></p></body></html> + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + + Licenses page is available only in English language. + @@ -258,8 +324,8 @@ p, li { white-space: pre-wrap; } <!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:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;"><br /></span></p></body></html> +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> 30 @@ -291,8 +357,8 @@ p, li { white-space: pre-wrap; } <!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:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html> +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> false diff --git a/src/gui/shortcutcatcher.cpp b/src/gui/shortcutcatcher.cpp index 3dac75fda..5cddbbb13 100644 --- a/src/gui/shortcutcatcher.cpp +++ b/src/gui/shortcutcatcher.cpp @@ -55,7 +55,7 @@ ShortcutCatcher::ShortcutCatcher(QWidget *parent) m_layout->addWidget(m_clearButton); // Establish needed connections. - connect(m_clearButton, &QToolButton::clicked, this, &ShortcutCatcher::clearKeySequence); + connect(m_clearButton, &QToolButton::clicked, this, &ShortcutCatcher::clearShortcut); connect(m_sequenceButton, &ShortcutButton::clicked, this, &ShortcutCatcher::startRecording); // Prepare initial state of the control. @@ -86,7 +86,7 @@ void ShortcutCatcher::doneRecording() { updateDisplayShortcut(); - emit keySequenceChanged(m_currentSequence); + emit shortcutChanged(m_currentSequence); } void ShortcutCatcher::controlModifierlessTimout() { @@ -123,15 +123,15 @@ void ShortcutCatcher::updateDisplayShortcut() m_sequenceButton->setText(str); } -QKeySequence ShortcutCatcher::keySequence() const { +QKeySequence ShortcutCatcher::shortcut() const { return m_currentSequence; } -void ShortcutCatcher::setKeySequence(const QKeySequence &key) { +void ShortcutCatcher::setShortcut(const QKeySequence &key) { m_currentSequence = m_defaultSequence = key; doneRecording(); } -void ShortcutCatcher::clearKeySequence() { - setKeySequence(m_defaultSequence); +void ShortcutCatcher::clearShortcut() { + setShortcut(m_defaultSequence); } diff --git a/src/gui/shortcutcatcher.h b/src/gui/shortcutcatcher.h index ca37bb5d3..8c9fbaca4 100644 --- a/src/gui/shortcutcatcher.h +++ b/src/gui/shortcutcatcher.h @@ -38,9 +38,9 @@ class QToolButton; class ShortcutButton; class ShortcutCatcher : public QWidget { + Q_OBJECT friend class ShortcutButton; - Q_OBJECT public: explicit ShortcutCatcher(QWidget *parent = 0); virtual ~ShortcutCatcher(); @@ -48,17 +48,18 @@ class ShortcutCatcher : public QWidget { void controlModifierlessTimout(); void updateDisplayShortcut(); + QKeySequence shortcut() const; + void setShortcut(const QKeySequence& key); + protected slots: void startRecording(); void doneRecording(); public slots: - QKeySequence keySequence() const; - void setKeySequence(const QKeySequence& key); - void clearKeySequence(); + void clearShortcut(); signals: - void keySequenceChanged(QKeySequence seguence); + void shortcutChanged(QKeySequence seguence); private: QToolButton *m_clearButton;