|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
|
|
|
|
|
#include <QMenu>
|
|
|
|
|
#include <QContextMenuEvent>
|
|
|
|
|
#include <QMouseEvent>
|
|
|
|
|
|
|
|
|
|
#include "../../model/prefs/state.hpp"
|
|
|
|
|
|
|
|
|
@ -21,6 +22,17 @@ void CSVPrefs::ContextMenuList::contextMenuEvent(QContextMenuEvent* e)
|
|
|
|
|
delete menu;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVPrefs::ContextMenuList::mousePressEvent(QMouseEvent* e)
|
|
|
|
|
{
|
|
|
|
|
// enable all buttons except right click
|
|
|
|
|
// This means that when right-clicking to enable the
|
|
|
|
|
// context menu, the page doesn't switch at the same time.
|
|
|
|
|
if (!(e->buttons() & Qt::RightButton))
|
|
|
|
|
{
|
|
|
|
|
QListWidget::mousePressEvent(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVPrefs::ContextMenuList::resetCategory()
|
|
|
|
|
{
|
|
|
|
|
CSMPrefs::State::get().resetCategory(currentItem()->text().toStdString());
|
|
|
|
|