Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match WebUI About page to GUI #10096

Merged
merged 2 commits into from
Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/webui/api/appcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "base/scanfoldersmodel.h"
#include "base/torrentfileguard.h"
#include "base/utils/fs.h"
#include "base/utils/misc.h"
#include "base/utils/net.h"
#include "base/utils/password.h"
#include "../webapplication.h"
Expand All @@ -68,6 +69,18 @@ void AppController::versionAction()
setResult(QBT_VERSION);
}

void AppController::buildInfoAction()
{
const QJsonObject versions = {
Piccirello marked this conversation as resolved.
Show resolved Hide resolved
{"qt", QT_VERSION_STR},
{"libtorrent", Utils::Misc::libtorrentVersionString()},
{"boost", Utils::Misc::boostVersionString()},
{"openssl", Utils::Misc::opensslVersionString()},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, why don't we mention one more direct dependency library, ZLib?
(GUI too)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created issue #10240

{"bitness", (QT_POINTER_SIZE * 8)}
};
setResult(versions);
}

void AppController::shutdownAction()
{
qDebug() << "Shutdown request from Web UI";
Expand Down
1 change: 1 addition & 0 deletions src/webui/api/appcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class AppController : public APIController
private slots:
void webapiVersionAction();
void versionAction();
void buildInfoAction();
void shutdownAction();
void preferencesAction();
void setPreferencesAction();
Expand Down
703 changes: 693 additions & 10 deletions src/webui/www/private/about.html

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions src/webui/www/private/aboutToolbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<div class="toolbarTabs">
<ul id="aboutTabs" class="tab-menu">
<li id="aboutAboutLink" class="selected"><a>QBT_TR(About)QBT_TR[CONTEXT=AboutDialog]</a></li>
<li id="aboutAuthorLink"><a>QBT_TR(Author)QBT_TR[CONTEXT=AboutDialog]</a></li>
<li id="aboutSpecialThanksLink"><a>QBT_TR(Special Thanks)QBT_TR[CONTEXT=AboutDialog]</a></li>
<li id="aboutTranslatorsLink"><a>QBT_TR(Translators)QBT_TR[CONTEXT=AboutDialog]</a></li>
<li id="aboutLicenseLink"><a>QBT_TR(License)QBT_TR[CONTEXT=AboutDialog]</a></li>
<li id="aboutLibrariesLink"><a>QBT_TR(Libraries)QBT_TR[CONTEXT=AboutDialog]</a></li>
</ul>
<div class="clear"></div>
</div>

<script>
'use strict';

MochaUI.initializeTabs('aboutTabs');

$('aboutAboutLink').addEvent('click', function() {
$$('.aboutTabContent').addClass('invisible');
$('aboutAboutContent').removeClass('invisible');
});

$('aboutAuthorLink').addEvent('click', function() {
$$('.aboutTabContent').addClass('invisible');
$('aboutAuthorContent').removeClass('invisible');
});

$('aboutSpecialThanksLink').addEvent('click', function() {
$$('.aboutTabContent').addClass('invisible');
$('aboutSpecialThanksContent').removeClass('invisible');
});

$('aboutTranslatorsLink').addEvent('click', function() {
$$('.aboutTabContent').addClass('invisible');
$('aboutTranslatorsContent').removeClass('invisible');
});

$('aboutLicenseLink').addEvent('click', function() {
$$('.aboutTabContent').addClass('invisible');
$('aboutLicenseContent').removeClass('invisible');
});

$('aboutLibrariesLink').addEvent('click', function() {
$$('.aboutTabContent').addClass('invisible');
$('aboutLibrariesContent').removeClass('invisible');
});
</script>
10 changes: 5 additions & 5 deletions src/webui/www/private/properties_content.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="prop_general">
<div id="prop_general" class="propertiesTabContent">
<fieldset>
<legend><b>QBT_TR(Transfer)QBT_TR[CONTEXT=PropertiesWidget]</b></legend>
<table style="width: 100%">
Expand Down Expand Up @@ -79,7 +79,7 @@
</fieldset>
</div>

<div id="prop_trackers" class="invisible unselectable">
<div id="prop_trackers" class="propertiesTabContent invisible unselectable">
<div id="trackers">
<div id="torrentTrackersTableFixedHeaderDiv" class="dynamicTableFixedHeaderDiv">
<table class="dynamicTable" style="position:relative;">
Expand All @@ -99,7 +99,7 @@
</div>
</div>

<div id="prop_peers" class="invisible unselectable">
<div id="prop_peers" class="propertiesTabContent invisible unselectable">
<div>
<div id="torrentPeersTableFixedHeaderDiv" class="dynamicTableFixedHeaderDiv">
<table class="dynamicTable" style="position:relative;">
Expand All @@ -119,7 +119,7 @@
</div>
</div>

<div id="prop_webseeds" class="invisible unselectable">
<div id="prop_webseeds" class="propertiesTabContent invisible unselectable">
<div id="webseeds">
<table class="dynamicTable" style="width: 100%">
<thead>
Expand All @@ -132,7 +132,7 @@
</div>
</div>

<div id="prop_files" class="invisible unselectable">
<div id="prop_files" class="propertiesTabContent invisible unselectable">
<div id="torrentFiles">
<div id="torrentFilesTableFixedHeaderDiv" class="dynamicTableFixedHeaderDiv">
<table class="dynamicTable" style="position:relative;">
Expand Down
25 changes: 5 additions & 20 deletions src/webui/www/private/scripts/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -721,51 +721,36 @@ window.addEvent('load', function() {
};

$('PropGeneralLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_general').removeClass("invisible");
$('prop_trackers').addClass("invisible");
$('prop_webseeds').addClass("invisible");
$('prop_files').addClass("invisible");
$('prop_peers').addClass("invisible");
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});

$('PropTrackersLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_trackers').removeClass("invisible");
$('prop_general').addClass("invisible");
$('prop_webseeds').addClass("invisible");
$('prop_files').addClass("invisible");
$('prop_peers').addClass("invisible");
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});

$('PropPeersLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_peers').removeClass("invisible");
$('prop_trackers').addClass("invisible");
$('prop_general').addClass("invisible");
$('prop_webseeds').addClass("invisible");
$('prop_files').addClass("invisible");
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});

$('PropWebSeedsLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_webseeds').removeClass("invisible");
$('prop_general').addClass("invisible");
$('prop_trackers').addClass("invisible");
$('prop_files').addClass("invisible");
$('prop_peers').addClass("invisible");
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});

$('PropFilesLink').addEvent('click', function(e) {
$$('.propertiesTabContent').addClass('invisible');
$('prop_files').removeClass("invisible");
$('prop_general').addClass("invisible");
$('prop_trackers').addClass("invisible");
$('prop_webseeds').addClass("invisible");
$('prop_peers').addClass("invisible");
updatePropertiesPanel();
localStorage.setItem('selected_tab', this.id);
});
Expand Down
7 changes: 6 additions & 1 deletion src/webui/www/private/scripts/mocha-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,14 @@ var initializeWindows = function() {
var id = 'aboutpage';
new MochaUI.Window({
id: id,
title: 'QBT_TR(About)QBT_TR[CONTEXT=AboutDlg]',
title: 'QBT_TR(About qBittorrent)QBT_TR[CONTEXT=AboutDialog]',
loadMethod: 'xhr',
contentURL: 'about.html',
require: {
css: ['css/Tabs.css']
},
toolbar: true,
toolbarURL: 'aboutToolbar.html',
padding: 10,
width: loadWindowWidth(id, 550),
height: loadWindowHeight(id, 290),
Expand Down
1 change: 1 addition & 0 deletions src/webui/www/webui.qrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<RCC>
<qresource prefix="/www">
<file>private/about.html</file>
<file>private/aboutToolbar.html</file>
<file>private/addtrackers.html</file>
<file>private/confirmdeletion.html</file>
<file>private/css/Core.css</file>
Expand Down