From 2a1c2586c3a06ae8f13c7ea7eb234d3999268ee7 Mon Sep 17 00:00:00 2001 From: Mark Long Date: Fri, 14 Oct 2016 17:33:02 -0500 Subject: [PATCH] Removed now-unneeded context menu from catalog widget --- src/ui/catalogwidget.cxx | 26 +++----------------------- src/ui/catalogwidget.h | 3 +-- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/ui/catalogwidget.cxx b/src/ui/catalogwidget.cxx index 108ff0f..4e56b75 100644 --- a/src/ui/catalogwidget.cxx +++ b/src/ui/catalogwidget.cxx @@ -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); -} - diff --git a/src/ui/catalogwidget.h b/src/ui/catalogwidget.h index dd9cb22..9c5191e 100644 --- a/src/ui/catalogwidget.h +++ b/src/ui/catalogwidget.h @@ -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: