Compare commits

...

2 Commits

Author SHA1 Message Date
Vladimir Golovnev
efedbcb407 Allow to customize ProgressBar color
PR #22928.
2025-07-01 10:28:26 +03:00
Chocobo1
55de9b07d2 Add AppStream metadata for qbt-nox
Also trim redundant trailing path separators.
Ref: https://www.freedesktop.org/software/appstream/docs/sect-Metadata-ConsoleApplication.html

PR #22941.
2025-07-01 14:47:14 +08:00
7 changed files with 114 additions and 7 deletions

View File

@@ -34,12 +34,12 @@ endforeach()
if (GUI)
install(FILES org.qbittorrent.qBittorrent.desktop
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications/
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications
COMPONENT data
)
install(FILES org.qbittorrent.qBittorrent.metainfo.xml
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo/
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo
COMPONENT data
)
@@ -55,4 +55,9 @@ if (GUI)
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status
COMPONENT data
)
else()
install(FILES org.qbittorrent.qBittorrent-nox.metainfo.xml
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo
COMPONENT data
)
endif()

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 sledgehammer999 <sledgehammer999@qbittorrent.org> -->
<component type="console-application">
<id>org.qbittorrent.qBittorrent-nox</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later and OpenSSL</project_license>
<name>qBittorrent-nox</name>
<summary>An open-source Bittorrent client (nox version)</summary>
<description>
<p>
The qBittorrent project aims to provide an open-source software alternative to µTorrent.
Additionally, qBittorrent runs and provides the same features on all major platforms (FreeBSD, Linux, macOS, OS/2, Windows).
qBittorrent is based on the Qt toolkit and libtorrent-rasterbar library.
</p>
<ul>
<li>Polished µTorrent-like User Interface</li>
<li>Well-integrated and extensible Search Engine</li>
<li>RSS feed support with advanced download filters (incl. regex)</li>
<li>Many Bittorrent extensions supported</li>
<li>Remote control through Web user interface, written with AJAX</li>
<li>Sequential downloading (Download in order)</li>
<li>Advanced control over torrents, trackers and peers</li>
<li>Bandwidth scheduler</li>
<li>Torrent creation tool</li>
<li>IP Filtering (eMule &amp; PeerGuardian format compatible)</li>
<li>IPv6 compliant</li>
<li>UPnP / NAT-PMP port forwarding support</li>
<li>Available on all platforms: Windows, Linux, macOS, FreeBSD, OS/2</li>
<li>Available in ~70 languages</li>
</ul>
</description>
<provides>
<binary>qbittorrent-nox</binary>
</provides>
<screenshots>
<screenshot type="default">
<caption>Running headless (nox) version</caption>
<image>https://raw.githubusercontent.com/qbittorrent/qBittorrent-website/43fcf4550f567c38fb879b984922b659e90982cc/src/img/screenshots/linux/5.webp</image>
</screenshot>
</screenshots>
<update_contact>sledgehammer999@qbittorrent.org</update_contact>
<developer id="org.qbittorrent">
<name>The qBittorrent Project</name>
</developer>
<url type="homepage">https://www.qbittorrent.org/</url>
<url type="bugtracker">https://bugs.qbittorrent.org/</url>
<url type="faq">https://wiki.qbittorrent.org/Frequently-Asked-Questions</url>
<url type="help">https://forum.qbittorrent.org/</url>
<url type="donation">https://www.qbittorrent.org/donate</url>
<url type="translate">https://wiki.qbittorrent.org/How-to-translate-qBittorrent</url>
<url type="vcs-browser">https://github.com/qbittorrent/qBittorrent</url>
<url type="contribute">https://github.com/qbittorrent/qBittorrent/blob/master/CONTRIBUTING.md</url>
<content_rating type="oars-1.1"/>
<releases>
<release version="5.2.0~alpha1" date="2025-02-11"/>
</releases>
</component>

View File

@@ -1,5 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2025 Vladimir Golovnev <glassez@yandex.ru>
* Copyright (C) 2020 Prince Gupta <jagannatharjun11@gmail.com>
*
* This program is free software; you can redistribute it and/or
@@ -38,14 +39,19 @@
#endif
#include "base/global.h"
#include "gui/uithememanager.h"
ProgressBarPainter::ProgressBarPainter()
ProgressBarPainter::ProgressBarPainter(QObject *parent)
: QObject(parent)
{
#if (defined(Q_OS_WIN) || defined(Q_OS_MACOS))
auto *fusionStyle = new QProxyStyle {u"fusion"_s};
auto *fusionStyle = new QProxyStyle(u"fusion"_s);
fusionStyle->setParent(&m_dummyProgressBar);
m_dummyProgressBar.setStyle(fusionStyle);
#endif
applyUITheme();
connect(UIThemeManager::instance(), &UIThemeManager::themeChanged, this, &ProgressBarPainter::applyUITheme);
}
void ProgressBarPainter::paint(QPainter *painter, const QStyleOptionViewItem &option, const QString &text, const int progress) const
@@ -66,9 +72,17 @@ void ProgressBarPainter::paint(QPainter *painter, const QStyleOptionViewItem &op
const bool isEnabled = option.state.testFlag(QStyle::State_Enabled);
styleOption.palette.setCurrentColorGroup(isEnabled ? QPalette::Active : QPalette::Disabled);
if (m_chunkColor.isValid())
styleOption.palette.setColor(QPalette::Highlight, m_chunkColor);
painter->save();
const QStyle *style = m_dummyProgressBar.style();
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &option, painter, option.widget);
style->drawControl(QStyle::CE_ProgressBar, &styleOption, painter, &m_dummyProgressBar);
painter->restore();
}
void ProgressBarPainter::applyUITheme()
{
m_chunkColor = UIThemeManager::instance()->getColor(u"ProgressBar"_s);
}

View File

@@ -1,5 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2025 Vladimir Golovnev <glassez@yandex.ru>
* Copyright (C) 2020 Prince Gupta <jagannatharjun11@gmail.com>
*
* This program is free software; you can redistribute it and/or
@@ -28,18 +29,26 @@
#pragma once
#include <QColor>
#include <QObject>
#include <QProgressBar>
class QStyleOptionViewItem;
class ProgressBarPainter
class ProgressBarPainter : public QObject
{
Q_OBJECT
Q_DISABLE_COPY_MOVE(ProgressBarPainter)
public:
ProgressBarPainter();
explicit ProgressBarPainter(QObject *parent = nullptr);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QString &text, int progress) const;
private:
void applyUITheme();
QColor m_chunkColor;
// for painting progressbar with stylesheet option, a dummy progress bar is required
QProgressBar m_dummyProgressBar;
};

View File

@@ -85,7 +85,9 @@ inline QHash<QString, UIThemeColor> defaultUIThemeColors()
{u"PiecesBar.Border"_s, {{}, {}}},
{u"PiecesBar.Piece"_s, {{}, {}}},
{u"PiecesBar.PartialPiece"_s, {{}, {}}},
{u"PiecesBar.MissingPiece"_s, {{}, {}}}
{u"PiecesBar.MissingPiece"_s, {{}, {}}},
{u"ProgressBar"_s, {{}, {}}}
};
}

View File

@@ -28,6 +28,7 @@
#include "uithemedialog.h"
#include <QtSystemDetection>
#include <QColor>
#include <QColorDialog>
#include <QFileDialog>
@@ -233,6 +234,10 @@ UIThemeDialog::UIThemeDialog(QWidget *parent)
{
m_ui->setupUi(this);
#if (defined(Q_OS_WIN) || defined(Q_OS_MACOS))
m_ui->colorsWarningLabel->hide();
#endif
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);

View File

@@ -72,6 +72,21 @@
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="colorsWarningLabel">
<property name="text">
<string>Note that some custom colors may not be applied in some desktop environments.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="colorsLayout" columnstretch="1,0,0,0,0" columnminimumwidth="0,15,0,15,0">
<item row="0" column="0">