Browse Source

Don't show a popup menu when no torrent is selected.

adaptive-webui-19844
sledgehammer999 11 years ago
parent
commit
bf291dbfb1
  1. 4
      src/transferlistwidget.cpp

4
src/transferlistwidget.cpp

@ -695,6 +695,9 @@ void TransferListWidget::removeLabelFromRows(QString label) {
} }
void TransferListWidget::displayListMenu(const QPoint&) { void TransferListWidget::displayListMenu(const QPoint&) {
QModelIndexList selectedIndexes = selectionModel()->selectedRows();
if (selectedIndexes.size() == 0)
return;
// Create actions // Create actions
QAction actionStart(IconProvider::instance()->getIcon("media-playback-start"), tr("Resume", "Resume/start the torrent"), 0); QAction actionStart(IconProvider::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()));
@ -740,7 +743,6 @@ void TransferListWidget::displayListMenu(const QPoint&) {
// End of actions // End of actions
QMenu listMenu(this); QMenu listMenu(this);
// Enable/disable pause/start action given the DL state // Enable/disable pause/start action given the DL state
QModelIndexList selectedIndexes = selectionModel()->selectedRows();
bool has_pause = false, has_start = false, has_preview = false; bool has_pause = false, has_start = false, has_preview = false;
bool all_same_super_seeding = true; bool all_same_super_seeding = true;
bool super_seeding_mode = false; bool super_seeding_mode = false;

Loading…
Cancel
Save