summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-09-29 17:53:20 +0200
committerArno <arno@disconnect.de>2018-09-29 17:53:20 +0200
commit437430acd4266250e60a0dc1cb050d98f728fb70 (patch)
treeea61ff19c3f30a52647184645a8e43e5fee0f975
parent9983a4881a5a1bc43dd8be56794448c18e12dc8c (diff)
downloadSheMov-437430acd4266250e60a0dc1cb050d98f728fb70.tar.gz
SheMov-437430acd4266250e60a0dc1cb050d98f728fb70.tar.bz2
SheMov-437430acd4266250e60a0dc1cb050d98f728fb70.zip
Revamp context menu actions for RandomTab
Make them local in setupGui()
-rw-r--r--randomtab.cpp28
-rw-r--r--randomtab.h3
2 files changed, 12 insertions, 19 deletions
diff --git a/randomtab.cpp b/randomtab.cpp
index 1c9c590..893b327 100644
--- a/randomtab.cpp
+++ b/randomtab.cpp
@@ -66,6 +66,7 @@ void RandomTab::setupGui(){
QHBoxLayout *numL = new QHBoxLayout;
numL->addWidget(mNumber);
numBox->setLayout(numL);
+ mContextMenu = new QMenu(this);
QGroupBox *genreBox = new QGroupBox(tr("Genres"));
mGenre1 = new QComboBox;
@@ -102,6 +103,8 @@ void RandomTab::setupGui(){
connect(clearB, &QPushButton::clicked, this, &RandomTab::clearAll);
QPushButton *goB = new QPushButton(QIcon(":/huge_bra.png"), tr("Go!"));
connect(goB, &QPushButton::clicked, this, &RandomTab::select);
+ QAction *goA = new QAction(QIcon(":/huge_bra.png"), tr("Go!"), this);
+ connect(goA, &QAction::triggered, this, &RandomTab::select);
QGridLayout *actionL = new QGridLayout;
actionL->addWidget(clearB, 0, 0);
actionL->addWidget(refreshB, 0, 1);
@@ -111,13 +114,22 @@ void RandomTab::setupGui(){
QGroupBox *playBox = new QGroupBox(tr("Play"));
QPushButton *playAllB = new QPushButton(QIcon(":/gaping_ass.png"), tr("Play All"));
connect(playAllB, &QPushButton::clicked, this, &RandomTab::playAll);
+ QAction *playAllA = new QAction(QIcon(":/gaping_ass.png"), tr("Play All"), this);
+ connect(playAllA, &QAction::triggered, this, &RandomTab::playAll);
QPushButton *playSelectedB = new QPushButton(QIcon(":/big_ass.png"), tr("Play Selected"));
connect(playSelectedB, &QPushButton::clicked, this, &RandomTab::playSelected);
+ QAction *playSelectedA = new QAction(QIcon(":/big_ass.png"), tr("Play Selected"), this);
+ connect(playSelectedA, &QAction::triggered, this, &RandomTab::playSelected);
QVBoxLayout *playL = new QVBoxLayout;
playL->addWidget(playSelectedB);
playL->addWidget(playAllB);
playBox->setLayout(playL);
+ mContextMenu->addAction(playSelectedA);
+ mContextMenu->addAction(playAllA);
+ mContextMenu->addSeparator();
+ mContextMenu->addAction(goA);
+
QGroupBox *miscBox = new QGroupBox(tr("Misc."));
QPushButton *miscB = new QPushButton(Helper::icon(QColor(0, 0, 0, 0), Qt::black, QChar(0x26A4), true, false), tr("Global..."));
miscB->setMenu(SmGlobals::instance()->globalAction()->menu());
@@ -168,33 +180,17 @@ void RandomTab::setupGui(){
}
void RandomTab::setupActions(){
- mPlayAllA = new QAction(QIcon(":/gaping_ass.png"), tr("Play All"), this);
- connect(mPlayAllA, SIGNAL(triggered()), this, SLOT(playAll()));
- mPlaySelectedA = new QAction(QIcon(":/big_ass.png"), tr("Play Selected"), this);
- connect(mPlaySelectedA, SIGNAL(triggered()), this, SLOT(playSelected()));
mRefreshA = new QAction(QIcon(":/refresh.png"), tr("Refresh"));
connect(mRefreshA, SIGNAL(triggered()), this, SLOT(refreshComboboxes()));
mClearA = new QAction(QIcon(":/delete.png"), tr("Clear"), this);
connect(mClearA, SIGNAL(triggered()), this, SLOT(clearAll()));
- mGoA = new QAction(QIcon(":/huge_bra.png"), tr("Select"), this);
- connect(mGoA, SIGNAL(triggered()), this, SLOT(select()));
mConfigureA = new QAction(QIcon(":/chastity_belt.png"), tr("Configure..."), this);
connect(mConfigureA, SIGNAL(triggered()), this, SIGNAL(configure()));
- mFileView->actions() << mPlayAllA << mPlaySelectedA << mRefreshA << mClearA << mGoA << mConfigureA;
-
- mContextMenu = new QMenu(this);
- mContextMenu->addAction(mPlaySelectedA);
- mContextMenu->addAction(mPlayAllA);
- mContextMenu->addSeparator();
- mContextMenu->addAction(mGoA);
mEditMenu = new QMenu(tr("&Edit"), this);
- mEditMenu->addAction(mPlaySelectedA);
- mEditMenu->addAction(mPlayAllA);
mEditMenu->addSeparator();
mEditMenu->addAction(mRefreshA);
mEditMenu->addAction(mClearA);
- mEditMenu->addAction(mGoA);
mEditMenu->addSeparator();
mEditMenu->addAction(mConfigureA);
}
diff --git a/randomtab.h b/randomtab.h
index 03dfba9..7cf63a7 100644
--- a/randomtab.h
+++ b/randomtab.h
@@ -73,11 +73,8 @@ class RandomTab : public QWidget {
QSortFilterProxyModel *mFileProxy;
QSqlDatabase mDb;
QStringList mValidDvds;
- QAction *mPlaySelectedA;
- QAction *mPlayAllA;
QAction *mClearA;
QAction *mRefreshA;
- QAction *mGoA;
QAction *mConfigureA;
QMenu *mContextMenu;
QMenu *mEditMenu;