mirror of
https://github.com/markdavidlong/AppleSAWS.git
synced 2024-12-22 14:29:45 +00:00
Removed now-unneeded context menu from catalog widget
This commit is contained in:
parent
40f3c6dcaf
commit
2a1c2586c3
@ -19,9 +19,9 @@ CatalogWidget::CatalogWidget(QWidget *parent) :
|
|||||||
connect(ui->catalog_list, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
|
connect(ui->catalog_list, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
|
||||||
SLOT(itemClicked(QListWidgetItem*)));
|
SLOT(itemClicked(QListWidgetItem*)));
|
||||||
|
|
||||||
ui->catalog_list->setContextMenuPolicy(Qt::CustomContextMenu);
|
// ui->catalog_list->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(ui->catalog_list, SIGNAL(customContextMenuRequested(const QPoint &)),
|
// connect(ui->catalog_list, SIGNAL(customContextMenuRequested(const QPoint &)),
|
||||||
SLOT(showContextMenuForWidget(const QPoint &)));
|
// SLOT(showContextMenuForWidget(const QPoint &)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CatalogWidget::showContextMenuForWidget(const QPoint &point) {
|
void CatalogWidget::showContextMenuForWidget(const QPoint &point) {
|
||||||
@ -33,18 +33,6 @@ void CatalogWidget::showContextMenuForWidget(const QPoint &point) {
|
|||||||
[=](){ this->itemClicked(selectedItem); viewAction->deleteLater();});
|
[=](){ this->itemClicked(selectedItem); viewAction->deleteLater();});
|
||||||
contextMenu.addAction(viewAction);
|
contextMenu.addAction(viewAction);
|
||||||
|
|
||||||
QAction *hexViewAction = new QAction("Hex View",this);
|
|
||||||
connect(hexViewAction, &QAction::triggered,
|
|
||||||
[=](){ this->toggleHexView(selectedItem); hexViewAction->deleteLater();});
|
|
||||||
contextMenu.addAction(hexViewAction);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// QAction *viewWithAction = new QAction("View With...",this);
|
|
||||||
// connect(viewWithAction, &QAction::triggered,
|
|
||||||
// [=](){ this->itemClicked(selectedItem); viewWithAction->deleteLater();});
|
|
||||||
// contextMenu.addAction(viewWithAction);
|
|
||||||
|
|
||||||
contextMenu.exec(mapToGlobal(point));
|
contextMenu.exec(mapToGlobal(point));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,13 +134,5 @@ void CatalogWidget::itemClicked(QListWidgetItem *item)
|
|||||||
emit openWithDefaultViewer(m_disk,fde);
|
emit openWithDefaultViewer(m_disk,fde);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CatalogWidget::toggleHexView(QListWidgetItem *item)
|
|
||||||
{
|
|
||||||
int idx = item->data(0x0100).toInt();
|
|
||||||
FileDescriptiveEntry fde = m_disk->getAllFDEs()[idx];
|
|
||||||
qDebug() << "Hex File " << AppleString(fde.filename).printable().trimmed();
|
|
||||||
emit openWithHexViewer(m_disk,fde);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,13 +29,12 @@ public slots:
|
|||||||
signals:
|
signals:
|
||||||
void newFileSelected(FileDescriptiveEntry *entry);
|
void newFileSelected(FileDescriptiveEntry *entry);
|
||||||
void openWithDefaultViewer(DiskFile *disk, FileDescriptiveEntry fde);
|
void openWithDefaultViewer(DiskFile *disk, FileDescriptiveEntry fde);
|
||||||
void openWithHexViewer(DiskFile *disk, FileDescriptiveEntry fde);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString createToolTip(FileDescriptiveEntry &fde);
|
QString createToolTip(FileDescriptiveEntry &fde);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void itemClicked(QListWidgetItem *item);
|
void itemClicked(QListWidgetItem *item);
|
||||||
void toggleHexView(QListWidgetItem *item);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user