src/videomimedata.h \
src/global.h \
src/updatechecker.h \
- src/videowidget.h \
src/playlistwidget.h \
src/searchparams.h \
src/minisplitter.h \
- src/loadingwidget.h
+ src/loadingwidget.h \
+ src/videoareawidget.h
SOURCES += src/main.cpp \
src/MainWindow.cpp \
src/SearchView.cpp \
src/playlist/PrettyItemDelegate.cpp \
src/videomimedata.cpp \
src/updatechecker.cpp \
- src/videowidget.cpp \
src/networkaccess.cpp \
src/playlistwidget.cpp \
src/searchparams.cpp \
src/minisplitter.cpp \
- src/loadingwidget.cpp
+ src/loadingwidget.cpp \
+ src/videoareawidget.cpp
RESOURCES += resources.qrc
DESTDIR = build/target/
OBJECTS_DIR = build/obj/
PKGDATADIR = $$DATADIR/minitube
DEFINES += DATADIR=\\\"$$DATADIR\\\" \
PKGDATADIR=\\\"$$PKGDATADIR\\\"
+ INSTALLS += translations \
+ desktop \
+ iconsvg \
+ icon16 \
+ icon32 \
+ icon128
+ translations.path = $$PKGDATADIR
+ translations.files += .qm/locale
+ desktop.path = $$DATADIR/applications
+ desktop.files += minitube.desktop
+
+ # iconxpm.path = $$DATADIR/pixmaps
+ # iconxpm.files += data/minitube.xpm
+ iconsvg.path = $$DATADIR/icons/hicolor/scalable/apps
+ iconsvg.files += data/minitube.svg
+ icon16.path = $$DATADIR/icons/hicolor/16x16/apps
+ icon16.files += data/16x16/minitube.png
+ icon32.path = $$DATADIR/icons/hicolor/32x32/apps
+ icon32.files += data/32x32/minitube.png
+ icon128.path = $$DATADIR/icons/hicolor/128x128/apps
+ icon128.files += data/128x128/minitube.png
}
this, SLOT(selectionChanged ( const QItemSelection & , const QItemSelection & )));
playlistWidget = new PlaylistWidget(this, sortBar, listView);
- // playlistWidget->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
splitter->addWidget(playlistWidget);
- videoWidget = new VideoWidget(this);
+ videoAreaWidget = new VideoAreaWidget(this);
+
+ videoWidget = new Phonon::VideoWidget(this);
videoWidget->setMinimumSize(320,240);
- // videoWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
- videoWidget->hide();
- splitter->addWidget(videoWidget);
-
+ videoAreaWidget->setVideoWidget(videoWidget);
+
loadingWidget = new LoadingWidget(this);
loadingWidget->setMinimumSize(320,240);
- // loadingWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
- splitter->addWidget(loadingWidget);
+ videoAreaWidget->setLoadingWidget(loadingWidget);
+
+ splitter->addWidget(videoAreaWidget);
QList<int> sizes;
- sizes << 320 << 640 << 640;
+ sizes << 320 << 640;
splitter->setSizes(sizes);
layout->addWidget(splitter);
}
void MediaView::initialize() {
- connect(videoWidget, SIGNAL(doubleClicked()), The::globalActions()->value("fullscreen"), SLOT(trigger()));
- videoWidget->setContextMenuPolicy(Qt::CustomContextMenu);
- connect(videoWidget, SIGNAL(customContextMenuRequested(QPoint)),
+ connect(videoAreaWidget, SIGNAL(doubleClicked()), The::globalActions()->value("fullscreen"), SLOT(trigger()));
+ videoAreaWidget->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(videoAreaWidget, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(showVideoContextMenu(QPoint)));
}
case Phonon::PlayingState:
qDebug("playing");
- loadingWidget->hide();
- videoWidget->show();
+ videoAreaWidget->showVideo();
break;
case Phonon::StoppedState:
}
void MediaView::fullscreen() {
-
-#ifdef Q_WS_MAC
splitterState = splitter->saveState();
- videoWidget->setParent(0);
- videoWidget->showFullScreen();
-#else
- videoWidget->setFullScreen(!videoWidget->isFullScreen());
-#endif
-
+ videoAreaWidget->setParent(0);
+ videoAreaWidget->showFullScreen();
}
void MediaView::exitFullscreen() {
-
-#ifdef Q_WS_MAC
- videoWidget->setParent(this);
- splitter->addWidget(videoWidget);
- videoWidget->showNormal();
+ videoAreaWidget->setParent(this);
+ splitter->addWidget(videoAreaWidget);
+ videoAreaWidget->showNormal();
splitter->restoreState(splitterState);
-#else
- videoWidget->setFullScreen(false);
-#endif
-
}
void MediaView::stop() {
if (!video) return;
// immediately show the loading widget
- videoWidget->hide();
- loadingWidget->setVideo(video);
- loadingWidget->show();
+ videoAreaWidget->showLoading(video);
mediaObject->pause();
#include "searchparams.h"
#include "playlistwidget.h"
#include "loadingwidget.h"
+#include "videoareawidget.h"
class MediaView : public QWidget, public View {
Q_OBJECT
Phonon::VideoWidget *videoWidget;
// loadingWidget
+ VideoAreaWidget *videoAreaWidget;
LoadingWidget *loadingWidget;
- QNetworkReply *networkReply;
-
};
#endif // __MEDIAVIEW_H__
--- /dev/null
+#include "videoareawidget.h"
+
+VideoAreaWidget::VideoAreaWidget(QWidget *parent) : QWidget(parent) {
+ stackedLayout = new QStackedLayout(this);
+ setLayout(stackedLayout);
+}
+
+void VideoAreaWidget::setVideoWidget(QWidget *videoWidget) {
+ this->videoWidget = videoWidget;
+ stackedLayout->addWidget(videoWidget);
+}
+
+void VideoAreaWidget::setLoadingWidget(LoadingWidget *loadingWidget) {
+ this->loadingWidget = loadingWidget;
+ stackedLayout->addWidget(loadingWidget);
+}
+
+void VideoAreaWidget::showVideo() {
+ stackedLayout->setCurrentWidget(videoWidget);
+}
+
+void VideoAreaWidget::showLoading(Video *video) {
+ this->loadingWidget->setVideo(video);
+ stackedLayout->setCurrentWidget(loadingWidget);
+}
+
+void VideoAreaWidget::mouseDoubleClickEvent(QMouseEvent *event) {
+ switch(event->button()) {
+ case Qt::LeftButton:
+ emit doubleClicked();
+ break;
+ case Qt::RightButton:
+
+ break;
+ }
+}
+
+void VideoAreaWidget::mousePressEvent(QMouseEvent *event) {
+ switch(event->button()) {
+ case Qt::LeftButton:
+ break;
+ case Qt::RightButton:
+ emit rightClicked();
+ break;
+ }
+}
--- /dev/null
+#ifndef VIDEOAREAWIDGET_H
+#define VIDEOAREAWIDGET_H
+
+#include <QWidget>
+#include "video.h"
+#include "loadingwidget.h"
+
+class VideoAreaWidget : public QWidget {
+
+ Q_OBJECT
+
+public:
+ VideoAreaWidget(QWidget *parent);
+ void setVideoWidget(QWidget *videoWidget);
+ void setLoadingWidget(LoadingWidget *loadingWidget);
+ void showLoading(Video* video);
+ void showVideo();
+
+signals:
+ void doubleClicked();
+ void rightClicked();
+
+protected:
+ void mouseDoubleClickEvent(QMouseEvent *event);
+ void mousePressEvent(QMouseEvent *event);
+
+private:
+ QStackedLayout *stackedLayout;
+ QWidget *videoWidget;
+ LoadingWidget *loadingWidget;
+
+};
+
+#endif // VIDEOAREAWIDGET_H