]> git.sur5r.net Git - minitube/blob - src/SearchView.h
Fixed translation loading
[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         queryEdit->enableSuggest();
21     }
22
23     void disappear() {}
24
25     QMap<QString, QVariant> metadata() {
26         QMap<QString, QVariant> metadata;
27         metadata.insert("title", "");
28         metadata.insert("description", tr("Make yourself comfortable"));
29         return metadata;
30     }
31
32 public slots:
33     void watch(QString query);
34     void gotNewVersion(QString version);
35
36 protected:
37     void paintEvent(QPaintEvent *);
38
39 signals:
40     void search(QString query);
41
42 private slots:
43     void watch();
44     void textChanged(const QString &text);
45
46 private:
47     void updateRecentKeywords();
48     void checkForUpdate();
49
50     SearchLineEdit *queryEdit;
51     QLabel *recentKeywordsLabel;
52     QVBoxLayout *recentKeywordsLayout;
53     QLabel *message;
54     QPushButton *watchButton;
55
56     UpdateChecker *updateChecker;
57
58 };
59
60 #endif // __SEARCHVIEW_H__