diff --git a/aboutdialog.cpp b/aboutdialog.cpp index e1fb6e784a67221b6248da93659010f168c64440..125628a28a2ad53daf479492f74e2cf7892b46a5 100644 --- a/aboutdialog.cpp +++ b/aboutdialog.cpp @@ -1,6 +1,7 @@ /*************************************************************************** - * Copyright (C) 2015-2017 by Savoir-faire Linux * + * Copyright (C) 2015-2019 by Savoir-faire Linux * * Author: Edric Ladent Milaret * + * Author: Andreas Traczyk * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -23,17 +24,39 @@ #include "version.h" AboutDialog::AboutDialog(QWidget *parent) : - QDialog(parent), + PopupWidget( + parent, + RingTheme::lightGrey_, + PopupDialog::SpikeLabelAlignment::None), ui(new Ui::AboutDialog) { ui->setupUi(this); - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); this->setFixedSize(this->width(),this->height()); - ui->creditsWidget->hide(); - ui->gitVersionLabel->setText(QString("%1: %2").arg(isBeta ? tr("beta version") : tr("version"), QString(VERSION_STRING))); + ui->gitVersionLabel->setText(QString("%1: %2") + .arg(isBeta ? tr("(BETA) version") : tr("version"), QString(VERSION_STRING))); - ui->creditsBrowser->setHtml("" + ui->logTextEdit->insertHtml(Utils::getChangeLog()); + +} + +AboutDialog::~AboutDialog() +{ + delete ui; +} + +void +AboutDialog::on_changelogButton_clicked() +{ + ui->logTextEdit->clear(); + ui->logTextEdit->insertHtml(Utils::getChangeLog()); +} + +void +AboutDialog::on_creditsButton_clicked() +{ + ui->logTextEdit->clear(); + ui->logTextEdit->insertHtml("" "" @@ -85,22 +108,3 @@ AboutDialog::AboutDialog(QWidget *parent) : + tr("Based on the SFLPhone project") + "

" "


"); } - -AboutDialog::~AboutDialog() -{ - delete ui; -} - -void -AboutDialog::on_aboutButton_clicked() -{ - ui->aboutWidget->setVisible(true); - ui->creditsWidget->setVisible(false); -} - -void -AboutDialog::on_creditsButton_clicked() -{ - ui->creditsWidget->setVisible(true); - ui->aboutWidget->setVisible(false); -} diff --git a/aboutdialog.h b/aboutdialog.h index cc29613e081ad1fa7c74cb3576b9b073eb621163..5eabdff9d865f250cf31589578c6ef6405b2a746 100644 --- a/aboutdialog.h +++ b/aboutdialog.h @@ -1,6 +1,7 @@ /*************************************************************************** - * Copyright (C) 2015-2017 by Savoir-faire Linux * + * Copyright (C) 2015-2019 by Savoir-faire Linux * * Author: Edric Ladent Milaret * + * Author: Andreas Traczyk * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -18,13 +19,13 @@ #pragma once -#include +#include "widgethelpers.h" namespace Ui { class AboutDialog; } -class AboutDialog : public QDialog +class AboutDialog : public PopupWidget { Q_OBJECT @@ -32,12 +33,10 @@ public: explicit AboutDialog(QWidget *parent = 0); ~AboutDialog(); -//UI SLOTS private slots: - void on_aboutButton_clicked(); + void on_changelogButton_clicked(); void on_creditsButton_clicked(); private: Ui::AboutDialog *ui; }; - diff --git a/aboutdialog.ui b/aboutdialog.ui index 2f9f194572701c7796077029cfb435527577c0ca..bd423f2ace9e636103bcdaad35a725843df204a4 100644 --- a/aboutdialog.ui +++ b/aboutdialog.ui @@ -1,13 +1,13 @@ AboutDialog - + 0 0 - 674 - 616 + 595 + 684 @@ -434,100 +434,10 @@ About - + 0 - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 98 - 30 - - - - About - - - About - - - false - - - false - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - 98 - 30 - - - - Credits - - - Credits - - - false - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - @@ -547,23 +457,37 @@ - + + 7 + + 0 0 + + 0 + 0 - + + + + 8 + + version : + + Qt::AlignCenter + 5 @@ -571,6 +495,11 @@ + + + 8 + + Live Free or Die @@ -584,6 +513,11 @@ + + + 8 + + Qt::LeftToRight @@ -629,19 +563,6 @@ Jami is a secured and distributed communication software. - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -684,38 +605,287 @@ Jami is a secured and distributed communication software. - - - - - - - - 0 - - - 0 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 98 + 30 + + + + + 9 + + + + About + + + Changlog + + + false + + + false + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 98 + 30 + + + + + 9 + + + + Credits + + + Credits + + + false + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 0 + + + + + 400 + 0 + + + + + 16777215 + 200 + + + + 1 + + + Qt::ScrollBarAlwaysOff + + + true + + + + + 0 + 0 + 571 + 202 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 400 + 200 + + + + + 16777215 + 16777215 + + + + QFrame::StyledPanel + + + Qt::ScrollBarAsNeeded + + + 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:'Cantarell'; font-size:11pt; 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> - +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:6.6pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html> + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + - aboutButton + changelogButton creditsButton - creditsBrowser diff --git a/callwidget.cpp b/callwidget.cpp index ebf43de773493397e523cd87cd4429a89b538e1f..069d673973ebb7064d6ac0a19b9a642bbd3ee241 100644 --- a/callwidget.cpp +++ b/callwidget.cpp @@ -39,6 +39,7 @@ #include "pixbufmanipulator.h" #include "ringthemeutils.h" #include "settingskey.h" +#include "aboutdialog.h" #include "globalinstances.h" @@ -219,6 +220,12 @@ CallWidget::CallWidget(QWidget* parent) : connect(LRCInstance::renderer(), &RenderManager::videoDeviceListChanged, this, &CallWidget::slotVideoDeviceListChanged); + connect(ui->changelogButton, &QAbstractButton::clicked, + [this] { + AboutDialog aboutDialog(this); + aboutDialog.getContainer()->exec(); + }); + // set first view to welcome view ui->stackedWidget->setCurrentWidget(ui->welcomePage); ui->btnConversations->setChecked(true); diff --git a/callwidget.ui b/callwidget.ui index 3f83ff0215e6a3addddc1d963802dc220653be47..0a06809d51f86a26dabf0d8c04b65e5b601c8bbb 100644 --- a/callwidget.ui +++ b/callwidget.ui @@ -501,7 +501,7 @@ - 1 + 0 @@ -960,6 +960,80 @@ Copy and share it with your friends! + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 5 + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 100 + 30 + + + + + 100 + 30 + + + + About + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/changelog.md @@ -0,0 +1 @@ + diff --git a/copy-runtime-files.ps1 b/copy-runtime-files.ps1 index 1bd84f0dc328667b112c448a960d60fb07b8d63a..d9717594e86c0efa18187d2d7c335299084601bd 100644 --- a/copy-runtime-files.ps1 +++ b/copy-runtime-files.ps1 @@ -92,4 +92,9 @@ Get-ChildItem -Path $clientTSPath -Include *.qm -Recurse | ForEach-Object { Copy-Item -Path $_.FullName -Destination $CopyDir -Force –Recurse } -write-host "copy completed" -NoNewline -ForegroundColor Green +write-host "copy completed" -ForegroundColor Green + +write-host "Generate change log html" -ForegroundColor Green +$command = 'pandoc -f markdown -t html5 -o changelog.html changelog.md' +iex "& $command" +write-host "Conversion completed" -NoNewline -ForegroundColor Green \ No newline at end of file diff --git a/jami-qt.pro b/jami-qt.pro index 88c168cb9d6f159751e17a719527c8e79d9c8418..9c49047153a3e07e83ad7f58fcb1b605eb5214c8 100644 --- a/jami-qt.pro +++ b/jami-qt.pro @@ -1,6 +1,6 @@ TEMPLATE = app TARGET = jami-qt - + CONFIG += c++17 QT += widgets xml multimedia multimediawidgets network webenginewidgets svg @@ -184,4 +184,4 @@ FORMS += ./aboutdialog.ui \ ./popupdialog.ui \ ./recordoverlay.ui \ ./recordwidget.ui -RESOURCES += ressources.qrc \ No newline at end of file +RESOURCES += ressources.qrc diff --git a/main.cpp b/main.cpp index ae52e181e99b7bdcbb648d8e0964b939cc761c28..3ab61abde6048b8e6a0d2ad4f1c587b4f7cd968c 100644 --- a/main.cpp +++ b/main.cpp @@ -27,6 +27,7 @@ #include "runguard.h" #include "utils.h" #include "splashscreen.h" +#include "aboutdialog.h" #include #include @@ -283,6 +284,12 @@ main(int argc, char* argv[]) MainWindow::instance().hide(); } + QSettings settings("jami.net", "Jami"); + if (!settings.contains(SettingsKey::changeLogShownOnce)) { + std::unique_ptr aboutDialog = std::make_unique(&MainWindow::instance()); + aboutDialog->getContainer()->exec(); + } + QObject::connect(&a, &QApplication::aboutToQuit, [&guard] { exitApp(guard); }); auto ret = a.exec(); @@ -292,4 +299,4 @@ main(int argc, char* argv[]) #endif return ret; -} \ No newline at end of file +} diff --git a/mainwindow.cpp b/mainwindow.cpp index bc72b3cc581ae3d9787d24b0e1c2eadb27b3c0a7..3101eae3466d04d1263396c7f3207c4c2fc4a508 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -21,12 +21,19 @@ #include "mainwindow.h" #include "ui_mainwindow.h" +#include "aboutdialog.h" +#include "callwidget.h" +#include "settingskey.h" +#include "utils.h" +#include "version.h" + #include #include #include #include #include #include +#include #ifdef Q_OS_WIN #include @@ -34,12 +41,6 @@ #include #endif -#include "aboutdialog.h" -#include "callwidget.h" -#include "settingskey.h" -#include "utils.h" -#include "version.h" - MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) , ui(new Ui::MainWindow) @@ -217,8 +218,8 @@ bool MainWindow::nativeEvent(const QByteArray& eventType, void* message, long* r if ((msg->wParam & 0xfff0) == IDM_ABOUTBOX) { *result = 0; - AboutDialog aboutDialog; - aboutDialog.exec(); + AboutDialog aboutDialog(this); + aboutDialog.getContainer()->exec(); return true; } diff --git a/popupdialog.cpp b/popupdialog.cpp index ed38dd642676dac01d76cfd840c684541ac5c6eb..4b8436eacfaa49b5304524f07a16bbe611d7cfb9 100644 --- a/popupdialog.cpp +++ b/popupdialog.cpp @@ -61,6 +61,9 @@ PopupDialog::setSpikeLabelAlignment(SpikeLabelAlignment spikeAlignment) case PopupDialog::SpikeLabelAlignment::AlignRight: ui->spikeLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight); break; + case PopupDialog::SpikeLabelAlignment::None: + ui->spikeLabel->hide(); + break; default: break; } diff --git a/popupdialog.h b/popupdialog.h index 8283f8c820912216980e35bedffb4d712c68856e..a32c6ff1c4cd720ccd89e7acded4e520eddb501a 100644 --- a/popupdialog.h +++ b/popupdialog.h @@ -33,7 +33,8 @@ public: { AlignLeft, AlignHCenter, - AlignRight + AlignRight, + None }; explicit PopupDialog(QWidget *parent = nullptr, diff --git a/settingskey.h b/settingskey.h index a8a752052d488caaf059170b43206c4108644603..90a15b31f150da6dba7481dc6932b16a48b75c78 100644 --- a/settingskey.h +++ b/settingskey.h @@ -29,4 +29,5 @@ constexpr static char mainSplitterState[] = "mainSplitterState"; constexpr static char windowState[] = "windowState"; constexpr static char autoUpdate[] = "autoUpdate"; constexpr static char neverShowMeAgain[] = "neverShowMeAgain"; +constexpr static char changeLogShownOnce[] = "changeLogShownOnce"; } diff --git a/stylesheet.css b/stylesheet.css index 820cdf904a22f9644edd18dd2e5e58d6fd4d3554..23aecf500bccc6c6f5ebfe272cb4906019cc4c37 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -112,21 +112,21 @@ QPushButton#btnAcceptInvite:pressed, QPushButton#btnIgnoreInvite:pressed, QPushB background-color: rgb(187, 187, 187); } -QPushButton#imBackButton:hover, QPushButton#btnAudioCall:hover, QPushButton#btnVideoCall:hover, -QPushButton#sendContactRequestButton:hover, QPushButton#sendButton:hover, QPushButton#sendIMButton:hover, -QPushButton#btnExitSettings:hover, QPushButton#btnDeleteAccept:hover, QPushButton#btnDeleteCancel:hover, -QPushButton#aboutButton:hover, QPushButton#creditsButton:hover, QPushButton#updateCancelBtn:hover, -QPushButton#updateAcceptBtn:hover, QPushButton#installBetaButton:hover { - background-color: rgb(237, 237, 237); -} + QPushButton#imBackButton:hover, QPushButton#btnAudioCall:hover, QPushButton#btnVideoCall:hover, + QPushButton#sendContactRequestButton:hover, QPushButton#sendButton:hover, QPushButton#sendIMButton:hover, + QPushButton#btnExitSettings:hover, QPushButton#btnDeleteAccept:hover, QPushButton#btnDeleteCancel:hover, + QPushButton#changelogButton:hover, QPushButton#creditsButton:hover, QPushButton#changelogButton:hover, QPushButton#updateCancelBtn:hover, + QPushButton#updateAcceptBtn:hover, QPushButton#installBetaButton:hover { + background-color: rgb(237, 237, 237); + } -QPushButton#imBackButton:pressed, QPushButton#btnAudioCall:pressed, QPushButton#btnVideoCall:pressed, -QPushButton#sendContactRequestButton:pressed, QPushButton#sendButton:pressed, QPushButton#sendIMButton:pressed, -QPushButton#btnExitSettings:pressed, QPushButton#btnDeleteAccept:pressed, QPushButton#btnDeleteCancel:pressed, -QPushButton#aboutButton:pressed, QPushButton#creditsButton:pressed, QPushButton#updateCancelBtn:pressed, -QPushButton#updateAcceptBtn:pressed, QPushButton#installBetaButton:pressed { - background-color: rgb(212, 212, 212); -} + QPushButton#imBackButton:pressed, QPushButton#btnAudioCall:pressed, QPushButton#btnVideoCall:pressed, + QPushButton#sendContactRequestButton:pressed, QPushButton#sendButton:pressed, QPushButton#sendIMButton:pressed, + QPushButton#btnExitSettings:pressed, QPushButton#btnDeleteAccept:pressed, QPushButton#btnDeleteCancel:pressed, + QPushButton#changelogButton:pressed, QPushButton#creditsButton:pressed, QPushButton#changelogButton:pressed, QPushButton#updateCancelBtn:pressed, + QPushButton#updateAcceptBtn:pressed, QPushButton#installBetaButton:pressed { + background-color: rgb(212, 212, 212); + } QWidget#searchBarLayoutWidget, QWidget#smartList, QWidget#sidePanelLayoutWidget, QWidget#leftSettingsWidget { @@ -260,22 +260,22 @@ QMessageBox QPushButton:pressed { background: #58b; } -QToolButton#qrButton, QToolButton#shareButton{ +QToolButton#qrButton, QToolButton#shareButton { background-color: rgb(242, 242, 242); border-style: solid; border-width: 0px; border-radius: 15px; padding: 8px; - color: rgb(32, 32, 32); + color: rgb(32, 32, 32); } -QToolButton#qrButton:hover, QToolButton#shareButton:hover{ - background-color: rgb(237, 237, 237); -} + QToolButton#qrButton:hover, QToolButton#shareButton:hover { + background-color: rgb(237, 237, 237); + } -QToolButton#qrButton:pressed, QToolButton#shareButton:pressed{ - background-color: rgb(212, 212, 212); -} + QToolButton#qrButton:pressed, QToolButton#shareButton:pressed { + background-color: rgb(212, 212, 212); + } QToolButton#qrButton:checked { background-color: rgb(237, 237, 237); @@ -896,4 +896,32 @@ QProgressBar#levelMeter { QProgressBar#levelMeter::chunk { background-color: white; margin: 2px; + } + +QScrollArea#changeLogScrollArea { + background-color: transparent; + color: white; + border: none; +} + +QWidget#changeLogContents { + background-color: transparent; + color: white; + border: none; +} + +QTextEdit#logTextEdit { + background-color: white; + color: black; +} + +QPushButton#logCloseButton { + background-color: rgb(189, 189, 189); +} + + QPushButton#logCloseButton:hover { + background-color: rgb(170, 170, 170); + } + QPushButton#logCloseButton:pressed { + background-color: rgb(180, 180, 180); } \ No newline at end of file diff --git a/utils.cpp b/utils.cpp index 1b24967f934e37336291ba140a537d6b59b0a2a7..868a834ada946504d81f368c25a23328d0472922 100644 --- a/utils.cpp +++ b/utils.cpp @@ -323,6 +323,22 @@ Utils::forceDeleteAsync(const QString& path) }); } +QString +Utils::getChangeLog() +{ + QString logs; + QFile changeLogFile("changelog.html"); + if (!changeLogFile.open(QIODevice::ReadOnly | QIODevice::Text)) { + qDebug().noquote() << " Change log file failed to load"; + return {}; + } + QTextStream in(&changeLogFile); + while (!in.atEnd()) { + logs += in.readLine(); + } + return logs; +} + void Utils::cleanUpdateFiles() { diff --git a/utils.h b/utils.h index d8453c10ed32cac9c1bc19e09258d73dd10da28c..f6686d27d62e40708ef51303dbd2cb52b82793e6 100644 --- a/utils.h +++ b/utils.h @@ -73,6 +73,7 @@ void showSystemNotification(QWidget* widget, const QString& message, long delay void showSystemNotification(QWidget* widget, const QString& sender, const QString& message, long delay = 5000); QSize getRealSize(QScreen* screen); void forceDeleteAsync(const QString& path); +QString getChangeLog(); // updates void cleanUpdateFiles();