Commit 8e955b44 authored by Ming Rui Zhang's avatar Ming Rui Zhang

changelog: show generated change logs at every fresh install

Change-Id: Iedefc63495920502a00bcb8c3a81d92db0ae321e
parent b4988375
/*************************************************************************** /***************************************************************************
* Copyright (C) 2015-2017 by Savoir-faire Linux * * Copyright (C) 2015-2019 by Savoir-faire Linux *
* Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>* * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>*
* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> *
* * * *
* This program is free software; you can redistribute it and/or modify * * 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 * * it under the terms of the GNU General Public License as published by *
...@@ -23,17 +24,39 @@ ...@@ -23,17 +24,39 @@
#include "version.h" #include "version.h"
AboutDialog::AboutDialog(QWidget *parent) : AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent), PopupWidget(
parent,
RingTheme::lightGrey_,
PopupDialog::SpikeLabelAlignment::None),
ui(new Ui::AboutDialog) ui(new Ui::AboutDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
this->setFixedSize(this->width(),this->height()); this->setFixedSize(this->width(),this->height());
ui->creditsWidget->hide(); ui->gitVersionLabel->setText(QString("%1: %2")
ui->gitVersionLabel->setText(QString("%1: %2").arg(isBeta ? tr("beta version") : tr("version"), QString(VERSION_STRING))); .arg(isBeta ? tr("(BETA) version") : tr("version"), QString(VERSION_STRING)));
ui->creditsBrowser->setHtml("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">" 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("<!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\">" "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">"
"p, li { white-space: pre-wrap; }" "p, li { white-space: pre-wrap; }"
"</style></head><body style=\" font-family:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;\">" "</style></head><body style=\" font-family:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;\">"
...@@ -85,22 +108,3 @@ AboutDialog::AboutDialog(QWidget *parent) : ...@@ -85,22 +108,3 @@ AboutDialog::AboutDialog(QWidget *parent) :
+ tr("Based on the SFLPhone project") + "</p>" + tr("Based on the SFLPhone project") + "</p>"
"<p align=\"center\" 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>"); "<p align=\"center\" 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>");
} }
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);
}
/*************************************************************************** /***************************************************************************
* Copyright (C) 2015-2017 by Savoir-faire Linux * * Copyright (C) 2015-2019 by Savoir-faire Linux *
* Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>* * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>*
* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> *
* * * *
* This program is free software; you can redistribute it and/or modify * * 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 * * it under the terms of the GNU General Public License as published by *
...@@ -18,13 +19,13 @@ ...@@ -18,13 +19,13 @@
#pragma once #pragma once
#include <QDialog> #include "widgethelpers.h"
namespace Ui { namespace Ui {
class AboutDialog; class AboutDialog;
} }
class AboutDialog : public QDialog class AboutDialog : public PopupWidget
{ {
Q_OBJECT Q_OBJECT
...@@ -32,12 +33,10 @@ public: ...@@ -32,12 +33,10 @@ public:
explicit AboutDialog(QWidget *parent = 0); explicit AboutDialog(QWidget *parent = 0);
~AboutDialog(); ~AboutDialog();
//UI SLOTS
private slots: private slots:
void on_aboutButton_clicked(); void on_changelogButton_clicked();
void on_creditsButton_clicked(); void on_creditsButton_clicked();
private: private:
Ui::AboutDialog *ui; Ui::AboutDialog *ui;
}; };
This diff is collapsed.
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "pixbufmanipulator.h" #include "pixbufmanipulator.h"
#include "ringthemeutils.h" #include "ringthemeutils.h"
#include "settingskey.h" #include "settingskey.h"
#include "aboutdialog.h"
#include "globalinstances.h" #include "globalinstances.h"
...@@ -219,6 +220,12 @@ CallWidget::CallWidget(QWidget* parent) : ...@@ -219,6 +220,12 @@ CallWidget::CallWidget(QWidget* parent) :
connect(LRCInstance::renderer(), &RenderManager::videoDeviceListChanged, connect(LRCInstance::renderer(), &RenderManager::videoDeviceListChanged,
this, &CallWidget::slotVideoDeviceListChanged); this, &CallWidget::slotVideoDeviceListChanged);
connect(ui->changelogButton, &QAbstractButton::clicked,
[this] {
AboutDialog aboutDialog(this);
aboutDialog.getContainer()->exec();
});
// set first view to welcome view // set first view to welcome view
ui->stackedWidget->setCurrentWidget(ui->welcomePage); ui->stackedWidget->setCurrentWidget(ui->welcomePage);
ui->btnConversations->setChecked(true); ui->btnConversations->setChecked(true);
......
...@@ -501,7 +501,7 @@ ...@@ -501,7 +501,7 @@
<string/> <string/>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="welcomePage"> <widget class="QWidget" name="welcomePage">
<property name="sizePolicy"> <property name="sizePolicy">
...@@ -960,6 +960,80 @@ Copy and share it with your friends! ...@@ -960,6 +960,80 @@ Copy and share it with your friends!
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="verticalSpacer_11">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<property name="spacing">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="changelogButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>About</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item> <item>
<spacer name="verticalSpacer_2"> <spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
......
...@@ -92,4 +92,9 @@ Get-ChildItem -Path $clientTSPath -Include *.qm -Recurse | ForEach-Object { ...@@ -92,4 +92,9 @@ Get-ChildItem -Path $clientTSPath -Include *.qm -Recurse | ForEach-Object {
Copy-Item -Path $_.FullName -Destination $CopyDir -Force Recurse 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
TEMPLATE = app TEMPLATE = app
TARGET = jami-qt TARGET = jami-qt

CONFIG += c++17 CONFIG += c++17
QT += widgets xml multimedia multimediawidgets network webenginewidgets svg QT += widgets xml multimedia multimediawidgets network webenginewidgets svg
...@@ -184,4 +184,4 @@ FORMS += ./aboutdialog.ui \ ...@@ -184,4 +184,4 @@ FORMS += ./aboutdialog.ui \
./popupdialog.ui \ ./popupdialog.ui \
./recordoverlay.ui \ ./recordoverlay.ui \
./recordwidget.ui ./recordwidget.ui
RESOURCES += ressources.qrc RESOURCES += ressources.qrc
\ No newline at end of file
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "runguard.h" #include "runguard.h"
#include "utils.h" #include "utils.h"
#include "splashscreen.h" #include "splashscreen.h"
#include "aboutdialog.h"
#include <QApplication> #include <QApplication>
#include <QFile> #include <QFile>
...@@ -283,6 +284,12 @@ main(int argc, char* argv[]) ...@@ -283,6 +284,12 @@ main(int argc, char* argv[])
MainWindow::instance().hide(); MainWindow::instance().hide();
} }
QSettings settings("jami.net", "Jami");
if (!settings.contains(SettingsKey::changeLogShownOnce)) {
std::unique_ptr<AboutDialog> aboutDialog = std::make_unique<AboutDialog>(&MainWindow::instance());
aboutDialog->getContainer()->exec();
}
QObject::connect(&a, &QApplication::aboutToQuit, [&guard] { exitApp(guard); }); QObject::connect(&a, &QApplication::aboutToQuit, [&guard] { exitApp(guard); });
auto ret = a.exec(); auto ret = a.exec();
...@@ -292,4 +299,4 @@ main(int argc, char* argv[]) ...@@ -292,4 +299,4 @@ main(int argc, char* argv[])
#endif #endif
return ret; return ret;
} }
\ No newline at end of file
...@@ -21,12 +21,19 @@ ...@@ -21,12 +21,19 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "aboutdialog.h"
#include "callwidget.h"
#include "settingskey.h"
#include "utils.h"
#include "version.h"
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QDir> #include <QDir>
#include <QScreen> #include <QScreen>
#include <QStandardPaths> #include <QStandardPaths>
#include <QTimer> #include <QTimer>
#include <QWindow> #include <QWindow>
#include <QGraphicsDropShadowEffect>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <QWinThumbnailToolBar> #include <QWinThumbnailToolBar>
...@@ -34,12 +41,6 @@ ...@@ -34,12 +41,6 @@
#include <windows.h> #include <windows.h>
#endif #endif
#include "aboutdialog.h"
#include "callwidget.h"
#include "settingskey.h"
#include "utils.h"
#include "version.h"
MainWindow::MainWindow(QWidget* parent) MainWindow::MainWindow(QWidget* parent)
: QMainWindow(parent) : QMainWindow(parent)
, ui(new Ui::MainWindow) , ui(new Ui::MainWindow)
...@@ -217,8 +218,8 @@ bool MainWindow::nativeEvent(const QByteArray& eventType, void* message, long* r ...@@ -217,8 +218,8 @@ bool MainWindow::nativeEvent(const QByteArray& eventType, void* message, long* r
if ((msg->wParam & 0xfff0) == IDM_ABOUTBOX) { if ((msg->wParam & 0xfff0) == IDM_ABOUTBOX) {
*result = 0; *result = 0;
AboutDialog aboutDialog; AboutDialog aboutDialog(this);
aboutDialog.exec(); aboutDialog.getContainer()->exec();
return true; return true;
} }
......
...@@ -61,6 +61,9 @@ PopupDialog::setSpikeLabelAlignment(SpikeLabelAlignment spikeAlignment) ...@@ -61,6 +61,9 @@ PopupDialog::setSpikeLabelAlignment(SpikeLabelAlignment spikeAlignment)
case PopupDialog::SpikeLabelAlignment::AlignRight: case PopupDialog::SpikeLabelAlignment::AlignRight:
ui->spikeLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight); ui->spikeLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
break; break;
case PopupDialog::SpikeLabelAlignment::None:
ui->spikeLabel->hide();
break;
default: default:
break; break;
} }
......
...@@ -33,7 +33,8 @@ public: ...@@ -33,7 +33,8 @@ public:
{ {
AlignLeft, AlignLeft,
AlignHCenter, AlignHCenter,
AlignRight AlignRight,
None
}; };
explicit PopupDialog(QWidget *parent = nullptr, explicit PopupDialog(QWidget *parent = nullptr,
......
...@@ -29,4 +29,5 @@ constexpr static char mainSplitterState[] = "mainSplitterState"; ...@@ -29,4 +29,5 @@ constexpr static char mainSplitterState[] = "mainSplitterState";
constexpr static char windowState[] = "windowState"; constexpr static char windowState[] = "windowState";
constexpr static char autoUpdate[] = "autoUpdate"; constexpr static char autoUpdate[] = "autoUpdate";
constexpr static char neverShowMeAgain[] = "neverShowMeAgain"; constexpr static char neverShowMeAgain[] = "neverShowMeAgain";
constexpr static char changeLogShownOnce[] = "changeLogShownOnce";
} }
...@@ -112,21 +112,21 @@ QPushButton#btnAcceptInvite:pressed, QPushButton#btnIgnoreInvite:pressed, QPushB ...@@ -112,21 +112,21 @@ QPushButton#btnAcceptInvite:pressed, QPushButton#btnIgnoreInvite:pressed, QPushB
background-color: rgb(187, 187, 187); background-color: rgb(187, 187, 187);
} }
QPushButton#imBackButton:hover, QPushButton#btnAudioCall:hover, QPushButton#btnVideoCall:hover, QPushButton#imBackButton:hover, QPushButton#btnAudioCall:hover, QPushButton#btnVideoCall:hover,
QPushButton#sendContactRequestButton:hover, QPushButton#sendButton:hover, QPushButton#sendIMButton:hover, QPushButton#sendContactRequestButton:hover, QPushButton#sendButton:hover, QPushButton#sendIMButton:hover,
QPushButton#btnExitSettings:hover, QPushButton#btnDeleteAccept:hover, QPushButton#btnDeleteCancel:hover, QPushButton#btnExitSettings:hover, QPushButton#btnDeleteAccept:hover, QPushButton#btnDeleteCancel:hover,
QPushButton#aboutButton:hover, QPushButton#creditsButton:hover, QPushButton#updateCancelBtn:hover, QPushButton#changelogButton:hover, QPushButton#creditsButton:hover, QPushButton#changelogButton:hover, QPushButton#updateCancelBtn:hover,
QPushButton#updateAcceptBtn:hover, QPushButton#installBetaButton:hover { QPushButton#updateAcceptBtn:hover, QPushButton#installBetaButton:hover {
background-color: rgb(237, 237, 237); background-color: rgb(237, 237, 237);
} }
QPushButton#imBackButton:pressed, QPushButton#btnAudioCall:pressed, QPushButton#btnVideoCall:pressed, QPushButton#imBackButton:pressed, QPushButton#btnAudioCall:pressed, QPushButton#btnVideoCall:pressed,
QPushButton#sendContactRequestButton:pressed, QPushButton#sendButton:pressed, QPushButton#sendIMButton:pressed, QPushButton#sendContactRequestButton:pressed, QPushButton#sendButton:pressed, QPushButton#sendIMButton:pressed,
QPushButton#btnExitSettings:pressed, QPushButton#btnDeleteAccept:pressed, QPushButton#btnDeleteCancel:pressed, QPushButton#btnExitSettings:pressed, QPushButton#btnDeleteAccept:pressed, QPushButton#btnDeleteCancel:pressed,
QPushButton#aboutButton:pressed, QPushButton#creditsButton:pressed, QPushButton#updateCancelBtn:pressed, QPushButton#changelogButton:pressed, QPushButton#creditsButton:pressed, QPushButton#changelogButton:pressed, QPushButton#updateCancelBtn:pressed,
QPushButton#updateAcceptBtn:pressed, QPushButton#installBetaButton:pressed { QPushButton#updateAcceptBtn:pressed, QPushButton#installBetaButton:pressed {
background-color: rgb(212, 212, 212); background-color: rgb(212, 212, 212);
} }
QWidget#searchBarLayoutWidget, QWidget#smartList, QWidget#searchBarLayoutWidget, QWidget#smartList,
QWidget#sidePanelLayoutWidget, QWidget#leftSettingsWidget { QWidget#sidePanelLayoutWidget, QWidget#leftSettingsWidget {
...@@ -260,22 +260,22 @@ QMessageBox QPushButton:pressed { ...@@ -260,22 +260,22 @@ QMessageBox QPushButton:pressed {
background: #58b; background: #58b;
} }
QToolButton#qrButton, QToolButton#shareButton{ QToolButton#qrButton, QToolButton#shareButton {
background-color: rgb(242, 242, 242); background-color: rgb(242, 242, 242);
border-style: solid; border-style: solid;
border-width: 0px; border-width: 0px;
border-radius: 15px; border-radius: 15px;
padding: 8px; padding: 8px;
color: rgb(32, 32, 32); color: rgb(32, 32, 32);
} }
QToolButton#qrButton:hover, QToolButton#shareButton:hover{ QToolButton#qrButton:hover, QToolButton#shareButton:hover {
background-color: rgb(237, 237, 237); background-color: rgb(237, 237, 237);
} }
QToolButton#qrButton:pressed, QToolButton#shareButton:pressed{ QToolButton#qrButton:pressed, QToolButton#shareButton:pressed {
background-color: rgb(212, 212, 212); background-color: rgb(212, 212, 212);
} }
QToolButton#qrButton:checked { QToolButton#qrButton:checked {
background-color: rgb(237, 237, 237); background-color: rgb(237, 237, 237);
...@@ -896,4 +896,32 @@ QProgressBar#levelMeter { ...@@ -896,4 +896,32 @@ QProgressBar#levelMeter {
QProgressBar#levelMeter::chunk { QProgressBar#levelMeter::chunk {
background-color: white; background-color: white;
margin: 2px; 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
...@@ -323,6 +323,22 @@ Utils::forceDeleteAsync(const QString& path) ...@@ -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 void
Utils::cleanUpdateFiles() Utils::cleanUpdateFiles()
{ {
......
...@@ -73,6 +73,7 @@ void showSystemNotification(QWidget* widget, const QString& message, long delay ...@@ -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); void showSystemNotification(QWidget* widget, const QString& sender, const QString& message, long delay = 5000);
QSize getRealSize(QScreen* screen); QSize getRealSize(QScreen* screen);
void forceDeleteAsync(const QString& path); void forceDeleteAsync(const QString& path);
QString getChangeLog();
// updates // updates
void cleanUpdateFiles(); void cleanUpdateFiles();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment