mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 13:04:23 +00:00
Enable delete hotkey in web seed and tracker list.
Make delete hotkey in transfer list non-global.
This commit is contained in:
parent
7adf012f9c
commit
107906928a
@ -557,11 +557,6 @@ void MainWindow::createKeyboardShortcuts() {
|
||||
connect(switchRSSShortcut, SIGNAL(activated()), this, SLOT(displayRSSTab()));
|
||||
actionDocumentation->setShortcut(QKeySequence("F1"));
|
||||
actionOptions->setShortcut(QKeySequence(QString::fromUtf8("Alt+O")));
|
||||
#ifdef Q_WS_MAC
|
||||
actionDelete->setShortcut(QKeySequence("Ctrl+Backspace"));
|
||||
#else
|
||||
actionDelete->setShortcut(QKeySequence(QString::fromUtf8("Del")));
|
||||
#endif
|
||||
actionStart->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+S")));
|
||||
actionStart_All->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+Shift+S")));
|
||||
actionPause->setShortcut(QKeySequence(QString::fromUtf8("Ctrl+P")));
|
||||
|
@ -124,6 +124,8 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow* main_window, Tra
|
||||
editHotkeyWeb = new QShortcut(QKeySequence("F2"), listWebSeeds, 0, 0, Qt::WidgetShortcut);
|
||||
connect(editHotkeyWeb, SIGNAL(activated()), SLOT(editWebSeed()));
|
||||
connect(listWebSeeds, SIGNAL(doubleClicked(QModelIndex)), SLOT(editWebSeed()));
|
||||
deleteHotkeyWeb = new QShortcut(QKeySequence(QKeySequence::Delete), listWebSeeds, 0, 0, Qt::WidgetShortcut);
|
||||
connect(deleteHotkeyWeb, SIGNAL(activated()), SLOT(deleteSelectedUrlSeeds()));
|
||||
}
|
||||
|
||||
PropertiesWidget::~PropertiesWidget() {
|
||||
@ -138,6 +140,7 @@ PropertiesWidget::~PropertiesWidget() {
|
||||
delete m_tabBar;
|
||||
delete editHotkeyFile;
|
||||
delete editHotkeyWeb;
|
||||
delete deleteHotkeyWeb;
|
||||
qDebug() << Q_FUNC_INFO << "EXIT";
|
||||
}
|
||||
|
||||
@ -663,6 +666,8 @@ void PropertiesWidget::askWebSeed() {
|
||||
|
||||
void PropertiesWidget::deleteSelectedUrlSeeds() {
|
||||
const QList<QListWidgetItem *> selectedItems = listWebSeeds->selectedItems();
|
||||
if (selectedItems.isEmpty())
|
||||
return;
|
||||
bool change = false;
|
||||
foreach (const QListWidgetItem *item, selectedItems) {
|
||||
QString url_seed = item->text();
|
||||
@ -691,7 +696,7 @@ void PropertiesWidget::copySelectedWebSeedsToClipboard() const {
|
||||
|
||||
void PropertiesWidget::editWebSeed() {
|
||||
const QList<QListWidgetItem *> selected_items = listWebSeeds->selectedItems();
|
||||
if (selected_items.isEmpty())
|
||||
if (selected_items.size() != 1)
|
||||
return;
|
||||
|
||||
const QListWidgetItem *selected_item = selected_items.last();
|
||||
|
@ -115,6 +115,7 @@ private:
|
||||
LineEdit *m_contentFilerLine;
|
||||
QShortcut *editHotkeyFile;
|
||||
QShortcut *editHotkeyWeb;
|
||||
QShortcut *deleteHotkeyWeb;
|
||||
};
|
||||
|
||||
#endif // PROPERTIESWIDGET_H
|
||||
|
@ -77,12 +77,14 @@ TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), propertie
|
||||
setRowColor(2, QColor("grey"));
|
||||
editHotkey = new QShortcut(QKeySequence("F2"), this, SLOT(editSelectedTracker()), 0, Qt::WidgetShortcut);
|
||||
connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(editSelectedTracker()));
|
||||
deleteHotkey = new QShortcut(QKeySequence(QKeySequence::Delete), this, SLOT(deleteSelectedTrackers()), 0, Qt::WidgetShortcut);
|
||||
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
TrackerList::~TrackerList() {
|
||||
delete editHotkey;
|
||||
delete deleteHotkey;
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ private:
|
||||
QTreeWidgetItem* pex_item;
|
||||
QTreeWidgetItem* lsd_item;
|
||||
QShortcut *editHotkey;
|
||||
QShortcut *deleteHotkey;
|
||||
|
||||
public:
|
||||
TrackerList(PropertiesWidget *properties);
|
||||
|
@ -143,6 +143,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window,
|
||||
connect(header(), SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayDLHoSMenu(const QPoint&)));
|
||||
|
||||
editHotkey = new QShortcut(QKeySequence("F2"), this, SLOT(renameSelectedTorrent()), 0, Qt::WidgetShortcut);
|
||||
deleteHotkey = new QShortcut(QKeySequence::Delete, this, SLOT(deleteSelectedTorrents()), 0, Qt::WidgetShortcut);
|
||||
}
|
||||
|
||||
TransferListWidget::~TransferListWidget() {
|
||||
@ -156,6 +157,7 @@ TransferListWidget::~TransferListWidget() {
|
||||
delete listModel;
|
||||
delete listDelegate;
|
||||
delete editHotkey;
|
||||
delete deleteHotkey;
|
||||
qDebug() << Q_FUNC_INFO << "EXIT";
|
||||
}
|
||||
|
||||
|
@ -118,6 +118,7 @@ private:
|
||||
QBtSession* BTSession;
|
||||
MainWindow *main_window;
|
||||
QShortcut *editHotkey;
|
||||
QShortcut *deleteHotkey;
|
||||
};
|
||||
|
||||
#endif // TRANSFERLISTWIDGET_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user