Browse Source

- Put pieces properties on the top of torrent properties (uTorrent like)

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
6199d6d543
  1. 70
      src/propertiesWidget.ui
  2. 7
      src/propertieswidget.cpp
  3. 2
      src/propertieswidget.h
  4. 6
      src/realprogressbar.cpp

70
src/propertiesWidget.ui

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>756</width> <width>758</width>
<height>292</height> <height>292</height>
</rect> </rect>
</property> </property>
@ -54,6 +54,48 @@
</property> </property>
<widget class="QWidget" name="page"> <widget class="QWidget" name="page">
<layout class="QVBoxLayout" name="verticalLayout_4"> <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> <item>
<layout class="QHBoxLayout" name="horizontalLayout_5"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="spacing"> <property name="spacing">
@ -257,12 +299,6 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize">
<size>
<width>0</width>
<height>115</height>
</size>
</property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>8</pointsize> <pointsize>8</pointsize>
@ -450,26 +486,6 @@
</item> </item>
</layout> </layout>
</item> </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> <item>
<widget class="QCheckBox" name="incrementalDownload"> <widget class="QCheckBox" name="incrementalDownload">
<property name="font"> <property name="font">

7
src/propertieswidget.cpp

@ -96,8 +96,8 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, TransferListWidget *transfer
// Downloaded pieces progress bar // Downloaded pieces progress bar
progressBar = new RealProgressBar(this); progressBar = new RealProgressBar(this);
progressBar->setForegroundColor(Qt::blue); progressBar->setForegroundColor(Qt::blue);
progressBarVbox = new QVBoxLayout(RealProgressBox); ProgressHLayout->insertWidget(1, progressBar);
progressBarVbox->addWidget(progressBar); //progressBar->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
// Pointers init // Pointers init
progressBarUpdater = 0; progressBarUpdater = 0;
// Dynamic data refresher // Dynamic data refresher
@ -112,7 +112,6 @@ PropertiesWidget::~PropertiesWidget() {
if(progressBarUpdater) if(progressBarUpdater)
delete progressBarUpdater; delete progressBarUpdater;
delete progressBar; delete progressBar;
delete progressBarVbox;
delete PropListModel; delete PropListModel;
// Delete QActions // Delete QActions
delete actionIgnored; delete actionIgnored;
@ -246,6 +245,8 @@ void PropertiesWidget::loadDynamicData() {
// Downloaded pieces // Downloaded pieces
if(progressBarUpdater) if(progressBarUpdater)
progressBarUpdater->refresh(); progressBarUpdater->refresh();
// Progress
progress_lbl->setText(QString::number(h.progress(), 'f', 1)+"%");
// Files progress // Files progress
std::vector<size_type> fp; std::vector<size_type> fp;
h.file_progress(fp); h.file_progress(fp);

2
src/propertieswidget.h

@ -39,7 +39,6 @@
class TransferListWidget; class TransferListWidget;
class QTimer; class QTimer;
class RealProgressBar; class RealProgressBar;
class QVBoxLayout;
class RealProgressBarThread; class RealProgressBarThread;
class bittorrent; class bittorrent;
class TorrentFilesModel; class TorrentFilesModel;
@ -59,7 +58,6 @@ private:
QTimer *refreshTimer; QTimer *refreshTimer;
RealProgressBar *progressBar; RealProgressBar *progressBar;
RealProgressBarThread *progressBarUpdater; RealProgressBarThread *progressBarUpdater;
QVBoxLayout *progressBarVbox;
bittorrent* BTSession; bittorrent* BTSession;
SlideState state; SlideState state;
TorrentFilesModel *PropListModel; TorrentFilesModel *PropListModel;

6
src/realprogressbar.cpp

@ -33,12 +33,10 @@
#include <QtDebug> #include <QtDebug>
#include <QResizeEvent> #include <QResizeEvent>
RealProgressBar::RealProgressBar(QWidget *parent) RealProgressBar::RealProgressBar(QWidget *parent): QWidget(parent), array(1) {
: QWidget(parent), array(1)
{
background = Qt::white; background = Qt::white;
foreground = Qt::black; foreground = Qt::black;
setFixedHeight(20); setFixedHeight(18);
active = false; active = false;
array[0] = 0.; array[0] = 0.;
drawPixmap(); drawPixmap();

Loading…
Cancel
Save