author | ar <ar> | 2004-02-08 19:14:56 (UTC) |
---|---|---|
committer | ar <ar> | 2004-02-08 19:14:56 (UTC) |
commit | 5f698069bca9dde2c8be9ff1bf863ee3a7a33cf0 (patch) (unidiff) | |
tree | 525f35c4937c9f4ae99538289c5d1f96c53d7fa7 /noncore/apps/tableviewer/ui/tveditview.cpp | |
parent | 2dc8add65c44b3dd240cf2bd3c276c3c0155f46b (diff) | |
download | opie-5f698069bca9dde2c8be9ff1bf863ee3a7a33cf0.zip opie-5f698069bca9dde2c8be9ff1bf863ee3a7a33cf0.tar.gz opie-5f698069bca9dde2c8be9ff1bf863ee3a7a33cf0.tar.bz2 |
improve support for BigScreen
Diffstat (limited to 'noncore/apps/tableviewer/ui/tveditview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/tableviewer/ui/tveditview.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/noncore/apps/tableviewer/ui/tveditview.cpp b/noncore/apps/tableviewer/ui/tveditview.cpp index 23e2b42..20a24c8 100644 --- a/noncore/apps/tableviewer/ui/tveditview.cpp +++ b/noncore/apps/tableviewer/ui/tveditview.cpp | |||
@@ -19,73 +19,75 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | 21 | ||
22 | /* The edit view widget. For each key in the DB display an | 22 | /* The edit view widget. For each key in the DB display an |
23 | * appropriate edit box, and a 'key' button to change that particular | 23 | * appropriate edit box, and a 'key' button to change that particular |
24 | * key information (delete or edit). | 24 | * key information (delete or edit). |
25 | * | 25 | * |
26 | * Bottem line should be a 'new key' button. Should be able to scroll | 26 | * Bottem line should be a 'new key' button. Should be able to scroll |
27 | * in both directions. | 27 | * in both directions. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "tveditview.h" | 30 | #include "tveditview.h" |
31 | #include "commonwidgets.h" | 31 | #include "commonwidgets.h" |
32 | 32 | ||
33 | #include <qlayout.h> | 33 | #include <qlayout.h> |
34 | #include <qgrid.h> | 34 | #include <qgrid.h> |
35 | #include <qvbox.h> | 35 | #include <qvbox.h> |
36 | #include <qlineedit.h> | 36 | #include <qlineedit.h> |
37 | #include <qcheckbox.h> | 37 | #include <qcheckbox.h> |
38 | #include <qlist.h> | 38 | #include <qlist.h> |
39 | #include <qlabel.h> | 39 | #include <qlabel.h> |
40 | #include <qscrollview.h> | 40 | #include <qscrollview.h> |
41 | #include <qsignalmapper.h> | 41 | #include <qsignalmapper.h> |
42 | 42 | ||
43 | TVEditView::TVEditView(TableState *s, DataElem *d, QWidget* parent, | 43 | #include <qpe/qpeapplication.h> |
44 | |||
45 | TVEditView::TVEditView(TableState *s, DataElem *d, QWidget* parent, | ||
44 | const char *name, WFlags fl ) : QDialog(parent, name, true, fl) | 46 | const char *name, WFlags fl ) : QDialog(parent, name, true, fl) |
45 | { | 47 | { |
46 | if (!name) | 48 | if (!name) |
47 | setName("TVEditView"); | 49 | setName("TVEditView"); |
48 | 50 | ||
49 | QVBoxLayout *layout = new QVBoxLayout(this, 0); /* only so that will resize | 51 | QVBoxLayout *layout = new QVBoxLayout(this, 0); /* only so that will resize |
50 | correctly in other | 52 | correctly in other |
51 | widgets */ | 53 | widgets */ |
52 | 54 | ||
53 | toggles = new QSignalMapper(this); | 55 | toggles = new QSignalMapper(this); |
54 | QScrollView *sv = new QScrollView(this, 0); | 56 | QScrollView *sv = new QScrollView(this, 0); |
55 | sv->setResizePolicy(QScrollView::AutoOneFit); | 57 | sv->setResizePolicy(QScrollView::AutoOneFit); |
56 | 58 | ||
57 | layout->addWidget(sv); | 59 | layout->addWidget(sv); |
58 | 60 | ||
59 | editDisplay = new QGrid(3, sv, 0); | 61 | editDisplay = new QGrid(3, sv, 0); |
60 | editDisplay->setSpacing(3); | 62 | editDisplay->setSpacing(3); |
61 | sv->addChild(editDisplay); | 63 | sv->addChild(editDisplay); |
62 | 64 | ||
63 | connect(toggles, SIGNAL(mapped(int)), this, SLOT(toggleEnabled(int))); | 65 | connect(toggles, SIGNAL(mapped(int)), this, SLOT(toggleEnabled(int))); |
64 | 66 | ||
65 | setData(s, d); | 67 | setData(s, d); |
66 | #ifdef Q_WS_QWS | 68 | #ifdef Q_WS_QWS |
67 | showMaximized(); | 69 | QPEApplication::showDialog( this ); |
68 | #endif | 70 | #endif |
69 | } | 71 | } |
70 | 72 | ||
71 | TVEditView::~TVEditView() | 73 | TVEditView::~TVEditView() |
72 | { | 74 | { |
73 | } | 75 | } |
74 | 76 | ||
75 | /*! set up the widgets in the grid, Set up initial values */ | 77 | /*! set up the widgets in the grid, Set up initial values */ |
76 | void TVEditView::setData(TableState *t, DataElem *d) | 78 | void TVEditView::setData(TableState *t, DataElem *d) |
77 | { | 79 | { |
78 | 80 | ||
79 | /* TODO need to somehow clear old children... a delete of each | 81 | /* TODO need to somehow clear old children... a delete of each |
80 | * child? */ | 82 | * child? */ |
81 | keyIds.clear(); | 83 | keyIds.clear(); |
82 | 84 | ||
83 | KeyListIterator it(*t->kRep); | 85 | KeyListIterator it(*t->kRep); |
84 | 86 | ||
85 | int i = 0; | 87 | int i = 0; |
86 | while(it.current()) { | 88 | while(it.current()) { |
87 | if (t->kRep->validIndex(it.currentKey())) { | 89 | if (t->kRep->validIndex(it.currentKey())) { |
88 | new QLabel(it.current()->name(), editDisplay); | 90 | new QLabel(it.current()->name(), editDisplay); |
89 | keyIds.insert(i, it.currentKey()); | 91 | keyIds.insert(i, it.currentKey()); |
90 | if (d->hasValidValue(it.currentKey())) { | 92 | if (d->hasValidValue(it.currentKey())) { |
91 | switch(it.current()->type()) { | 93 | switch(it.current()->type()) { |