From d12d44cd511b76181859736fb60598a3ad7e3d0f Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 7 Nov 2010 11:46:42 +0100 Subject: Added Toobar Implemented a toolbar with various actions. Also did some artwork :) --- back_dick.png | Bin 0 -> 822 bytes bald_pussy.png | Bin 0 -> 776 bytes chastity_belt.png | Bin 0 -> 850 bytes clitoris.png | Bin 0 -> 934 bytes filesystemwidget.cpp | 16 +++++++++++- filesystemwidget.h | 3 +++ gaping_ass.png | Bin 0 -> 884 bytes nipple_up.png | Bin 0 -> 917 bytes prince_albert.png | Bin 0 -> 935 bytes shemov.cpp | 69 ++++++++++++++++++++++++++++++++++++++++++++++----- shemov.h | 6 +++++ shemov.qrc | 8 ++++++ up_dick.png | Bin 0 -> 836 bytes 13 files changed, 95 insertions(+), 7 deletions(-) create mode 100644 back_dick.png create mode 100644 bald_pussy.png create mode 100644 chastity_belt.png create mode 100644 clitoris.png create mode 100644 gaping_ass.png create mode 100644 nipple_up.png create mode 100644 prince_albert.png create mode 100644 up_dick.png diff --git a/back_dick.png b/back_dick.png new file mode 100644 index 0000000..ec7eded Binary files /dev/null and b/back_dick.png differ diff --git a/bald_pussy.png b/bald_pussy.png new file mode 100644 index 0000000..de0d6dd Binary files /dev/null and b/bald_pussy.png differ diff --git a/chastity_belt.png b/chastity_belt.png new file mode 100644 index 0000000..ebe3390 Binary files /dev/null and b/chastity_belt.png differ diff --git a/clitoris.png b/clitoris.png new file mode 100644 index 0000000..46b0106 Binary files /dev/null and b/clitoris.png differ diff --git a/filesystemwidget.cpp b/filesystemwidget.cpp index 52aede8..5d63aef 100644 --- a/filesystemwidget.cpp +++ b/filesystemwidget.cpp @@ -107,11 +107,15 @@ FilesystemWidget::FilesystemWidget(QWidget *parent) : QWidget(parent) { setLayout(mainLayout); } -void FilesystemWidget::directoryChanged(const QModelIndex &selected, const QModelIndex & /* deselected */){ +void FilesystemWidget::directoryChanged(const QModelIndex &selected, const QModelIndex &deselected){ QModelIndex real = mDirProxy->mapToSource(selected); if(!real.isValid()){ return; } + QModelIndex realPrev = mDirProxy->mapToSource(deselected); + if(realPrev.isValid()){ + mLastDir = realPrev.data(QFileSystemModel::FilePathRole).toString(); + } mModel->setRootPath(mModel->filePath(real)); mDirEdit->setText(mModel->filePath(real)); setWindowTitle(mModel->filePath(real)); @@ -170,6 +174,16 @@ void FilesystemWidget::parentDir(){ } } +void FilesystemWidget::goBack(){ + if(mLastDir.isEmpty()){ + return; + } + QModelIndex lastIdx = mModel->index(mLastDir); + if(lastIdx.isValid()){ + mDirView->selectionModel()->setCurrentIndex(mDirProxy->mapFromSource(lastIdx), QItemSelectionModel::ClearAndSelect); + } +} + void FilesystemWidget::deleteFiles(){ QSortFilterProxyModel *proxy = static_cast(mFileView->model()); QModelIndexList selected = mFileView->selectionModel()->selectedRows(); diff --git a/filesystemwidget.h b/filesystemwidget.h index 09563f4..cf8774e 100644 --- a/filesystemwidget.h +++ b/filesystemwidget.h @@ -23,6 +23,7 @@ class QAction; class QVariant; class MessageDialog; class PictureViewer; +class QStringList; class FilesystemWidget : public QWidget { Q_OBJECT @@ -45,6 +46,7 @@ class FilesystemWidget : public QWidget { void directoryEdited(); void fileViewActivated(const QModelIndex &index); void parentDir(); + void goBack(); void deleteFiles(); void copyFiles(); void moveFiles(); @@ -79,6 +81,7 @@ class FilesystemWidget : public QWidget { qint64 mSize; QAction *mRefreshAction; PictureViewer *mPicViewer; + QString mLastDir; }; #endif diff --git a/gaping_ass.png b/gaping_ass.png new file mode 100644 index 0000000..18feb02 Binary files /dev/null and b/gaping_ass.png differ diff --git a/nipple_up.png b/nipple_up.png new file mode 100644 index 0000000..4c92252 Binary files /dev/null and b/nipple_up.png differ diff --git a/prince_albert.png b/prince_albert.png new file mode 100644 index 0000000..02118f5 Binary files /dev/null and b/prince_albert.png differ diff --git a/shemov.cpp b/shemov.cpp index da3986f..cd524ff 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include @@ -75,6 +77,7 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla createStatusbar(); createActions(); createMenus(); + createToolBar(); setFsFree(); connect(mFSWidget->fileView()->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this, SLOT(updateSelectionCount(const QItemSelection &, const QItemSelection &))); @@ -153,9 +156,19 @@ void SheMov::tabChanged(int newTab){ mEditFSMenuA->setVisible(newTab == 0); if(newTab == 0){ setWindowTitle(mFSWidget->windowTitle()); + mCdupA->setEnabled(true); + mBackDirA->setEnabled(true); + mShowNormalA->setEnabled(false); + mShowArchivedA->setEnabled(false); + mShowLocalA->setEnabled(false); } if(newTab == 1){ setWindowTitle(mATree->windowTitle()); + mCdupA->setEnabled(false); + mBackDirA->setEnabled(false); + mShowNormalA->setEnabled(true); + mShowArchivedA->setEnabled(true); + mShowLocalA->setEnabled(true); } updateSelectionCount(QItemSelection(), QItemSelection()); } @@ -293,8 +306,10 @@ void SheMov::createActions(){ mQuitA->setShortcut(tr("CTRL+q")); //Edit menu (FS) - mCdupA = new QAction(tr("Go up"), this); + mCdupA = new QAction(QIcon(":/up_dick.png"), tr("Go up"), this); connect(mCdupA, SIGNAL(triggered()), mFSWidget, SLOT(parentDir())); + mBackDirA = new QAction(QIcon(":/back_dick.png"), tr("Go back"), this); + connect(mBackDirA, SIGNAL(triggered()), mFSWidget, SLOT(goBack())); connect(mQuitA, SIGNAL(triggered()), qApp, SLOT(quit())); mMarkFilesA = new QAction(tr("Select files..."), this); mMarkFilesA->setShortcut(tr("CTRL++")); @@ -317,7 +332,7 @@ void SheMov::createActions(){ mRenameA = new QAction(tr("Rename file..."), this); mRenameA->setShortcut(tr("CTRL+r")); connect(mRenameA, SIGNAL(triggered()), mFSWidget, SLOT(renameFile())); - mConfigA = new QAction(tr("Configure..."), this); + mConfigA = new QAction(QIcon(":/chastity_belt.png"), tr("Configure..."), this); connect(mConfigA, SIGNAL(triggered()), this, SLOT(configure())); //Edit menu rename submenu @@ -373,17 +388,17 @@ void SheMov::createActions(){ //Tree view menu mViewTreeGroup = new QActionGroup(this); QSignalMapper *viewMapper = new QSignalMapper(this); - mShowArchivedA = new QAction(tr("Show archived movies"), this); + mShowArchivedA = new QAction(QIcon(":/gaping_ass.png"), tr("Show archived movies"), this); mViewTreeGroup->addAction(mShowArchivedA); viewMapper->setMapping(mShowArchivedA, 1); connect(mShowArchivedA, SIGNAL(triggered()), viewMapper, SLOT(map())); mShowArchivedA->setCheckable(true); - mShowLocalA = new QAction(tr("Show local movies"), this); + mShowLocalA = new QAction(QIcon(":/clitoris.png"), tr("Show local movies"), this); mViewTreeGroup->addAction(mShowLocalA); viewMapper->setMapping(mShowLocalA, 2); connect(mShowLocalA, SIGNAL(triggered()), viewMapper, SLOT(map())); mShowLocalA->setCheckable(true); - mShowNormalA = new QAction(tr("Normal view"), this); + mShowNormalA = new QAction(QIcon(":/nipple_up.png"), tr("Normal view"), this); mViewTreeGroup->addAction(mShowNormalA); viewMapper->setMapping(mShowNormalA, 0); connect(mShowNormalA, SIGNAL(triggered()), viewMapper, SLOT(map())); @@ -413,7 +428,14 @@ void SheMov::createActions(){ connect(mOpenWithMapperAV, SIGNAL(mapped(QString)), mATree, SLOT(playSelected(QString))); connect(mCleanupMapper, SIGNAL(mapped(QString)), mATree, SLOT(cleanDatabase(QString))); connect(viewMapper, SIGNAL(mapped(int)), mATree, SLOT(setFileViewMode(int))); - + mHoverPicsA = new QAction(QIcon(":/bald_pussy.png"), tr("Hover over pictures"), this); + connect(mHoverPicsA, SIGNAL(toggled(bool)), this, SLOT(toggleHoverPics(bool))); + mHoverPicsA->setCheckable(true); + mHoverArchiveA = new QAction(QIcon(":/prince_albert.png"), tr("Hover over directories"), this); + connect(mHoverArchiveA, SIGNAL(toggled(bool)), this, SLOT(toggleHoverArchive(bool))); + mHoverArchiveA->setCheckable(true); + QSignalMapper *hoverMapper = new QSignalMapper(this); + connect(hoverMapper, SIGNAL(mapped(QString)), this, SLOT(toggleHover())); } void SheMov::createMenus(){ @@ -433,6 +455,7 @@ void SheMov::createMenus(){ //filesystem edit menu mEditFSMenu = new QMenu(tr("&Edit"), this); mEditFSMenu->addAction(mCdupA); + mEditFSMenu->addAction(mBackDirA); mEditFSMenu->addSeparator(); mEditFSMenu->addAction(mMarkFilesA); mEditFSMenu->addAction(mUnmarkFilesA); @@ -480,6 +503,7 @@ void SheMov::createMenus(){ sep1->setSeparator(true); mFSWidget->fileView()->addAction(sep1); mFSWidget->fileView()->addAction(mCdupA); + mFSWidget->fileView()->addAction(mBackDirA); QAction *sep2 = new QAction(this); sep2->setSeparator(true); mFSWidget->fileView()->addAction(sep2); @@ -591,6 +615,22 @@ void SheMov::createOpenWithMenuAV(){ } } +void SheMov::createToolBar(){ + QToolBar *toolBar = new QToolBar(this); + toolBar->addAction(mBackDirA); + toolBar->addAction(mCdupA); + toolBar->addSeparator(); + toolBar->addAction(mConfigA); + toolBar->addSeparator(); + toolBar->addAction(mShowNormalA); + toolBar->addAction(mShowArchivedA); + toolBar->addAction(mShowLocalA); + toolBar->addSeparator(); + toolBar->addAction(mHoverPicsA); + toolBar->addAction(mHoverArchiveA); + addToolBar(Qt::LeftToolBarArea, toolBar); +} + void SheMov::writeSettings(){ QSettings s; s.setValue("windows/mainpos", pos()); @@ -616,6 +656,7 @@ void SheMov::readSettings(){ if(currentTab < mTab->count() && currentTab != mTab->currentIndex()){ mTab->setCurrentIndex(currentTab); } + tabChanged(currentTab); int filesMode = s.value("ui/filestreemode", FilesTreeModel::Normal).toInt(); switch(filesMode){ case FilesTreeModel::Normal: @@ -630,9 +671,25 @@ void SheMov::readSettings(){ default: ; } + bool hoverPics = s.value("ui/hoverpics").toBool(); + mHoverPicsA->setChecked(hoverPics); + bool hoverArchive = s.value("ui/hoverarchive").toBool(); + mHoverArchiveA->setChecked(hoverArchive); } void SheMov::checkConsistency(){ ConsistencyCheck c; c.exec(); } + +void SheMov::toggleHoverArchive(bool toggled){ + QSettings s; + s.setValue("ui/hoverarchive", toggled); + emit configChanged(); +} + +void SheMov::toggleHoverPics(bool toggled){ + QSettings s; + s.setValue("ui/hoverpics", toggled); + emit configChanged(); +} diff --git a/shemov.h b/shemov.h index 7504cfe..b6cdb15 100644 --- a/shemov.h +++ b/shemov.h @@ -45,6 +45,8 @@ class SheMov : public QMainWindow { void newMovieWizardWithFiles(); void setSize(qint64 size); void checkConsistency(); + void toggleHoverPics(bool toggled); + void toggleHoverArchive(bool toggled); signals: void configChanged(); @@ -55,6 +57,7 @@ class SheMov : public QMainWindow { void createMenus(); void createOpenWithMenuFS(); void createOpenWithMenuAV(); + void createToolBar(); void writeSettings(); void readSettings(); @@ -75,6 +78,7 @@ class SheMov : public QMainWindow { QAction *mMoveA; QAction *mRenameA; QAction *mCdupA; + QAction *mBackDirA; QAction *mRenameCoverFA; QAction *mRenameCoverBA; QAction *mRenameCoverCA; @@ -90,6 +94,8 @@ class SheMov : public QMainWindow { QAction *mRenameMenuA; QAction *mArchiveSelectedA; QAction *mConsistencyA; + QAction *mHoverPicsA; + QAction *mHoverArchiveA; //TreeView Actions //Series Actions diff --git a/shemov.qrc b/shemov.qrc index e11f49b..8066501 100644 --- a/shemov.qrc +++ b/shemov.qrc @@ -7,5 +7,13 @@ archive.svg shemov_splash.png statistics.html + back_dick.png + up_dick.png + chastity_belt.png + clitoris.png + gaping_ass.png + nipple_up.png + bald_pussy.png + prince_albert.png diff --git a/up_dick.png b/up_dick.png new file mode 100644 index 0000000..778df2d Binary files /dev/null and b/up_dick.png differ -- cgit v1.2.3-70-g09d2