-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 | |||
@@ -24,3 +24,3 @@ | |||
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" |
@@ -312,5 +312,5 @@ void TVVariant::load(QDataStream &s ) | |||
312 | } | 312 | } |
313 | break; | 313 | break; |
314 | default: | 314 | default: |
315 | qFatal("Unrecognized data type"); | 315 | qFatal("Unrecognized data type"); |
316 | } | 316 | } |
@@ -392,3 +392,3 @@ int TVVariant::toInt() const | |||
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); |
@@ -686,5 +686,5 @@ 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 | } |
@@ -780,6 +780,6 @@ KeyList::KeyList(const KeyList &k) : QIntDict<Key>(k) | |||
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 | ||
@@ -800,11 +800,11 @@ bool KeyList::operator!=(const KeyList &other) | |||
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 | } |
@@ -1184,3 +1184,3 @@ void DataElem::setField(int i, QString q) | |||
1184 | setField(i, t); | 1184 | setField(i, t); |
1185 | return; | 1185 | return; |
1186 | } | 1186 | } |
@@ -1272,3 +1272,3 @@ QString DataElem::toQString() const | |||
1272 | while (it.current()) { | 1272 | while (it.current()) { |
1273 | i = it.currentKey(); | 1273 | i = it.currentKey(); |
1274 | if(hasValidValue(i)) { | 1274 | if(hasValidValue(i)) { |
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 | |||
@@ -20,3 +20,3 @@ | |||
20 | #include "tableviewer.h" | 20 | #include "tableviewer.h" |
21 | #include <qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
22 | 22 | ||
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 | |||
@@ -30,4 +30,5 @@ | |||
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 | ||
@@ -40,3 +41,2 @@ | |||
40 | #include <qbuffer.h> | 41 | #include <qbuffer.h> |
41 | |||
42 | /*! | 42 | /*! |
@@ -95,11 +95,11 @@ TableViewerWindow::TableViewerWindow(QWidget *parent, const char *name, WFlags f | |||
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 | ||
@@ -108,17 +108,17 @@ TableViewerWindow::TableViewerWindow(QWidget *parent, const char *name, WFlags f | |||
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 | ||
@@ -126,9 +126,9 @@ TableViewerWindow::TableViewerWindow(QWidget *parent, const char *name, WFlags f | |||
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 | ||
@@ -143,3 +143,3 @@ TableViewerWindow::TableViewerWindow(QWidget *parent, const char *name, WFlags f | |||
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); |
@@ -164,3 +164,3 @@ TableViewerWindow::TableViewerWindow(QWidget *parent, const char *name, WFlags f | |||
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 | ||
@@ -179,3 +179,3 @@ TableViewerWindow::~TableViewerWindow() | |||
179 | if(dirty) | 179 | if(dirty) |
180 | saveDocument(); | 180 | saveDocument(); |
181 | } | 181 | } |
@@ -188,3 +188,3 @@ void TableViewerWindow::selectDocument() | |||
188 | if(dirty) | 188 | if(dirty) |
189 | saveDocument(); | 189 | saveDocument(); |
190 | current_view = FileState; | 190 | current_view = FileState; |
@@ -197,3 +197,3 @@ void TableViewerWindow::saveDocument() | |||
197 | if(!dirty) | 197 | if(!dirty) |
198 | return; | 198 | return; |
199 | 199 | ||
@@ -203,4 +203,4 @@ void TableViewerWindow::saveDocument() | |||
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 | } |
@@ -231,5 +231,5 @@ void TableViewerWindow::newDocument() | |||
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 | } |
@@ -240,3 +240,3 @@ void TableViewerWindow::openDocument(const DocLnk &f) | |||
240 | if (!f.isValid()) | 240 | if (!f.isValid()) |
241 | return; | 241 | return; |
242 | 242 | ||
@@ -253,4 +253,4 @@ void TableViewerWindow::openDocument(const DocLnk &f) | |||
253 | 253 | ||
254 | current_view = BrowseState; | 254 | current_view = BrowseState; |
255 | cw->raiseWidget(current_view); | 255 | cw->raiseWidget(current_view); |
256 | 256 | ||
@@ -283,3 +283,3 @@ void TableViewerWindow::openDocument(const DocLnk &f) | |||
283 | 283 | ||
284 | dirty = FALSE; | 284 | dirty = FALSE; |
285 | } else { | 285 | } else { |
@@ -331,3 +331,3 @@ void TableViewerWindow::applyFilter() | |||
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()); |
@@ -367,5 +367,5 @@ void TableViewerWindow::editItemSlot() | |||
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 | } |
@@ -378,8 +378,8 @@ void TableViewerWindow::newItemSlot() | |||
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 | } |
@@ -389,10 +389,10 @@ 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 | ||
@@ -434,3 +434,3 @@ void TableViewerWindow::editKeysSlot() | |||
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 | } |
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 | |||
@@ -24,3 +24,3 @@ | |||
24 | #include "db/common.h" | 24 | #include "db/common.h" |
25 | #include "fileselector.h" | 25 | #include <qpe/fileselector.h> |
26 | 26 | ||
@@ -100,3 +100,3 @@ private: | |||
100 | EditState, | 100 | EditState, |
101 | FileState, | 101 | FileState, |
102 | }; | 102 | }; |
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 | |||
@@ -24,3 +24,4 @@ | |||
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> |
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 | |||
@@ -40,8 +40,8 @@ | |||
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); |
@@ -76,6 +76,6 @@ void TVBrowseView::rebuildData() | |||
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 | ||