-rw-r--r-- | noncore/apps/tableviewer/db/common.cpp | 40 | ||||
-rw-r--r-- | noncore/apps/tableviewer/main.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/tableviewer/tableviewer.cpp | 116 | ||||
-rw-r--r-- | noncore/apps/tableviewer/tableviewer.h | 4 | ||||
-rw-r--r-- | noncore/apps/tableviewer/ui/commonwidgets.cpp | 3 | ||||
-rw-r--r-- | noncore/apps/tableviewer/ui/tvbrowseview.cpp | 12 |
6 files changed, 89 insertions, 88 deletions
diff --git a/noncore/apps/tableviewer/db/common.cpp b/noncore/apps/tableviewer/db/common.cpp index 4c70e54..71844a5 100644 --- a/noncore/apps/tableviewer/db/common.cpp +++ b/noncore/apps/tableviewer/db/common.cpp | |||
@@ -23,5 +23,5 @@ | |||
23 | #include <qvector.h> | 23 | #include <qvector.h> |
24 | #include <qdatetime.h> | 24 | #include <qdatetime.h> |
25 | #include <timestring.h> | 25 | #include <qpe/timestring.h> |
26 | #include "common.h" | 26 | #include "common.h" |
27 | #include "datacache.h" | 27 | #include "datacache.h" |
@@ -311,7 +311,7 @@ void TVVariant::load(QDataStream &s ) | |||
311 | d->value.i = x; | 311 | d->value.i = x; |
312 | } | 312 | } |
313 | break; | 313 | break; |
314 | default: | 314 | default: |
315 | qFatal("Unrecognized data type"); | 315 | qFatal("Unrecognized data type"); |
316 | } | 316 | } |
317 | } | 317 | } |
@@ -391,5 +391,5 @@ int TVVariant::toInt() const | |||
391 | 391 | ||
392 | if(d->typ == String) { | 392 | if(d->typ == String) { |
393 | QString tmpq(*(QString *)d->value.ptr); | 393 | QString tmpq(*(QString *)d->value.ptr); |
394 | return parseNextNumber(&tmpq); | 394 | return parseNextNumber(&tmpq); |
395 | } | 395 | } |
@@ -685,7 +685,7 @@ Key::Key(QString name, TVVariant example, int flags = 0) : | |||
685 | Key::Key(const Key &other) | 685 | Key::Key(const Key &other) |
686 | { | 686 | { |
687 | kname = other.kname; | 687 | kname = other.kname; |
688 | kexample = other.kexample; | 688 | kexample = other.kexample; |
689 | kflags = other.kflags; | 689 | kflags = other.kflags; |
690 | } | 690 | } |
691 | 691 | ||
@@ -779,8 +779,8 @@ KeyList::KeyList(const KeyList &k) : QIntDict<Key>(k) | |||
779 | { | 779 | { |
780 | KeyListIterator it(k); | 780 | KeyListIterator it(k); |
781 | while(it.current()) { | 781 | while(it.current()) { |
782 | replace(it.currentKey(), new Key(*it.current())); | 782 | replace(it.currentKey(), new Key(*it.current())); |
783 | ++it; | 783 | ++it; |
784 | } | 784 | } |
785 | 785 | ||
786 | setAutoDelete(TRUE); | 786 | setAutoDelete(TRUE); |
@@ -799,13 +799,13 @@ bool KeyList::operator!=(const KeyList &other) | |||
799 | 799 | ||
800 | if (other.getNumFields() != getNumFields()) | 800 | if (other.getNumFields() != getNumFields()) |
801 | return TRUE; | 801 | return TRUE; |
802 | 802 | ||
803 | while(it.current()) { | 803 | while(it.current()) { |
804 | //it.currentKey(), it.current(); | 804 | //it.currentKey(), it.current(); |
805 | if (other.getKeyName(it.currentKey()) != getKeyName(it.currentKey())) | 805 | if (other.getKeyName(it.currentKey()) != getKeyName(it.currentKey())) |
806 | return TRUE; | 806 | return TRUE; |
807 | if (other.getKeyType(it.currentKey()) != getKeyType(it.currentKey())) | 807 | if (other.getKeyType(it.currentKey()) != getKeyType(it.currentKey())) |
808 | return TRUE; | 808 | return TRUE; |
809 | ++it; | 809 | ++it; |
810 | } | 810 | } |
811 | return FALSE; | 811 | return FALSE; |
@@ -1183,5 +1183,5 @@ void DataElem::setField(int i, QString q) | |||
1183 | t.asInt(); | 1183 | t.asInt(); |
1184 | setField(i, t); | 1184 | setField(i, t); |
1185 | return; | 1185 | return; |
1186 | } | 1186 | } |
1187 | case TVVariant::String: { | 1187 | case TVVariant::String: { |
@@ -1271,5 +1271,5 @@ QString DataElem::toQString() const | |||
1271 | 1271 | ||
1272 | while (it.current()) { | 1272 | while (it.current()) { |
1273 | i = it.currentKey(); | 1273 | i = it.currentKey(); |
1274 | if(hasValidValue(i)) { | 1274 | if(hasValidValue(i)) { |
1275 | scratch += "<B>" + contained->getKeyName(i) + ":</B> "; | 1275 | scratch += "<B>" + contained->getKeyName(i) + ":</B> "; |
diff --git a/noncore/apps/tableviewer/main.cpp b/noncore/apps/tableviewer/main.cpp index 736e1cf..56c567f 100644 --- a/noncore/apps/tableviewer/main.cpp +++ b/noncore/apps/tableviewer/main.cpp | |||
@@ -19,5 +19,5 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "tableviewer.h" | 20 | #include "tableviewer.h" |
21 | #include <qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
22 | 22 | ||
23 | int main( int argc, char ** argv ) | 23 | int main( int argc, char ** argv ) |
diff --git a/noncore/apps/tableviewer/tableviewer.cpp b/noncore/apps/tableviewer/tableviewer.cpp index 0d4a412..0456b41 100644 --- a/noncore/apps/tableviewer/tableviewer.cpp +++ b/noncore/apps/tableviewer/tableviewer.cpp | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | /* QPE includes */ | 30 | /* QPE includes */ |
31 | #include "fileselector.h" | 31 | #include <qpe/fileselector.h> |
32 | #include "resource.h" | 32 | #include <qpe/resource.h> |
33 | #include <qpe/qpetoolbar.h> | ||
33 | 34 | ||
34 | /* QTE includes */ | 35 | /* QTE includes */ |
@@ -39,5 +40,4 @@ | |||
39 | #include <qlayout.h> | 40 | #include <qlayout.h> |
40 | #include <qbuffer.h> | 41 | #include <qbuffer.h> |
41 | |||
42 | /*! | 42 | /*! |
43 | \class TableViewerWindow | 43 | \class TableViewerWindow |
@@ -94,42 +94,42 @@ TableViewerWindow::TableViewerWindow(QWidget *parent, const char *name, WFlags f | |||
94 | navigation = new QPEToolBar(this, "navigation"); | 94 | navigation = new QPEToolBar(this, "navigation"); |
95 | QToolButton *newItemButton = new QToolButton( | 95 | QToolButton *newItemButton = new QToolButton( |
96 | QIconSet(Resource::loadImage("new")), "New Item", QString::null, | 96 | QIconSet(Resource::loadPixmap("new")), "New Item", QString::null, |
97 | this, SLOT(newItemSlot()), navigation, "New Item"); | 97 | this, SLOT(newItemSlot()), navigation, "New Item"); |
98 | QToolButton *editItemButton = new QToolButton( | 98 | QToolButton *editItemButton = new QToolButton( |
99 | QIconSet(Resource::loadImage("edit")), "Edit Item", QString::null, | 99 | QIconSet(Resource::loadPixmap("edit")), "Edit Item", QString::null, |
100 | this, SLOT(editItemSlot()), navigation, "Edit Item"); | 100 | this, SLOT(editItemSlot()), navigation, "Edit Item"); |
101 | QToolButton *deleteItemButton = new QToolButton( | 101 | QToolButton *deleteItemButton = new QToolButton( |
102 | QIconSet(Resource::loadImage("trash")), "Delete Item", | 102 | QIconSet(Resource::loadPixmap("trash")), "Delete Item", |
103 | QString::null, this, | 103 | QString::null, this, |
104 | SLOT(deleteItemSlot()), navigation, "Delete Item"); | 104 | SLOT(deleteItemSlot()), navigation, "Delete Item"); |
105 | 105 | ||
106 | navigation->addSeparator(); | 106 | navigation->addSeparator(); |
107 | 107 | ||
108 | QToolButton *firstItemButton = new QToolButton( | 108 | QToolButton *firstItemButton = new QToolButton( |
109 | QIconSet(Resource::loadImage("fastback")), "First Item", | 109 | QIconSet(Resource::loadPixmap("fastback")), "First Item", |
110 | QString::null, this, | 110 | QString::null, this, |
111 | SLOT(firstItem()), navigation, "First Item"); | 111 | SLOT(firstItem()), navigation, "First Item"); |
112 | QToolButton *previousItemButton = new QToolButton( | 112 | QToolButton *previousItemButton = new QToolButton( |
113 | QIconSet(Resource::loadImage("back")), "Previous Item", | 113 | QIconSet(Resource::loadPixmap("back")), "Previous Item", |
114 | QString::null, this, | 114 | QString::null, this, |
115 | SLOT(previousItem()), navigation, "Previous Item"); | 115 | SLOT(previousItem()), navigation, "Previous Item"); |
116 | QToolButton *nextItemButton = new QToolButton( | 116 | QToolButton *nextItemButton = new QToolButton( |
117 | QIconSet(Resource::loadImage("forward")), "Next Item", | 117 | QIconSet(Resource::loadPixmap("forward")), "Next Item", |
118 | QString::null, this, | 118 | QString::null, this, |
119 | SLOT(nextItem()), navigation, "Next Item"); | 119 | SLOT(nextItem()), navigation, "Next Item"); |
120 | QToolButton *lastItemButton = new QToolButton( | 120 | QToolButton *lastItemButton = new QToolButton( |
121 | QIconSet(Resource::loadImage("fastforward")), "Last Item", | 121 | QIconSet(Resource::loadPixmap("fastforward")), "Last Item", |
122 | QString::null, this, | 122 | QString::null, this, |
123 | SLOT(lastItem()), navigation, "Last Item"); | 123 | SLOT(lastItem()), navigation, "Last Item"); |
124 | 124 | ||
125 | navigation->addSeparator(); | 125 | navigation->addSeparator(); |
126 | QToolButton *browseButton = new QToolButton( | 126 | QToolButton *browseButton = new QToolButton( |
127 | QIconSet(Resource::loadImage("day")), "View Single Item", | 127 | QIconSet(Resource::loadPixmap("day")), "View Single Item", |
128 | QString::null, this, | 128 | QString::null, this, |
129 | SLOT(browseViewSlot()), navigation, "View Single Item"); | 129 | SLOT(browseViewSlot()), navigation, "View Single Item"); |
130 | QToolButton *listButton = new QToolButton( | 130 | QToolButton *listButton = new QToolButton( |
131 | QIconSet(Resource::loadImage("month")), "View Multiple Items", | 131 | QIconSet(Resource::loadPixmap("month")), "View Multiple Items", |
132 | QString::null, this, | 132 | QString::null, this, |
133 | SLOT(listViewSlot()), navigation, "View Multiple Items"); | 133 | SLOT(listViewSlot()), navigation, "View Multiple Items"); |
134 | 134 | ||
135 | setToolBarsMovable(FALSE); | 135 | setToolBarsMovable(FALSE); |
@@ -142,5 +142,5 @@ TableViewerWindow::TableViewerWindow(QWidget *parent, const char *name, WFlags f | |||
142 | filterView = new TVFilterView(&ts, this, 0); | 142 | filterView = new TVFilterView(&ts, this, 0); |
143 | fileSelector = new FileSelector("text/csv;text/x-xml-tableviewer", | 143 | fileSelector = new FileSelector("text/csv;text/x-xml-tableviewer", |
144 | this, "fileselector"); | 144 | this, "fileselector"); |
145 | fileSelector->setNewVisible(FALSE); | 145 | fileSelector->setNewVisible(FALSE); |
146 | fileSelector->setCloseVisible(FALSE); | 146 | fileSelector->setCloseVisible(FALSE); |
@@ -163,5 +163,5 @@ TableViewerWindow::TableViewerWindow(QWidget *parent, const char *name, WFlags f | |||
163 | connect(fileSelector, SIGNAL(closeMe()), this, SLOT(browseViewSlot())); | 163 | connect(fileSelector, SIGNAL(closeMe()), this, SLOT(browseViewSlot())); |
164 | connect(fileSelector, SIGNAL(fileSelected(const DocLnk &)), | 164 | connect(fileSelector, SIGNAL(fileSelected(const DocLnk &)), |
165 | this, SLOT(openDocument(const DocLnk &))); | 165 | this, SLOT(openDocument(const DocLnk &))); |
166 | 166 | ||
167 | main_layout->addWidget(menu); | 167 | main_layout->addWidget(menu); |
@@ -178,5 +178,5 @@ TableViewerWindow::~TableViewerWindow() | |||
178 | { | 178 | { |
179 | if(dirty) | 179 | if(dirty) |
180 | saveDocument(); | 180 | saveDocument(); |
181 | } | 181 | } |
182 | 182 | ||
@@ -187,5 +187,5 @@ void TableViewerWindow::selectDocument() | |||
187 | { | 187 | { |
188 | if(dirty) | 188 | if(dirty) |
189 | saveDocument(); | 189 | saveDocument(); |
190 | current_view = FileState; | 190 | current_view = FileState; |
191 | cw->raiseWidget(current_view); | 191 | cw->raiseWidget(current_view); |
@@ -196,5 +196,5 @@ void TableViewerWindow::saveDocument() | |||
196 | { | 196 | { |
197 | if(!dirty) | 197 | if(!dirty) |
198 | return; | 198 | return; |
199 | 199 | ||
200 | FileManager fm; | 200 | FileManager fm; |
@@ -202,6 +202,6 @@ void TableViewerWindow::saveDocument() | |||
202 | 202 | ||
203 | if(!ds->saveSource(dev, doc.type())){ | 203 | if(!ds->saveSource(dev, doc.type())){ |
204 | qWarning("Save unsuccessful"); | 204 | qWarning("Save unsuccessful"); |
205 | return; | 205 | return; |
206 | } | 206 | } |
207 | dev->close(); | 207 | dev->close(); |
@@ -230,7 +230,7 @@ void TableViewerWindow::newDocument() | |||
230 | cw->raiseWidget(current_view); | 230 | cw->raiseWidget(current_view); |
231 | 231 | ||
232 | /* now set up for editing the keys */ | 232 | /* now set up for editing the keys */ |
233 | ts.kRep->addKey("key", TVVariant::String); | 233 | ts.kRep->addKey("key", TVVariant::String); |
234 | editKeysSlot(); | 234 | editKeysSlot(); |
235 | } | 235 | } |
236 | 236 | ||
@@ -239,5 +239,5 @@ void TableViewerWindow::openDocument(const DocLnk &f) | |||
239 | 239 | ||
240 | if (!f.isValid()) | 240 | if (!f.isValid()) |
241 | return; | 241 | return; |
242 | 242 | ||
243 | FileManager fm; | 243 | FileManager fm; |
@@ -252,6 +252,6 @@ void TableViewerWindow::openDocument(const DocLnk &f) | |||
252 | filterView->reset(); | 252 | filterView->reset(); |
253 | 253 | ||
254 | current_view = BrowseState; | 254 | current_view = BrowseState; |
255 | cw->raiseWidget(current_view); | 255 | cw->raiseWidget(current_view); |
256 | 256 | ||
257 | /* set up new table state and ensure sub widgets have a reference */ | 257 | /* set up new table state and ensure sub widgets have a reference */ |
@@ -282,5 +282,5 @@ void TableViewerWindow::openDocument(const DocLnk &f) | |||
282 | setCaption(tr(scratch)); | 282 | setCaption(tr(scratch)); |
283 | 283 | ||
284 | dirty = FALSE; | 284 | dirty = FALSE; |
285 | } else { | 285 | } else { |
286 | qWarning(tr("could not load Document")); | 286 | qWarning(tr("could not load Document")); |
@@ -330,5 +330,5 @@ void TableViewerWindow::applyFilter() | |||
330 | if(d) | 330 | if(d) |
331 | if(filterView->passesFilter(d)) | 331 | if(filterView->passesFilter(d)) |
332 | listView->addItem(d); | 332 | listView->addItem(d); |
333 | } while(ds->next()); | 333 | } while(ds->next()); |
334 | listView->first(); | 334 | listView->first(); |
@@ -366,7 +366,7 @@ void TableViewerWindow::editItemSlot() | |||
366 | { | 366 | { |
367 | if(TVEditView::openEditItemDialog(&ts, ts.current_elem, this)) { | 367 | if(TVEditView::openEditItemDialog(&ts, ts.current_elem, this)) { |
368 | listView->rebuildData(); | 368 | listView->rebuildData(); |
369 | browseView->rebuildData(); | 369 | browseView->rebuildData(); |
370 | dirty = TRUE; | 370 | dirty = TRUE; |
371 | } | 371 | } |
372 | } | 372 | } |
@@ -377,10 +377,10 @@ void TableViewerWindow::newItemSlot() | |||
377 | if (TVEditView::openEditItemDialog(&ts, d, this)) { | 377 | if (TVEditView::openEditItemDialog(&ts, d, this)) { |
378 | 378 | ||
379 | ds->addItem(d); | 379 | ds->addItem(d); |
380 | ts.current_elem = d; | 380 | ts.current_elem = d; |
381 | applyFilter(); | 381 | applyFilter(); |
382 | listView->rebuildData(); | 382 | listView->rebuildData(); |
383 | browseView->rebuildData(); | 383 | browseView->rebuildData(); |
384 | dirty = TRUE; | 384 | dirty = TRUE; |
385 | } | 385 | } |
386 | } | 386 | } |
@@ -388,12 +388,12 @@ void TableViewerWindow::newItemSlot() | |||
388 | void TableViewerWindow::deleteItemSlot() | 388 | void TableViewerWindow::deleteItemSlot() |
389 | { | 389 | { |
390 | /* delete the actual item, then do a 'filter' */ | 390 | /* delete the actual item, then do a 'filter' */ |
391 | DataElem *to_remove = ts.current_elem; | 391 | DataElem *to_remove = ts.current_elem; |
392 | 392 | ||
393 | if(!to_remove) | 393 | if(!to_remove) |
394 | return; | 394 | return; |
395 | 395 | ||
396 | listView->removeItem(); | 396 | listView->removeItem(); |
397 | ds->removeItem(to_remove); | 397 | ds->removeItem(to_remove); |
398 | 398 | ||
399 | applyFilter(); | 399 | applyFilter(); |
@@ -433,5 +433,5 @@ void TableViewerWindow::editKeysSlot() | |||
433 | 433 | ||
434 | /* Set up browse view, Will be based of structure of listView */ | 434 | /* Set up browse view, Will be based of structure of listView */ |
435 | dirty = TRUE; | 435 | dirty = TRUE; |
436 | } | 436 | } |
437 | } | 437 | } |
diff --git a/noncore/apps/tableviewer/tableviewer.h b/noncore/apps/tableviewer/tableviewer.h index 2d4686a..0d3c39d 100644 --- a/noncore/apps/tableviewer/tableviewer.h +++ b/noncore/apps/tableviewer/tableviewer.h | |||
@@ -23,5 +23,5 @@ | |||
23 | #include <qmainwindow.h> | 23 | #include <qmainwindow.h> |
24 | #include "db/common.h" | 24 | #include "db/common.h" |
25 | #include "fileselector.h" | 25 | #include <qpe/fileselector.h> |
26 | 26 | ||
27 | /* Forward class declarations */ | 27 | /* Forward class declarations */ |
@@ -99,5 +99,5 @@ private: | |||
99 | FilterState, | 99 | FilterState, |
100 | EditState, | 100 | EditState, |
101 | FileState, | 101 | FileState, |
102 | }; | 102 | }; |
103 | 103 | ||
diff --git a/noncore/apps/tableviewer/ui/commonwidgets.cpp b/noncore/apps/tableviewer/ui/commonwidgets.cpp index 0b4f3c2..bf4c36f 100644 --- a/noncore/apps/tableviewer/ui/commonwidgets.cpp +++ b/noncore/apps/tableviewer/ui/commonwidgets.cpp | |||
@@ -23,5 +23,6 @@ | |||
23 | #include <qlabel.h> | 23 | #include <qlabel.h> |
24 | #include <qcombobox.h> | 24 | #include <qcombobox.h> |
25 | #include <datebookmonth.h> | 25 | |
26 | #include <qpe/datebookmonth.h> | ||
26 | #include <qpopupmenu.h> | 27 | #include <qpopupmenu.h> |
27 | #include <qspinbox.h> | 28 | #include <qspinbox.h> |
diff --git a/noncore/apps/tableviewer/ui/tvbrowseview.cpp b/noncore/apps/tableviewer/ui/tvbrowseview.cpp index f6da7b1..9bfc791 100644 --- a/noncore/apps/tableviewer/ui/tvbrowseview.cpp +++ b/noncore/apps/tableviewer/ui/tvbrowseview.cpp | |||
@@ -39,10 +39,10 @@ | |||
39 | */ | 39 | */ |
40 | TVBrowseView::TVBrowseView(TableState *t, QWidget* parent = 0, const char *name = 0, | 40 | TVBrowseView::TVBrowseView(TableState *t, QWidget* parent = 0, const char *name = 0, |
41 | WFlags fl =0) | 41 | WFlags fl =0) |
42 | { | 42 | { |
43 | if (!name) | 43 | if (!name) |
44 | setName("BrowseView"); | 44 | setName("BrowseView"); |
45 | 45 | ||
46 | setSizePolicy(QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding, 0, 0, sizePolicy().hasHeightForWidth() ) ); | 46 | // setSizePolicy(QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding, 0, 0, sizePolicy().hasHeightForWidth() ) ); |
47 | QVBoxLayout *vlayout = new QVBoxLayout(this); | 47 | QVBoxLayout *vlayout = new QVBoxLayout(this); |
48 | textViewDisplay = new QTextBrowser(this, "textViewDisplay"); | 48 | textViewDisplay = new QTextBrowser(this, "textViewDisplay"); |
@@ -75,8 +75,8 @@ void TVBrowseView::rebuildData() | |||
75 | return; | 75 | return; |
76 | if(!ts->current_elem) { | 76 | if(!ts->current_elem) { |
77 | /* also disable buttons */ | 77 | /* also disable buttons */ |
78 | textViewDisplay->setText(""); | 78 | textViewDisplay->setText(""); |
79 | return; | 79 | return; |
80 | } | 80 | } |
81 | 81 | ||
82 | setDisplayText(ts->current_elem); | 82 | setDisplayText(ts->current_elem); |