]> git.sur5r.net Git - minitube/blobdiff - src/mainwindow.h
Imported Upstream version 2.5.1
[minitube] / src / mainwindow.h
index 1c761714e2097561ae53c138e7fcb65fac115e8b..eb1058f4874a7828603b5a928e8a6c67b2e407b4 100644 (file)
@@ -48,7 +48,6 @@ class MainWindow : public QMainWindow {
 public:
     static MainWindow* instance();
     MainWindow();
-    ~MainWindow();
 #ifdef APP_PHONON_SEEK
     Phonon::SeekSlider* getSeekSlider() { return seekSlider; }
 #else
@@ -56,14 +55,20 @@ public:
 #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);
@@ -76,7 +81,7 @@ public slots:
     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();
@@ -86,18 +91,23 @@ public slots:
     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();
@@ -112,7 +122,7 @@ private slots:
     void searchFocus();
     void tick(qint64 time);
     void totalTimeChanged(qint64 time);
-    void setDefinitionMode(QString definitionName);
+    void setDefinitionMode(const QString &definitionName);
     void toggleDefinitionMode();
     void clearRecentKeywords();
 
@@ -128,11 +138,13 @@ private slots:
     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();
@@ -150,15 +162,17 @@ private:
     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;
 
     // view mechanism
     QStackedWidget *views;
-    QStack<QWidget*> *history;
+    QStack<QWidget*> history;
     QList<QAction*> viewActions;
 
     // view widgets
@@ -225,11 +239,14 @@ private:
     QLabel *currentTime;
     // QLabel *totalTime;
 
-    // fullscreen
-    bool m_fullscreen;
+    bool fullscreenFlag;
     bool m_maximized;
     QTimer *mouseTimer;
     bool m_compact;
+    bool initialized;
+
+    QLabel *messageLabel;
+    QTimer *messageTimer;
 
 };