Browse Source

Enable delete hotkey in web seed and tracker list.

Make delete hotkey in transfer list non-global.
adaptive-webui-19844
Nick Tiskov 12 years ago
parent
commit
107906928a
  1. 5
      src/mainwindow.cpp
  2. 7
      src/properties/propertieswidget.cpp
  3. 1
      src/properties/propertieswidget.h
  4. 2
      src/properties/trackerlist.cpp
  5. 1
      src/properties/trackerlist.h
  6. 2
      src/transferlistwidget.cpp
  7. 1
      src/transferlistwidget.h

5
src/mainwindow.cpp

@ -557,11 +557,6 @@ void MainWindow::createKeyboardShortcuts() { @@ -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")));

7
src/properties/propertieswidget.cpp

@ -124,6 +124,8 @@ PropertiesWidget::PropertiesWidget(QWidget *parent, MainWindow* main_window, Tra @@ -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() { @@ -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() { @@ -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 { @@ -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();

1
src/properties/propertieswidget.h

@ -115,6 +115,7 @@ private: @@ -115,6 +115,7 @@ private:
LineEdit *m_contentFilerLine;
QShortcut *editHotkeyFile;
QShortcut *editHotkeyWeb;
QShortcut *deleteHotkeyWeb;
};
#endif // PROPERTIESWIDGET_H

2
src/properties/trackerlist.cpp

@ -77,12 +77,14 @@ TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), propertie @@ -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();
}

1
src/properties/trackerlist.h

@ -54,6 +54,7 @@ private: @@ -54,6 +54,7 @@ private:
QTreeWidgetItem* pex_item;
QTreeWidgetItem* lsd_item;
QShortcut *editHotkey;
QShortcut *deleteHotkey;
public:
TrackerList(PropertiesWidget *properties);

2
src/transferlistwidget.cpp

@ -143,6 +143,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window, @@ -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() { @@ -156,6 +157,7 @@ TransferListWidget::~TransferListWidget() {
delete listModel;
delete listDelegate;
delete editHotkey;
delete deleteHotkey;
qDebug() << Q_FUNC_INFO << "EXIT";
}

1
src/transferlistwidget.h

@ -118,6 +118,7 @@ private: @@ -118,6 +118,7 @@ private:
QBtSession* BTSession;
MainWindow *main_window;
QShortcut *editHotkey;
QShortcut *deleteHotkey;
};
#endif // TRANSFERLISTWIDGET_H

Loading…
Cancel
Save