added gotofirstpage action

This commit is contained in:
dockes 2007-08-02 06:33:35 +00:00
parent e883b24ffc
commit 767e4c01c8
6 changed files with 40 additions and 8 deletions

View File

@ -6,6 +6,7 @@
<file>images/history.png</file>
<file>images/nextpage.png</file>
<file>images/prevpage.png</file>
<file>images/firstpage.png</file>
<file>images/sortparms.png</file>
<file>images/spell.png</file>
</qresource>

View File

@ -120,6 +120,7 @@
<property name="label">
<string>Result list</string>
</property>
<action name="firstPageAction"/>
<action name="prevPageAction"/>
<action name="nextPageAction"/>
</toolbar>
@ -259,6 +260,20 @@
<string>Next page of results</string>
</property>
</action>
<action>
<property name="name">
<cstring>firstPageAction</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>First page</string>
</property>
<property name="toolTip">
<string>Go to first page of results</string>
</property>
</action>
<action>
<property name="name">
<cstring>prevPageAction</cstring>

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.38 2007-08-01 10:04:53 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: rclmain_w.cpp,v 1.39 2007-08-02 06:33:35 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@ -151,6 +151,8 @@ void RclMain::init()
// signals and slots connections
connect(sSearch, SIGNAL(clearSearch()),
this, SLOT(resetSearch()));
connect(firstPageAction, SIGNAL(activated()),
resList, SLOT(resultPageFirst()));
connect(prevPageAction, SIGNAL(activated()),
resList, SLOT(resultPageBack()));
connect(nextPageAction, SIGNAL(activated()),
@ -202,6 +204,7 @@ void RclMain::init()
#if (QT_VERSION < 0x040000)
nextPageAction->setIconSet(createIconSet("nextpage.png"));
prevPageAction->setIconSet(createIconSet("prevpage.png"));
firstPageAction->setIconSet(createIconSet("firstpage.png"));
toolsSpellAction->setIconSet(QPixmap::fromMimeSource("spell.png"));
toolsDoc_HistoryAction->setIconSet(QPixmap::fromMimeSource("history.png"));
toolsAdvanced_SearchAction->setIconSet(QPixmap::fromMimeSource("asearch.png"));
@ -210,6 +213,7 @@ void RclMain::init()
toolsSpellAction->setIcon(QIcon(":/images/spell.png"));
nextPageAction->setIcon(QIcon(":/images/nextpage.png"));
prevPageAction->setIcon(QIcon(":/images/prevpage.png"));
firstPageAction->setIcon(QIcon(":/images/firstpage.png"));
toolsDoc_HistoryAction->setIcon(QIcon(":/images/history.png"));
toolsAdvanced_SearchAction->setIcon(QIcon(":/images/asearch.png"));
toolsSort_parametersAction->setIcon(QIcon(":/images/sortparms.png"));
@ -950,5 +954,6 @@ void RclMain::enableNextPage(bool yesno)
void RclMain::enablePrevPage(bool yesno)
{
prevPageAction->setEnabled(yesno);
firstPageAction->setEnabled(yesno);
}

View File

@ -42,15 +42,18 @@ FORMS = \
uiprefs.ui \
viewaction.ui
IMAGES = images/asearch.png \
images/history.png \
IMAGES = \
images/asearch.png \
images/d_firstpage.png \
images/d_nextpage.png \
images/nextpage.png \
images/d_prevpage.png \
images/d_spell.png \
images/firstpage.png \
images/history.png \
images/nextpage.png \
images/prevpage.png \
images/sortparms.png \
images/d_spell.png \
images/spell.png
images/spell.png
unix {
UI_DIR = .ui

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.32 2007-07-20 14:32:55 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.33 2007-08-02 06:33:35 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
#include <time.h>
@ -247,6 +247,13 @@ void ResList::resultPageBack()
resultPageNext();
}
// Go to the first page
void ResList::resultPageFirst()
{
m_winfirst = -1;
resultPageNext();
}
// Convert byte count into unit (KB/MB...) appropriate for display
static string displayableBytes(long size)
{

View File

@ -1,6 +1,6 @@
#ifndef _RESLIST_H_INCLUDED_
#define _RESLIST_H_INCLUDED_
/* @(#$Id: reslist.h,v 1.12 2007-07-20 14:32:55 dockes Exp $ (C) 2005 J.F.Dockes */
/* @(#$Id: reslist.h,v 1.13 2007-08-02 06:33:35 dockes Exp $ (C) 2005 J.F.Dockes */
#include <list>
@ -47,6 +47,7 @@ class ResList : public QTEXTBROWSER
virtual void resPageUpOrBack(); // Page up pressed
virtual void resPageDownOrNext(); // Page down pressed
virtual void resultPageBack(); // Display previous page of results
virtual void resultPageFirst(); // Display first page of results
virtual void resultPageNext(); // Display next (or first) page of results
virtual void menuPreview();
virtual void menuEdit();