]> git.sur5r.net Git - minitube/blob - src/SearchView.h
Fixed message item not updating
[minitube] / src / SearchView.h
1 #ifndef __SEARCHVIEW_H__
2 #define __SEARCHVIEW_H__
3
4 #include <QtGui>
5 #include "View.h"
6 #include "searchlineedit.h"
7 #include "updatechecker.h"
8
9 class SearchView : public QWidget, public View {
10
11     Q_OBJECT
12
13 public:
14     SearchView(QWidget *parent);
15
16     void appear() {
17         updateRecentKeywords();
18         queryEdit->clear();
19         queryEdit->setFocus(Qt::OtherFocusReason);
20     }
21
22     void disappear() {}
23
24     QMap<QString, QVariant> metadata() {
25         QMap<QString, QVariant> metadata;
26         metadata.insert("title", "");
27         metadata.insert("description", tr("Make yourself comfortable"));
28         return metadata;
29     }
30
31 public slots:
32     void watch(QString query);
33     void gotNewVersion(QString version);
34
35 protected:
36     void paintEvent(QPaintEvent *);
37
38 signals:
39     void search(QString query);
40
41 private slots:
42     void watch();
43     void textChanged(const QString &text);
44
45 private:
46     void updateRecentKeywords();
47     void checkForUpdate();
48
49     SearchLineEdit *queryEdit;
50     QLabel *recentKeywordsLabel;
51     QVBoxLayout *recentKeywordsLayout;
52     QLabel *message;
53     QPushButton *watchButton;
54
55     UpdateChecker *updateChecker;
56
57 };
58
59 #endif // __SEARCHVIEW_H__