mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
- Simplified keyboard shortcuts code
This commit is contained in:
parent
22a80fe1c3
commit
e079c87f5c
44
src/GUI.cpp
44
src/GUI.cpp
@ -222,21 +222,10 @@ GUI::~GUI(){
|
|||||||
delete previewProcess;
|
delete previewProcess;
|
||||||
delete connecStatusLblIcon;
|
delete connecStatusLblIcon;
|
||||||
// Keyboard shortcuts
|
// Keyboard shortcuts
|
||||||
delete createShortcut;
|
|
||||||
delete openShortcut;
|
|
||||||
delete quitShortcut;
|
|
||||||
delete switchSearchShortcut;
|
delete switchSearchShortcut;
|
||||||
delete switchDownShortcut;
|
delete switchDownShortcut;
|
||||||
delete switchUpShortcut;
|
delete switchUpShortcut;
|
||||||
delete switchRSSShortcut;
|
delete switchRSSShortcut;
|
||||||
delete propertiesShortcut;
|
|
||||||
delete optionsShortcut;
|
|
||||||
delete delShortcut;
|
|
||||||
delete delPermShortcut;
|
|
||||||
delete startShortcut;
|
|
||||||
delete startAllShortcut;
|
|
||||||
delete pauseShortcut;
|
|
||||||
delete pauseAllPermShortcut;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::on_actionWebsite_triggered(){
|
void GUI::on_actionWebsite_triggered(){
|
||||||
@ -260,12 +249,9 @@ void GUI::writeSettings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GUI::createKeyboardShortcuts(){
|
void GUI::createKeyboardShortcuts(){
|
||||||
createShortcut = new QShortcut(QKeySequence("Ctrl+N"), this);
|
actionCreate_torrent->setShortcut("Ctrl+N");
|
||||||
connect(createShortcut, SIGNAL(activated()), this, SLOT(on_actionCreate_torrent_triggered()));
|
actionOpen->setShortcut("Ctrl+O");
|
||||||
openShortcut = new QShortcut(QKeySequence("Ctrl+O"), this);
|
actionExit->setShortcut("Ctrl+Q");
|
||||||
connect(openShortcut, SIGNAL(activated()), this, SLOT(on_actionOpen_triggered()));
|
|
||||||
quitShortcut = new QShortcut(QKeySequence("Ctrl+Q"), this);
|
|
||||||
connect(quitShortcut, SIGNAL(activated()), this, SLOT(on_actionExit_triggered()));
|
|
||||||
switchDownShortcut = new QShortcut(QKeySequence(tr("Alt+1", "shortcut to switch to first tab")), this);
|
switchDownShortcut = new QShortcut(QKeySequence(tr("Alt+1", "shortcut to switch to first tab")), this);
|
||||||
connect(switchDownShortcut, SIGNAL(activated()), this, SLOT(displayDownTab()));
|
connect(switchDownShortcut, SIGNAL(activated()), this, SLOT(displayDownTab()));
|
||||||
switchUpShortcut = new QShortcut(QKeySequence(tr("Alt+2", "shortcut to switch to second tab")), this);
|
switchUpShortcut = new QShortcut(QKeySequence(tr("Alt+2", "shortcut to switch to second tab")), this);
|
||||||
@ -274,22 +260,14 @@ void GUI::createKeyboardShortcuts(){
|
|||||||
connect(switchSearchShortcut, SIGNAL(activated()), this, SLOT(displaySearchTab()));
|
connect(switchSearchShortcut, SIGNAL(activated()), this, SLOT(displaySearchTab()));
|
||||||
switchRSSShortcut = new QShortcut(QKeySequence(tr("Alt+4", "shortcut to switch to fourth tab")), this);
|
switchRSSShortcut = new QShortcut(QKeySequence(tr("Alt+4", "shortcut to switch to fourth tab")), this);
|
||||||
connect(switchRSSShortcut, SIGNAL(activated()), this, SLOT(displayRSSTab()));
|
connect(switchRSSShortcut, SIGNAL(activated()), this, SLOT(displayRSSTab()));
|
||||||
propertiesShortcut = new QShortcut(QKeySequence("Alt+P"), this);
|
actionTorrent_Properties->setShortcut("Alt+P");
|
||||||
connect(propertiesShortcut, SIGNAL(activated()), this, SLOT(on_actionTorrent_Properties_triggered()));
|
actionOptions->setShortcut("Alt+O");
|
||||||
optionsShortcut = new QShortcut(QKeySequence("Alt+O"), this);
|
actionDelete->setShortcut("Del");
|
||||||
connect(optionsShortcut, SIGNAL(activated()), this, SLOT(on_actionOptions_triggered()));
|
actionDelete_Permanently->setShortcut("Shift+Del");
|
||||||
delShortcut = new QShortcut(QKeySequence("Del"), this);
|
actionStart->setShortcut("Ctrl+S");
|
||||||
connect(delShortcut, SIGNAL(activated()), this, SLOT(on_actionDelete_triggered()));
|
actionStart_All->setShortcut("Ctrl+Shift+S");
|
||||||
delPermShortcut = new QShortcut(QKeySequence("Shift+Del"), this);
|
actionPause->setShortcut("Ctrl+P")
|
||||||
connect(delPermShortcut, SIGNAL(activated()), this, SLOT(on_actionDelete_Permanently_triggered()));
|
actionPause_All->setShortcut("Ctrl+Shift+P");
|
||||||
startShortcut = new QShortcut(QKeySequence("Ctrl+S"), this);
|
|
||||||
connect(startShortcut, SIGNAL(activated()), this, SLOT(on_actionStart_triggered()));
|
|
||||||
startAllShortcut = new QShortcut(QKeySequence("Ctrl+Shift+S"), this);
|
|
||||||
connect(startAllShortcut, SIGNAL(activated()), this, SLOT(on_actionStart_All_triggered()));
|
|
||||||
pauseShortcut = new QShortcut(QKeySequence("Ctrl+P"), this);
|
|
||||||
connect(pauseShortcut, SIGNAL(activated()), this, SLOT(on_actionPause_triggered()));
|
|
||||||
pauseAllPermShortcut = new QShortcut(QKeySequence("Ctrl+Shift+P"), this);
|
|
||||||
connect(pauseAllPermShortcut, SIGNAL(activated()), this, SLOT(on_actionPause_All_triggered()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keyboard shortcuts slots
|
// Keyboard shortcuts slots
|
||||||
|
Loading…
Reference in New Issue
Block a user