mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-27 11:49:01 +03:00
- Put pieces properties on the top of torrent properties (uTorrent like)
This commit is contained in:
parent
f9c8b6a66e
commit
6199d6d543
4 changed files with 90 additions and 77 deletions
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>756</width>
|
||||
<width>758</width>
|
||||
<height>292</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -54,6 +54,48 @@
|
|||
</property>
|
||||
<widget class="QWidget" name="page">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="ProgressHLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="downloaded_pieces_lbl">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Downloaded:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="progress_lbl">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>44</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">0.0%</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<property name="spacing">
|
||||
|
@ -257,12 +299,6 @@
|
|||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>115</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
|
@ -450,26 +486,6 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="RealProgressBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Downloaded pieces</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="incrementalDownload">
|
||||
<property name="font">
|
||||
|
|
|
@ -96,8 +96,8 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, TransferListWidget *transfer
|
|||
// Downloaded pieces progress bar
|
||||
progressBar = new RealProgressBar(this);
|
||||
progressBar->setForegroundColor(Qt::blue);
|
||||
progressBarVbox = new QVBoxLayout(RealProgressBox);
|
||||
progressBarVbox->addWidget(progressBar);
|
||||
ProgressHLayout->insertWidget(1, progressBar);
|
||||
//progressBar->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
||||
// Pointers init
|
||||
progressBarUpdater = 0;
|
||||
// Dynamic data refresher
|
||||
|
@ -112,7 +112,6 @@ PropertiesWidget::~PropertiesWidget() {
|
|||
if(progressBarUpdater)
|
||||
delete progressBarUpdater;
|
||||
delete progressBar;
|
||||
delete progressBarVbox;
|
||||
delete PropListModel;
|
||||
// Delete QActions
|
||||
delete actionIgnored;
|
||||
|
@ -246,6 +245,8 @@ void PropertiesWidget::loadDynamicData() {
|
|||
// Downloaded pieces
|
||||
if(progressBarUpdater)
|
||||
progressBarUpdater->refresh();
|
||||
// Progress
|
||||
progress_lbl->setText(QString::number(h.progress(), 'f', 1)+"%");
|
||||
// Files progress
|
||||
std::vector<size_type> fp;
|
||||
h.file_progress(fp);
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
class TransferListWidget;
|
||||
class QTimer;
|
||||
class RealProgressBar;
|
||||
class QVBoxLayout;
|
||||
class RealProgressBarThread;
|
||||
class bittorrent;
|
||||
class TorrentFilesModel;
|
||||
|
@ -59,7 +58,6 @@ private:
|
|||
QTimer *refreshTimer;
|
||||
RealProgressBar *progressBar;
|
||||
RealProgressBarThread *progressBarUpdater;
|
||||
QVBoxLayout *progressBarVbox;
|
||||
bittorrent* BTSession;
|
||||
SlideState state;
|
||||
TorrentFilesModel *PropListModel;
|
||||
|
|
|
@ -33,12 +33,10 @@
|
|||
#include <QtDebug>
|
||||
#include <QResizeEvent>
|
||||
|
||||
RealProgressBar::RealProgressBar(QWidget *parent)
|
||||
: QWidget(parent), array(1)
|
||||
{
|
||||
RealProgressBar::RealProgressBar(QWidget *parent): QWidget(parent), array(1) {
|
||||
background = Qt::white;
|
||||
foreground = Qt::black;
|
||||
setFixedHeight(20);
|
||||
setFixedHeight(18);
|
||||
active = false;
|
||||
array[0] = 0.;
|
||||
drawPixmap();
|
||||
|
@ -106,8 +104,8 @@ QColor RealProgressBar::penColor(qreal x)
|
|||
if(x > 1.)
|
||||
x = 1.;
|
||||
qreal y = 1. - x;
|
||||
// Q_ASSERT(x >= 0.);
|
||||
// Q_ASSERT(y >= 0.);
|
||||
// Q_ASSERT(x >= 0.);
|
||||
// Q_ASSERT(y >= 0.);
|
||||
qreal r1, g1, b1, a1, r2, g2, b2, a2;
|
||||
foreground.getRgbF(&r1, &g1, &b1, &a1);
|
||||
background.getRgbF(&r2, &g2, &b2, &a2);
|
||||
|
|
Loading…
Reference in a new issue