Removed now-unneeded context menu from catalog widget

This commit is contained in:
Mark Long 2016-10-14 17:33:02 -05:00
parent 40f3c6dcaf
commit 2a1c2586c3
2 changed files with 4 additions and 25 deletions

View File

@ -19,9 +19,9 @@ CatalogWidget::CatalogWidget(QWidget *parent) :
connect(ui->catalog_list, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
SLOT(itemClicked(QListWidgetItem*)));
ui->catalog_list->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->catalog_list, SIGNAL(customContextMenuRequested(const QPoint &)),
SLOT(showContextMenuForWidget(const QPoint &)));
// ui->catalog_list->setContextMenuPolicy(Qt::CustomContextMenu);
// connect(ui->catalog_list, SIGNAL(customContextMenuRequested(const QPoint &)),
// SLOT(showContextMenuForWidget(const QPoint &)));
}
void CatalogWidget::showContextMenuForWidget(const QPoint &point) {
@ -33,18 +33,6 @@ void CatalogWidget::showContextMenuForWidget(const QPoint &point) {
[=](){ this->itemClicked(selectedItem); viewAction->deleteLater();});
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));
}
@ -146,13 +134,5 @@ void CatalogWidget::itemClicked(QListWidgetItem *item)
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);
}

View File

@ -29,13 +29,12 @@ public slots:
signals:
void newFileSelected(FileDescriptiveEntry *entry);
void openWithDefaultViewer(DiskFile *disk, FileDescriptiveEntry fde);
void openWithHexViewer(DiskFile *disk, FileDescriptiveEntry fde);
protected:
QString createToolTip(FileDescriptiveEntry &fde);
private slots:
void itemClicked(QListWidgetItem *item);
void toggleHexView(QListWidgetItem *item);
private: