author | llornkcor <llornkcor> | 2002-03-11 13:35:07 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-11 13:35:07 (UTC) |
commit | d9406acf405148290c11a49fc09f5ed6b1258843 (patch) (side-by-side diff) | |
tree | fe3ca4c79917a1ff052ad63e65434b9b372c5d0b /noncore/apps/tableviewer/tableviewer.cpp | |
parent | aeb745907f05b7d0729d273f72b5641e890a4c27 (diff) | |
download | opie-d9406acf405148290c11a49fc09f5ed6b1258843.zip opie-d9406acf405148290c11a49fc09f5ed6b1258843.tar.gz opie-d9406acf405148290c11a49fc09f5ed6b1258843.tar.bz2 |
adde patch for Pru'homme
Diffstat (limited to 'noncore/apps/tableviewer/tableviewer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/tableviewer/tableviewer.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
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 @@ -25,24 +25,25 @@ #include "ui/tvlistview.h" #include "ui/tveditview.h" #include "ui/tvkeyedit.h" #include "db/datacache.h" /* QPE includes */ #include <qpe/fileselector.h> #include <qpe/resource.h> #include <qpe/qpetoolbar.h> /* QTE includes */ #include <qpe/qpemenubar.h> +#include <qpe/qpetoolbar.h> #include <qpopupmenu.h> #include <qapplication.h> #include <qwidgetstack.h> #include <qlayout.h> #include <qbuffer.h> /*! \class TableViewerWindow \brief The main window widget of the application This is the main widget of the table viewer application. It is the co-ordination point. */ @@ -225,24 +226,29 @@ void TableViewerWindow::newDocument() doc = nf; dirty = FALSE; current_view = BrowseState; cw->raiseWidget(current_view); /* now set up for editing the keys */ ts.kRep->addKey("key", TVVariant::String); editKeysSlot(); } +void TableViewerWindow::setDocument(const QString &f) +{ + openDocument(DocLnk(f, TRUE)); +} + void TableViewerWindow::openDocument(const DocLnk &f) { if (!f.isValid()) return; FileManager fm; QIODevice *dev = fm.openFile(f); doc = f; if(ds->openSource(dev, doc.type())) { DataElem *d; @@ -280,24 +286,44 @@ void TableViewerWindow::openDocument(const DocLnk &f) scratch += " - "; scratch += ds->getName(); setCaption(tr(scratch)); dirty = FALSE; } else { qWarning(tr("could not load Document")); } dev->close(); } /*! + Moves to the first item of the current table +*/ +void TableViewerWindow::firstItem() +{ + listView->first(); + ts.current_elem = listView->getCurrentData(); + browseView->rebuildData(); +} + +/*! + Moves to the lat item of the current table +*/ +void TableViewerWindow::lastItem() +{ + listView->last(); + ts.current_elem = listView->getCurrentData(); + browseView->rebuildData(); +} + +/*! Moves to the next item of the current table */ void TableViewerWindow::nextItem() { listView->next(); ts.current_elem = listView->getCurrentData(); browseView->rebuildData(); } /*! Moves to the previous item of the current table */ |