From 808f07250ed94a96574bf261709cac0a3b4f1833 Mon Sep 17 00:00:00 2001 From: ngosang Date: Tue, 14 Jul 2015 00:32:51 +0200 Subject: [PATCH 1/3] Minor changes in Preview File dialog --- src/gui/preview.ui | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/gui/preview.ui b/src/gui/preview.ui index 84e5fc248..66a2e0a72 100644 --- a/src/gui/preview.ui +++ b/src/gui/preview.ui @@ -6,7 +6,7 @@ 0 0 - 414 + 462 256 @@ -14,34 +14,6 @@ Preview selection - - - - - 0 - 37 - - - - - 16777215 - 37 - - - - - 75 - true - - - - File preview - - - Qt::AlignHCenter|Qt::AlignTop - - - From 9dbb2720b04fe7894676dde089382d331be66606 Mon Sep 17 00:00:00 2001 From: ngosang Date: Sun, 12 Jul 2015 16:40:25 +0200 Subject: [PATCH 2/3] Changes in Force Resume icon and menu order --- src/gui/transferlistwidget.cpp | 24 +++++++++--------------- src/icons.qrc | 1 + src/icons/oxygen/media-seek-forward.png | Bin 0 -> 1220 bytes 3 files changed, 10 insertions(+), 15 deletions(-) create mode 100644 src/icons/oxygen/media-seek-forward.png diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index eaec0487f..8973d6141 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -621,10 +621,10 @@ void TransferListWidget::displayListMenu(const QPoint&) // Create actions QAction actionStart(GuiIconProvider::instance()->getIcon("media-playback-start"), tr("Resume", "Resume/start the torrent"), 0); connect(&actionStart, SIGNAL(triggered()), this, SLOT(startSelectedTorrents())); - QAction actionForceStart(tr("Force Resume", "Force Resume/start the torrent"), 0); - connect(&actionForceStart, SIGNAL(triggered()), this, SLOT(forceStartSelectedTorrents())); QAction actionPause(GuiIconProvider::instance()->getIcon("media-playback-pause"), tr("Pause", "Pause the torrent"), 0); connect(&actionPause, SIGNAL(triggered()), this, SLOT(pauseSelectedTorrents())); + QAction actionForceStart(GuiIconProvider::instance()->getIcon("media-seek-forward"), tr("Force Resume", "Force Resume/start the torrent"), 0); + connect(&actionForceStart, SIGNAL(triggered()), this, SLOT(forceStartSelectedTorrents())); QAction actionDelete(GuiIconProvider::instance()->getIcon("edit-delete"), tr("Delete", "Delete the torrent"), 0); connect(&actionDelete, SIGNAL(triggered()), this, SLOT(deleteSelectedTorrents())); QAction actionPreview_file(GuiIconProvider::instance()->getIcon("view-preview"), tr("Preview file..."), 0); @@ -723,24 +723,18 @@ void TransferListWidget::displayListMenu(const QPoint&) } } else { - - if (!forced) { - if (!has_force) { - listMenu.addAction(&actionForceStart); - has_force = true; - } + if (forced && !has_start) { + listMenu.addAction(&actionStart); + has_start = true; } - else { - if (!has_start) { - listMenu.addAction(&actionStart); - has_start = true; - } - } - if (!has_pause) { listMenu.addAction(&actionPause); has_pause = true; } + if (!forced && !has_force) { + listMenu.addAction(&actionForceStart); + has_force = true; + } } if (torrent->hasMetadata() && !has_preview) has_preview = true; diff --git a/src/icons.qrc b/src/icons.qrc index 860c6653d..cb9afd6ce 100644 --- a/src/icons.qrc +++ b/src/icons.qrc @@ -292,6 +292,7 @@ icons/oxygen/mail-mark-read.png icons/oxygen/media-playback-pause.png icons/oxygen/media-playback-start.png + icons/oxygen/media-seek-forward.png icons/oxygen/network-server.png icons/oxygen/network-wired.png icons/oxygen/object-locked.png diff --git a/src/icons/oxygen/media-seek-forward.png b/src/icons/oxygen/media-seek-forward.png new file mode 100644 index 0000000000000000000000000000000000000000..51881ea8dfbabd8bc7c015a28636d3259d3e0272 GIT binary patch literal 1220 zcmV;#1UvhQP)kdg00002b3#c}2nbc| zMg#x=010qNS#tmY19kua19ky@)q>0b000?uMObuGZ)S9NVRB^vcXxL#X>MzCV_|S* zE^l&Yo9;Xs000C-NklxciUL8 zXrPv^rKf(j0gwW)_DEbRD~*Y%L-zZKfvyg+Mq|gjt{WKYscxqu>+b<6z)$wZ^|CUx zX^+S3vrAu+B!nz$ZQF3k2Ocm`-A;#oz5yxl!$Djvt5e$!I%KZ}9kp7L1d3v=F|+Ay z*DV^TuBFF*Ii-TUR#s>3IcU{GmJIau_4M@&^bPbaShQ%jM}5{kGi5ceK?*+@#jSR@ zW!YEkGtkvht0W0;dQ=FZHP_g&>3N%$bSCN3zZzHM)9r9->aZ09JzX8OTBTBX%T={n zt*ftZ!IGy(n)-u&d12n)^mzyE*3;4Tu8&I+c*Eb#?Uy7;0t5U*SK9yQUsvVv zyxizIV2@g@mb~L{0CsG<;15VDwXU9?&*^I9lu_1tKv$9l zlBsPI7bRabGqt7F_kymcCACWJV_I1nb;_v7mUL7q3B2vD@Ss<8H8$Nb_kfNIdY+V2 zDtlx_8FfMkBnb(8=s)h-XX>7RdEfhbdRhe}BuNONig8G`gg}5w$Aa3|9FtVKYDse3 zmkThzELqg^Eyoc;QQVP)GOpq#wSSw-iY$ahyZp$v zLC=C^OTOpp2q7!7n`*?(Dqan>TV}FW7Q(XcI0;y=XxS+zK?qqZyP+21)hb?hzqaGL ziAJkcobXiuLrcEvBnU;T)p*N9&HZ@2dT|!#Dt(u2Xf)=sBLcwCH+=(yBAaXc&nx;W zaqh)gMVyIAjq^55H5#p~2=Hac5sIwUXiWV^sKq4CQ1Q~(*;?O!UA1M$%*kike3;rrOtjMyCS}jRJ$g);r>asstP;<>XqyW$Ejq9<} znD~U}tmx_Ks8paRT8%rNcgs*ux}6T4-+&Z=XCH}6vC^6;j{1V3TCI|VBFoWeSFM&N&ZhMXQvgx`0FIC1v=gx$0)d1iN%x&gXI>ry04V?faJ(N+IGPT`$Oz*! ij+ Date: Tue, 14 Jul 2015 03:06:34 +0200 Subject: [PATCH 3/3] [Web UI] Changes in Force Resume icon and menu order --- src/webui/www/private/index.html | 2 +- src/webui/www/public/scripts/contextmenu.js | 38 ++++++++++----------- src/webui/www/public/scripts/mocha-init.js | 4 +-- src/webui/www/public/transferlist.html | 6 ++-- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/webui/www/private/index.html b/src/webui/www/private/index.html index 0459315e5..defb810ea 100644 --- a/src/webui/www/private/index.html +++ b/src/webui/www/private/index.html @@ -102,8 +102,8 @@
  • QBT_TR(Resume)QBT_TR QBT_TR(Resume)QBT_TR
  • -
  • QBT_TR(Force Resume)QBT_TR QBT_TR(Force Resume)QBT_TR
  • QBT_TR(Pause)QBT_TR QBT_TR(Pause)QBT_TR
  • +
  • QBT_TR(Force Resume)QBT_TR QBT_TR(Force Resume)QBT_TR
  • QBT_TR(Delete)QBT_TR QBT_TR(Delete)QBT_TR
  • QBT_TR(Priority)QBT_TR diff --git a/src/webui/www/public/scripts/contextmenu.js b/src/webui/www/public/scripts/contextmenu.js index 0382a3aa6..2387f340f 100644 --- a/src/webui/www/public/scripts/contextmenu.js +++ b/src/webui/www/public/scripts/contextmenu.js @@ -136,8 +136,9 @@ var ContextMenu = new Class({ all_are_downloaded = true; all_are_paused = true; there_are_paused = false; - all_are_super_seeding = true; all_are_force_start = true; + there_are_force_start = false; + all_are_super_seeding = true; var h = myTable.selectedIds(); h.each(function(item, index){ @@ -153,19 +154,20 @@ var ContextMenu = new Class({ else there_are_f_l_piece_prio = true; - if (data['force_start'] != true) - all_are_force_start = false; - if (data['progress'] != 1.0) // not downloaded all_are_downloaded = false; else if (data['super_seeding'] != true) all_are_super_seeding = false; - state = data['state']; - if ((state != 'pausedUP') && (state != 'pausedDL')) + if (data['state'] != 'pausedUP' && data['state'] != 'pausedDL') all_are_paused = false; else there_are_paused = true; + + if (data['force_start'] != true) + all_are_force_start = false; + else + there_are_force_start = true; }); show_seq_dl = true; @@ -178,8 +180,6 @@ var ContextMenu = new Class({ if (!all_are_f_l_piece_prio && there_are_f_l_piece_prio) show_f_l_piece_prio = false; - this.setItemChecked('ForceStart', all_are_force_start); - if (all_are_downloaded) { this.hideItem('SequentialDownload'); this.hideItem('FirstLastPiecePrio'); @@ -207,18 +207,16 @@ var ContextMenu = new Class({ this.hideItem('SuperSeeding'); } - if (all_are_paused) { - this.showItem('Start'); + this.showItem('Start'); + this.showItem('Pause'); + this.showItem('ForceStart'); + if (all_are_paused) this.hideItem('Pause'); - } else { - if (there_are_paused) { - this.showItem('Start'); - this.showItem('Pause'); - } else { - this.hideItem('Start'); - this.showItem('Pause'); - } - } + else if (all_are_force_start) + this.hideItem('ForceStart'); + else if (!there_are_paused && !there_are_force_start) + this.hideItem('Start'); + }, //show menu @@ -283,4 +281,4 @@ var ContextMenu = new Class({ return this; } -}); \ No newline at end of file +}); diff --git a/src/webui/www/public/scripts/mocha-init.js b/src/webui/www/public/scripts/mocha-init.js index f1205049f..1fdd5e924 100644 --- a/src/webui/www/public/scripts/mocha-init.js +++ b/src/webui/www/public/scripts/mocha-init.js @@ -181,14 +181,14 @@ initializeWindows = function() { } }; - setForceStartFN = function(val) { + setForceStartFN = function() { var h = myTable.selectedIds(); if (h.length) { new Request({ url: 'command/setForceStart', method: 'post', data: { - value: val, + value: 'true', hashes: h.join("|") } }).send(); diff --git a/src/webui/www/public/transferlist.html b/src/webui/www/public/transferlist.html index 1f0ad7e87..54c8105e3 100644 --- a/src/webui/www/public/transferlist.html +++ b/src/webui/www/public/transferlist.html @@ -25,6 +25,9 @@ Pause : function (element, ref) { pauseFN(); }, + ForceStart : function (element, ref) { + setForceStartFN(); + }, prioTop : function (element, ref) { setPriorityFN('topPrio'); }, @@ -54,9 +57,6 @@ }, SuperSeeding : function (element, ref) { setSuperSeedingFN(!ref.getItemChecked('SuperSeeding')); - }, - ForceStart : function (element, ref) { - setForceStartFN(!ref.getItemChecked('ForceStart')); } }, offsets : {