Skip to content

Commit 4780ae1

Browse files
committedNov 4, 2018
Settings: Bring back version and copyright
For owncloud/enterprise#2941
1 parent 22d07cf commit 4780ae1

8 files changed

+201
-99
lines changed
 

‎src/gui/generalsettings.cpp

+11-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "ui_generalsettings.h"
1717

1818
#include "theme.h"
19+
#include "version.h"
1920
#include "configfile.h"
2021
#include "application.h"
2122
#include "configfile.h"
@@ -101,12 +102,20 @@ GeneralSettings::GeneralSettings(QWidget *parent)
101102
if (theme->appName() != QLatin1String("ownCloud") && theme->appName() != QLatin1String("testpilotcloud") ) {
102103
#ifdef Q_OS_MAC
103104
// Because we don't have any statusString from the SparkleUpdater anyway we can hide the whole thing
104-
_ui->updatesGroupBox->hide();
105+
_ui->updaterWidget->hide();
105106
#else
106107
_ui->updateChannelLabel->hide();
107108
_ui->updateChannel->hide();
108109
#endif
109110
}
111+
112+
_ui->versionLabel->setText("<a href='about'>" MIRALL_VERSION_STRING "</a>");
113+
QObject::connect(_ui->versionLabel, &QLabel::linkActivated, this, &GeneralSettings::showAbout);
114+
115+
if (!theme->aboutShowCopyright()) {
116+
_ui->copyrightLabelDotBefore->hide();
117+
_ui->copyrightLabel->hide();
118+
}
110119
}
111120

112121
GeneralSettings::~GeneralSettings()
@@ -139,7 +148,7 @@ void GeneralSettings::slotUpdateInfo()
139148
{
140149
if (ConfigFile().skipUpdateCheck() || !Updater::instance()) {
141150
// updater disabled on compile
142-
_ui->updatesGroupBox->setVisible(false);
151+
_ui->updaterWidget->setVisible(false);
143152
return;
144153
}
145154

‎src/gui/generalsettings.h

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class GeneralSettings : public QWidget
3939
~GeneralSettings();
4040
QSize sizeHint() const;
4141

42+
signals:
43+
void showAbout();
44+
4245
private slots:
4346
void saveMiscSettings();
4447
void slotToggleLaunchOnStartup(bool);

‎src/gui/generalsettings.ui

+178-96
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>785</width>
10-
<height>390</height>
9+
<width>794</width>
10+
<height>432</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -47,110 +47,181 @@
4747
</layout>
4848
</widget>
4949
</item>
50-
<item row="2" column="0">
51-
<widget class="QGroupBox" name="updatesGroupBox">
50+
<item row="4" column="0">
51+
<widget class="QGroupBox" name="versionGroupBox">
5252
<property name="title">
53-
<string>Updates</string>
53+
<string>Version</string>
5454
</property>
5555
<layout class="QVBoxLayout" name="verticalLayout_2">
5656
<item>
57-
<layout class="QHBoxLayout" name="horizontalLayout">
58-
<item>
59-
<widget class="QLabel" name="updateChannelLabel">
60-
<property name="sizePolicy">
61-
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
62-
<horstretch>0</horstretch>
63-
<verstretch>0</verstretch>
64-
</sizepolicy>
65-
</property>
66-
<property name="text">
67-
<string>&amp;Channel</string>
68-
</property>
69-
<property name="buddy">
70-
<cstring>updateChannel</cstring>
71-
</property>
72-
</widget>
73-
</item>
74-
<item>
75-
<widget class="QComboBox" name="updateChannel">
76-
<property name="sizePolicy">
77-
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
78-
<horstretch>0</horstretch>
79-
<verstretch>0</verstretch>
80-
</sizepolicy>
81-
</property>
82-
<item>
57+
<widget class="QWidget" name="updaterWidget" native="true">
58+
<layout class="QHBoxLayout" name="horizontalLayout_5">
59+
<property name="leftMargin">
60+
<number>0</number>
61+
</property>
62+
<property name="topMargin">
63+
<number>0</number>
64+
</property>
65+
<property name="rightMargin">
66+
<number>0</number>
67+
</property>
68+
<property name="bottomMargin">
69+
<number>0</number>
70+
</property>
71+
<item>
72+
<widget class="QLabel" name="updateChannelLabel">
73+
<property name="sizePolicy">
74+
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
75+
<horstretch>0</horstretch>
76+
<verstretch>0</verstretch>
77+
</sizepolicy>
78+
</property>
8379
<property name="text">
84-
<string>stable</string>
80+
<string>&amp;Update Channel</string>
8581
</property>
86-
</item>
87-
<item>
82+
<property name="buddy">
83+
<cstring>updateChannel</cstring>
84+
</property>
85+
</widget>
86+
</item>
87+
<item>
88+
<widget class="QComboBox" name="updateChannel">
89+
<property name="sizePolicy">
90+
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
91+
<horstretch>0</horstretch>
92+
<verstretch>0</verstretch>
93+
</sizepolicy>
94+
</property>
95+
<item>
96+
<property name="text">
97+
<string>stable</string>
98+
</property>
99+
</item>
100+
<item>
101+
<property name="text">
102+
<string>beta</string>
103+
</property>
104+
</item>
105+
</widget>
106+
</item>
107+
<item>
108+
<widget class="QLabel" name="updateStateLabel">
88109
<property name="text">
89-
<string>beta</string>
110+
<string/>
90111
</property>
91-
</item>
92-
</widget>
93-
</item>
94-
<item>
95-
<widget class="QLabel" name="updateStateLabel">
96-
<property name="text">
97-
<string/>
98-
</property>
99-
<property name="wordWrap">
100-
<bool>true</bool>
101-
</property>
102-
<property name="openExternalLinks">
103-
<bool>true</bool>
104-
</property>
105-
</widget>
106-
</item>
107-
<item>
108-
<widget class="QPushButton" name="restartButton">
109-
<property name="sizePolicy">
110-
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
111-
<horstretch>0</horstretch>
112-
<verstretch>0</verstretch>
113-
</sizepolicy>
114-
</property>
115-
<property name="text">
116-
<string>&amp;Restart &amp;&amp; Update</string>
117-
</property>
118-
</widget>
119-
</item>
120-
<item>
121-
<spacer name="horizontalSpacer">
122-
<property name="orientation">
123-
<enum>Qt::Horizontal</enum>
124-
</property>
125-
<property name="sizeType">
126-
<enum>QSizePolicy::Preferred</enum>
127-
</property>
128-
<property name="sizeHint" stdset="0">
129-
<size>
130-
<width>40</width>
131-
<height>20</height>
132-
</size>
133-
</property>
134-
</spacer>
135-
</item>
136-
</layout>
112+
<property name="wordWrap">
113+
<bool>true</bool>
114+
</property>
115+
<property name="openExternalLinks">
116+
<bool>true</bool>
117+
</property>
118+
</widget>
119+
</item>
120+
<item>
121+
<widget class="QPushButton" name="restartButton">
122+
<property name="sizePolicy">
123+
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
124+
<horstretch>0</horstretch>
125+
<verstretch>0</verstretch>
126+
</sizepolicy>
127+
</property>
128+
<property name="text">
129+
<string>&amp;Restart &amp;&amp; Update</string>
130+
</property>
131+
</widget>
132+
</item>
133+
<item>
134+
<spacer name="horizontalSpacer">
135+
<property name="orientation">
136+
<enum>Qt::Horizontal</enum>
137+
</property>
138+
<property name="sizeType">
139+
<enum>QSizePolicy::Preferred</enum>
140+
</property>
141+
<property name="sizeHint" stdset="0">
142+
<size>
143+
<width>222</width>
144+
<height>20</height>
145+
</size>
146+
</property>
147+
</spacer>
148+
</item>
149+
</layout>
150+
</widget>
151+
</item>
152+
<item>
153+
<widget class="QWidget" name="versionInfoWidget" native="true">
154+
<layout class="QHBoxLayout" name="horizontalLayout_2">
155+
<property name="leftMargin">
156+
<number>0</number>
157+
</property>
158+
<property name="topMargin">
159+
<number>0</number>
160+
</property>
161+
<property name="rightMargin">
162+
<number>0</number>
163+
</property>
164+
<property name="bottomMargin">
165+
<number>0</number>
166+
</property>
167+
<item>
168+
<widget class="QLabel" name="versionLabel">
169+
<property name="cursor">
170+
<cursorShape>PointingHandCursor</cursorShape>
171+
</property>
172+
<property name="text">
173+
<string notr="true">Version 3.1.3 (build 37)</string>
174+
</property>
175+
<property name="textInteractionFlags">
176+
<set>Qt::LinksAccessibleByMouse</set>
177+
</property>
178+
</widget>
179+
</item>
180+
<item>
181+
<widget class="QLabel" name="copyrightLabelDotBefore">
182+
<property name="cursor">
183+
<cursorShape>ArrowCursor</cursorShape>
184+
</property>
185+
<property name="text">
186+
<string>•</string>
187+
</property>
188+
<property name="textInteractionFlags">
189+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
190+
</property>
191+
</widget>
192+
</item>
193+
<item>
194+
<widget class="QLabel" name="copyrightLabel">
195+
<property name="cursor">
196+
<cursorShape>ArrowCursor</cursorShape>
197+
</property>
198+
<property name="text">
199+
<string notr="true">Copyright ownCloud GmbH</string>
200+
</property>
201+
<property name="textInteractionFlags">
202+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
203+
</property>
204+
</widget>
205+
</item>
206+
<item>
207+
<spacer name="horizontalSpacer_2">
208+
<property name="orientation">
209+
<enum>Qt::Horizontal</enum>
210+
</property>
211+
<property name="sizeHint" stdset="0">
212+
<size>
213+
<width>40</width>
214+
<height>20</height>
215+
</size>
216+
</property>
217+
</spacer>
218+
</item>
219+
</layout>
220+
</widget>
137221
</item>
138222
</layout>
139223
</widget>
140224
</item>
141-
<item row="3" column="0">
142-
<spacer name="verticalSpacer">
143-
<property name="orientation">
144-
<enum>Qt::Vertical</enum>
145-
</property>
146-
<property name="sizeHint" stdset="0">
147-
<size>
148-
<width>20</width>
149-
<height>0</height>
150-
</size>
151-
</property>
152-
</spacer>
153-
</item>
154225
<item row="1" column="0">
155226
<widget class="QGroupBox" name="groupBox">
156227
<property name="title">
@@ -267,6 +338,19 @@
267338
</layout>
268339
</widget>
269340
</item>
341+
<item row="5" column="0">
342+
<spacer name="verticalSpacer">
343+
<property name="orientation">
344+
<enum>Qt::Vertical</enum>
345+
</property>
346+
<property name="sizeHint" stdset="0">
347+
<size>
348+
<width>20</width>
349+
<height>0</height>
350+
</size>
351+
</property>
352+
</spacer>
353+
</item>
270354
</layout>
271355
</widget>
272356
<tabstops>
@@ -279,8 +363,6 @@
279363
<tabstop>newExternalStorage</tabstop>
280364
<tabstop>showInExplorerNavigationPaneCheckBox</tabstop>
281365
<tabstop>crashreporterCheckBox</tabstop>
282-
<tabstop>updateChannel</tabstop>
283-
<tabstop>restartButton</tabstop>
284366
</tabstops>
285367
<resources/>
286368
<connections>

‎src/gui/owncloudgui.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public slots:
8787
void slotOpenOwnCloud();
8888
void slotOpenSettingsDialog();
8989
void slotHelp();
90+
void slotAbout();
9091
void slotOpenPath(const QString &path);
9192
void slotAccountStateChanged();
9293
void slotTrayMessageIfServerUnsupported(Account *account);
@@ -108,7 +109,6 @@ private slots:
108109
void slotUnpauseAllFolders();
109110
void slotPauseAllFolders();
110111
void slotNewAccountWizard();
111-
void slotAbout();
112112

113113
private:
114114
void setPauseOnAllFoldersHelper(bool pause);

‎src/gui/settingsdialog.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent)
103103
_toolBar->addAction(generalAction);
104104
GeneralSettings *generalSettings = new GeneralSettings;
105105
_ui->stack->addWidget(generalSettings);
106+
QObject::connect(generalSettings, &GeneralSettings::showAbout, gui, &ownCloudGui::slotAbout);
106107

107108
QAction *networkAction = createColorAwareAction(QLatin1String(":/client/resources/network.png"), tr("Network"));
108109
_actionGroup->addAction(networkAction);

‎src/gui/settingsdialogmac.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ SettingsDialogMac::SettingsDialogMac(ownCloudGui *gui, QWidget *parent)
110110
QIcon generalIcon = MacStandardIcon::icon(MacStandardIcon::PreferencesGeneral);
111111
GeneralSettings *generalSettings = new GeneralSettings;
112112
addPreferencesPanel(generalIcon, tr("General"), generalSettings);
113+
QObject::connect(generalSettings, &GeneralSettings::showAbout, gui, &ownCloudGui::slotAbout);
113114

114115
QIcon networkIcon = MacStandardIcon::icon(MacStandardIcon::Network);
115116
NetworkSettings *networkSettings = new NetworkSettings;

‎src/libsync/theme.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,11 @@ QString Theme::about() const
356356
return devString;
357357
}
358358

359+
bool Theme::aboutShowCopyright() const
360+
{
361+
return false;
362+
}
363+
359364
#ifndef TOKEN_AUTH_ONLY
360365
QVariant Theme::customMedia(CustomMediaType type)
361366
{

‎src/libsync/theme.h

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ class OWNCLOUDSYNC_EXPORT Theme : public QObject
203203
* About dialog contents
204204
*/
205205
virtual QString about() const;
206+
virtual bool aboutShowCopyright() const;
206207

207208
/**
208209
* Define if the systray icons should be using mono design

0 commit comments

Comments
 (0)
Please sign in to comment.