Diffstat (limited to 'noncore/apps/opie-reader/cbkmkselector.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/cbkmkselector.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/cbkmkselector.h b/noncore/apps/opie-reader/cbkmkselector.h new file mode 100644 index 0000000..1a49c5a --- a/dev/null +++ b/noncore/apps/opie-reader/cbkmkselector.h | |||
@@ -0,0 +1,41 @@ | |||
1 | #include <qwidget.h> | ||
2 | #include <qlistbox.h> | ||
3 | #include <qpushbutton.h> | ||
4 | #include <qlayout.h> | ||
5 | |||
6 | class CBkmkSelector : public QWidget | ||
7 | { | ||
8 | |||
9 | Q_OBJECT | ||
10 | |||
11 | QListBox* bkmkselector; | ||
12 | |||
13 | signals: | ||
14 | void selected(int i); | ||
15 | void cancelled(); | ||
16 | private slots: | ||
17 | void slotSelected(QListBoxItem* t) { emit selected(bkmkselector->index(t)); } | ||
18 | void slotSelected(int t) { emit selected(t); } | ||
19 | void slotCancel() { emit cancelled(); } | ||
20 | public: | ||
21 | CBkmkSelector( QWidget *parent=0, const char *name=0, WFlags f = 0) : | ||
22 | QWidget(parent, name, f) | ||
23 | { | ||
24 | |||
25 | // QFont f("unifont", 16); | ||
26 | // setFont( f ); | ||
27 | |||
28 | QVBoxLayout* grid = new QVBoxLayout(this); | ||
29 | bkmkselector = new QListBox(this, "Bookmarks"); | ||
30 | QPushButton* exitButton = new QPushButton("Cancel", this); | ||
31 | connect(bkmkselector, SIGNAL( selected(int) ), this, SLOT( slotSelected(int) ) ); | ||
32 | connect(bkmkselector, SIGNAL( clicked(QListBoxItem*) ), this, SLOT( slotSelected(QListBoxItem*) ) ); | ||
33 | connect(exitButton, SIGNAL( released() ), this, SLOT( slotCancel() ) ); | ||
34 | grid->addWidget(bkmkselector,1); | ||
35 | grid->addWidget(exitButton); | ||
36 | } | ||
37 | void clear() { bkmkselector->clear(); } | ||
38 | void insertItem(const QString& item) { bkmkselector->insertItem(item); } | ||
39 | QString text(int index) const { return bkmkselector->text(index); } | ||
40 | }; | ||
41 | |||