summaryrefslogtreecommitdiff
path: root/noncore/apps/tableviewer
Unidiff
Diffstat (limited to 'noncore/apps/tableviewer') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/tableviewer/main.cpp6
-rw-r--r--noncore/apps/tableviewer/tableviewer.cpp26
-rw-r--r--noncore/apps/tableviewer/tableviewer.h3
3 files changed, 32 insertions, 3 deletions
diff --git a/noncore/apps/tableviewer/main.cpp b/noncore/apps/tableviewer/main.cpp
index 56c567f..d17ee65 100644
--- a/noncore/apps/tableviewer/main.cpp
+++ b/noncore/apps/tableviewer/main.cpp
@@ -21,12 +21,12 @@
21#include <qpe/qpeapplication.h> 21#include <qpe/qpeapplication.h>
22 22
23int main( int argc, char ** argv ) 23int main( int argc, char ** argv )
24{ 24{
25 QPEApplication a( argc, argv ); 25 QPEApplication a( argc, argv );
26 26
27 TableViewerWindow * mw = new TableViewerWindow; 27 TableViewerWindow mw;
28 mw->setCaption( TableViewerWindow::tr("Table Viewer") ); 28 mw.setCaption( TableViewerWindow::tr("Table Viewer") );
29 a.showMainWidget(mw); 29 a.showMainWidget(&mw);
30 30
31 return a.exec(); 31 return a.exec();
32} 32}
diff --git a/noncore/apps/tableviewer/tableviewer.cpp b/noncore/apps/tableviewer/tableviewer.cpp
index 0456b41..fbb5c24 100644
--- a/noncore/apps/tableviewer/tableviewer.cpp
+++ b/noncore/apps/tableviewer/tableviewer.cpp
@@ -31,12 +31,13 @@
31#include <qpe/fileselector.h> 31#include <qpe/fileselector.h>
32#include <qpe/resource.h> 32#include <qpe/resource.h>
33#include <qpe/qpetoolbar.h> 33#include <qpe/qpetoolbar.h>
34 34
35/* QTE includes */ 35/* QTE includes */
36#include <qpe/qpemenubar.h> 36#include <qpe/qpemenubar.h>
37#include <qpe/qpetoolbar.h>
37#include <qpopupmenu.h> 38#include <qpopupmenu.h>
38#include <qapplication.h> 39#include <qapplication.h>
39#include <qwidgetstack.h> 40#include <qwidgetstack.h>
40#include <qlayout.h> 41#include <qlayout.h>
41#include <qbuffer.h> 42#include <qbuffer.h>
42/*! 43/*!
@@ -231,12 +232,17 @@ void TableViewerWindow::newDocument()
231 232
232 /* now set up for editing the keys */ 233 /* now set up for editing the keys */
233 ts.kRep->addKey("key", TVVariant::String); 234 ts.kRep->addKey("key", TVVariant::String);
234 editKeysSlot(); 235 editKeysSlot();
235} 236}
236 237
238void TableViewerWindow::setDocument(const QString &f)
239{
240 openDocument(DocLnk(f, TRUE));
241}
242
237void TableViewerWindow::openDocument(const DocLnk &f) 243void TableViewerWindow::openDocument(const DocLnk &f)
238{ 244{
239 245
240 if (!f.isValid()) 246 if (!f.isValid())
241 return; 247 return;
242 248
@@ -286,12 +292,32 @@ void TableViewerWindow::openDocument(const DocLnk &f)
286 qWarning(tr("could not load Document")); 292 qWarning(tr("could not load Document"));
287 } 293 }
288 dev->close(); 294 dev->close();
289} 295}
290 296
291/*! 297/*!
298 Moves to the first item of the current table
299*/
300void TableViewerWindow::firstItem()
301{
302 listView->first();
303 ts.current_elem = listView->getCurrentData();
304 browseView->rebuildData();
305}
306
307/*!
308 Moves to the lat item of the current table
309*/
310void TableViewerWindow::lastItem()
311{
312 listView->last();
313 ts.current_elem = listView->getCurrentData();
314 browseView->rebuildData();
315}
316
317/*!
292 Moves to the next item of the current table 318 Moves to the next item of the current table
293*/ 319*/
294void TableViewerWindow::nextItem() 320void TableViewerWindow::nextItem()
295{ 321{
296 listView->next(); 322 listView->next();
297 ts.current_elem = listView->getCurrentData(); 323 ts.current_elem = listView->getCurrentData();
diff --git a/noncore/apps/tableviewer/tableviewer.h b/noncore/apps/tableviewer/tableviewer.h
index 0d3c39d..817db21 100644
--- a/noncore/apps/tableviewer/tableviewer.h
+++ b/noncore/apps/tableviewer/tableviewer.h
@@ -46,14 +46,17 @@ public:
46 46
47public slots: 47public slots:
48 void selectDocument(); 48 void selectDocument();
49 49
50 void newDocument(); 50 void newDocument();
51 void saveDocument(); 51 void saveDocument();
52 void setDocument(const QString &);
52 void openDocument(const DocLnk &); 53 void openDocument(const DocLnk &);
53 54
55 void firstItem();
56 void lastItem();
54 void nextItem(); 57 void nextItem();
55 void previousItem(); 58 void previousItem();
56 59
57 void listViewSlot(); 60 void listViewSlot();
58 void browseViewSlot(); 61 void browseViewSlot();
59 void filterViewSlot(); 62 void filterViewSlot();