Merge pull request #3410 from ngosang/preview

Minor changes in the GUI (Preview file & Forece Resume)
This commit is contained in:
sledgehammer999 2015-07-20 02:46:40 +03:00
commit f21cafb605
8 changed files with 35 additions and 70 deletions

View file

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>414</width> <width>462</width>
<height>256</height> <height>256</height>
</rect> </rect>
</property> </property>
@ -14,34 +14,6 @@
<string>Preview selection</string> <string>Preview selection</string>
</property> </property>
<layout class="QVBoxLayout"> <layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="lbl_title">
<property name="minimumSize">
<size>
<width>0</width>
<height>37</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>37</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>File preview</string>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="maximumSize"> <property name="maximumSize">

View file

@ -621,10 +621,10 @@ void TransferListWidget::displayListMenu(const QPoint&)
// Create actions // Create actions
QAction actionStart(GuiIconProvider::instance()->getIcon("media-playback-start"), tr("Resume", "Resume/start the torrent"), 0); QAction actionStart(GuiIconProvider::instance()->getIcon("media-playback-start"), tr("Resume", "Resume/start the torrent"), 0);
connect(&actionStart, SIGNAL(triggered()), this, SLOT(startSelectedTorrents())); 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); QAction actionPause(GuiIconProvider::instance()->getIcon("media-playback-pause"), tr("Pause", "Pause the torrent"), 0);
connect(&actionPause, SIGNAL(triggered()), this, SLOT(pauseSelectedTorrents())); 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); QAction actionDelete(GuiIconProvider::instance()->getIcon("edit-delete"), tr("Delete", "Delete the torrent"), 0);
connect(&actionDelete, SIGNAL(triggered()), this, SLOT(deleteSelectedTorrents())); connect(&actionDelete, SIGNAL(triggered()), this, SLOT(deleteSelectedTorrents()));
QAction actionPreview_file(GuiIconProvider::instance()->getIcon("view-preview"), tr("Preview file..."), 0); QAction actionPreview_file(GuiIconProvider::instance()->getIcon("view-preview"), tr("Preview file..."), 0);
@ -723,24 +723,18 @@ void TransferListWidget::displayListMenu(const QPoint&)
} }
} }
else { else {
if (forced && !has_start) {
if (!forced) { listMenu.addAction(&actionStart);
if (!has_force) { has_start = true;
listMenu.addAction(&actionForceStart);
has_force = true;
}
} }
else {
if (!has_start) {
listMenu.addAction(&actionStart);
has_start = true;
}
}
if (!has_pause) { if (!has_pause) {
listMenu.addAction(&actionPause); listMenu.addAction(&actionPause);
has_pause = true; has_pause = true;
} }
if (!forced && !has_force) {
listMenu.addAction(&actionForceStart);
has_force = true;
}
} }
if (torrent->hasMetadata() && !has_preview) if (torrent->hasMetadata() && !has_preview)
has_preview = true; has_preview = true;

View file

@ -292,6 +292,7 @@
<file>icons/oxygen/mail-mark-read.png</file> <file>icons/oxygen/mail-mark-read.png</file>
<file>icons/oxygen/media-playback-pause.png</file> <file>icons/oxygen/media-playback-pause.png</file>
<file>icons/oxygen/media-playback-start.png</file> <file>icons/oxygen/media-playback-start.png</file>
<file>icons/oxygen/media-seek-forward.png</file>
<file>icons/oxygen/network-server.png</file> <file>icons/oxygen/network-server.png</file>
<file>icons/oxygen/network-wired.png</file> <file>icons/oxygen/network-wired.png</file>
<file>icons/oxygen/object-locked.png</file> <file>icons/oxygen/object-locked.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -102,8 +102,8 @@
</div> </div>
<ul id="contextmenu"> <ul id="contextmenu">
<li><a href="#Start"><img src="theme/media-playback-start" alt="QBT_TR(Resume)QBT_TR"/> QBT_TR(Resume)QBT_TR</a></li> <li><a href="#Start"><img src="theme/media-playback-start" alt="QBT_TR(Resume)QBT_TR"/> QBT_TR(Resume)QBT_TR</a></li>
<li><a href="#ForceStart"><img src="theme/checked" alt="QBT_TR(Force Resume)QBT_TR"/> QBT_TR(Force Resume)QBT_TR</a></li>
<li><a href="#Pause"><img src="theme/media-playback-pause" alt="QBT_TR(Pause)QBT_TR"/> QBT_TR(Pause)QBT_TR</a></li> <li><a href="#Pause"><img src="theme/media-playback-pause" alt="QBT_TR(Pause)QBT_TR"/> QBT_TR(Pause)QBT_TR</a></li>
<li><a href="#ForceStart"><img src="theme/media-seek-forward" alt="QBT_TR(Force Resume)QBT_TR"/> QBT_TR(Force Resume)QBT_TR</a></li>
<li class="separator"><a href="#Delete"><img src="theme/list-remove" alt="QBT_TR(Delete)QBT_TR"/> QBT_TR(Delete)QBT_TR</a></li> <li class="separator"><a href="#Delete"><img src="theme/list-remove" alt="QBT_TR(Delete)QBT_TR"/> QBT_TR(Delete)QBT_TR</a></li>
<li id="queueingMenuItems" class="separator"> <li id="queueingMenuItems" class="separator">
<a href="#priority" class="arrow-right"><span style="display: inline-block; width:16px"></span> QBT_TR(Priority)QBT_TR</a> <a href="#priority" class="arrow-right"><span style="display: inline-block; width:16px"></span> QBT_TR(Priority)QBT_TR</a>

View file

@ -136,8 +136,9 @@ var ContextMenu = new Class({
all_are_downloaded = true; all_are_downloaded = true;
all_are_paused = true; all_are_paused = true;
there_are_paused = false; there_are_paused = false;
all_are_super_seeding = true;
all_are_force_start = true; all_are_force_start = true;
there_are_force_start = false;
all_are_super_seeding = true;
var h = myTable.selectedIds(); var h = myTable.selectedIds();
h.each(function(item, index){ h.each(function(item, index){
@ -153,19 +154,20 @@ var ContextMenu = new Class({
else else
there_are_f_l_piece_prio = true; there_are_f_l_piece_prio = true;
if (data['force_start'] != true)
all_are_force_start = false;
if (data['progress'] != 1.0) // not downloaded if (data['progress'] != 1.0) // not downloaded
all_are_downloaded = false; all_are_downloaded = false;
else if (data['super_seeding'] != true) else if (data['super_seeding'] != true)
all_are_super_seeding = false; all_are_super_seeding = false;
state = data['state']; if (data['state'] != 'pausedUP' && data['state'] != 'pausedDL')
if ((state != 'pausedUP') && (state != 'pausedDL'))
all_are_paused = false; all_are_paused = false;
else else
there_are_paused = true; there_are_paused = true;
if (data['force_start'] != true)
all_are_force_start = false;
else
there_are_force_start = true;
}); });
show_seq_dl = 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) if (!all_are_f_l_piece_prio && there_are_f_l_piece_prio)
show_f_l_piece_prio = false; show_f_l_piece_prio = false;
this.setItemChecked('ForceStart', all_are_force_start);
if (all_are_downloaded) { if (all_are_downloaded) {
this.hideItem('SequentialDownload'); this.hideItem('SequentialDownload');
this.hideItem('FirstLastPiecePrio'); this.hideItem('FirstLastPiecePrio');
@ -207,18 +207,16 @@ var ContextMenu = new Class({
this.hideItem('SuperSeeding'); 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'); this.hideItem('Pause');
} else { else if (all_are_force_start)
if (there_are_paused) { this.hideItem('ForceStart');
this.showItem('Start'); else if (!there_are_paused && !there_are_force_start)
this.showItem('Pause'); this.hideItem('Start');
} else {
this.hideItem('Start');
this.showItem('Pause');
}
}
}, },
//show menu //show menu
@ -283,4 +281,4 @@ var ContextMenu = new Class({
return this; return this;
} }
}); });

View file

@ -181,14 +181,14 @@ initializeWindows = function() {
} }
}; };
setForceStartFN = function(val) { setForceStartFN = function() {
var h = myTable.selectedIds(); var h = myTable.selectedIds();
if (h.length) { if (h.length) {
new Request({ new Request({
url: 'command/setForceStart', url: 'command/setForceStart',
method: 'post', method: 'post',
data: { data: {
value: val, value: 'true',
hashes: h.join("|") hashes: h.join("|")
} }
}).send(); }).send();

View file

@ -25,6 +25,9 @@
Pause : function (element, ref) { Pause : function (element, ref) {
pauseFN(); pauseFN();
}, },
ForceStart : function (element, ref) {
setForceStartFN();
},
prioTop : function (element, ref) { prioTop : function (element, ref) {
setPriorityFN('topPrio'); setPriorityFN('topPrio');
}, },
@ -54,9 +57,6 @@
}, },
SuperSeeding : function (element, ref) { SuperSeeding : function (element, ref) {
setSuperSeedingFN(!ref.getItemChecked('SuperSeeding')); setSuperSeedingFN(!ref.getItemChecked('SuperSeeding'));
},
ForceStart : function (element, ref) {
setForceStartFN(!ref.getItemChecked('ForceStart'));
} }
}, },
offsets : { offsets : {