Browse Source

change all existing shortcuts to use Qt::Keys

adaptive-webui-19844
thalieht 8 years ago
parent
commit
2bb2d3fc89
  1. 2
      src/gui/addnewtorrentdialog.cpp
  2. 32
      src/gui/mainwindow.cpp
  3. 6
      src/gui/properties/propertieswidget.cpp
  4. 12
      src/gui/properties/proptabbar.cpp
  5. 4
      src/gui/properties/trackerlist.cpp
  6. 2
      src/gui/rss/automatedrssdownloader.cpp
  7. 2
      src/gui/rss/rss_imp.cpp
  8. 8
      src/gui/transferlistwidget.cpp

2
src/gui/addnewtorrentdialog.cpp

@ -117,7 +117,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(QWidget *parent)
// Signal / slots // Signal / slots
connect(ui->adv_button, SIGNAL(clicked(bool)), SLOT(showAdvancedSettings(bool))); connect(ui->adv_button, SIGNAL(clicked(bool)), SLOT(showAdvancedSettings(bool)));
connect(ui->doNotDeleteTorrentCheckBox, SIGNAL(clicked(bool)), SLOT(doNotDeleteTorrentClicked(bool))); connect(ui->doNotDeleteTorrentCheckBox, SIGNAL(clicked(bool)), SLOT(doNotDeleteTorrentClicked(bool)));
editHotkey = new QShortcut(QKeySequence("F2"), ui->contentTreeView, 0, 0, Qt::WidgetShortcut); editHotkey = new QShortcut(Qt::Key_F2, ui->contentTreeView, 0, 0, Qt::WidgetShortcut);
connect(editHotkey, SIGNAL(activated()), SLOT(renameSelectedFile())); connect(editHotkey, SIGNAL(activated()), SLOT(renameSelectedFile()));
connect(ui->contentTreeView, SIGNAL(doubleClicked(QModelIndex)), SLOT(renameSelectedFile())); connect(ui->contentTreeView, SIGNAL(doubleClicked(QModelIndex)), SLOT(renameSelectedFile()));

32
src/gui/mainwindow.cpp

@ -758,33 +758,33 @@ void MainWindow::createKeyboardShortcuts()
{ {
m_ui->actionCreateTorrent->setShortcut(QKeySequence::New); m_ui->actionCreateTorrent->setShortcut(QKeySequence::New);
m_ui->actionOpen->setShortcut(QKeySequence::Open); m_ui->actionOpen->setShortcut(QKeySequence::Open);
m_ui->actionDownloadFromURL->setShortcut(QKeySequence("Ctrl+Shift+O")); m_ui->actionDownloadFromURL->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_O);
m_ui->actionExit->setShortcut(QKeySequence("Ctrl+Q")); m_ui->actionExit->setShortcut(Qt::CTRL + Qt::Key_Q);
QShortcut *switchTransferShortcut = new QShortcut(QKeySequence("Alt+1"), this); QShortcut *switchTransferShortcut = new QShortcut(Qt::ALT + Qt::Key_1, this);
connect(switchTransferShortcut, SIGNAL(activated()), this, SLOT(displayTransferTab())); connect(switchTransferShortcut, SIGNAL(activated()), this, SLOT(displayTransferTab()));
QShortcut *switchSearchShortcut = new QShortcut(QKeySequence("Alt+2"), this); QShortcut *switchSearchShortcut = new QShortcut(Qt::ALT + Qt::Key_2, this);
connect(switchSearchShortcut, SIGNAL(activated()), this, SLOT(displaySearchTab())); connect(switchSearchShortcut, SIGNAL(activated()), this, SLOT(displaySearchTab()));
QShortcut *switchRSSShortcut = new QShortcut(QKeySequence("Alt+3"), this); QShortcut *switchRSSShortcut = new QShortcut(Qt::ALT + Qt::Key_3, this);
connect(switchRSSShortcut, SIGNAL(activated()), this, SLOT(displayRSSTab())); connect(switchRSSShortcut, SIGNAL(activated()), this, SLOT(displayRSSTab()));
QShortcut *switchExecutionLogShortcut = new QShortcut(QKeySequence(Qt::ALT + Qt::Key_4), this); QShortcut *switchExecutionLogShortcut = new QShortcut(Qt::ALT + Qt::Key_4, this);
connect(switchExecutionLogShortcut, SIGNAL(activated()), this, SLOT(displayExecutionLogTab())); connect(switchExecutionLogShortcut, SIGNAL(activated()), this, SLOT(displayExecutionLogTab()));
QShortcut *switchSearchFilterShortcut = new QShortcut(QKeySequence::Find, this); QShortcut *switchSearchFilterShortcut = new QShortcut(QKeySequence::Find, this);
connect(switchSearchFilterShortcut, SIGNAL(activated()), this, SLOT(focusSearchFilter())); connect(switchSearchFilterShortcut, SIGNAL(activated()), this, SLOT(focusSearchFilter()));
m_ui->actionDocumentation->setShortcut(QKeySequence::HelpContents); m_ui->actionDocumentation->setShortcut(QKeySequence::HelpContents);
m_ui->actionOptions->setShortcut(QKeySequence("Alt+O")); m_ui->actionOptions->setShortcut(Qt::ALT + Qt::Key_O);
m_ui->actionStart->setShortcut(QKeySequence("Ctrl+S")); m_ui->actionStart->setShortcut(Qt::CTRL + Qt::Key_S);
m_ui->actionStartAll->setShortcut(QKeySequence("Ctrl+Shift+S")); m_ui->actionStartAll->setShortcut(Qt::CTRL + Qt::SHIFT +Qt::Key_S);
m_ui->actionPause->setShortcut(QKeySequence("Ctrl+P")); m_ui->actionPause->setShortcut(Qt::CTRL + Qt::Key_P);
m_ui->actionPauseAll->setShortcut(QKeySequence("Ctrl+Shift+P")); m_ui->actionPauseAll->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_P);
m_ui->actionBottomPriority->setShortcut(QKeySequence("Ctrl+Shift+-")); m_ui->actionBottomPriority->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Minus);
m_ui->actionDecreasePriority->setShortcut(QKeySequence("Ctrl+-")); m_ui->actionDecreasePriority->setShortcut(Qt::CTRL + Qt::Key_Minus);
m_ui->actionIncreasePriority->setShortcut(QKeySequence("Ctrl++")); m_ui->actionIncreasePriority->setShortcut(Qt::CTRL + Qt::Key_Plus);
m_ui->actionTopPriority->setShortcut(QKeySequence("Ctrl+Shift++")); m_ui->actionTopPriority->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Plus);
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
m_ui->actionMinimize->setShortcut(QKeySequence("Ctrl+M")); m_ui->actionMinimize->setShortcut(Qt::CTRL + Qt::Key_M);
addAction(m_ui->actionMinimize); addAction(m_ui->actionMinimize);
#endif #endif
} }

6
src/gui/properties/propertieswidget.cpp

@ -159,14 +159,14 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow *main_window, Tra
refreshTimer = new QTimer(this); refreshTimer = new QTimer(this);
connect(refreshTimer, SIGNAL(timeout()), this, SLOT(loadDynamicData())); connect(refreshTimer, SIGNAL(timeout()), this, SLOT(loadDynamicData()));
refreshTimer->start(3000); // 3sec refreshTimer->start(3000); // 3sec
editHotkeyFile = new QShortcut(QKeySequence("F2"), filesList, 0, 0, Qt::WidgetShortcut); editHotkeyFile = new QShortcut(Qt::Key_F2, filesList, 0, 0, Qt::WidgetShortcut);
connect(editHotkeyFile, SIGNAL(activated()), SLOT(renameSelectedFile())); connect(editHotkeyFile, SIGNAL(activated()), SLOT(renameSelectedFile()));
editHotkeyWeb = new QShortcut(QKeySequence("F2"), listWebSeeds, 0, 0, Qt::WidgetShortcut); editHotkeyWeb = new QShortcut(Qt::Key_F2, listWebSeeds, 0, 0, Qt::WidgetShortcut);
connect(editHotkeyWeb, SIGNAL(activated()), SLOT(editWebSeed())); connect(editHotkeyWeb, SIGNAL(activated()), SLOT(editWebSeed()));
connect(listWebSeeds, SIGNAL(doubleClicked(QModelIndex)), SLOT(editWebSeed())); connect(listWebSeeds, SIGNAL(doubleClicked(QModelIndex)), SLOT(editWebSeed()));
deleteHotkeyWeb = new QShortcut(QKeySequence::Delete, listWebSeeds, 0, 0, Qt::WidgetShortcut); deleteHotkeyWeb = new QShortcut(QKeySequence::Delete, listWebSeeds, 0, 0, Qt::WidgetShortcut);
connect(deleteHotkeyWeb, SIGNAL(activated()), SLOT(deleteSelectedUrlSeeds())); connect(deleteHotkeyWeb, SIGNAL(activated()), SLOT(deleteSelectedUrlSeeds()));
openHotkeyFile = new QShortcut(QKeySequence("Return"), filesList, 0, 0, Qt::WidgetShortcut); openHotkeyFile = new QShortcut(Qt::Key_Return, filesList, 0, 0, Qt::WidgetShortcut);
connect(openHotkeyFile, SIGNAL(activated()), SLOT(openSelectedFile())); connect(openHotkeyFile, SIGNAL(activated()), SLOT(openSelectedFile()));
} }

12
src/gui/properties/proptabbar.cpp

@ -44,34 +44,34 @@ PropTabBar::PropTabBar(QWidget *parent) :
m_btnGroup = new QButtonGroup(this); m_btnGroup = new QButtonGroup(this);
// General tab // General tab
QPushButton *main_infos_button = new QPushButton(GuiIconProvider::instance()->getIcon("document-properties"), tr("General"), parent); QPushButton *main_infos_button = new QPushButton(GuiIconProvider::instance()->getIcon("document-properties"), tr("General"), parent);
main_infos_button->setShortcut(QKeySequence(Qt::ALT + Qt::Key_G)); main_infos_button->setShortcut(Qt::ALT + Qt::Key_G);
addWidget(main_infos_button); addWidget(main_infos_button);
m_btnGroup->addButton(main_infos_button, MAIN_TAB); m_btnGroup->addButton(main_infos_button, MAIN_TAB);
// Trackers tab // Trackers tab
QPushButton *trackers_button = new QPushButton(GuiIconProvider::instance()->getIcon("network-server"), tr("Trackers"), parent); QPushButton *trackers_button = new QPushButton(GuiIconProvider::instance()->getIcon("network-server"), tr("Trackers"), parent);
trackers_button->setShortcut(QKeySequence(Qt::ALT + Qt::Key_C)); trackers_button->setShortcut(Qt::ALT + Qt::Key_C);
addWidget(trackers_button); addWidget(trackers_button);
m_btnGroup->addButton(trackers_button, TRACKERS_TAB); m_btnGroup->addButton(trackers_button, TRACKERS_TAB);
// Peers tab // Peers tab
QPushButton *peers_button = new QPushButton(GuiIconProvider::instance()->getIcon("edit-find-user"), tr("Peers"), parent); QPushButton *peers_button = new QPushButton(GuiIconProvider::instance()->getIcon("edit-find-user"), tr("Peers"), parent);
peers_button->setShortcut(QKeySequence(Qt::ALT + Qt::Key_R)); peers_button->setShortcut(Qt::ALT + Qt::Key_R);
addWidget(peers_button); addWidget(peers_button);
m_btnGroup->addButton(peers_button, PEERS_TAB); m_btnGroup->addButton(peers_button, PEERS_TAB);
// URL seeds tab // URL seeds tab
QPushButton *urlseeds_button = new QPushButton(GuiIconProvider::instance()->getIcon("network-server"), tr("HTTP Sources"), parent); QPushButton *urlseeds_button = new QPushButton(GuiIconProvider::instance()->getIcon("network-server"), tr("HTTP Sources"), parent);
urlseeds_button->setShortcut(QKeySequence(Qt::ALT + Qt::Key_B)); urlseeds_button->setShortcut(Qt::ALT + Qt::Key_B);
addWidget(urlseeds_button); addWidget(urlseeds_button);
m_btnGroup->addButton(urlseeds_button, URLSEEDS_TAB); m_btnGroup->addButton(urlseeds_button, URLSEEDS_TAB);
// Files tab // Files tab
QPushButton *files_button = new QPushButton(GuiIconProvider::instance()->getIcon("inode-directory"), tr("Content"), parent); QPushButton *files_button = new QPushButton(GuiIconProvider::instance()->getIcon("inode-directory"), tr("Content"), parent);
files_button->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Z)); files_button->setShortcut(Qt::ALT + Qt::Key_Z);
addWidget(files_button); addWidget(files_button);
m_btnGroup->addButton(files_button, FILES_TAB); m_btnGroup->addButton(files_button, FILES_TAB);
// Spacer // Spacer
addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Fixed)); addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Fixed));
// Speed tab // Speed tab
QPushButton *speed_button = new QPushButton(GuiIconProvider::instance()->getIcon("office-chart-line"), tr("Speed"), parent); QPushButton *speed_button = new QPushButton(GuiIconProvider::instance()->getIcon("office-chart-line"), tr("Speed"), parent);
speed_button->setShortcut(QKeySequence(Qt::ALT + Qt::Key_D)); speed_button->setShortcut(Qt::ALT + Qt::Key_D);
addWidget(speed_button); addWidget(speed_button);
m_btnGroup->addButton(speed_button, SPEED_TAB); m_btnGroup->addButton(speed_button, SPEED_TAB);
// SIGNAL/SLOT // SIGNAL/SLOT

4
src/gui/properties/trackerlist.cpp

@ -83,9 +83,9 @@ TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), propertie
lsd_item = new QTreeWidgetItem(QStringList() << "" << "** [LSD] **" << "" << "" << "0" << "0" << "0"); lsd_item = new QTreeWidgetItem(QStringList() << "" << "** [LSD] **" << "" << "" << "0" << "0" << "0");
insertTopLevelItem(2, lsd_item); insertTopLevelItem(2, lsd_item);
setRowColor(2, QColor("grey")); setRowColor(2, QColor("grey"));
editHotkey = new QShortcut(QKeySequence("F2"), this, SLOT(editSelectedTracker()), 0, Qt::WidgetShortcut); editHotkey = new QShortcut(Qt::Key_F2, this, SLOT(editSelectedTracker()), 0, Qt::WidgetShortcut);
connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(editSelectedTracker())); connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(editSelectedTracker()));
deleteHotkey = new QShortcut(QKeySequence(QKeySequence::Delete), this, SLOT(deleteSelectedTrackers()), 0, Qt::WidgetShortcut); deleteHotkey = new QShortcut(QKeySequence::Delete, this, SLOT(deleteSelectedTrackers()), 0, Qt::WidgetShortcut);
copyHotkey = new QShortcut(QKeySequence::Copy, this, SLOT(copyTrackerUrl()), 0, Qt::WidgetShortcut); copyHotkey = new QShortcut(QKeySequence::Copy, this, SLOT(copyTrackerUrl()), 0, Qt::WidgetShortcut);
#ifdef QBT_USES_QT5 #ifdef QBT_USES_QT5

2
src/gui/rss/automatedrssdownloader.cpp

@ -114,7 +114,7 @@ AutomatedRssDownloader::AutomatedRssDownloader(const QWeakPointer<Rss::Manager>
Q_ASSERT(ok); Q_ASSERT(ok);
ok = connect(ui->lineEFilter, SIGNAL(textEdited(QString)), SLOT(updateMatchingArticles())); ok = connect(ui->lineEFilter, SIGNAL(textEdited(QString)), SLOT(updateMatchingArticles()));
Q_ASSERT(ok); Q_ASSERT(ok);
editHotkey = new QShortcut(QKeySequence("F2"), ui->listRules, 0, 0, Qt::WidgetShortcut); editHotkey = new QShortcut(Qt::Key_F2, ui->listRules, 0, 0, Qt::WidgetShortcut);
ok = connect(editHotkey, SIGNAL(activated()), SLOT(renameSelectedRule())); ok = connect(editHotkey, SIGNAL(activated()), SLOT(renameSelectedRule()));
Q_ASSERT(ok); Q_ASSERT(ok);
ok = connect(ui->listRules, SIGNAL(doubleClicked(QModelIndex)), SLOT(renameSelectedRule())); ok = connect(ui->listRules, SIGNAL(doubleClicked(QModelIndex)), SLOT(renameSelectedRule()));

2
src/gui/rss/rss_imp.cpp

@ -706,7 +706,7 @@ RSSImp::RSSImp(QWidget *parent)
m_feedList = new FeedListWidget(splitterSide, m_rssManager); m_feedList = new FeedListWidget(splitterSide, m_rssManager);
splitterSide->insertWidget(0, m_feedList); splitterSide->insertWidget(0, m_feedList);
editHotkey = new QShortcut(QKeySequence("F2"), m_feedList, 0, 0, Qt::WidgetShortcut); editHotkey = new QShortcut(Qt::Key_F2, m_feedList, 0, 0, Qt::WidgetShortcut);
connect(editHotkey, SIGNAL(activated()), SLOT(renameSelectedRssFile())); connect(editHotkey, SIGNAL(activated()), SLOT(renameSelectedRssFile()));
connect(m_feedList, SIGNAL(doubleClicked(QModelIndex)), SLOT(renameSelectedRssFile())); connect(m_feedList, SIGNAL(doubleClicked(QModelIndex)), SLOT(renameSelectedRssFile()));
deleteHotkey = new QShortcut(QKeySequence::Delete, m_feedList, 0, 0, Qt::WidgetShortcut); deleteHotkey = new QShortcut(QKeySequence::Delete, m_feedList, 0, 0, Qt::WidgetShortcut);

8
src/gui/transferlistwidget.cpp

@ -155,11 +155,11 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window)
connect(header(), SIGNAL(sectionResized(int, int, int)), this, SLOT(saveSettings())); connect(header(), SIGNAL(sectionResized(int, int, int)), this, SLOT(saveSettings()));
connect(header(), SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)), this, SLOT(saveSettings())); connect(header(), SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)), this, SLOT(saveSettings()));
editHotkey = new QShortcut(QKeySequence("F2"), this, SLOT(renameSelectedTorrent()), 0, Qt::WidgetShortcut); editHotkey = new QShortcut(Qt::Key_F2, this, SLOT(renameSelectedTorrent()), 0, Qt::WidgetShortcut);
deleteHotkey = new QShortcut(QKeySequence::Delete, this, SLOT(softDeleteSelectedTorrents()), 0, Qt::WidgetShortcut); deleteHotkey = new QShortcut(QKeySequence::Delete, this, SLOT(softDeleteSelectedTorrents()), 0, Qt::WidgetShortcut);
permDeleteHotkey = new QShortcut(QKeySequence("Shift+Delete"), this, SLOT(permDeleteSelectedTorrents()), 0, Qt::WidgetShortcut); permDeleteHotkey = new QShortcut(Qt::SHIFT + Qt::Key_Delete, this, SLOT(permDeleteSelectedTorrents()), 0, Qt::WidgetShortcut);
doubleClickHotkey = new QShortcut(QKeySequence(Qt::Key_Return), this, SLOT(torrentDoubleClicked()), 0, Qt::WidgetShortcut); doubleClickHotkey = new QShortcut(Qt::Key_Return, this, SLOT(torrentDoubleClicked()), 0, Qt::WidgetShortcut);
recheckHotkey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_R), this, SLOT(recheckSelectedTorrents()), 0, Qt::WidgetShortcut); recheckHotkey = new QShortcut(Qt::CTRL + Qt::Key_R, this, SLOT(recheckSelectedTorrents()), 0, Qt::WidgetShortcut);
#ifdef QBT_USES_QT5 #ifdef QBT_USES_QT5
// This hack fixes reordering of first column with Qt5. // This hack fixes reordering of first column with Qt5.

Loading…
Cancel
Save