Browse Source

- Fix completed torrent counting

- Make sure the status bar is displayed before showing the GUI
adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
cedc87a703
  1. 4
      src/GUI.cpp
  2. 5
      src/TransferListWidget.cpp
  3. 4
      src/statusbar.h

4
src/GUI.cpp

@ -196,14 +196,14 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
// Accept drag 'n drops // Accept drag 'n drops
setAcceptDrops(true); setAcceptDrops(true);
createKeyboardShortcuts(); createKeyboardShortcuts();
// Create status bar
status_bar = new StatusBar(QMainWindow::statusBar(), BTSession);
show(); show();
// Load Window state and sizes // Load Window state and sizes
readSettings(); readSettings();
properties->readSettings(); properties->readSettings();
// Create status bar
status_bar = new StatusBar(QMainWindow::statusBar(), BTSession);
if(Preferences::startMinimized()) { if(Preferences::startMinimized()) {
setWindowState(Qt::WindowMinimized); setWindowState(Qt::WindowMinimized);

5
src/TransferListWidget.cpp

@ -239,9 +239,8 @@ int TransferListWidget::updateTorrent(int row) {
return s; return s;
} }
try { try {
if(!h.is_seed()) {
// Queueing code // Queueing code
if(BTSession->isQueueingEnabled()) { if(!h.is_seed() && BTSession->isQueueingEnabled()) {
listModel->setData(listModel->index(row, PRIORITY), QVariant((int)h.queue_position())); listModel->setData(listModel->index(row, PRIORITY), QVariant((int)h.queue_position()));
if(h.is_queued()) { if(h.is_queued()) {
if(h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking) { if(h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking) {
@ -300,8 +299,6 @@ int TransferListWidget::updateTorrent(int row) {
listModel->setData(listModel->index(row, STATUS), STATE_SEEDING); listModel->setData(listModel->index(row, STATUS), STATE_SEEDING);
s = STATE_SEEDING; s = STATE_SEEDING;
} }
}
// Common to both downloads and uploads // Common to both downloads and uploads
listModel->setData(listModel->index(row, PROGRESS), QVariant((double)h.progress())); listModel->setData(listModel->index(row, PROGRESS), QVariant((double)h.progress()));
listModel->setData(listModel->index(row, DLSPEED), QVariant((double)h.download_payload_rate())); listModel->setData(listModel->index(row, DLSPEED), QVariant((double)h.download_payload_rate()));

4
src/statusbar.h

@ -88,7 +88,7 @@ public:
statusSep3->setFixedSize(3, 18); statusSep3->setFixedSize(3, 18);
statusSep3->setFrameStyle(QFrame::VLine); statusSep3->setFrameStyle(QFrame::VLine);
statusSep3->setFrameShadow(QFrame::Raised); statusSep3->setFrameShadow(QFrame::Raised);
layout->addWidget(DHTLbl, 0, 0, Qt::AlignRight); layout->addWidget(DHTLbl, 0, 0, Qt::AlignLeft);
//layout->setColumnStretch(0, 10); //layout->setColumnStretch(0, 10);
layout->addWidget(statusSep1, 0, 1, Qt::AlignRight); layout->addWidget(statusSep1, 0, 1, Qt::AlignRight);
//layout->setColumnStretch(1, 1); //layout->setColumnStretch(1, 1);
@ -96,7 +96,7 @@ public:
//layout->setColumnStretch(2, 1); //layout->setColumnStretch(2, 1);
layout->addWidget(statusSep2, 0, 3, Qt::AlignLeft); layout->addWidget(statusSep2, 0, 3, Qt::AlignLeft);
//layout->setColumnStretch(3, 1); //layout->setColumnStretch(3, 1);
layout->addWidget(dlSpeedLbl, 0, 4); layout->addWidget(dlSpeedLbl, 0, 4, Qt::AlignLeft);
//layout->setColumnStretch(4, 10); //layout->setColumnStretch(4, 10);
layout->addWidget(statusSep3, 0, 5, Qt::AlignLeft); layout->addWidget(statusSep3, 0, 5, Qt::AlignLeft);
//layout->setColumnStretch(5, 10); //layout->setColumnStretch(5, 10);

Loading…
Cancel
Save