From d9406acf405148290c11a49fc09f5ed6b1258843 Mon Sep 17 00:00:00 2001 From: llornkcor Date: Mon, 11 Mar 2002 13:35:07 +0000 Subject: adde patch for Pru'homme --- (limited to 'noncore/apps') 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 @@ -24,9 +24,9 @@ int main( int argc, char ** argv ) { QPEApplication a( argc, argv ); - TableViewerWindow * mw = new TableViewerWindow; - mw->setCaption( TableViewerWindow::tr("Table Viewer") ); - a.showMainWidget(mw); + TableViewerWindow mw; + mw.setCaption( TableViewerWindow::tr("Table Viewer") ); + a.showMainWidget(&mw); return a.exec(); } 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 @@ -34,6 +34,7 @@ /* QTE includes */ #include +#include #include #include #include @@ -234,6 +235,11 @@ void TableViewerWindow::newDocument() editKeysSlot(); } +void TableViewerWindow::setDocument(const QString &f) +{ + openDocument(DocLnk(f, TRUE)); +} + void TableViewerWindow::openDocument(const DocLnk &f) { @@ -289,6 +295,26 @@ void TableViewerWindow::openDocument(const DocLnk &f) } /*! + 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() 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 @@ -49,8 +49,11 @@ public slots: void newDocument(); void saveDocument(); + void setDocument(const QString &); void openDocument(const DocLnk &); + void firstItem(); + void lastItem(); void nextItem(); void previousItem(); -- cgit v0.9.0.2