summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dick_in_cage.pngbin0 -> 710 bytes
-rw-r--r--picgone.pngbin0 -> 399165 bytes
-rw-r--r--pictureswidget.cpp5
-rw-r--r--pictureswidget.h6
-rw-r--r--pictureviewer2.cpp65
-rw-r--r--pictureviewer2.h38
-rw-r--r--shemov.cpp22
-rw-r--r--shemov.h1
-rw-r--r--shemov.pro6
-rw-r--r--shemov.qrc2
-rw-r--r--smglobals.cpp1
11 files changed, 137 insertions, 9 deletions
diff --git a/dick_in_cage.png b/dick_in_cage.png
new file mode 100644
index 0000000..ae2879e
--- /dev/null
+++ b/dick_in_cage.png
Binary files differ
diff --git a/picgone.png b/picgone.png
new file mode 100644
index 0000000..0a8104f
--- /dev/null
+++ b/picgone.png
Binary files differ
diff --git a/pictureswidget.cpp b/pictureswidget.cpp
index fdcba30..907b33f 100644
--- a/pictureswidget.cpp
+++ b/pictureswidget.cpp
@@ -44,6 +44,7 @@ PicturesWidget::PicturesWidget(QWidget *parent) : QWidget(parent), mWindowTitleB
//misc
mEditDialog = new MappingEditDialog(this);
+ mPicViewer = new PictureViewer2(this);
//put it all togehter
QHBoxLayout *mainLayout = new QHBoxLayout;
@@ -51,6 +52,10 @@ PicturesWidget::PicturesWidget(QWidget *parent) : QWidget(parent), mWindowTitleB
setLayout(mainLayout);
}
+void PicturesWidget::showPicViewer(bool toggled){
+ mPicViewer->setVisible(toggled);
+}
+
void PicturesWidget::setMappingColors(){
MappingTreeModel *mtm = static_cast<MappingTreeModel*>(SmGlobals::instance()->model("MappingTree"));
mtm->setSelectedMappings(mPictureView->fileMappings());
diff --git a/pictureswidget.h b/pictureswidget.h
index ece2bfb..1b7fa09 100644
--- a/pictureswidget.h
+++ b/pictureswidget.h
@@ -13,6 +13,7 @@
#include <QSqlDatabase>
#include "smtreemodel.h"
+#include "pictureviewer2.h"
class PictureView;
class MappingTreeWidget;
@@ -24,6 +25,7 @@ class QSortFilterProxyModel;
class QHideEvent;
class QEvent;
class HoverWindow;
+class PictureViewer2;
class PicturesWidget : public QWidget {
Q_OBJECT
@@ -31,6 +33,9 @@ class PicturesWidget : public QWidget {
explicit PicturesWidget(QWidget *parent = 0);
PictureView *picView() { return mPictureView; }
+ public slots:
+ void showPicViewer(bool toggled);
+
private slots:
void setMappingColors();
void editMappings();
@@ -42,6 +47,7 @@ class PicturesWidget : public QWidget {
private:
MappingTreeWidget *mMappingTree;
PictureView *mPictureView;
+ PictureViewer2 *mPicViewer;
MappingEditDialog *mEditDialog;
const QString mWindowTitleBase;
};
diff --git a/pictureviewer2.cpp b/pictureviewer2.cpp
new file mode 100644
index 0000000..0c2530e
--- /dev/null
+++ b/pictureviewer2.cpp
@@ -0,0 +1,65 @@
+/*
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version
+ 2 of the License, or (at your option) any later version.
+*/
+
+#include <QDesktopWidget>
+#include <QApplication>
+#include <QGraphicsScene>
+#include <QGraphicsPixmapItem>
+#include <QImage>
+
+#include "pictureviewer2.h"
+
+const QString PictureViewer2::mDefaultFile(":/picgone.png");
+
+PictureViewer2::PictureViewer2(QWidget *parent) : QGraphicsView(parent), mCur(0) {
+ //behave like QDialog, but don't be one...
+ setWindowFlags(QFlags<Qt::WindowType>(0x1|0x2|0x1000|0x2000|0x10000|0x8000000));
+
+ //setup gui
+ mScene = new QGraphicsScene(this);
+ setScene(mScene);
+ QDesktopWidget *dw = QApplication::desktop();
+ QSize screenSize = dw->availableGeometry().size();
+ mMinimunSize = QSize(screenSize.width() - 100, screenSize.height() - 100);
+ setMinimumSize(mMinimunSize);
+ move(50, 50);
+ setVisible(false);
+ setFile();
+}
+
+void PictureViewer2::setFile(const QString file){
+ QPixmap pixmap(file);
+ if(pixmap.isNull()){
+ return;
+ }
+ setCurPalette(pixmap);
+ if((pixmap.height() > height()) || (pixmap.width() > width())){
+ pixmap = pixmap.scaled(QSize(width() - 3, height() - 10), Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ }
+ if(mCur){
+ mScene->removeItem(mCur);
+ mCur = 0;
+ }
+ mCur = new QGraphicsPixmapItem(pixmap);
+ mScene->addItem(mCur);
+}
+
+void PictureViewer2::setCurPalette(const QPixmap &pic){
+ QPoint val1 = QPoint(qrand() % pic.width(), qrand() % pic.height());
+ QPoint val2 = QPoint(qrand() % pic.width(), qrand() % pic.height());
+ QImage img = pic.toImage();
+ QColor c1(img.pixel(val1));
+ QColor c2(img.pixel(val2));
+ QLinearGradient g(QPoint(0,0), QPoint(rect().bottomRight()));
+ g.setColorAt(0, c1);
+ g.setColorAt(1, c2);
+ setBackgroundBrush(QBrush(g));
+}
+
+QSize PictureViewer2::sizeHint() const{
+ return mMinimunSize;
+}
diff --git a/pictureviewer2.h b/pictureviewer2.h
new file mode 100644
index 0000000..7b106bf
--- /dev/null
+++ b/pictureviewer2.h
@@ -0,0 +1,38 @@
+/*
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version
+ 2 of the License, or (at your option) any later version.
+*/
+
+#ifndef PICTUREVIEWER2_H
+#define PICTUREVIEWER2_H
+
+#include <QGraphicsView>
+#include <QString>
+
+class QGraphicsScene;
+class QGraphicsPixmapItem;
+
+class PictureViewer2 : public QGraphicsView {
+ Q_OBJECT
+ public:
+ explicit PictureViewer2(QWidget *parent = 0); //, Qt::WindowFlags f = 0);
+ void setFiles(const QStringList &files) { mFiles = files; }
+ virtual QSize sizeHint() const;
+
+ private slots:
+ void setFile(const QString file = mDefaultFile);
+
+ private:
+ void setupDialog();
+ void setCurPalette(const QPixmap &pic);
+ void position();
+ QStringList mFiles;
+ QGraphicsScene *mScene;
+ QSize mMinimunSize;
+ QGraphicsPixmapItem *mCur;
+ static const QString mDefaultFile;
+};
+
+#endif // PICTUREVIEWER2_H
diff --git a/shemov.cpp b/shemov.cpp
index 63dfd51..0635db3 100644
--- a/shemov.cpp
+++ b/shemov.cpp
@@ -612,6 +612,11 @@ void SheMov::createActions(){
mRefreshPicsA = new QAction(QIcon(":/huge_bra.png"), tr("Refresh"), this);
mPicWidget->picView()->addAction(mRefreshPicsA);
connect(mRefreshPicsA, SIGNAL(triggered()), mPicWidget->picView(), SLOT(refresh()));
+ mTogglePicV2A = new QAction(QIcon(":/dick_in_cage.png"), tr("Show/Hide Picture Viewer"), this);
+ mTogglePicV2A->setCheckable(true);
+ connect(mTogglePicV2A, SIGNAL(toggled(bool)), mPicWidget, SLOT(showPicViewer(bool)));
+ mTogglePicV2A->setChecked(false);
+ //don't add actions with checkable(true) unless you know what you're doing!
mPicActionGroup = new QActionGroup(this);
mPicActionGroup->addAction(mDeletePicFromA);
mPicActionGroup->addAction(mEditPicsMappingsA);
@@ -733,6 +738,8 @@ void SheMov::createMenus(){
//Pictures view menu
mPicViewMenu = new QMenu(tr("&View"), this);
+ mPicViewMenu->addAction(mTogglePicV2A);
+ mPicViewMenu->addSeparator();
mPicViewMenu->addAction(mRefreshPicsA);
mViewPicMenuA = menuBar()->addMenu(mPicViewMenu);
@@ -913,6 +920,7 @@ void SheMov::createToolBar(){
toolBar->addAction(mFilterFavoritesA);
toolBar->addSeparator();
toolBar->addActions(mPicActionGroup->actions());
+ toolBar->addAction(mTogglePicV2A);
toolBar->addSeparator();
toolBar->addAction(mHoverPicsA);
toolBar->addAction(mHoverArchiveA);
@@ -944,14 +952,14 @@ void SheMov::writeSettings(){
void SheMov::readSettings(){
QSettings s;
- QPoint winPos = s.value("windows/mainpos").toPoint();
- QSize winSize = s.value("windows/mainsize").toSize();
- bool winState = s.value("windows/maximized", false).toBool();
- resize(winSize);
- move(winPos);
- if(winState){
+ QPoint winPos = s.value("windows/mainpos").toPoint();
+ QSize winSize = s.value("windows/mainsize").toSize();
+ bool winState = s.value("windows/maximized", false).toBool();
+ resize(winSize);
+ move(winPos);
+ if(winState){
setWindowState(Qt::WindowMaximized);
- }
+ }
int currentTab = s.value("ui/selectedtab", 0).toInt();
if(currentTab < mTab->count() && currentTab != mTab->currentIndex()){
mTab->setCurrentIndex(currentTab);
diff --git a/shemov.h b/shemov.h
index d72b346..e10cc7f 100644
--- a/shemov.h
+++ b/shemov.h
@@ -170,6 +170,7 @@ class SheMov : public QMainWindow {
QAction *mDeletePicFromA;
QAction *mEditPicsMappingsA;
QAction *mRefreshPicsA;
+ QAction *mTogglePicV2A;
QActionGroup *mPicActionGroup;
//EndActions
diff --git a/shemov.pro b/shemov.pro
index a7bb514..876ff2f 100644
--- a/shemov.pro
+++ b/shemov.pro
@@ -39,7 +39,8 @@ SOURCES = main.cpp \
mappingtreemodel.cpp \
mappingtreewidget.cpp \
newpicsdialog.cpp \
- pictureswidget.cpp
+ pictureswidget.cpp \
+ pictureviewer2.cpp
HEADERS = listitem.h \
filesystemdirproxy.h \
filesystemwidget.h \
@@ -74,6 +75,7 @@ HEADERS = listitem.h \
mappingtreemodel.h \
mappingtreewidget.h \
newpicsdialog.h \
- pictureswidget.h
+ pictureswidget.h \
+ pictureviewer2.h
LIBS += -lmagic -lXfixes -lX11
RESOURCES = shemov.qrc
diff --git a/shemov.qrc b/shemov.qrc
index 734ef42..fac3225 100644
--- a/shemov.qrc
+++ b/shemov.qrc
@@ -33,5 +33,7 @@
<file>huge_balls_pierced.png</file>
<file>huge_bra.png</file>
<file>squirting_nipple.png</file>
+ <file>picgone.png</file>
+ <file>dick_in_cage.png</file>
</qresource>
</RCC>
diff --git a/smglobals.cpp b/smglobals.cpp
index 72c1148..4a73d0b 100644
--- a/smglobals.cpp
+++ b/smglobals.cpp
@@ -149,6 +149,7 @@ SmGlobals::SmGlobals() : mPictureViewer(0), mFrameCache(0){
mIcons.insert("Big pierced balls", ":/huge_balls_pierced.png");
mIcons.insert("Huge bra", ":/huge_bra.png");
mIcons.insert("Squirting nipple", ":/squirting_nipple.png");
+ mIcons.insert("Dick in a cage", ":/dick_in_cage.png");
mDvdSize = Q_INT64_C(4707319808) - 20 * 1024 *1024;
}