forked from owncloud/client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Gui]Redesign AboutDialog and unify version info
Fixes: owncloud#7749 Fixes: owncloud#7704
- Loading branch information
1 parent
59a10bf
commit 6eb42c4
Showing
10 changed files
with
342 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Change: Redesign the About dialog | ||
|
||
We redesigned the way the About information is displayed and unified it | ||
with the "--version" switch. | ||
|
||
https://github.com/owncloud/client/issues/7749 | ||
https://github.com/owncloud/enterprise/issues/3787 | ||
https://github.com/owncloud/client/issues/7704 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (C) by Hannah von Reth <hannah.vonreth@owncloud.com> | ||
* | ||
* 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 | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program 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. | ||
*/ | ||
#include "aboutdialog.h" | ||
#include "ui_aboutdialog.h" | ||
|
||
#include "theme.h" | ||
#include "guiutility.h" | ||
|
||
namespace OCC { | ||
|
||
AboutDialog::AboutDialog(QWidget *parent) | ||
: QDialog(parent) | ||
, ui(new Ui::AboutDialog) | ||
{ | ||
ui->setupUi(this); | ||
setWindowTitle(tr("About %1").arg(Theme::instance()->appNameGUI())); | ||
ui->aboutText->setText(Theme::instance()->about()); | ||
ui->icon->setPixmap(Theme::instance()->applicationIcon().pixmap(256)); | ||
ui->versionInfo->setText(Theme::instance()->aboutVersions(Theme::VersionFormat::RichText)); | ||
|
||
connect(ui->versionInfo, &QTextBrowser::anchorClicked, this, &AboutDialog::openBrowserFromUrl); | ||
connect(ui->aboutText, &QLabel::linkActivated, this, &AboutDialog::openBrowser); | ||
setAttribute(Qt::WA_DeleteOnClose); | ||
} | ||
|
||
AboutDialog::~AboutDialog() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void AboutDialog::openBrowser(const QString &s) | ||
{ | ||
Utility::openBrowser(s, this); | ||
} | ||
|
||
void AboutDialog::openBrowserFromUrl(const QUrl &s) | ||
{ | ||
return openBrowser(s.toString()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (C) by Hannah von Reth <hannah.vonreth@owncloud.com> | ||
* | ||
* 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 | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program 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. | ||
*/ | ||
#ifndef ABOUTDIALOG_H | ||
#define ABOUTDIALOG_H | ||
|
||
#include <QDialog> | ||
|
||
|
||
namespace OCC { | ||
|
||
namespace Ui { | ||
class AboutDialog; | ||
} | ||
|
||
class AboutDialog : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit AboutDialog(QWidget *parent = nullptr); | ||
~AboutDialog(); | ||
|
||
private: | ||
void openBrowser(const QString &s); | ||
void openBrowserFromUrl(const QUrl &s); | ||
|
||
private: | ||
Ui::AboutDialog *ui; | ||
}; | ||
|
||
} | ||
#endif // ABOUTDIALOG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>OCC::AboutDialog</class> | ||
<widget class="QDialog" name="OCC::AboutDialog"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>751</width> | ||
<height>391</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string notr="true">About</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QTabWidget" name="tabWidget"> | ||
<property name="currentIndex"> | ||
<number>0</number> | ||
</property> | ||
<widget class="QWidget" name="tab"> | ||
<attribute name="title"> | ||
<string>About</string> | ||
</attribute> | ||
<layout class="QHBoxLayout"> | ||
<item> | ||
<layout class="QVBoxLayout" name="verticalLayout_2"> | ||
<item> | ||
<spacer name="verticalSpacer_2"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="icon"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="maximumSize"> | ||
<size> | ||
<width>256</width> | ||
<height>256</height> | ||
</size> | ||
</property> | ||
<property name="text"> | ||
<string notr="true"/> | ||
</property> | ||
<property name="pixmap"> | ||
<pixmap resource="../../theme.qrc">:/client/theme/colored/owncloud-icon-256.png</pixmap> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="verticalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="aboutText"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="text"> | ||
<string>TextLabel</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<widget class="QWidget" name="tab_2"> | ||
<attribute name="title"> | ||
<string>Versions</string> | ||
</attribute> | ||
<layout class="QVBoxLayout" name="verticalLayout_3"> | ||
<item> | ||
<widget class="QTextBrowser" name="versionInfo"> | ||
<property name="openExternalLinks"> | ||
<bool>false</bool> | ||
</property> | ||
<property name="openLinks"> | ||
<bool>false</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QDialogButtonBox" name="buttonBox"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="standardButtons"> | ||
<set>QDialogButtonBox::Ok</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources> | ||
<include location="../../theme.qrc"/> | ||
</resources> | ||
<connections> | ||
<connection> | ||
<sender>buttonBox</sender> | ||
<signal>accepted()</signal> | ||
<receiver>OCC::AboutDialog</receiver> | ||
<slot>accept()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>248</x> | ||
<y>254</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>157</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>buttonBox</sender> | ||
<signal>rejected()</signal> | ||
<receiver>OCC::AboutDialog</receiver> | ||
<slot>reject()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>316</x> | ||
<y>260</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>286</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
</connections> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.