summaryrefslogtreecommitdiff
authordrw <drw>2005-05-17 22:48:25 (UTC)
committer drw <drw>2005-05-17 22:48:25 (UTC)
commit0892a9d473bfeacc921d586266e6889153654737 (patch) (unidiff)
treed3ea1c3b08ac642b999db357a3ccbff691ce8bce
parent58c3aa9b498e43665511fbe8f32995e0a4cb29d6 (diff)
downloadopie-0892a9d473bfeacc921d586266e6889153654737.zip
opie-0892a9d473bfeacc921d586266e6889153654737.tar.gz
opie-0892a9d473bfeacc921d586266e6889153654737.tar.bz2
Resource -> OResource
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,498 +1,498 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. Allrights reserved. 2** Copyright (C) 2000 Trolltech AS. Allrights reserved.
3** 3**
4** This file is part of Qt Palmtop Environment. 4** This file is part of Qt Palmtop Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include <qregexp.h> 21#include <qregexp.h>
22#include <qclipboard.h> 22#include <qclipboard.h>
23#include <qwidgetstack.h> 23#include <qwidgetstack.h>
24#ifdef USEQPE 24#ifdef USEQPE
25#include <qpe/qpemenubar.h> 25#include <qpe/qpemenubar.h>
26#include <qpe/qpetoolbar.h> 26#include <qpe/qpetoolbar.h>
27#endif 27#endif
28#include <qmenubar.h> 28#include <qmenubar.h>
29#include <qtoolbar.h> 29#include <qtoolbar.h>
30#ifdef USEQPE 30#ifdef USEQPE
31#include <qpe/menubutton.h> 31#include <qpe/menubutton.h>
32#endif 32#endif
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qpopupmenu.h> 34#include <qpopupmenu.h>
35#include <qaction.h> 35#include <qaction.h>
36#include <qapplication.h> 36#include <qapplication.h>
37#include <qlineedit.h> 37#include <qlineedit.h>
38#include <qtoolbutton.h> 38#include <qtoolbutton.h>
39#include <qspinbox.h> 39#include <qspinbox.h>
40#include <qobjectlist.h> 40#include <qobjectlist.h>
41#include <qstatusbar.h> 41#include <qstatusbar.h>
42#ifdef USEQPE 42#ifdef USEQPE
43#include <qpe/global.h> 43#include <qpe/global.h>
44#include <qpe/applnk.h> 44#include <qpe/applnk.h>
45#endif 45#endif
46#include <qfileinfo.h> 46#include <qfileinfo.h>
47#include <stdlib.h> //getenv 47#include <stdlib.h> //getenv
48#include <qprogressbar.h> 48#include <qprogressbar.h>
49#ifdef USEQPE 49#ifdef USEQPE
50#include <qpe/config.h> 50#include <qpe/config.h>
51#endif 51#endif
52#include <qbuttongroup.h> 52#include <qbuttongroup.h>
53#include <qradiobutton.h> 53#include <qradiobutton.h>
54#ifdef USEQPE 54#ifdef USEQPE
55#include <qpe/qcopenvelope_qws.h> 55#include <qpe/qcopenvelope_qws.h>
56#endif 56#endif
57#include "QTReader.h" 57#include "QTReader.h"
58#include "GraphicWin.h" 58#include "GraphicWin.h"
59#include "Bkmks.h" 59#include "Bkmks.h"
60#include "cbkmkselector.h" 60#include "cbkmkselector.h"
61#include "infowin.h" 61#include "infowin.h"
62#include "ToolbarPrefs.h" 62#include "ToolbarPrefs.h"
63#include "Prefs.h" 63#include "Prefs.h"
64#include "CAnnoEdit.h" 64#include "CAnnoEdit.h"
65#include "QFloatBar.h" 65#include "QFloatBar.h"
66#include "FixedFont.h" 66#include "FixedFont.h"
67#include "URLDialog.h" 67#include "URLDialog.h"
68#include "util.h" 68#include "util.h"
69#include <qfontdatabase.h> 69#include <qfontdatabase.h>
70 70
71#ifdef USEQPE 71#ifdef USEQPE
72#include <qpe/resource.h> 72#include <opie2/oresource.h>
73#ifdef OPIE 73#ifdef OPIE
74#if defined(OPIEFILEDIALOG) 74#if defined(OPIEFILEDIALOG)
75#include <qpe/applnk.h> 75#include <qpe/applnk.h>
76#include <opie2/ofiledialog.h> 76#include <opie2/ofiledialog.h>
77using namespace Opie::Ui; 77using namespace Opie::Ui;
78#else 78#else
79#include "fileBrowser.h" 79#include "fileBrowser.h"
80#endif 80#endif
81#else 81#else
82#include "fileBrowser.h" 82#include "fileBrowser.h"
83#endif 83#endif
84#else 84#else
85#include "qfiledialog.h" 85#include "qfiledialog.h"
86#endif 86#endif
87 87
88#include "QTReaderApp.h" 88#include "QTReaderApp.h"
89#include "CDrawBuffer.h" 89#include "CDrawBuffer.h"
90#include "Filedata.h" 90#include "Filedata.h"
91#include "names.h" 91#include "names.h"
92#include "CEncoding_tables.h" 92#include "CEncoding_tables.h"
93#include "CloseDialog.h" 93#include "CloseDialog.h"
94 94
95#include "ButtonPrefs.h" 95#include "ButtonPrefs.h"
96 96
97bool CheckVersion(int&, int&, char&, QWidget*); 97bool CheckVersion(int&, int&, char&, QWidget*);
98 98
99#ifdef _WINDOWS 99#ifdef _WINDOWS
100#define PICDIR "c:\\uqtreader\\pics\\" 100#define PICDIR "c:\\uqtreader\\pics\\"
101#else 101#else
102#ifdef USEQPE 102#ifdef USEQPE
103#define USEMSGS 103#define USEMSGS
104#define PICDIR "opie-reader/" 104#define PICDIR "opie-reader/"
105#else 105#else
106//#define PICDIR "/home/tim/uqtreader/pics/" 106//#define PICDIR "/home/tim/uqtreader/pics/"
107QString picdir() 107QString picdir()
108{ 108{
109 QString hd(getenv("READERDIR")); 109 QString hd(getenv("READERDIR"));
110 return hd + "/pics"; 110 return hd + "/pics";
111} 111}
112#define PICDIR picdir() 112#define PICDIR picdir()
113#endif 113#endif
114#endif 114#endif
115 115
116unsigned long QTReaderApp::m_uid = 0; 116unsigned long QTReaderApp::m_uid = 0;
117 117
118void QTReaderApp::setScrollState(bool _b) { m_scrollButton->setOn(_b); } 118void QTReaderApp::setScrollState(bool _b) { m_scrollButton->setOn(_b); }
119 119
120#ifdef USEQPE 120#ifdef USEQPE
121#define geticon(iconname) Resource::loadPixmap( iconname ) 121#define geticon(iconname) Opie::Core::OResource::loadPixmap( iconname, Opie::Core::OResource::SmallIcon )
122#define getmyicon(iconname) Resource::loadPixmap( PICDIR iconname ) 122#define getmyicon(iconname) Opie::Core::OResource::loadPixmap( PICDIR iconname, Opie::Core::OResource::SmallIcon )
123#else 123#else
124//#define geticon(iconname) QPixmap(PICDIR iconname ".png") 124//#define geticon(iconname) QPixmap(PICDIR iconname ".png")
125#define geticon(iconname) QPixmap(PICDIR +"/"+iconname+".png") 125#define geticon(iconname) QPixmap(PICDIR +"/"+iconname+".png")
126#define getmyicon(iconname) geticon(iconname) 126#define getmyicon(iconname) geticon(iconname)
127//#define geticon(iconname) QIconSet( QPixmap(PICDIR iconname) ) 127//#define geticon(iconname) QIconSet( QPixmap(PICDIR iconname) )
128#endif 128#endif
129 129
130#ifndef _WINDOWS 130#ifndef _WINDOWS
131#include <unistd.h> 131#include <unistd.h>
132#endif 132#endif
133#include <stddef.h> 133#include <stddef.h>
134#ifndef _WINDOWS 134#ifndef _WINDOWS
135#include <dirent.h> 135#include <dirent.h>
136#endif 136#endif
137 137
138void QTReaderApp::listBkmkFiles() 138void QTReaderApp::listBkmkFiles()
139{ 139{
140 bkmkselector->clear(); 140 bkmkselector->clear();
141 bkmkselector->setText("Cancel"); 141 bkmkselector->setText("Cancel");
142#ifndef USEQPE 142#ifndef USEQPE
143 int cnt = 0; 143 int cnt = 0;
144 144
145 QDir d = QDir::home(); // "/" 145 QDir d = QDir::home(); // "/"
146 if ( !d.cd(APPDIR) ) { // "/tmp" 146 if ( !d.cd(APPDIR) ) { // "/tmp"
147 qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); 147 qWarning( "Cannot find the \"~/" APPDIR "\" directory" );
148 d = QDir::home(); 148 d = QDir::home();
149 d.mkdir(APPDIR); 149 d.mkdir(APPDIR);
150 d.cd(APPDIR); 150 d.cd(APPDIR);
151 } 151 }
152 152
153 153
154 154
155 155
156 d.setFilter( QDir::Files | QDir::NoSymLinks ); 156 d.setFilter( QDir::Files | QDir::NoSymLinks );
157// d.setSorting( QDir::Size | QDir::Reversed ); 157// d.setSorting( QDir::Size | QDir::Reversed );
158 158
159 const QFileInfoList *list = d.entryInfoList(); 159 const QFileInfoList *list = d.entryInfoList();
160 QFileInfoListIterator it( *list ); // create list iterator 160 QFileInfoListIterator it( *list ); // create list iterator
161 QFileInfo *fi; // pointer for traversing 161 QFileInfo *fi; // pointer for traversing
162 while ( (fi=it.current()) ) { // for each file... 162 while ( (fi=it.current()) ) { // for each file...
163 163
164 bkmkselector->insertItem(fi->fileName(), cnt++); 164 bkmkselector->insertItem(fi->fileName(), cnt++);
165 165
166 //qDebug( "%10li %s", fi->size(), fi->fileName().data() ); 166 //qDebug( "%10li %s", fi->size(), fi->fileName().data() );
167 ++it; // goto next list element 167 ++it; // goto next list element
168 } 168 }
169 169
170#else /* USEQPE */ 170#else /* USEQPE */
171 int cnt = 0; 171 int cnt = 0;
172 DIR *d; 172 DIR *d;
173 d = opendir((const char *)Global::applicationFileName(APPDIR,"")); 173 d = opendir((const char *)Global::applicationFileName(APPDIR,""));
174 174
175 while(1) 175 while(1)
176 { 176 {
177 struct dirent* de; 177 struct dirent* de;
178 struct stat buf; 178 struct stat buf;
179 de = readdir(d); 179 de = readdir(d);
180 if (de == NULL) break; 180 if (de == NULL) break;
181 181
182 if (lstat((const char *)Global::applicationFileName(APPDIR,de->d_name),&buf) == 0 && S_ISREG(buf.st_mode)) 182 if (lstat((const char *)Global::applicationFileName(APPDIR,de->d_name),&buf) == 0 && S_ISREG(buf.st_mode))
183 { 183 {
184 bkmkselector->insertItem(de->d_name, cnt++); 184 bkmkselector->insertItem(de->d_name, cnt++);
185 } 185 }
186 } 186 }
187 187
188 closedir(d); 188 closedir(d);
189#endif 189#endif
190 if (cnt > 0) 190 if (cnt > 0)
191 { 191 {
192//tjw menu->hide(); 192//tjw menu->hide();
193 193
194 194
195 editorStack->raiseWidget( bkmkselector ); 195 editorStack->raiseWidget( bkmkselector );
196 hidetoolbars(); 196 hidetoolbars();
197 m_nBkmkAction = cRmBkmkFile; 197 m_nBkmkAction = cRmBkmkFile;
198 } 198 }
199 else 199 else
200 QMessageBox::information(this, PROGNAME, "No bookmark files"); 200 QMessageBox::information(this, PROGNAME, "No bookmark files");
201} 201}
202 202
203void QTReaderApp::hidetoolbars() 203void QTReaderApp::hidetoolbars()
204{ 204{
205 if (m_scrollbar != NULL) m_scrollbar->hide(); 205 if (m_scrollbar != NULL) m_scrollbar->hide();
206 if (m_prog != NULL) m_prog->hide(); 206 if (m_prog != NULL) m_prog->hide();
207 207
208#if defined(USEQPE) 208#if defined(USEQPE)
209 menubar->hide(); 209 menubar->hide();
210#endif 210#endif
211 211
212 if (m_scrollbar != NULL) m_scrollbar->hide(); 212 if (m_scrollbar != NULL) m_scrollbar->hide();
213 213
214 if (fileBar != NULL) fileBar->hide(); 214 if (fileBar != NULL) fileBar->hide();
215 if (viewBar != NULL) viewBar->hide(); 215 if (viewBar != NULL) viewBar->hide();
216 if (navBar != NULL) navBar->hide(); 216 if (navBar != NULL) navBar->hide();
217 if (markBar != NULL) markBar->hide(); 217 if (markBar != NULL) markBar->hide();
218 if (m_fontVisible) m_fontBar->hide(); 218 if (m_fontVisible) m_fontBar->hide();
219 if (regVisible) 219 if (regVisible)
220 { 220 {
221#ifdef USEQPE 221#ifdef USEQPE
222 Global::hideInputMethod(); 222 Global::hideInputMethod();
223#endif 223#endif
224 regBar->hide(); 224 regBar->hide();
225 } 225 }
226 if (searchVisible) 226 if (searchVisible)
227 { 227 {
228#ifdef USEQPE 228#ifdef USEQPE
229 Global::hideInputMethod(); 229 Global::hideInputMethod();
230#endif 230#endif
231 searchBar->hide(); 231 searchBar->hide();
232 } 232 }
233} 233}
234 234
235QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) 235QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
236 : QMainWindow( parent, name, f ), m_dontSave(false), 236 : QMainWindow( parent, name, f ), m_dontSave(false),
237 fileBar(NULL), navBar(NULL), viewBar(NULL), markBar(NULL), m_scrollbar(NULL), m_localscroll(2), m_hidebars(false), m_kmapchanged(false) 237 fileBar(NULL), navBar(NULL), viewBar(NULL), markBar(NULL), m_scrollbar(NULL), m_localscroll(2), m_hidebars(false), m_kmapchanged(false)
238{ 238{
239 { 239 {
240 setKeyCompression ( true ); 240 setKeyCompression ( true );
241#ifndef USEQPE 241#ifndef USEQPE
242 QDir d = QDir::home(); // "/" 242 QDir d = QDir::home(); // "/"
243 d.cd(APPDIR); 243 d.cd(APPDIR);
244 QFileInfo fi(d, ".keymap"); 244 QFileInfo fi(d, ".keymap");
245 FILE* f = fopen((const char *)fi.absFilePath(), "r"); 245 FILE* f = fopen((const char *)fi.absFilePath(), "r");
246#else /* USEQPE */ 246#else /* USEQPE */
247 FILE* f = fopen((const char *)Global::applicationFileName(APPDIR,".keymap"), "r"); 247 FILE* f = fopen((const char *)Global::applicationFileName(APPDIR,".keymap"), "r");
248#endif /* USEQPE */ 248#endif /* USEQPE */
249 if (f != NULL) 249 if (f != NULL)
250 { 250 {
251 uint cnt; 251 uint cnt;
252 if ((fread(&cnt, sizeof(cnt), 1, f) != 0) && (cnt == KEYMAPVERSION)) 252 if ((fread(&cnt, sizeof(cnt), 1, f) != 0) && (cnt == KEYMAPVERSION))
253 { 253 {
254 if (fread(&cnt, sizeof(cnt), 1, f) == 0) cnt = 0; 254 if (fread(&cnt, sizeof(cnt), 1, f) == 0) cnt = 0;
255 for (uint i = 0; i != cnt; i++) 255 for (uint i = 0; i != cnt; i++)
256 { 256 {
257 orKey key; 257 orKey key;
258 int data; 258 int data;
259 fread(&key, sizeof(key), 1, f); 259 fread(&key, sizeof(key), 1, f);
260 fread(&data, sizeof(data), 1, f); 260 fread(&data, sizeof(data), 1, f);
261 kmap[key] = data; 261 kmap[key] = data;
262 } 262 }
263 } 263 }
264 fclose(f); 264 fclose(f);
265 } 265 }
266 } 266 }
267 267
268 m_url_clipboard = false; 268 m_url_clipboard = false;
269 m_url_localfile = false; 269 m_url_localfile = false;
270 m_url_globalfile = false; 270 m_url_globalfile = false;
271 ftime(&m_lastkeytime); 271 ftime(&m_lastkeytime);
272//// qDebug("Application directory = %s", (const tchar *)QPEApplication::documentDir()); 272//// qDebug("Application directory = %s", (const tchar *)QPEApplication::documentDir());
273//// qDebug("Application directory = %s", (const tchar *)Global::applicationFileName("uqtreader","bkmks.xml")); 273//// qDebug("Application directory = %s", (const tchar *)Global::applicationFileName("uqtreader","bkmks.xml"));
274 274
275 m_bcloseDisabled = true; 275 m_bcloseDisabled = true;
276 m_disableesckey = false; 276 m_disableesckey = false;
277 pBkmklist = NULL; 277 pBkmklist = NULL;
278 pOpenlist = NULL; 278 pOpenlist = NULL;
279// doc = 0; 279// doc = 0;
280 280
281 m_fBkmksChanged = false; 281 m_fBkmksChanged = false;
282 282
283 QString lang = getenv( "LANG" ); 283 QString lang = getenv( "LANG" );
284 QString rot = getenv( "QWS_DISPLAY" ); 284 QString rot = getenv( "QWS_DISPLAY" );
285 285
286/* 286/*
287 int m_rot = 0; 287 int m_rot = 0;
288 if (rot.contains("Rot90")) 288 if (rot.contains("Rot90"))
289 { 289 {
290 m_rot = 90; 290 m_rot = 90;
291 } 291 }
292 else if (rot.contains("Rot180")) 292 else if (rot.contains("Rot180"))
293 { 293 {
294 m_rot = 180; 294 m_rot = 180;
295 } 295 }
296 else if (rot.contains("Rot270")) 296 else if (rot.contains("Rot270"))
297 { 297 {
298 m_rot = 270; 298 m_rot = 270;
299 } 299 }
300 300
301// qDebug("Initial Rotation(%d):%s", m_rot, (const char*)rot); 301// qDebug("Initial Rotation(%d):%s", m_rot, (const char*)rot);
302*/ 302*/
303 m_autogenstr = "^ *[A-Z].*[a-z] *$"; 303 m_autogenstr = "^ *[A-Z].*[a-z] *$";
304 304
305#ifdef USEQPE 305#ifdef USEQPE
306 setIcon( Resource::loadPixmap( PICDIR "uqtreader") ); 306 setIcon( Opie::Core::OResource::loadPixmap( PICDIR "uqtreader", Opie::Core::OResource::SmallIcon ) );
307#else 307#else
308 setIcon( QPixmap (PICDIR + "/uqtreader.png") ); 308 setIcon( QPixmap (PICDIR + "/uqtreader.png") );
309#endif /* USEQPE */ 309#endif /* USEQPE */
310 310
311// QPEToolBar *bar = new QPEToolBar( this ); 311// QPEToolBar *bar = new QPEToolBar( this );
312// menubar = new QPEToolBar( this ); 312// menubar = new QPEToolBar( this );
313#ifdef USEQPE 313#ifdef USEQPE
314 Config config( APPDIR ); 314 Config config( APPDIR );
315#else 315#else
316 QDir d = QDir::home(); // "/" 316 QDir d = QDir::home(); // "/"
317 if ( !d.cd(APPDIR) ) { // "/tmp" 317 if ( !d.cd(APPDIR) ) { // "/tmp"
318 qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); 318 qWarning( "Cannot find the \"~/" APPDIR "\" directory" );
319 d = QDir::home(); 319 d = QDir::home();
320 d.mkdir(APPDIR); 320 d.mkdir(APPDIR);
321 d.cd(APPDIR); 321 d.cd(APPDIR);
322 } 322 }
323 QFileInfo fi(d, INIFILE); 323 QFileInfo fi(d, INIFILE);
324// qDebug("Path:%s", (const char*)fi.absFilePath()); 324// qDebug("Path:%s", (const char*)fi.absFilePath());
325 Config config(fi.absFilePath()); 325 Config config(fi.absFilePath());
326#endif 326#endif
327 config.setGroup("Toolbar"); 327 config.setGroup("Toolbar");
328 m_tbmovesave = m_tbmove = config.readBoolEntry("Movable", false); 328 m_tbmovesave = m_tbmove = config.readBoolEntry("Movable", false);
329 m_tbpolsave = m_tbpol = (ToolbarPolicy)config.readNumEntry("Policy", 1); 329 m_tbpolsave = m_tbpol = (ToolbarPolicy)config.readNumEntry("Policy", 1);
330 m_tbposition = (ToolBarDock)config.readNumEntry("Position", 2); 330 m_tbposition = (ToolBarDock)config.readNumEntry("Position", 2);
331 m_qtscroll = config.readNumEntry("QTScrollBar", false); 331 m_qtscroll = config.readNumEntry("QTScrollBar", false);
332 m_localscroll = config.readNumEntry("LocalScrollBar", false); 332 m_localscroll = config.readNumEntry("LocalScrollBar", false);
333 333
334// fileBar = new QToolBar("File", this); 334// fileBar = new QToolBar("File", this);
335// QToolBar* viewBar = new QToolBar("File", this); 335// QToolBar* viewBar = new QToolBar("File", this);
336// QToolBar* navBar = new QToolBar("File", this); 336// QToolBar* navBar = new QToolBar("File", this);
337// QToolBar* markBar = new QToolBar("File", this); 337// QToolBar* markBar = new QToolBar("File", this);
338 338
339#if defined(USEQPE) 339#if defined(USEQPE)
340 menubar = new QToolBar("Menus", this, m_tbposition); 340 menubar = new QToolBar("Menus", this, m_tbposition);
341 mb = new QPEMenuBar( menubar ); 341 mb = new QPEMenuBar( menubar );
342#else 342#else
343 mb = new QMenuBar( this ); 343 mb = new QMenuBar( this );
344#endif 344#endif
345 345
346#if defined(USEQPE) 346#if defined(USEQPE)
347 QPopupMenu* tmp = new QPopupMenu(mb); 347 QPopupMenu* tmp = new QPopupMenu(mb);
348 mb->insertItem( geticon( "AppsIcon" ), tmp ); 348 mb->insertItem( geticon( "AppsIcon" ), tmp );
349#else 349#else
350 QMenuBar* tmp = mb; 350 QMenuBar* tmp = mb;
351#endif 351#endif
352 352
353 QPopupMenu *file = new QPopupMenu( mb ); 353 QPopupMenu *file = new QPopupMenu( mb );
354 tmp->insertItem( tr( "File" ), file ); 354 tmp->insertItem( tr( "File" ), file );
355 355
356 QPopupMenu *navigation = new QPopupMenu(mb); 356 QPopupMenu *navigation = new QPopupMenu(mb);
357 tmp->insertItem( tr( "Navigation" ), navigation ); 357 tmp->insertItem( tr( "Navigation" ), navigation );
358 358
359 QPopupMenu *view = new QPopupMenu( mb ); 359 QPopupMenu *view = new QPopupMenu( mb );
360 tmp->insertItem( tr( "View" ), view ); 360 tmp->insertItem( tr( "View" ), view );
361 361
362 QPopupMenu *marks = new QPopupMenu( this ); 362 QPopupMenu *marks = new QPopupMenu( this );
363 tmp->insertItem( tr( "Marks" ), marks ); 363 tmp->insertItem( tr( "Marks" ), marks );
364 364
365 QPopupMenu *settings = new QPopupMenu( this ); 365 QPopupMenu *settings = new QPopupMenu( this );
366 tmp->insertItem( tr( "Settings" ), settings ); 366 tmp->insertItem( tr( "Settings" ), settings );
367 367
368// addToolBar(menubar, "Menus",QMainWindow::Top); 368// addToolBar(menubar, "Menus",QMainWindow::Top);
369// addToolBar(fileBar, "Toolbar",QMainWindow::Top); 369// addToolBar(fileBar, "Toolbar",QMainWindow::Top);
370 370
371 // QPopupMenu *edit = new QPopupMenu( this ); 371 // QPopupMenu *edit = new QPopupMenu( this );
372 372
373 /* 373 /*
374 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); 374 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
375 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); 375 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
376 a->addTo( bar ); 376 a->addTo( bar );
377 a->addTo( file ); 377 a->addTo( file );
378 */ 378 */
379 QWidget* widge = new QWidget(this); 379 QWidget* widge = new QWidget(this);
380 setCentralWidget( widge ); 380 setCentralWidget( widge );
381 QVBoxLayout* vlayout = new QVBoxLayout(widge); 381 QVBoxLayout* vlayout = new QVBoxLayout(widge);
382 m_layout = new QBoxLayout(QBoxLayout::LeftToRight); 382 m_layout = new QBoxLayout(QBoxLayout::LeftToRight);
383 m_prog = new QLabel(widge); 383 m_prog = new QLabel(widge);
384 vlayout->addLayout(m_layout, 1); 384 vlayout->addLayout(m_layout, 1);
385 vlayout->addWidget(m_prog); 385 vlayout->addWidget(m_prog);
386 386
387 editorStack = new QWidgetStack( widge ); 387 editorStack = new QWidgetStack( widge );
388 // setCentralWidget( editorStack ); 388 // setCentralWidget( editorStack );
389 389
390 searchVisible = FALSE; 390 searchVisible = FALSE;
391 regVisible = FALSE; 391 regVisible = FALSE;
392 m_fontVisible = false; 392 m_fontVisible = false;
393 393
394 m_buttonprefs = new CButtonPrefs(&kmap, this); 394 m_buttonprefs = new CButtonPrefs(&kmap, this);
395 editorStack->addWidget(m_buttonprefs, get_unique_id()); 395 editorStack->addWidget(m_buttonprefs, get_unique_id());
396 connect( m_buttonprefs, SIGNAL( Closed() ), this, SLOT( infoClose() ) ); 396 connect( m_buttonprefs, SIGNAL( Closed() ), this, SLOT( infoClose() ) );
397 397
398 398
399 m_annoWin = new CAnnoEdit(editorStack); 399 m_annoWin = new CAnnoEdit(editorStack);
400 editorStack->addWidget(m_annoWin, get_unique_id()); 400 editorStack->addWidget(m_annoWin, get_unique_id());
401 connect( m_annoWin, SIGNAL( finished(const QString&, const QString&) ), this, SLOT( addAnno(const QString&, const QString&) ) ); 401 connect( m_annoWin, SIGNAL( finished(const QString&, const QString&) ), this, SLOT( addAnno(const QString&, const QString&) ) );
402 connect( m_annoWin, SIGNAL( cancelled() ), this, SLOT( infoClose() ) ); 402 connect( m_annoWin, SIGNAL( cancelled() ), this, SLOT( infoClose() ) );
403 403
404 m_infoWin = new infowin(editorStack); 404 m_infoWin = new infowin(editorStack);
405 editorStack->addWidget(m_infoWin, get_unique_id()); 405 editorStack->addWidget(m_infoWin, get_unique_id());
406 connect( m_infoWin, SIGNAL( Close() ), this, SLOT( infoClose() ) ); 406 connect( m_infoWin, SIGNAL( Close() ), this, SLOT( infoClose() ) );
407 407
408 m_graphicwin = new GraphicWin(editorStack); 408 m_graphicwin = new GraphicWin(editorStack);
409 editorStack->addWidget(m_graphicwin, get_unique_id()); 409 editorStack->addWidget(m_graphicwin, get_unique_id());
410 connect( m_graphicwin, SIGNAL( Closed() ), this, SLOT( infoClose() ) ); 410 connect( m_graphicwin, SIGNAL( Closed() ), this, SLOT( infoClose() ) );
411 411
412// bkmkselector = new QListBox(editorStack, "Bookmarks"); 412// bkmkselector = new QListBox(editorStack, "Bookmarks");
413 bkmkselector = new CBkmkSelector(editorStack, "Bookmarks"); 413 bkmkselector = new CBkmkSelector(editorStack, "Bookmarks");
414 // connect(bkmkselector, SIGNAL( selected(const QString&) ), this, SLOT( gotobkmk(const QString&) ) ); 414 // connect(bkmkselector, SIGNAL( selected(const QString&) ), this, SLOT( gotobkmk(const QString&) ) );
415 connect(bkmkselector, SIGNAL( selected(int) ), this, SLOT( gotobkmk(int) ) ); 415 connect(bkmkselector, SIGNAL( selected(int) ), this, SLOT( gotobkmk(int) ) );
416 connect(bkmkselector, SIGNAL( cancelled() ), this, SLOT( cancelbkmk() ) ); 416 connect(bkmkselector, SIGNAL( cancelled() ), this, SLOT( cancelbkmk() ) );
417 editorStack->addWidget( bkmkselector, get_unique_id() ); 417 editorStack->addWidget( bkmkselector, get_unique_id() );
418 418
419/* 419/*
420 importSelector = new FileSelector( "*", editorStack, "importselector", false ); 420 importSelector = new FileSelector( "*", editorStack, "importselector", false );
421 connect( importSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( importFile( const DocLnk & ) ) ); 421 connect( importSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( importFile( const DocLnk & ) ) );
422 422
423 editorStack->addWidget( importSelector, get_unique_id() ); 423 editorStack->addWidget( importSelector, get_unique_id() );
424 424
425 // don't need the close visible, it is redundant... 425 // don't need the close visible, it is redundant...
426 importSelector->setCloseVisible( FALSE ); 426 importSelector->setCloseVisible( FALSE );
427*/ 427*/
428// qDebug("Reading file list"); 428// qDebug("Reading file list");
429 readfilelist(); 429 readfilelist();
430 430
431 reader = new QTReader( editorStack ); 431 reader = new QTReader( editorStack );
432 432
433 reader->setDoUpdates(false); 433 reader->setDoUpdates(false);
434 434
435#ifdef USEQPE 435#ifdef USEQPE
436 ((QPEApplication*)qApp)->setStylusOperation(reader, QPEApplication::RightOnHold); 436 ((QPEApplication*)qApp)->setStylusOperation(reader, QPEApplication::RightOnHold);
437#endif 437#endif
438 438
439// qDebug("Reading config"); 439// qDebug("Reading config");
440// Config config( APPDIR ); 440// Config config( APPDIR );
441 config.setGroup( "View" ); 441 config.setGroup( "View" );
442#if defined(USEQPE) && defined(USENEWFULLSCREEN) 442#if defined(USEQPE) && defined(USENEWFULLSCREEN)
443 m_usenewfullscreen = config.readBoolEntry("NewFullScreen", false); 443 m_usenewfullscreen = config.readBoolEntry("NewFullScreen", false);
444#endif 444#endif
445 m_debounce = config.readNumEntry("Debounce", 0); 445 m_debounce = config.readNumEntry("Debounce", 0);
446 m_buttonprefs->Debounce(m_debounce); 446 m_buttonprefs->Debounce(m_debounce);
447#ifdef USEQPE 447#ifdef USEQPE
448 m_bFloatingDialog = config.readBoolEntry("FloatDialogs", false); 448 m_bFloatingDialog = config.readBoolEntry("FloatDialogs", false);
449#else 449#else
450 m_bFloatingDialog = config.readBoolEntry("FloatDialogs", true); 450 m_bFloatingDialog = config.readBoolEntry("FloatDialogs", true);
451#endif 451#endif
452 reader->setStripCR(config.readBoolEntry( "StripCr", true )); 452 reader->setStripCR(config.readBoolEntry( "StripCr", true ));
453 reader->bfulljust = config.readBoolEntry( "FullJust", false ); 453 reader->bfulljust = config.readBoolEntry( "FullJust", false );
454 /* 454 /*
455 bool btmp = config.readBoolEntry("Negative", false); 455 bool btmp = config.readBoolEntry("Negative", false);
456 if (btmp) reader->setNegative(); 456 if (btmp) reader->setNegative();
457 */ 457 */
458 reader->bInverse = config.readBoolEntry("Inverse", false); 458 reader->bInverse = config.readBoolEntry("Inverse", false);
459 reader->m_fontControl.FixGraphics(config.readBoolEntry( "FixGraphics", false )); 459 reader->m_fontControl.FixGraphics(config.readBoolEntry( "FixGraphics", false ));
460 reader->setextraspace(config.readNumEntry( "ExtraSpace", 0 )); 460 reader->setextraspace(config.readNumEntry( "ExtraSpace", 0 ));
461 reader->setlead(config.readNumEntry( "ExtraLead", 0 )); 461 reader->setlead(config.readNumEntry( "ExtraLead", 0 ));
462 reader->btextfmt = config.readBoolEntry( "TextFmt", false ); 462 reader->btextfmt = config.readBoolEntry( "TextFmt", false );
463 reader->bautofmt = config.readBoolEntry( "AutoFmt", true ); 463 reader->bautofmt = config.readBoolEntry( "AutoFmt", true );
464 reader->bstriphtml = config.readBoolEntry( "StripHtml", false ); 464 reader->bstriphtml = config.readBoolEntry( "StripHtml", false );
465 reader->bNoInlineTables = config.readBoolEntry( "NoInlineTables", false ); 465 reader->bNoInlineTables = config.readBoolEntry( "NoInlineTables", false );
466 reader->bpeanut = config.readBoolEntry( "Peanut", false ); 466 reader->bpeanut = config.readBoolEntry( "Peanut", false );
467 reader->bdehyphen = config.readBoolEntry( "Dehyphen", false ); 467 reader->bdehyphen = config.readBoolEntry( "Dehyphen", false );
468 reader->bdepluck = config.readBoolEntry( "Depluck", false ); 468 reader->bdepluck = config.readBoolEntry( "Depluck", false );
469 reader->bdejpluck = config.readBoolEntry( "Dejpluck", false ); 469 reader->bdejpluck = config.readBoolEntry( "Dejpluck", false );
470 reader->bonespace = config.readBoolEntry( "OneSpace", false ); 470 reader->bonespace = config.readBoolEntry( "OneSpace", false );
471 reader->bunindent = config.readBoolEntry( "Unindent", false ); 471 reader->bunindent = config.readBoolEntry( "Unindent", false );
472 reader->brepara = config.readBoolEntry( "Repara", false ); 472 reader->brepara = config.readBoolEntry( "Repara", false );
473 reader->m_reparastring = config.readEntry( "ReparaString", "\\n{[\\n \\t]}"); 473 reader->m_reparastring = config.readEntry( "ReparaString", "\\n{[\\n \\t]}");
474 m_bgtype = (bground)config.readNumEntry( "BackgroundType" , 0 ); 474 m_bgtype = (bground)config.readNumEntry( "BackgroundType" , 0 );
475 m_themename = config.readEntry("Theme", QString::null ); 475 m_themename = config.readEntry("Theme", QString::null );
476 reader->bdblspce = config.readBoolEntry( "DoubleSpace", false ); 476 reader->bdblspce = config.readBoolEntry( "DoubleSpace", false );
477 reader->bindenter = config.readNumEntry( "Indent", 0 ); 477 reader->bindenter = config.readNumEntry( "Indent", 0 );
478 reader->m_textsize = config.readNumEntry( "FontSize", 12 ); 478 reader->m_textsize = config.readNumEntry( "FontSize", 12 );
479 reader->m_delay = config.readNumEntry( "ScrollDelay", 5184); 479 reader->m_delay = config.readNumEntry( "ScrollDelay", 5184);
480 reader->m_scrollstep = config.readNumEntry( "ScrollStep", 1); 480 reader->m_scrollstep = config.readNumEntry( "ScrollStep", 1);
481 reader->m_outputName = config.readEntry( "OutputCodec", ""); 481 reader->m_outputName = config.readEntry( "OutputCodec", "");
482 482
483 483
484 reader->m_lastfile = config.readEntry( "LastFile", QString::null ); 484 reader->m_lastfile = config.readEntry( "LastFile", QString::null );
485 reader->m_lastposn = config.readNumEntry( "LastPosn", 0 ); 485 reader->m_lastposn = config.readNumEntry( "LastPosn", 0 );
486 reader->m_bpagemode = config.readBoolEntry( "PageMode", true ); 486 reader->m_bpagemode = config.readBoolEntry( "PageMode", true );
487 reader->m_bMonoSpaced = config.readBoolEntry( "MonoSpaced", false); 487 reader->m_bMonoSpaced = config.readBoolEntry( "MonoSpaced", false);
488 reader->m_rotated = config.readBoolEntry( "IsRotated", false ); 488 reader->m_rotated = config.readBoolEntry( "IsRotated", false );
489 reader->m_scrolltype = config.readNumEntry( "ScrollType", 0 ); 489 reader->m_scrolltype = config.readNumEntry( "ScrollType", 0 );
490 m_statusstring = config.readEntry("StatusContent", "%P%% Doc:%d/%D %p%% %z%%"); 490 m_statusstring = config.readEntry("StatusContent", "%P%% Doc:%d/%D %p%% %z%%");
491 m_statusishidden = config.readBoolEntry("StatusHidden", false); 491 m_statusishidden = config.readBoolEntry("StatusHidden", false);
492 m_background = config.readNumEntry( "Background", 0 ); 492 m_background = config.readNumEntry( "Background", 0 );
493 reader->setBackground(getcolour(m_background)); 493 reader->setBackground(getcolour(m_background));
494 m_foreground = config.readNumEntry( "Foreground", 1 ); 494 m_foreground = config.readNumEntry( "Foreground", 1 );
495 reader->setForeground(getcolour(m_foreground)); 495 reader->setForeground(getcolour(m_foreground));
496 m_scrollcolor = config.readNumEntry( "ScrollColour", 5 ); 496 m_scrollcolor = config.readNumEntry( "ScrollColour", 5 );
497 setscrollcolour(); 497 setscrollcolour();
498 m_scrollbarcolor = config.readNumEntry( "ScrollBarColour", 5 ); 498 m_scrollbarcolor = config.readNumEntry( "ScrollBarColour", 5 );
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 @@
1Package: opie-reader 1Package: opie-reader
2Files: bin/reader lib/libreader* plugins/reader/* apps/Applications/opie-reader.desktop pics/opie-reader/* 2Files: bin/reader lib/libreader* plugins/reader/* apps/Applications/opie-reader.desktop pics/opie-reader/*
3Priority: optional 3Priority: optional
4Section: opie/applications 4Section: opie/applications
5Maintainer: Tim Wentford <timwentford@hotmail.com> 5Maintainer: Tim Wentford <timwentford@hotmail.com>
6Architecture: arm 6Architecture: arm
7Depends: task-opie-minimal 7Depends: task-opie-minimal, libopiecore2
8License: GPL 8License: GPL
9Description: E-Book reader 9Description: E-Book reader
10Version: $QPE_VERSION$EXTRAVERSION 10Version: $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 @@
1TEMPLATE = subdirs 1TEMPLATE = subdirs
2SUBDIRS = pluckerbaselib \ 2SUBDIRS = pluckerbaselib \
3 codeclib \ 3 codeclib \
4 pdblib \ 4 pdblib \
5 PluckerCodec \ 5 PluckerCodec \
6 AportisCodec \ 6 AportisCodec \
7 CHM \ 7 CHM \
8 HTMLFilter \ 8 HTMLFilter \
9 WeaselCodec \ 9 WeaselCodec \
10 iSiloCodec \ 10 iSiloCodec \
11 ppmsCodec \ 11 ppmsCodec \
12 FliteCmd \ 12 FliteCmd \
13 pluckerdecompress \ 13 pluckerdecompress \
14 ArriereCodec \ 14 ArriereCodec \
15 RebCodec \ 15 RebCodec \
16 reader 16 reader
17LIBS += -lopiecore2
17 18
18# these are added only built if enabled in "make menuconfig" 19# these are added only built if enabled in "make menuconfig"
19# FliteDyn 20# FliteDyn
20# FliteDyn16 21# FliteDyn16
21 22
22include( $(OPIEDIR)/include.pro ) 23include( $(OPIEDIR)/include.pro )
23 24
24 25