Skip to content

Commit

Permalink
feature: Enhance and update about dialog (#1095)
Browse files Browse the repository at this point in the history
This enhances the layout of the About dialog and updates the contributors.

Dialog is now split into 3 tabs.

    About - Displays the basic build and legal information. This tab also adds a Copy to Clipboard that copies the build and system information to the clipboard that can then be pasted into for ex: a bug report.

    Moves the downloading widget to the button box area .

    Now displays the proper compiler version for MSVC when MSVC 2019 or greater.
  • Loading branch information
DSCaskey committed Apr 20, 2024
1 parent fe07a43 commit 0bce425
Show file tree
Hide file tree
Showing 36 changed files with 10,188 additions and 2,440 deletions.
480 changes: 406 additions & 74 deletions share/translations/seamly2d_cs_CZ.ts

Large diffs are not rendered by default.

564 changes: 454 additions & 110 deletions share/translations/seamly2d_de_DE.ts

Large diffs are not rendered by default.

480 changes: 406 additions & 74 deletions share/translations/seamly2d_el_GR.ts

Large diffs are not rendered by default.

480 changes: 406 additions & 74 deletions share/translations/seamly2d_en_CA.ts

Large diffs are not rendered by default.

480 changes: 406 additions & 74 deletions share/translations/seamly2d_en_GB.ts

Large diffs are not rendered by default.

480 changes: 406 additions & 74 deletions share/translations/seamly2d_en_IN.ts

Large diffs are not rendered by default.

480 changes: 406 additions & 74 deletions share/translations/seamly2d_en_US.ts

Large diffs are not rendered by default.

598 changes: 471 additions & 127 deletions share/translations/seamly2d_es_ES.ts

Large diffs are not rendered by default.

480 changes: 406 additions & 74 deletions share/translations/seamly2d_fi_FI.ts

Large diffs are not rendered by default.

508 changes: 420 additions & 88 deletions share/translations/seamly2d_fr_FR.ts

Large diffs are not rendered by default.

480 changes: 406 additions & 74 deletions share/translations/seamly2d_he_IL.ts

Large diffs are not rendered by default.

480 changes: 406 additions & 74 deletions share/translations/seamly2d_id_ID.ts

Large diffs are not rendered by default.

480 changes: 406 additions & 74 deletions share/translations/seamly2d_it_IT.ts

Large diffs are not rendered by default.

610 changes: 471 additions & 139 deletions share/translations/seamly2d_nl_NL.ts

Large diffs are not rendered by default.

480 changes: 406 additions & 74 deletions share/translations/seamly2d_pt_BR.ts

Large diffs are not rendered by default.

480 changes: 406 additions & 74 deletions share/translations/seamly2d_ro_RO.ts

Large diffs are not rendered by default.

528 changes: 430 additions & 98 deletions share/translations/seamly2d_ru_RU.ts

Large diffs are not rendered by default.

480 changes: 406 additions & 74 deletions share/translations/seamly2d_uk_UA.ts

Large diffs are not rendered by default.

480 changes: 406 additions & 74 deletions share/translations/seamly2d_zh_CN.ts

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions share/translations/translations.pro
Expand Up @@ -15,6 +15,7 @@ DEPENDPATH += \
../../src/libs/vgeometry \
../../src/libs/vpatterndb \
../../src/libs/vmisc \
../../src/libs/tools \
../../src/libs/vtools \
../../src/libs/vformat \
../../src/libs/vwidgets \
Expand All @@ -30,6 +31,7 @@ include(../../src/libs/vlayout/vlayout.pri)
include(../../src/libs/vgeometry/vgeometry.pri)
include(../../src/libs/vpatterndb/vpatterndb.pri)
include(../../src/libs/vmisc/vmisc.pri)
include(../../src/libs/tools/tools.pri)
include(../../src/libs/vtools/vtools.pri)
include(../../src/libs/vformat/vformat.pri)
include(../../src/libs/vwidgets/vwidgets.pri)
Expand Down
247 changes: 247 additions & 0 deletions src/app/seamly2d/dialogs/about2d_dialog.cpp
@@ -0,0 +1,247 @@
// @file about2d_dialog.cpp
// @author Douglas S Caskey
// @date 18 Apr, 2024
//
// @brief
// @copyright
// This source code is part of the Seamly2D project, a pattern making
// program to create and model patterns of clothing.
// Copyright (C) 2017-2024 Seamly2D project
// <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
//
// Seamly2D is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Seamly2D is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.

/************************************************************************
**
** @file dialogaboutapp.cpp
** @author Patrick Proy <patrick(at)proy.org>
** @date 6 5, 2014
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2014 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/

#include "about2d_dialog.h"
#include "ui_about2d_dialog.h"
#include "../version.h"

#include <QClipboard>
#include <QDate>
#include <QDesktopServices>
#include <QGuiApplication>
#include <QMessageBox>
#include <QScreen>
#include <QSound>
#include <QSysInfo>
#include <QtDebug>
#include <QTextCodec>

#include "../options.h"
#include "../core/application_2d.h"
#include "../fervor/fvupdater.h"
#include "../vmisc/vcommonsettings.h"

//---------------------------------------------------------------------------------------------------------------------
About2DAppDialog::About2DAppDialog(QWidget *parent)
: QDialog(parent)
, ui(new Ui::About2DAppDialog)
, m_isInitialized(false)
, m_beep(new QSound(qApp->Settings()->getSelectionSound()))
{
ui->setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

qApp->Seamly2DSettings()->getOsSeparator() ? setLocale(QLocale()) : setLocale(QLocale::c());

//About Tab
connect(ui->copyToClipbaord_toolButton, &QToolButton::clicked, this, &About2DAppDialog::copyToClipboard);

QString revision = BUILD_REVISION;
if (revision == QString("unknown"))
{
revision = tr("unknown");
}
ui->version_value->setText(QString("Seamly2D %1").arg(APP_VERSION_STR));
ui->revision_value->setText(revision);

QDate date = QLocale::c().toDate(QString(__DATE__).simplified(), QLatin1String("MMM d yyyy"));
ui->buildDate_value->setText(tr("Built on %1 at %2").arg(date.toString()).arg(__TIME__));
ui->qtVersion_value->setText(QLatin1String(qVersion()));
ui->cpu_value->setText(QSysInfo::buildCpuArchitecture());
ui->compiler_value->setText(QString("%1 %2 bit").arg(compilerString(), QString::number(QSysInfo::WordSize)));

ui->legalStuff_label->setText(QApplication::translate("InternalStrings",
"Seamly2D is an application for computer-aided design of garment patterns.\n\n"
"Seamly2D is a free (open source) software.\n\n"
"All brand or product names are trademarks or registered trademarks of their respective holders.\n\n"
"© 2017-2024 Seamly2D Project.\n\n"
"Portions of this software © 2008-2024 The Qt Company Ltd.\n\n"
"The program is provided AS IS with NO WARRANTY OF ANY "
"KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY "
"AND FITNESS FOR A PARTICULAR PURPOSE."));


ui->pushButton_Web_Site->setText(tr("Web site : %1").arg(VER_COMPANYDOMAIN_STR));
connect(ui->pushButton_Web_Site, &QPushButton::clicked, this, [this]()
{
if ( QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)) == false)
{
qWarning() << tr("Cannot open your default browser");
}
});

connect(ui->pushButtonCheckUpdate, &QPushButton::clicked, []()
{
// Set feed URL before doing anything else
FvUpdater::sharedUpdater()->SetFeedURL(defaultFeedURL);
FvUpdater::sharedUpdater()->CheckForUpdatesNotSilent();
});

ui->downloadProgress->hide();
ui->downloadProgress->setValue(0);
connect(FvUpdater::sharedUpdater(), SIGNAL(setProgress(int)), this, SLOT(setProgressValue(int)));

//System Tab
ui->sysVersion_value->setText(QString("Seamly2D %1").arg(APP_VERSION_STR));
ui->sysRevision_value->setText(revision);
ui->sysBuildDate_value->setText(tr("Built on %1 at %2").arg(date.toString()).arg(__TIME__));
ui->sysCPU_value->setText(QSysInfo::buildCpuArchitecture());
ui->sysCompiler_value->setText(QString("%1 %2 bit").arg(compilerString(), QString::number(QSysInfo::WordSize)));

ui->sysArchCPU_value->setText(QSysInfo::buildCpuArchitecture());

QString os = "Unknown";
#if defined(Q_OS_LINUX)
os = "Linux";
#elif defined(Q_OS_MAC)
os = "macOS";
#elif defined(Q_OS_WIN)
os = "Windows";
#endif

ui->sysOS_value->setText(os);
ui->sysOSVersion_value->setText(QSysInfo::productVersion());

QLocale sysloc = QLocale();
ui->sysLocale_value->setText(sysloc.name());
ui->sysLocaleCountry_value->setText(QLocale::countryToString(sysloc.country()));
ui->sysLocalLang_value->setText(QLocale::languageToString(sysloc.language()));

ui->sysLocalScriptName_vale->setText(QLocale::scriptToString(sysloc.script()));
ui->sysLocalDecimal_value->setText(sysloc.decimalPoint());
ui->sysLocalNegative_value->setText(sysloc.negativeSign());
ui->sysLocalPositive_value->setText(sysloc.positiveSign());

QString direction;
switch(sysloc.textDirection())
{
case Qt::LeftToRight:
direction = tr("Left to right");
case Qt::RightToLeft:
direction = tr("Right to left");
case Qt::LayoutDirectionAuto:
default:
direction = tr("Automatic");
}

ui->sysLocalDirection_value->setText(direction);
ui->sysCodec_value->setText(QTextCodec::codecForLocale()->name());
ui->sysArguments_value->setText(QCoreApplication::arguments().join(","));
}

//---------------------------------------------------------------------------------------------------------------------
About2DAppDialog::~About2DAppDialog()
{
delete ui;
}

//---------------------------------------------------------------------------------------------------------------------
void About2DAppDialog::showEvent(QShowEvent *event)
{
QDialog::showEvent( event );
if ( event->spontaneous() )
{
return;
}

if (m_isInitialized)
{
return;
}

m_isInitialized = true;//first show windows are held
}

void About2DAppDialog::setProgressValue(int val) {
if (!ui->downloadProgress->isVisible()){
ui->downloadProgress->show();
ui->pushButtonCheckUpdate->setDisabled(true);
}
ui->downloadProgress->setValue(val);
if (val == 100){
ui->downloadProgress->hide();
ui->downloadProgress->setValue(0);
ui->pushButtonCheckUpdate->setDisabled(false);
}
}

//---------------------------------------------------------------------------------------------------------------------
/*
* @brief Copies the text content of the text browser widget to the clipboard.
*/
void About2DAppDialog::copyToClipboard()
{
m_beep->play();
QClipboard *clipboard = QApplication::clipboard();

QString text ="";
text += QString("Seamly2D version: %1").arg(ui->version_value->text());
text += QString("\nBuild revision: %1").arg(ui->revision_value->text());
text += QString("\nBuild date: %1").arg(ui->buildDate_value->text());
text += QString("\nQt Version: %1").arg(ui->qtVersion_value->text());
text += QString("\nCPU: %1").arg(ui->cpu_value->text());
text += QString("\nCompiler: %1").arg(ui->compiler_value->text());
text += QString("\nCPU: %1").arg(ui->sysArchCPU_value->text());
text += QString("\nOS: %1").arg(ui->sysOS_value->text());
text += QString("\nOS Version: %1").arg(ui->sysOSVersion_value->text());
text += QString("\nLocale: %1").arg(ui->sysLocale_value->text());
text += QString("\nCountry: %1").arg(ui->sysLocaleCountry_value->text());
text += QString("\nLanguage: %1").arg(ui->sysLocalLang_value->text());
text += QString("\nScript Name: %1").arg(ui->sysLocalScriptName_vale->text());
text += QString("\nDecimal Point: %1").arg(ui->sysLocalDecimal_value->text());
text += QString("\nNegative Sign: %1").arg(ui->sysLocalNegative_value->text());
text += QString("\nPositive Sign: %1").arg(ui->sysLocalPositive_value->text());
text += QString("\nDirection: %1").arg(ui->sysLocalDirection_value->text());
text += QString("\nSystem Codec: %1").arg(ui->sysCodec_value->text());
text += QString("\nArguments: %1").arg(ui->sysArguments_value->text());
clipboard->setText(text);
}
87 changes: 87 additions & 0 deletions src/app/seamly2d/dialogs/about2d_dialog.h
@@ -0,0 +1,87 @@
// @file about2d_dialog.h
// @author Douglas S Caskey
// @date 18 Apr, 2024
//
// @brief
// @copyright
// This source code is part of the Seamly2D project, a pattern making
// program to create and model patterns of clothing.
// Copyright (C) 2017-2024 Seamly2D project
// <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
//
// Seamly2D is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Seamly2D is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.

/************************************************************************
**
** @file dialogaboutapp.h
** @author Patrick Proy <patrick(at)proy.org>
** @date 6 5, 2014
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013-2015 Seamly2D project
** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
**
** Seamly2D is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Seamly2D is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/

#ifndef ABOUT2D_DIALOG_H
#define ABOUT2D_DIALOG_H

#include <QDialog>
#include <QSound>

namespace Ui
{
class About2DAppDialog;
}

class About2DAppDialog : public QDialog
{
Q_OBJECT

public:
explicit About2DAppDialog(QWidget *parent = nullptr);
virtual ~About2DAppDialog();

protected:
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;

public slots:
void setProgressValue(int val);

private:
Ui::About2DAppDialog *ui;
bool m_isInitialized;
QSound *m_beep;
Q_DISABLE_COPY(About2DAppDialog)

void copyToClipboard();
};

#endif // ABOUT2D_DIALOG_H

0 comments on commit 0bce425

Please sign in to comment.