summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-07-02 12:46:18 (UTC)
committer llornkcor <llornkcor>2002-07-02 12:46:18 (UTC)
commitd4a5bcbba0e6f67ef9d41e08c7d5ae598caa61a8 (patch) (side-by-side diff)
tree36de80f384f0a6c51efef6bed184a77ece608eae
parentdbcbad1d7252e877e485020966eb25e9f4a34f49 (diff)
downloadopie-d4a5bcbba0e6f67ef9d41e08c7d5ae598caa61a8.zip
opie-d4a5bcbba0e6f67ef9d41e08c7d5ae598caa61a8.tar.gz
opie-d4a5bcbba0e6f67ef9d41e08c7d5ae598caa61a8.tar.bz2
use icon on opie-reader pics dir
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReaderApp.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp
index 06a35f6..68c80c1 100644
--- a/noncore/apps/opie-reader/QTReaderApp.cpp
+++ b/noncore/apps/opie-reader/QTReaderApp.cpp
@@ -32,385 +32,385 @@
#include <qobjectlist.h>
#include <qpe/global.h>
#include <qpe/applnk.h>
#include <qfileinfo.h>
#include <stdlib.h> //getenv
#include <qprogressbar.h>
#include <qpe/config.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include "cbkmkselector.h"
#include "infowin.h"
//#include <qpe/fontdatabase.h>
#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
#include "QTReaderApp.h"
#include "fileBrowser.h"
unsigned long QTReaderApp::m_uid = 0;
void QTReaderApp::setScrollState(bool _b) { m_scrollButton->setOn(_b); }
#include <unistd.h>
#include <stddef.h>
#include <dirent.h>
void QTReaderApp::listBkmkFiles()
{
bkmkselector->clear();
int cnt = 0;
DIR *d;
d = opendir((const char *)Global::applicationFileName("uqtreader",""));
while(1)
{
struct dirent* de;
struct stat buf;
de = readdir(d);
if (de == NULL) break;
if (lstat((const char *)Global::applicationFileName("uqtreader",de->d_name),&buf) == 0 && S_ISREG(buf.st_mode))
{
bkmkselector->insertItem(de->d_name);
cnt++;
}
}
closedir(d);
if (cnt > 0)
{
menu->hide();
editBar->hide();
if (m_fontVisible) m_fontBar->hide();
if (regVisible) regBar->hide();
if (searchVisible) searchBar->hide();
m_nRegAction = cRmBkmkFile;
editorStack->raiseWidget( bkmkselector );
}
else
QMessageBox::information(this, "QTReader", "No bookmark files");
}
QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
: QMainWindow( parent, name, f ), bFromDocView( FALSE )
{
// qDebug("Application directory = %s", (const tchar *)QPEApplication::documentDir());
// qDebug("Application directory = %s", (const tchar *)Global::applicationFileName("uqtreader","bkmks.xml"));
pBkmklist = NULL;
doc = 0;
m_fBkmksChanged = false;
QString lang = getenv( "LANG" );
m_autogenstr = "^ *[A-Z].*[a-z] *$";
setToolBarsMovable( FALSE );
setIcon( Resource::loadPixmap( "uqtreader" ) );
QPEToolBar *bar = new QPEToolBar( this );
bar->setHorizontalStretchable( TRUE );
addToolBar(bar, "tool",QMainWindow::Top, true);
menu = bar;
QPEMenuBar *mb = new QPEMenuBar( bar );
QPopupMenu *file = new QPopupMenu( this );
QPopupMenu *format = new QPopupMenu( this );
// QPopupMenu *edit = new QPopupMenu( this );
// bar = new QToolBar( this );
editBar = bar;
/*
QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
a->addTo( bar );
a->addTo( file );
*/
editorStack = new QWidgetStack( this );
setCentralWidget( editorStack );
searchVisible = FALSE;
regVisible = FALSE;
m_fontVisible = false;
pbar = new QProgressBar(this);
pbar->hide();
m_infoWin = new infowin(editorStack);
editorStack->addWidget(m_infoWin, get_unique_id());
connect( m_infoWin, SIGNAL( Close() ), this, SLOT( infoClose() ) );
// bkmkselector = new QListBox(editorStack, "Bookmarks");
bkmkselector = new CBkmkSelector(editorStack, "Bookmarks");
// connect(bkmkselector, SIGNAL( selected(const QString&) ), this, SLOT( gotobkmk(const QString&) ) );
connect(bkmkselector, SIGNAL( selected(int) ), this, SLOT( gotobkmk(int) ) );
connect(bkmkselector, SIGNAL( cancelled() ), this, SLOT( cancelbkmk() ) );
editorStack->addWidget( bkmkselector, get_unique_id() );
/*
importSelector = new FileSelector( "*", editorStack, "importselector", false );
connect( importSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( importFile( const DocLnk & ) ) );
editorStack->addWidget( importSelector, get_unique_id() );
// don't need the close visible, it is redundant...
importSelector->setCloseVisible( FALSE );
*/
reader = new QTReader( editorStack );
Config config( "uqtreader" );
config.setGroup( "View" );
reader->bstripcr = config.readBoolEntry( "StripCr", true );
reader->bstriphtml = config.readBoolEntry( "StripHtml", false );
reader->bdehyphen = config.readBoolEntry( "Dehyphen", false );
reader->bunindent = config.readBoolEntry( "Unindent", false );
reader->brepara = config.readBoolEntry( "Repara", false );
reader->bdblspce = config.readBoolEntry( "DoubleSpace", false );
reader->bindenter = config.readNumEntry( "Indent", 0 );
reader->m_textsize = config.readNumEntry( "FontSize", 12 );
reader->m_bBold = config.readBoolEntry( "Bold", false );
reader->m_delay = config.readNumEntry( "ScrollDelay", 5184);
reader->m_lastfile = config.readEntry( "LastFile", QString::null );
reader->m_lastposn = config.readNumEntry( "LastPosn", 0 );
reader->m_bpagemode = config.readBoolEntry( "PageMode", true );
reader->m_bMonoSpaced = config.readBoolEntry( "MonoSpaced", false);
reader->m_fontname = config.readEntry( "Fontname", "helvetica" );
reader->m_encd = config.readNumEntry( "Encoding", 0 );
reader->m_charpc = config.readNumEntry( "CharSpacing", 100 );
reader->m_overlap = config.readNumEntry( "Overlap", 0 );
reader->m_targetapp = config.readEntry( "TargetApp", QString::null );
reader->m_targetmsg = config.readEntry( "TargetMsg", QString::null );
reader->init();
editorStack->addWidget( reader, get_unique_id() );
QAction *a = new QAction( tr( "Open" ), Resource::loadPixmap( "fileopen" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
a->addTo( bar );
a->addTo( file );
/*
a = new QAction( tr( "Revert" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( fileRevert() ) );
a->addTo( file );
a = new QAction( tr( "Cut" ), Resource::loadPixmap( "cut" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
a->addTo( editBar );
a->addTo( edit );
*/
a = new QAction( tr( "Info" ), QString::null, 0, this, NULL);
connect( a, SIGNAL( activated() ), this, SLOT( showinfo() ) );
a->addTo( file );
a = new QAction( tr( "Start Block" ), QString::null, 0, this, NULL);
connect( a, SIGNAL( activated() ), this, SLOT( editMark() ) );
file->insertSeparator();
a->addTo( file );
a = new QAction( tr( "Copy Block" ), QString::null, 0, this, NULL);
connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) );
a->addTo( file );
- a = m_scrollButton = new QAction( tr( "Scroll" ), Resource::loadPixmap( "panel-arrow-down" ), QString::null, 0, this, 0, true );
+ a = m_scrollButton = new QAction( tr( "Scroll" ), Resource::loadPixmap( "opie-reader/panel-arrow-down" ), QString::null, 0, this, 0, true );
// connect( a, SIGNAL( activated() ), this, SLOT( autoScroll() ) );
a->setOn(false);
connect( a, SIGNAL( toggled(bool) ), this, SLOT( autoScroll(bool) ) );
file->insertSeparator();
a->addTo( bar );
a->addTo( file );
/*
a = new QAction( tr( "Find" ), QString::null, 0, this, NULL, true );
// connect( a, SIGNAL( activated() ), this, SLOT( pagedn() ) );
a->addTo( file );
a = new QAction( tr( "Find Again" ), QString::null, 0, this, NULL, true );
// connect( a, SIGNAL( activated() ), this, SLOT( pagedn() ) );
a->addTo( file );
*/
a = new QAction( tr( "Jump" ), QString::null, 0, this, NULL);
connect( a, SIGNAL( activated() ), this, SLOT( jump() ) );
a->addTo( file );
a = new QAction( tr( "Page/Line scroll" ), QString::null, 0, this, NULL, true );
connect( a, SIGNAL( toggled(bool) ), this, SLOT( pagemode(bool) ) );
a->setOn(reader->m_bpagemode);
a->addTo( file );
a = new QAction( tr( "Set Overlap" ), QString::null, 0, this, NULL);
connect( a, SIGNAL( activated() ), this, SLOT( setoverlap() ) );
a->addTo( file );
a = new QAction( tr( "Set Dictionary" ), QString::null, 0, this, NULL);
connect( a, SIGNAL( activated() ), this, SLOT( settarget() ) );
a->addTo( file );
/*
a = new QAction( tr( "Import" ), QString::null, 0, this, NULL );
connect( a, SIGNAL( activated() ), this, SLOT( importFiles() ) );
a->addTo( file );
*/
a = new QAction( tr( "Up" ), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( pageup() ) );
a->addTo( editBar );
a = new QAction( tr( "Down" ), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( pagedn() ) );
a->addTo( editBar );
/*
a = new QAction( tr( "Paste" ), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) );
a->addTo( editBar );
a->addTo( edit );
*/
a = new QAction( tr( "Find..." ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( editFind() ) );
file->insertSeparator();
a->addTo( bar );
a->addTo( file );
a = new QAction( tr( "Strip CR" ), QString::null, 0, this, NULL, true );
a->setOn(reader->bstripcr);
connect( a, SIGNAL( toggled(bool) ), this, SLOT( stripcr(bool) ) );
a->addTo( format );
// a->setOn(true);
a = new QAction( tr( "Strip HTML" ), QString::null, 0, this, NULL, true );
a->setOn(reader->bstriphtml);
connect( a, SIGNAL( toggled(bool) ), this, SLOT( striphtml(bool) ) );
a->addTo( format );
a = new QAction( tr( "Dehyphen" ), QString::null, 0, this, NULL, true );
a->setOn(reader->bdehyphen);
connect( a, SIGNAL( toggled(bool) ), this, SLOT( dehyphen(bool) ) );
a->addTo( format );
a = new QAction( tr( "Unindent" ), QString::null, 0, this, NULL, true );
connect( a, SIGNAL( toggled(bool) ), this, SLOT( unindent(bool) ) );
a->setOn(reader->bunindent);
a->addTo( format );
a = new QAction( tr( "Re-paragraph" ), QString::null, 0, this, NULL, true );
connect( a, SIGNAL( toggled(bool) ), this, SLOT( repara(bool) ) );
a->setOn(reader->brepara);
a->addTo( format );
a = new QAction( tr( "Double Space" ), QString::null, 0, this, NULL, true );
connect( a, SIGNAL( toggled(bool) ), this, SLOT( dblspce(bool) ) );
a->setOn(reader->bdblspce);
a->addTo( format );
a = new QAction( tr( "Indent+" ), QString::null, 0, this, NULL );
connect( a, SIGNAL( activated() ), this, SLOT( indentplus() ) );
a->addTo( format );
a = new QAction( tr( "Indent-" ), QString::null, 0, this, NULL );
connect( a, SIGNAL( activated() ), this, SLOT( indentminus() ) );
a->addTo( format );
a = new QAction( tr( "Bold" ), QString::null, 0, this, NULL, true );
a->setOn(reader->m_bBold);
connect( a, SIGNAL( toggled(bool) ), this, SLOT( setbold(bool) ) );
a->addTo( format );
// a = new QAction( tr( "Zoom" ), QString::null, 0, this, NULL, true );
// a = new QAction( tr( "Zoom" ), Resource::loadPixmap( "mag" ), QString::null, 0, this, 0 );
a = new QAction( tr( "Zoom" ), QString::null, 0, this);
connect( a, SIGNAL( activated() ), this, SLOT( TBDzoom() ) );
format->insertSeparator();
a->addTo( format );
// a->addTo( editBar );
a = new QAction( tr( "Ideogram/Word" ), QString::null, 0, this, NULL, true );
connect( a, SIGNAL( toggled(bool) ), this, SLOT( monospace(bool) ) );
a->setOn(reader->m_bMonoSpaced);
format->insertSeparator();
a->addTo( format );
a = new QAction( tr( "Set width" ), QString::null, 0, this, NULL);
connect( a, SIGNAL( activated() ), this, SLOT( setspacing() ) );
a->addTo( format );
QPopupMenu *encoding = new QPopupMenu(this);
format->insertSeparator();
format->insertItem( tr( "Encoding" ), encoding );
QActionGroup* ag = new QActionGroup(this);
m_EncodingAction[0] = new QAction( tr( "Ascii" ), QString::null, 0, ag, NULL, true );
m_EncodingAction[1] = new QAction( tr( "UTF-8" ), QString::null, 0, ag, NULL, true );
m_EncodingAction[2] = new QAction( tr( "UCS-2(BE)" ), QString::null, 0, ag, NULL, true );
m_EncodingAction[3] = new QAction( tr( "USC-2(LE)" ), QString::null, 0, ag, NULL, true );
m_EncodingAction[4] = new QAction( tr( "Palm" ), QString::null, 0, ag, NULL, true );
m_EncodingAction[5] = new QAction( tr( "Windows(1252)" ), QString::null, 0, ag, NULL, true );
ag->addTo(encoding);
connect(ag, SIGNAL( selected(QAction*) ), this, SLOT( encodingSelected(QAction*) ) );
a = new QAction( tr( "Set Font" ), QString::null, 0, this);
connect( a, SIGNAL( activated() ), this, SLOT( setfont() ) );
format->insertSeparator();
a->addTo( format );
QPopupMenu *marks = new QPopupMenu( this );
a = new QAction( tr( "Mark" ), QString::null, 0, this, NULL);
connect( a, SIGNAL( activated() ), this, SLOT( addbkmk() ) );
a->addTo( marks );
a = new QAction( tr( "Goto" ), QString::null, 0, this, NULL, false );
connect( a, SIGNAL( activated() ), this, SLOT( do_gotomark() ) );
a->addTo( marks );
a = new QAction( tr( "Delete" ), QString::null, 0, this, NULL);
connect( a, SIGNAL( activated() ), this, SLOT( do_delmark() ) );
a->addTo( marks );
a = new QAction( tr( "Autogen" ), QString::null, 0, this, NULL, false );
connect( a, SIGNAL( activated() ), this, SLOT( do_autogen() ) );
marks->insertSeparator();
a->addTo( marks );
a = new QAction( tr( "Clear" ), QString::null, 0, this, NULL);
connect( a, SIGNAL( activated() ), this, SLOT( clearBkmkList() ) );
a->addTo( marks );
a = new QAction( tr( "Save" ), QString::null, 0, this, NULL );
connect( a, SIGNAL( activated() ), this, SLOT( savebkmks() ) );
a->addTo( marks );
a = new QAction( tr( "Tidy" ), QString::null, 0, this, NULL);
connect( a, SIGNAL( activated() ), this, SLOT( listBkmkFiles() ) );
marks->insertSeparator();
a->addTo( marks );
mb->insertItem( tr( "File" ), file );
// mb->insertItem( tr( "Edit" ), edit );
mb->insertItem( tr( "Format" ), format );
mb->insertItem( tr( "Marks" ), marks );
searchBar = new QToolBar( "Search", this, QMainWindow::Top, TRUE );
searchBar->setHorizontalStretchable( TRUE );