#if QT_VERSION >= 0x050000
#include <QtWidgets>
#endif
+#ifdef APP_PHONON
#include <phonon/audiooutput.h>
#include <phonon/volumeslider.h>
#include <phonon/mediaobject.h>
#include <phonon/seekslider.h>
-#include "view.h"
+#endif
class HomeView;
class MediaView;
class UpdateChecker;
class SearchParams;
class VideoSource;
+class Suggestion;
class MainWindow : public QMainWindow {
~MainWindow();
#ifdef APP_PHONON_SEEK
Phonon::SeekSlider* getSeekSlider() { return seekSlider; }
-#endif
+#else
QSlider* getSlider() { return slider; }
+#endif
+#ifdef APP_PHONON
+ Phonon::AudioOutput* getAudioOutput() { return audioOutput; }
+ Phonon::VolumeSlider *getVolumeSlider() { return volumeSlider; }
+#endif
+ QLabel *getCurrentTimeLabel() { return currentTime; }
void readSettings();
void writeSettings();
static void printHelp();
MediaView* getMediaView() { return mediaView; }
QToolButton* getRegionButton() { return regionButton; }
QAction* getRegionAction() { return regionAction; }
+ SearchLineEdit *getToolbarSearch() { return toolbarSearch; }
+
void showActionInStatusBar(QAction*, bool show);
+ void setStatusBarVisibility(bool show);
+ void adjustStatusBarVisibility();
public slots:
void showHome(bool transition = true);
void restore();
void messageReceived(const QString &message);
void quit();
- void startToolbarSearch(QString query);
+ void suggestionAccepted(Suggestion *suggestion);
+ void search(const QString &query);
void goBack();
- void showMessage(QString message);
+ void showMessage(const QString &message);
#ifdef APP_ACTIVATION
void showActivationView(bool transition = true);
void showActivationDialog();
bool isReallyFullScreen();
bool isCompact() { return m_compact; }
+signals:
+ void currentTimeChanged(const QString &s);
+
protected:
- void changeEvent(QEvent *);
- void closeEvent(QCloseEvent *);
- bool eventFilter(QObject *obj, QEvent *event);
- void dragEnterEvent(QDragEnterEvent *event);
- void dropEvent(QDropEvent *event);
- void resizeEvent(QResizeEvent *);
+ void changeEvent(QEvent *e);
+ void closeEvent(QCloseEvent *e);
+ void showEvent(QShowEvent *e);
+ bool eventFilter(QObject *obj, QEvent *e);
+ void dragEnterEvent(QDragEnterEvent *e);
+ void dropEvent(QDropEvent *e);
+ void resizeEvent(QResizeEvent *e);
+ void moveEvent(QMoveEvent *e);
private slots:
void lazyInit();
void checkForUpdate();
- void gotNewVersion(QString version);
+ void gotNewVersion(const QString &version);
void visitSite();
void donate();
void reportIssue();
void updateUIForFullscreen();
void compactView(bool enable);
void stop();
+#ifdef APP_PHONON
void stateChanged(Phonon::State newState, Phonon::State oldState);
+#endif
void searchFocus();
void tick(qint64 time);
void totalTimeChanged(qint64 time);
- void setDefinitionMode(QString definitionName);
+ void setDefinitionMode(const QString &definitionName);
void toggleDefinitionMode();
void clearRecentKeywords();
void showFullscreenPlaylist(bool show);
void setManualPlay(bool enabled);
- void updateDownloadMessage(QString);
+ void updateDownloadMessage(const QString &);
void downloadsFinished();
void toggleDownloads(bool show);
- void floatOnTop(bool);
+ void floatOnTop(bool, bool showAction = true);
+ void adjustWindowSizeChanged(bool enabled);
+
void showStopAfterThisInStatusBar(bool show);
void hideMouse();
+#ifdef APP_MAC_STORE
+ void rateOnAppStore();
+#endif
+
private:
+#ifdef APP_PHONON
void initPhonon();
+#endif
void createActions();
void createMenus();
void createToolBars();
void createStatusBar();
void showWidget(QWidget*, bool transition = true);
- static QString formatTime(qint64 time);
+ static QString formatTime(qint64 duration);
bool confirmQuit();
- void simpleUpdateDialog(QString version);
+ void simpleUpdateDialog(const QString &version);
+ bool needStatusBar();
+ void adjustMessageLabelPosition();
UpdateChecker *updateChecker;
QAction *regionAction;
// phonon
- QSlider *slider;
+#ifdef APP_PHONON
#ifdef APP_PHONON_SEEK
Phonon::SeekSlider *seekSlider;
+#else
+ QSlider *slider;
#endif
Phonon::VolumeSlider *volumeSlider;
Phonon::MediaObject *mediaObject;
Phonon::AudioOutput *audioOutput;
+#endif
QLabel *currentTime;
- QLabel *totalTime;
+ // QLabel *totalTime;
// fullscreen
bool m_fullscreen;
QTimer *mouseTimer;
bool m_compact;
+ QLabel *messageLabel;
+ QTimer *messageTimer;
+
};
#endif