summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReaderApp.cpp8
-rw-r--r--noncore/apps/opie-reader/opie-reader.control2
-rw-r--r--noncore/apps/opie-reader/opie-reader.pro1
3 files changed, 6 insertions, 5 deletions
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp
index 8ef0674..b985094 100644
--- a/noncore/apps/opie-reader/QTReaderApp.cpp
+++ b/noncore/apps/opie-reader/QTReaderApp.cpp
@@ -1,690 +1,690 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. Allrights reserved.
**
** This file is part of Qt Palmtop Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <qregexp.h>
#include <qclipboard.h>
#include <qwidgetstack.h>
#ifdef USEQPE
#include <qpe/qpemenubar.h>
#include <qpe/qpetoolbar.h>
#endif
#include <qmenubar.h>
#include <qtoolbar.h>
#ifdef USEQPE
#include <qpe/menubutton.h>
#endif
#include <qcombobox.h>
#include <qpopupmenu.h>
#include <qaction.h>
#include <qapplication.h>
#include <qlineedit.h>
#include <qtoolbutton.h>
#include <qspinbox.h>
#include <qobjectlist.h>
#include <qstatusbar.h>
#ifdef USEQPE
#include <qpe/global.h>
#include <qpe/applnk.h>
#endif
#include <qfileinfo.h>
#include <stdlib.h> //getenv
#include <qprogressbar.h>
#ifdef USEQPE
#include <qpe/config.h>
#endif
#include <qbuttongroup.h>
#include <qradiobutton.h>
#ifdef USEQPE
#include <qpe/qcopenvelope_qws.h>
#endif
#include "QTReader.h"
#include "GraphicWin.h"
#include "Bkmks.h"
#include "cbkmkselector.h"
#include "infowin.h"
#include "ToolbarPrefs.h"
#include "Prefs.h"
#include "CAnnoEdit.h"
#include "QFloatBar.h"
#include "FixedFont.h"
#include "URLDialog.h"
#include "util.h"
#include <qfontdatabase.h>
#ifdef USEQPE
-#include <qpe/resource.h>
+#include <opie2/oresource.h>
#ifdef OPIE
#if defined(OPIEFILEDIALOG)
#include <qpe/applnk.h>
#include <opie2/ofiledialog.h>
using namespace Opie::Ui;
#else
#include "fileBrowser.h"
#endif
#else
#include "fileBrowser.h"
#endif
#else
#include "qfiledialog.h"
#endif
#include "QTReaderApp.h"
#include "CDrawBuffer.h"
#include "Filedata.h"
#include "names.h"
#include "CEncoding_tables.h"
#include "CloseDialog.h"
#include "ButtonPrefs.h"
bool CheckVersion(int&, int&, char&, QWidget*);
#ifdef _WINDOWS
#define PICDIR "c:\\uqtreader\\pics\\"
#else
#ifdef USEQPE
#define USEMSGS
#define PICDIR "opie-reader/"
#else
//#define PICDIR "/home/tim/uqtreader/pics/"
QString picdir()
{
QString hd(getenv("READERDIR"));
return hd + "/pics";
}
#define PICDIR picdir()
#endif
#endif
unsigned long QTReaderApp::m_uid = 0;
void QTReaderApp::setScrollState(bool _b) { m_scrollButton->setOn(_b); }
#ifdef USEQPE
-#define geticon(iconname) Resource::loadPixmap( iconname )
-#define getmyicon(iconname) Resource::loadPixmap( PICDIR iconname )
+#define geticon(iconname) Opie::Core::OResource::loadPixmap( iconname, Opie::Core::OResource::SmallIcon )
+#define getmyicon(iconname) Opie::Core::OResource::loadPixmap( PICDIR iconname, Opie::Core::OResource::SmallIcon )
#else
//#define geticon(iconname) QPixmap(PICDIR iconname ".png")
#define geticon(iconname) QPixmap(PICDIR +"/"+iconname+".png")
#define getmyicon(iconname) geticon(iconname)
//#define geticon(iconname) QIconSet( QPixmap(PICDIR iconname) )
#endif
#ifndef _WINDOWS
#include <unistd.h>
#endif
#include <stddef.h>
#ifndef _WINDOWS
#include <dirent.h>
#endif
void QTReaderApp::listBkmkFiles()
{
bkmkselector->clear();
bkmkselector->setText("Cancel");
#ifndef USEQPE
int cnt = 0;
QDir d = QDir::home(); // "/"
if ( !d.cd(APPDIR) ) { // "/tmp"
qWarning( "Cannot find the \"~/" APPDIR "\" directory" );
d = QDir::home();
d.mkdir(APPDIR);
d.cd(APPDIR);
}
d.setFilter( QDir::Files | QDir::NoSymLinks );
// d.setSorting( QDir::Size | QDir::Reversed );
const QFileInfoList *list = d.entryInfoList();
QFileInfoListIterator it( *list ); // create list iterator
QFileInfo *fi; // pointer for traversing
while ( (fi=it.current()) ) { // for each file...
bkmkselector->insertItem(fi->fileName(), cnt++);
//qDebug( "%10li %s", fi->size(), fi->fileName().data() );
++it; // goto next list element
}
#else /* USEQPE */
int cnt = 0;
DIR *d;
d = opendir((const char *)Global::applicationFileName(APPDIR,""));
while(1)
{
struct dirent* de;
struct stat buf;
de = readdir(d);
if (de == NULL) break;
if (lstat((const char *)Global::applicationFileName(APPDIR,de->d_name),&buf) == 0 && S_ISREG(buf.st_mode))
{
bkmkselector->insertItem(de->d_name, cnt++);
}
}
closedir(d);
#endif
if (cnt > 0)
{
//tjw menu->hide();
editorStack->raiseWidget( bkmkselector );
hidetoolbars();
m_nBkmkAction = cRmBkmkFile;
}
else
QMessageBox::information(this, PROGNAME, "No bookmark files");
}
void QTReaderApp::hidetoolbars()
{
if (m_scrollbar != NULL) m_scrollbar->hide();
if (m_prog != NULL) m_prog->hide();
#if defined(USEQPE)
menubar->hide();
#endif
if (m_scrollbar != NULL) m_scrollbar->hide();
if (fileBar != NULL) fileBar->hide();
if (viewBar != NULL) viewBar->hide();
if (navBar != NULL) navBar->hide();
if (markBar != NULL) markBar->hide();
if (m_fontVisible) m_fontBar->hide();
if (regVisible)
{
#ifdef USEQPE
Global::hideInputMethod();
#endif
regBar->hide();
}
if (searchVisible)
{
#ifdef USEQPE
Global::hideInputMethod();
#endif
searchBar->hide();
}
}
QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
: QMainWindow( parent, name, f ), m_dontSave(false),
fileBar(NULL), navBar(NULL), viewBar(NULL), markBar(NULL), m_scrollbar(NULL), m_localscroll(2), m_hidebars(false), m_kmapchanged(false)
{
{
setKeyCompression ( true );
#ifndef USEQPE
QDir d = QDir::home(); // "/"
d.cd(APPDIR);
QFileInfo fi(d, ".keymap");
FILE* f = fopen((const char *)fi.absFilePath(), "r");
#else /* USEQPE */
FILE* f = fopen((const char *)Global::applicationFileName(APPDIR,".keymap"), "r");
#endif /* USEQPE */
if (f != NULL)
{
uint cnt;
if ((fread(&cnt, sizeof(cnt), 1, f) != 0) && (cnt == KEYMAPVERSION))
{
if (fread(&cnt, sizeof(cnt), 1, f) == 0) cnt = 0;
for (uint i = 0; i != cnt; i++)
{
orKey key;
int data;
fread(&key, sizeof(key), 1, f);
fread(&data, sizeof(data), 1, f);
kmap[key] = data;
}
}
fclose(f);
}
}
m_url_clipboard = false;
m_url_localfile = false;
m_url_globalfile = false;
ftime(&m_lastkeytime);
//// qDebug("Application directory = %s", (const tchar *)QPEApplication::documentDir());
//// qDebug("Application directory = %s", (const tchar *)Global::applicationFileName("uqtreader","bkmks.xml"));
m_bcloseDisabled = true;
m_disableesckey = false;
pBkmklist = NULL;
pOpenlist = NULL;
// doc = 0;
m_fBkmksChanged = false;
QString lang = getenv( "LANG" );
QString rot = getenv( "QWS_DISPLAY" );
/*
int m_rot = 0;
if (rot.contains("Rot90"))
{
m_rot = 90;
}
else if (rot.contains("Rot180"))
{
m_rot = 180;
}
else if (rot.contains("Rot270"))
{
m_rot = 270;
}
// qDebug("Initial Rotation(%d):%s", m_rot, (const char*)rot);
*/
m_autogenstr = "^ *[A-Z].*[a-z] *$";
#ifdef USEQPE
- setIcon( Resource::loadPixmap( PICDIR "uqtreader") );
+ setIcon( Opie::Core::OResource::loadPixmap( PICDIR "uqtreader", Opie::Core::OResource::SmallIcon ) );
#else
setIcon( QPixmap (PICDIR + "/uqtreader.png") );
#endif /* USEQPE */
// QPEToolBar *bar = new QPEToolBar( this );
// menubar = new QPEToolBar( this );
#ifdef USEQPE
Config config( APPDIR );
#else
QDir d = QDir::home(); // "/"
if ( !d.cd(APPDIR) ) { // "/tmp"
qWarning( "Cannot find the \"~/" APPDIR "\" directory" );
d = QDir::home();
d.mkdir(APPDIR);
d.cd(APPDIR);
}
QFileInfo fi(d, INIFILE);
// qDebug("Path:%s", (const char*)fi.absFilePath());
Config config(fi.absFilePath());
#endif
config.setGroup("Toolbar");
m_tbmovesave = m_tbmove = config.readBoolEntry("Movable", false);
m_tbpolsave = m_tbpol = (ToolbarPolicy)config.readNumEntry("Policy", 1);
m_tbposition = (ToolBarDock)config.readNumEntry("Position", 2);
m_qtscroll = config.readNumEntry("QTScrollBar", false);
m_localscroll = config.readNumEntry("LocalScrollBar", false);
// fileBar = new QToolBar("File", this);
// QToolBar* viewBar = new QToolBar("File", this);
// QToolBar* navBar = new QToolBar("File", this);
// QToolBar* markBar = new QToolBar("File", this);
#if defined(USEQPE)
menubar = new QToolBar("Menus", this, m_tbposition);
mb = new QPEMenuBar( menubar );
#else
mb = new QMenuBar( this );
#endif
#if defined(USEQPE)
QPopupMenu* tmp = new QPopupMenu(mb);
mb->insertItem( geticon( "AppsIcon" ), tmp );
#else
QMenuBar* tmp = mb;
#endif
QPopupMenu *file = new QPopupMenu( mb );
tmp->insertItem( tr( "File" ), file );
QPopupMenu *navigation = new QPopupMenu(mb);
tmp->insertItem( tr( "Navigation" ), navigation );
QPopupMenu *view = new QPopupMenu( mb );
tmp->insertItem( tr( "View" ), view );
QPopupMenu *marks = new QPopupMenu( this );
tmp->insertItem( tr( "Marks" ), marks );
QPopupMenu *settings = new QPopupMenu( this );
tmp->insertItem( tr( "Settings" ), settings );
// addToolBar(menubar, "Menus",QMainWindow::Top);
// addToolBar(fileBar, "Toolbar",QMainWindow::Top);
// QPopupMenu *edit = new QPopupMenu( this );
/*
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 );
*/
QWidget* widge = new QWidget(this);
setCentralWidget( widge );
QVBoxLayout* vlayout = new QVBoxLayout(widge);
m_layout = new QBoxLayout(QBoxLayout::LeftToRight);
m_prog = new QLabel(widge);
vlayout->addLayout(m_layout, 1);
vlayout->addWidget(m_prog);
editorStack = new QWidgetStack( widge );
// setCentralWidget( editorStack );
searchVisible = FALSE;
regVisible = FALSE;
m_fontVisible = false;
m_buttonprefs = new CButtonPrefs(&kmap, this);
editorStack->addWidget(m_buttonprefs, get_unique_id());
connect( m_buttonprefs, SIGNAL( Closed() ), this, SLOT( infoClose() ) );
m_annoWin = new CAnnoEdit(editorStack);
editorStack->addWidget(m_annoWin, get_unique_id());
connect( m_annoWin, SIGNAL( finished(const QString&, const QString&) ), this, SLOT( addAnno(const QString&, const QString&) ) );
connect( m_annoWin, SIGNAL( cancelled() ), this, SLOT( infoClose() ) );
m_infoWin = new infowin(editorStack);
editorStack->addWidget(m_infoWin, get_unique_id());
connect( m_infoWin, SIGNAL( Close() ), this, SLOT( infoClose() ) );
m_graphicwin = new GraphicWin(editorStack);
editorStack->addWidget(m_graphicwin, get_unique_id());
connect( m_graphicwin, SIGNAL( Closed() ), 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 );
*/
// qDebug("Reading file list");
readfilelist();
reader = new QTReader( editorStack );
reader->setDoUpdates(false);
#ifdef USEQPE
((QPEApplication*)qApp)->setStylusOperation(reader, QPEApplication::RightOnHold);
#endif
// qDebug("Reading config");
// Config config( APPDIR );
config.setGroup( "View" );
#if defined(USEQPE) && defined(USENEWFULLSCREEN)
m_usenewfullscreen = config.readBoolEntry("NewFullScreen", false);
#endif
m_debounce = config.readNumEntry("Debounce", 0);
m_buttonprefs->Debounce(m_debounce);
#ifdef USEQPE
m_bFloatingDialog = config.readBoolEntry("FloatDialogs", false);
#else
m_bFloatingDialog = config.readBoolEntry("FloatDialogs", true);
#endif
reader->setStripCR(config.readBoolEntry( "StripCr", true ));
reader->bfulljust = config.readBoolEntry( "FullJust", false );
/*
bool btmp = config.readBoolEntry("Negative", false);
if (btmp) reader->setNegative();
*/
reader->bInverse = config.readBoolEntry("Inverse", false);
reader->m_fontControl.FixGraphics(config.readBoolEntry( "FixGraphics", false ));
reader->setextraspace(config.readNumEntry( "ExtraSpace", 0 ));
reader->setlead(config.readNumEntry( "ExtraLead", 0 ));
reader->btextfmt = config.readBoolEntry( "TextFmt", false );
reader->bautofmt = config.readBoolEntry( "AutoFmt", true );
reader->bstriphtml = config.readBoolEntry( "StripHtml", false );
reader->bNoInlineTables = config.readBoolEntry( "NoInlineTables", false );
reader->bpeanut = config.readBoolEntry( "Peanut", false );
reader->bdehyphen = config.readBoolEntry( "Dehyphen", false );
reader->bdepluck = config.readBoolEntry( "Depluck", false );
reader->bdejpluck = config.readBoolEntry( "Dejpluck", false );
reader->bonespace = config.readBoolEntry( "OneSpace", false );
reader->bunindent = config.readBoolEntry( "Unindent", false );
reader->brepara = config.readBoolEntry( "Repara", false );
reader->m_reparastring = config.readEntry( "ReparaString", "\\n{[\\n \\t]}");
m_bgtype = (bground)config.readNumEntry( "BackgroundType" , 0 );
m_themename = config.readEntry("Theme", QString::null );
reader->bdblspce = config.readBoolEntry( "DoubleSpace", false );
reader->bindenter = config.readNumEntry( "Indent", 0 );
reader->m_textsize = config.readNumEntry( "FontSize", 12 );
reader->m_delay = config.readNumEntry( "ScrollDelay", 5184);
reader->m_scrollstep = config.readNumEntry( "ScrollStep", 1);
reader->m_outputName = config.readEntry( "OutputCodec", "");
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_rotated = config.readBoolEntry( "IsRotated", false );
reader->m_scrolltype = config.readNumEntry( "ScrollType", 0 );
m_statusstring = config.readEntry("StatusContent", "%P%% Doc:%d/%D %p%% %z%%");
m_statusishidden = config.readBoolEntry("StatusHidden", false);
m_background = config.readNumEntry( "Background", 0 );
reader->setBackground(getcolour(m_background));
m_foreground = config.readNumEntry( "Foreground", 1 );
reader->setForeground(getcolour(m_foreground));
m_scrollcolor = config.readNumEntry( "ScrollColour", 5 );
setscrollcolour();
m_scrollbarcolor = config.readNumEntry( "ScrollBarColour", 5 );
setscrollbarcolour();
reader->hyphenate = config.readBoolEntry( "Hyphenate", false );
reader->m_swapmouse = config.readBoolEntry( "SwapMouse", 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_abstopmargin = config.readNumEntry( "Top Margin", 100 );
reader->m_absbottommargin = config.readNumEntry( "Bottom Margin", 100 );
reader->m_absleft_border = config.readNumEntry( "Left Margin", 100 );
reader->m_absright_border = config.readNumEntry( "Right Margin", 100 );
m_scrollishidden = config.readBoolEntry( "HideScrollBar", false );
m_hidebars = config.readBoolEntry( "HideToolBar", false );
reader->brepalm = config.readBoolEntry( "Repalm", false );
reader->bunderlineLink = config.readBoolEntry( "UnderlineLink", true );
reader->bkern = config.readBoolEntry( "Kern", false );
reader->bremap = config.readBoolEntry( "Remap", true );
reader->bmakebold = config.readBoolEntry( "MakeBold", false );
reader->setContinuous(config.readBoolEntry( "Continuous", true ));
reader->setDoubleBuffer(config.readBoolEntry("DoubleBuffer", true));
m_targetapp = config.readEntry( "TargetApp", QString::null );
m_targetmsg = config.readEntry( "TargetMsg", QString::null );
#ifdef _SCROLLPIPE
reader->m_pipetarget = config.readEntry( "PipeTarget", QString::null );
reader->m_pauseAfterEachPara = config.readBoolEntry( "PauseAfterPara", true );
#endif
m_twoTouch = config.readBoolEntry( "TwoTouch", false);
m_doAnnotation = config.readBoolEntry( "Annotation", false);
m_doDictionary = config.readBoolEntry( "Dictionary", false);
m_doClipboard = config.readBoolEntry( "Clipboard", false);
m_doOutput = config.readBoolEntry( "OutputTgt", false);
/*
m_spaceTarget = (ActionTypes)config.readNumEntry("SpaceTarget", cesAutoScroll);
m_escapeTarget = (ActionTypes)config.readNumEntry("EscapeTarget", cesNone);
m_returnTarget = (ActionTypes)config.readNumEntry("ReturnTarget", cesFullScreen);
m_leftTarget = (ActionTypes)config.readNumEntry("LeftTarget", cesZoomOut);
m_rightTarget = (ActionTypes)config.readNumEntry("RightTarget", cesZoomIn);
m_upTarget = (ActionTypes)config.readNumEntry("UpTarget", cesPageUp);
m_downTarget = (ActionTypes)config.readNumEntry("DownTarget", cesPageDown);
m_leftScroll = config.readBoolEntry("LeftScroll", false);
m_rightScroll = config.readBoolEntry("RightScroll", false);
m_upScroll = config.readBoolEntry("UpScroll", true);
m_downScroll = config.readBoolEntry("DownScroll", true);
*/
m_propogatefontchange = config.readBoolEntry( "RequestorFontChange", false);
reader->setBaseSize(config.readNumEntry( "Basesize", 10 ));
reader->setHyphenThreshold(config.readNumEntry( "HyphenThreshold", 50 ));
// reader->buffdoc.setCustomHyphen(config.readBoolEntry( "CustomHyphen", false ));
#ifndef USEQPE
config.setGroup( "Geometry" );
setGeometry(0,0,
config.readNumEntry( "width", QApplication::desktop()->width()/2 ),
config.readNumEntry( "height", QApplication::desktop()->height()/2 ));
move(
config.readNumEntry( "x", 20 ),
config.readNumEntry( "y", 20 ));
#else
m_grabkeyboard = config.readBoolEntry( "GrabKeyboard", false);
#endif
setTwoTouch(m_twoTouch);
connect( reader, SIGNAL( OnShowPicture(QImage&) ), this, SLOT( showgraphic(QImage&) ) );
connect( reader, SIGNAL( OnRedraw() ), this, SLOT( OnRedraw() ) );
connect( reader, SIGNAL( OnWordSelected(const QString&, size_t, size_t, const QString&) ), this, SLOT( OnWordSelected(const QString&, size_t, size_t, const QString&) ) );
connect( reader, SIGNAL( OnURLSelected(const QString&, const size_t) ), this, SLOT( OnURLSelected(const QString&, const size_t) ) );
connect( reader, SIGNAL( NewFileRequest(const QString&) ), this, SLOT( forceopen(const QString&) ) );
connect( reader, SIGNAL( HandleKeyRequest(QKeyEvent*) ), this, SLOT( handlekey(QKeyEvent*) ) );
connect( reader, SIGNAL( SetScrollState(bool) ), this, SLOT( setScrollState(bool) ) );
connect( reader, SIGNAL(RefreshBitmap()), this, SLOT(setBackgroundBitmap()));
editorStack->addWidget( reader, get_unique_id() );
m_preferences_action = new QAction( tr( "Configuration" ), geticon( "SettingsIcon" ), QString::null, 0, this, NULL);
connect( m_preferences_action, SIGNAL( activated() ), this, SLOT( showprefs() ) );
m_preferences_action->addTo( settings );
m_saveconfig_action = new QAction( tr( "Save Config" ), QString::null, 0, this, NULL);
connect( m_saveconfig_action, SIGNAL( activated() ), this, SLOT( SaveConfig() ) );
m_saveconfig_action->addTo( settings );
m_loadconfig_action = new QAction( tr( "Load Config" ), QString::null, 0, this, NULL);
connect( m_loadconfig_action, SIGNAL( activated() ), this, SLOT( LoadConfig() ) );
m_loadconfig_action->addTo( settings );
m_tidyconfig_action = new QAction( tr( "Delete Config" ), QString::null, 0, this, NULL);
connect( m_tidyconfig_action, SIGNAL( activated() ), this, SLOT( TidyConfig() ) );
m_tidyconfig_action->addTo( settings );
settings->insertSeparator();
m_toolbarprefs_action = new QAction( tr( "Toolbars" ), QString::null, 0, this, NULL);
connect( m_toolbarprefs_action, SIGNAL( activated() ), this, SLOT( showtoolbarprefs() ) );
m_toolbarprefs_action->addTo( settings );
m_buttonprefs_action = new QAction( tr( "Buttons" ), QString::null, 0, this, NULL);
connect( m_buttonprefs_action, SIGNAL( activated() ), this, SLOT( showbuttonprefs() ) );
m_buttonprefs_action->addTo( settings );
m_loadtheme_action = new QAction( tr( "Load Theme" ), QString::null, 0, this, NULL);
connect( m_loadtheme_action, SIGNAL( activated() ), this, SLOT( LoadTheme() ) );
m_loadtheme_action->addTo( settings );
m_repara_action = new QAction( tr( "EOP Marker" ), QString::null, 0, this, NULL);
connect( m_repara_action, SIGNAL( activated() ), this, SLOT( reparastring() ) );
m_repara_action->addTo(settings);
#ifdef USEQPE
m_grab_action = new QAction( tr( "Grab Buttons" ), QString::null, 0, this, NULL, true );
connect( m_grab_action, SIGNAL( toggled(bool) ), this, SLOT( setgrab(bool) ) );
m_grab_action->setOn(m_grabkeyboard);
m_grab_action->addTo( settings );
#endif
m_open_action = new QAction( tr( "Open" ), geticon( "fileopen" ), QString::null, 0, this, 0 );
connect( m_open_action, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
m_open_action->addTo( file );
m_close_action = new QAction( tr( "Close" ), geticon( "close" ), QString::null, 0, this, 0 );
connect( m_close_action, SIGNAL( activated() ), this, SLOT( fileClose() ) );
m_close_action->addTo( file );
#ifdef _SCRIPT
a = new QAction( tr( "Run Script" ), QString::null, 0, this, NULL);
connect( a, SIGNAL( activated() ), this, SLOT( RunScript() ) );
a->addTo( file );
#endif
/*
a = new QAction( tr( "Revert" ), geticon( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( fileRevert() ) );
a->addTo( file );
a = new QAction( tr( "Cut" ), geticon( "cut" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
a->addTo( filebar() );
a->addTo( edit );
*/
m_info_action = new QAction( tr( "Info" ), geticon( "UtilsIcon" ), QString::null, 0, this, NULL);
connect( m_info_action, SIGNAL( activated() ), this, SLOT( showinfo() ) );
m_info_action->addTo( file );
m_touch_action = new QAction( tr( "Two/One Touch" ), geticon( "1to1" ), QString::null, 0, this, NULL, true );
connect( m_touch_action, SIGNAL( toggled(bool) ), this, SLOT( setTwoTouch(bool) ) );
m_touch_action->setOn(m_twoTouch);
m_touch_action->addTo( file );
m_find_action = new QAction( tr( "Find..." ), geticon( "find" ), QString::null, 0, this, NULL);
connect( m_find_action, SIGNAL( activated() ), this, SLOT( editFind() ) );
file->insertSeparator();
// a->addTo( bar );
m_find_action->addTo( file );
m_exportlinks_action = new QAction( tr( "Export Links" ), QString::null, 0, this, NULL);
connect( m_exportlinks_action, SIGNAL( activated() ), this, SLOT( ExportLinks() ) );
m_exportlinks_action->addTo( file );
m_scrollButton = new QAction( tr( "Scroll" ), getmyicon( "panel-arrow-down" ), QString::null, 0, this, 0, true );
connect( m_scrollButton, SIGNAL( toggled(bool) ), this, SLOT( autoScroll(bool) ) );
m_scrollButton->addTo(navigation);
m_scrollButton->setOn(false);
m_start_action = new QAction( tr( "Goto Start" ), geticon( "start" ), QString::null, 0, this, NULL);
connect( m_start_action, SIGNAL( activated() ), this, SLOT( gotoStart() ) );
m_start_action->addTo(navigation);
m_end_action = new QAction( tr( "Goto End" ), geticon( "finish" ), QString::null, 0, this, NULL);
connect( m_end_action, SIGNAL( activated() ), this, SLOT( gotoEnd() ) );
m_end_action->addTo(navigation);
m_jump_action = new QAction( tr( "Jump" ), geticon( "rotate" ), QString::null, 0, this, NULL);
connect( m_jump_action, SIGNAL( activated() ), this, SLOT( jump() ) );
m_jump_action->addTo(navigation);
m_pageline_action = new QAction( tr( "Page/Line Scroll" ), geticon( "pass" ), QString::null, 0, this, NULL, true );
connect( m_pageline_action, SIGNAL( toggled(bool) ), this, SLOT( pagemode(bool) ) );
m_pageline_action->addTo(navigation);
m_pageline_action->setOn(reader->m_bpagemode);
m_pageup_action = new QAction( tr( "Up" ), geticon( "up" ), QString::null, 0, this, 0 );
connect( m_pageup_action, SIGNAL( activated() ), this, SLOT( pageup() ) );
m_pageup_action->addTo( navigation );
m_pagedn_action = new QAction( tr( "Down" ), geticon( "down" ), QString::null, 0, this, 0 );
connect( m_pagedn_action, SIGNAL( activated() ), this, SLOT( pagedn() ) );
m_pagedn_action->addTo( navigation );
m_back_action = new QAction( tr( "Back" ), geticon( "back" ), QString::null, 0, this, 0 );
diff --git a/noncore/apps/opie-reader/opie-reader.control b/noncore/apps/opie-reader/opie-reader.control
index 60976b2..d53f70d 100644
--- a/noncore/apps/opie-reader/opie-reader.control
+++ b/noncore/apps/opie-reader/opie-reader.control
@@ -1,10 +1,10 @@
Package: opie-reader
Files: bin/reader lib/libreader* plugins/reader/* apps/Applications/opie-reader.desktop pics/opie-reader/*
Priority: optional
Section: opie/applications
Maintainer: Tim Wentford <timwentford@hotmail.com>
Architecture: arm
-Depends: task-opie-minimal
+Depends: task-opie-minimal, libopiecore2
License: GPL
Description: E-Book reader
Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/apps/opie-reader/opie-reader.pro b/noncore/apps/opie-reader/opie-reader.pro
index 47980e1..da39154 100644
--- a/noncore/apps/opie-reader/opie-reader.pro
+++ b/noncore/apps/opie-reader/opie-reader.pro
@@ -1,24 +1,25 @@
TEMPLATE = subdirs
SUBDIRS = pluckerbaselib \
codeclib \
pdblib \
PluckerCodec \
AportisCodec \
CHM \
HTMLFilter \
WeaselCodec \
iSiloCodec \
ppmsCodec \
FliteCmd \
pluckerdecompress \
ArriereCodec \
RebCodec \
reader
+LIBS += -lopiecore2
# these are added only built if enabled in "make menuconfig"
# FliteDyn
# FliteDyn16
include( $(OPIEDIR)/include.pro )