Browse Source

Add hotkeys and buttons for Top and Bottom priorities

adaptive-webui-19844
Alfredo Monclus 10 years ago
parent
commit
d28ca2eddc
  1. 16
      src/mainwindow.cpp
  2. 26
      src/mainwindow.ui

16
src/mainwindow.cpp

@ -135,11 +135,13 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa @@ -135,11 +135,13 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
actionStatistics->setIcon(IconProvider::instance()->getIcon("view-statistics"));
actionBugReport->setIcon(IconProvider::instance()->getIcon("tools-report-bug"));
actionDecreasePriority->setIcon(IconProvider::instance()->getIcon("go-down"));
actionBottomPriority->setIcon(IconProvider::instance()->getIcon("go-bottom"));
actionDelete->setIcon(IconProvider::instance()->getIcon("list-remove"));
actionDocumentation->setIcon(IconProvider::instance()->getIcon("help-contents"));
actionDonate_money->setIcon(IconProvider::instance()->getIcon("wallet-open"));
actionExit->setIcon(IconProvider::instance()->getIcon("application-exit"));
actionIncreasePriority->setIcon(IconProvider::instance()->getIcon("go-up"));
actionTopPriority->setIcon(IconProvider::instance()->getIcon("go-top"));
actionLock_qBittorrent->setIcon(IconProvider::instance()->getIcon("object-locked"));
actionOptions->setIcon(IconProvider::instance()->getIcon("preferences-system"));
actionPause->setIcon(IconProvider::instance()->getIcon("media-playback-pause"));
@ -208,9 +210,8 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa @@ -208,9 +210,8 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
vboxLayout->addWidget(tabs);
prioSeparator = toolBar->insertSeparator(actionDecreasePriority);
prioSeparatorMenu = menu_Edit->insertSeparator(actionDecreasePriority);
prioSeparator = toolBar->insertSeparator(actionBottomPriority);
prioSeparatorMenu = menu_Edit->insertSeparator(actionTopPriority);
// Transfer list slots
connect(actionStart, SIGNAL(triggered()), transferList, SLOT(startSelectedTorrents()));
@ -218,8 +219,10 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa @@ -218,8 +219,10 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
connect(actionPause, SIGNAL(triggered()), transferList, SLOT(pauseSelectedTorrents()));
connect(actionPause_All, SIGNAL(triggered()), QBtSession::instance(), SLOT(pauseAllTorrents()));
connect(actionDelete, SIGNAL(triggered()), transferList, SLOT(deleteSelectedTorrents()));
connect(actionTopPriority, SIGNAL(triggered()), transferList, SLOT(topPrioSelectedTorrents()));
connect(actionIncreasePriority, SIGNAL(triggered()), transferList, SLOT(increasePrioSelectedTorrents()));
connect(actionDecreasePriority, SIGNAL(triggered()), transferList, SLOT(decreasePrioSelectedTorrents()));
connect(actionBottomPriority, SIGNAL(triggered()), transferList, SLOT(bottomPrioSelectedTorrents()));
connect(actionToggleVisibility, SIGNAL(triggered()), this, SLOT(toggleVisibility()));
connect(actionMinimize, SIGNAL(triggered()), SLOT(minimizeWindow()));
@ -583,8 +586,10 @@ void MainWindow::createKeyboardShortcuts() { @@ -583,8 +586,10 @@ void MainWindow::createKeyboardShortcuts() {
actionStart_All->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Shift+S")));
actionPause->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+P")));
actionPause_All->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Shift+P")));
actionBottomPriority->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Shift+-")));
actionDecreasePriority->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+-")));
actionIncreasePriority->setShortcut(QKeySequence(QString::fromUtf8("Ctrl++")));
actionTopPriority->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Shift++")));
#ifdef Q_OS_MAC
actionMinimize->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+M")));
addAction(actionMinimize);
@ -1093,12 +1098,15 @@ void MainWindow::loadPreferences(bool configure_session) { @@ -1093,12 +1098,15 @@ void MainWindow::loadPreferences(bool configure_session) {
properties->getFilesList()->setAlternatingRowColors(pref->useAlternatingRowColors());
properties->getTrackerList()->setAlternatingRowColors(pref->useAlternatingRowColors());
properties->getPeerList()->setAlternatingRowColors(pref->useAlternatingRowColors());
// Queueing System
if (pref->isQueueingSystemEnabled()) {
if (!actionDecreasePriority->isVisible()) {
transferList->hidePriorityColumn(false);
actionDecreasePriority->setVisible(true);
actionIncreasePriority->setVisible(true);
actionTopPriority->setVisible(true);
actionBottomPriority->setVisible(true);
prioSeparator->setVisible(true);
prioSeparatorMenu->setVisible(true);
}
@ -1107,6 +1115,8 @@ void MainWindow::loadPreferences(bool configure_session) { @@ -1107,6 +1115,8 @@ void MainWindow::loadPreferences(bool configure_session) {
transferList->hidePriorityColumn(true);
actionDecreasePriority->setVisible(false);
actionIncreasePriority->setVisible(false);
actionTopPriority->setVisible(false);
actionBottomPriority->setVisible(false);
prioSeparator->setVisible(false);
prioSeparatorMenu->setVisible(false);
}

26
src/mainwindow.ui

@ -36,14 +36,15 @@ @@ -36,14 +36,15 @@
<property name="title">
<string>&amp;Edit</string>
</property>
<addaction name="separator"/>
<addaction name="actionStart"/>
<addaction name="actionPause"/>
<addaction name="separator"/>
<addaction name="actionDelete"/>
<addaction name="separator"/>
<addaction name="actionDecreasePriority"/>
<!--Dynamic separator from mainwindow.cpp-->
<addaction name="actionTopPriority"/>
<addaction name="actionIncreasePriority"/>
<addaction name="actionDecreasePriority"/>
<addaction name="actionBottomPriority"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
@ -130,8 +131,11 @@ @@ -130,8 +131,11 @@
<addaction name="separator"/>
<addaction name="actionStart"/>
<addaction name="actionPause"/>
<!--Dynamic separator from mainwindow.cpp-->
<addaction name="actionBottomPriority"/>
<addaction name="actionDecreasePriority"/>
<addaction name="actionIncreasePriority"/>
<addaction name="actionTopPriority"/>
<addaction name="separator"/>
<addaction name="actionOptions"/>
<addaction name="actionLock_qBittorrent"/>
@ -224,6 +228,22 @@ @@ -224,6 +228,22 @@
<string>Set global upload limit...</string>
</property>
</action>
<action name="actionBottomPriority">
<property name="text">
<string>Minimum priority</string>
</property>
<property name="visible">
<bool>true</bool>
</property>
</action>
<action name="actionTopPriority">
<property name="text">
<string>Top priority</string>
</property>
<property name="visible">
<bool>true</bool>
</property>
</action>
<action name="actionDecreasePriority">
<property name="text">
<string>Decrease priority</string>

Loading…
Cancel
Save