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,1842 +1,1842 @@
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 );
499 setscrollbarcolour(); 499 setscrollbarcolour();
500 reader->hyphenate = config.readBoolEntry( "Hyphenate", false ); 500 reader->hyphenate = config.readBoolEntry( "Hyphenate", false );
501 reader->m_swapmouse = config.readBoolEntry( "SwapMouse", false); 501 reader->m_swapmouse = config.readBoolEntry( "SwapMouse", false);
502 reader->m_fontname = config.readEntry( "Fontname", "helvetica" ); 502 reader->m_fontname = config.readEntry( "Fontname", "helvetica" );
503 reader->m_encd = config.readNumEntry( "Encoding", 0 ); 503 reader->m_encd = config.readNumEntry( "Encoding", 0 );
504 reader->m_charpc = config.readNumEntry( "CharSpacing", 100 ); 504 reader->m_charpc = config.readNumEntry( "CharSpacing", 100 );
505 reader->m_overlap = config.readNumEntry( "Overlap", 0 ); 505 reader->m_overlap = config.readNumEntry( "Overlap", 0 );
506 reader->m_abstopmargin = config.readNumEntry( "Top Margin", 100 ); 506 reader->m_abstopmargin = config.readNumEntry( "Top Margin", 100 );
507 reader->m_absbottommargin = config.readNumEntry( "Bottom Margin", 100 ); 507 reader->m_absbottommargin = config.readNumEntry( "Bottom Margin", 100 );
508 reader->m_absleft_border = config.readNumEntry( "Left Margin", 100 ); 508 reader->m_absleft_border = config.readNumEntry( "Left Margin", 100 );
509 reader->m_absright_border = config.readNumEntry( "Right Margin", 100 ); 509 reader->m_absright_border = config.readNumEntry( "Right Margin", 100 );
510 510
511 m_scrollishidden = config.readBoolEntry( "HideScrollBar", false ); 511 m_scrollishidden = config.readBoolEntry( "HideScrollBar", false );
512 m_hidebars = config.readBoolEntry( "HideToolBar", false ); 512 m_hidebars = config.readBoolEntry( "HideToolBar", false );
513 513
514 reader->brepalm = config.readBoolEntry( "Repalm", false ); 514 reader->brepalm = config.readBoolEntry( "Repalm", false );
515 reader->bunderlineLink = config.readBoolEntry( "UnderlineLink", true ); 515 reader->bunderlineLink = config.readBoolEntry( "UnderlineLink", true );
516 reader->bkern = config.readBoolEntry( "Kern", false ); 516 reader->bkern = config.readBoolEntry( "Kern", false );
517 reader->bremap = config.readBoolEntry( "Remap", true ); 517 reader->bremap = config.readBoolEntry( "Remap", true );
518 reader->bmakebold = config.readBoolEntry( "MakeBold", false ); 518 reader->bmakebold = config.readBoolEntry( "MakeBold", false );
519 reader->setContinuous(config.readBoolEntry( "Continuous", true )); 519 reader->setContinuous(config.readBoolEntry( "Continuous", true ));
520 reader->setDoubleBuffer(config.readBoolEntry("DoubleBuffer", true)); 520 reader->setDoubleBuffer(config.readBoolEntry("DoubleBuffer", true));
521 m_targetapp = config.readEntry( "TargetApp", QString::null ); 521 m_targetapp = config.readEntry( "TargetApp", QString::null );
522 m_targetmsg = config.readEntry( "TargetMsg", QString::null ); 522 m_targetmsg = config.readEntry( "TargetMsg", QString::null );
523#ifdef _SCROLLPIPE 523#ifdef _SCROLLPIPE
524 reader->m_pipetarget = config.readEntry( "PipeTarget", QString::null ); 524 reader->m_pipetarget = config.readEntry( "PipeTarget", QString::null );
525 reader->m_pauseAfterEachPara = config.readBoolEntry( "PauseAfterPara", true ); 525 reader->m_pauseAfterEachPara = config.readBoolEntry( "PauseAfterPara", true );
526#endif 526#endif
527 m_twoTouch = config.readBoolEntry( "TwoTouch", false); 527 m_twoTouch = config.readBoolEntry( "TwoTouch", false);
528 m_doAnnotation = config.readBoolEntry( "Annotation", false); 528 m_doAnnotation = config.readBoolEntry( "Annotation", false);
529 m_doDictionary = config.readBoolEntry( "Dictionary", false); 529 m_doDictionary = config.readBoolEntry( "Dictionary", false);
530 m_doClipboard = config.readBoolEntry( "Clipboard", false); 530 m_doClipboard = config.readBoolEntry( "Clipboard", false);
531 m_doOutput = config.readBoolEntry( "OutputTgt", false); 531 m_doOutput = config.readBoolEntry( "OutputTgt", false);
532 /* 532 /*
533 m_spaceTarget = (ActionTypes)config.readNumEntry("SpaceTarget", cesAutoScroll); 533 m_spaceTarget = (ActionTypes)config.readNumEntry("SpaceTarget", cesAutoScroll);
534 m_escapeTarget = (ActionTypes)config.readNumEntry("EscapeTarget", cesNone); 534 m_escapeTarget = (ActionTypes)config.readNumEntry("EscapeTarget", cesNone);
535 m_returnTarget = (ActionTypes)config.readNumEntry("ReturnTarget", cesFullScreen); 535 m_returnTarget = (ActionTypes)config.readNumEntry("ReturnTarget", cesFullScreen);
536 m_leftTarget = (ActionTypes)config.readNumEntry("LeftTarget", cesZoomOut); 536 m_leftTarget = (ActionTypes)config.readNumEntry("LeftTarget", cesZoomOut);
537 m_rightTarget = (ActionTypes)config.readNumEntry("RightTarget", cesZoomIn); 537 m_rightTarget = (ActionTypes)config.readNumEntry("RightTarget", cesZoomIn);
538 m_upTarget = (ActionTypes)config.readNumEntry("UpTarget", cesPageUp); 538 m_upTarget = (ActionTypes)config.readNumEntry("UpTarget", cesPageUp);
539 m_downTarget = (ActionTypes)config.readNumEntry("DownTarget", cesPageDown); 539 m_downTarget = (ActionTypes)config.readNumEntry("DownTarget", cesPageDown);
540 540
541 m_leftScroll = config.readBoolEntry("LeftScroll", false); 541 m_leftScroll = config.readBoolEntry("LeftScroll", false);
542 m_rightScroll = config.readBoolEntry("RightScroll", false); 542 m_rightScroll = config.readBoolEntry("RightScroll", false);
543 m_upScroll = config.readBoolEntry("UpScroll", true); 543 m_upScroll = config.readBoolEntry("UpScroll", true);
544 m_downScroll = config.readBoolEntry("DownScroll", true); 544 m_downScroll = config.readBoolEntry("DownScroll", true);
545 */ 545 */
546 m_propogatefontchange = config.readBoolEntry( "RequestorFontChange", false); 546 m_propogatefontchange = config.readBoolEntry( "RequestorFontChange", false);
547 reader->setBaseSize(config.readNumEntry( "Basesize", 10 )); 547 reader->setBaseSize(config.readNumEntry( "Basesize", 10 ));
548 reader->setHyphenThreshold(config.readNumEntry( "HyphenThreshold", 50 )); 548 reader->setHyphenThreshold(config.readNumEntry( "HyphenThreshold", 50 ));
549 // reader->buffdoc.setCustomHyphen(config.readBoolEntry( "CustomHyphen", false )); 549 // reader->buffdoc.setCustomHyphen(config.readBoolEntry( "CustomHyphen", false ));
550#ifndef USEQPE 550#ifndef USEQPE
551 config.setGroup( "Geometry" ); 551 config.setGroup( "Geometry" );
552 setGeometry(0,0, 552 setGeometry(0,0,
553 config.readNumEntry( "width", QApplication::desktop()->width()/2 ), 553 config.readNumEntry( "width", QApplication::desktop()->width()/2 ),
554 config.readNumEntry( "height", QApplication::desktop()->height()/2 )); 554 config.readNumEntry( "height", QApplication::desktop()->height()/2 ));
555 move( 555 move(
556 config.readNumEntry( "x", 20 ), 556 config.readNumEntry( "x", 20 ),
557 config.readNumEntry( "y", 20 )); 557 config.readNumEntry( "y", 20 ));
558#else 558#else
559 m_grabkeyboard = config.readBoolEntry( "GrabKeyboard", false); 559 m_grabkeyboard = config.readBoolEntry( "GrabKeyboard", false);
560#endif 560#endif
561 561
562 562
563 563
564 setTwoTouch(m_twoTouch); 564 setTwoTouch(m_twoTouch);
565 565
566 connect( reader, SIGNAL( OnShowPicture(QImage&) ), this, SLOT( showgraphic(QImage&) ) ); 566 connect( reader, SIGNAL( OnShowPicture(QImage&) ), this, SLOT( showgraphic(QImage&) ) );
567 567
568 connect( reader, SIGNAL( OnRedraw() ), this, SLOT( OnRedraw() ) ); 568 connect( reader, SIGNAL( OnRedraw() ), this, SLOT( OnRedraw() ) );
569 connect( reader, SIGNAL( OnWordSelected(const QString&, size_t, size_t, const QString&) ), this, SLOT( OnWordSelected(const QString&, size_t, size_t, const QString&) ) ); 569 connect( reader, SIGNAL( OnWordSelected(const QString&, size_t, size_t, const QString&) ), this, SLOT( OnWordSelected(const QString&, size_t, size_t, const QString&) ) );
570 connect( reader, SIGNAL( OnURLSelected(const QString&, const size_t) ), this, SLOT( OnURLSelected(const QString&, const size_t) ) ); 570 connect( reader, SIGNAL( OnURLSelected(const QString&, const size_t) ), this, SLOT( OnURLSelected(const QString&, const size_t) ) );
571 connect( reader, SIGNAL( NewFileRequest(const QString&) ), this, SLOT( forceopen(const QString&) ) ); 571 connect( reader, SIGNAL( NewFileRequest(const QString&) ), this, SLOT( forceopen(const QString&) ) );
572 connect( reader, SIGNAL( HandleKeyRequest(QKeyEvent*) ), this, SLOT( handlekey(QKeyEvent*) ) ); 572 connect( reader, SIGNAL( HandleKeyRequest(QKeyEvent*) ), this, SLOT( handlekey(QKeyEvent*) ) );
573 connect( reader, SIGNAL( SetScrollState(bool) ), this, SLOT( setScrollState(bool) ) ); 573 connect( reader, SIGNAL( SetScrollState(bool) ), this, SLOT( setScrollState(bool) ) );
574 connect( reader, SIGNAL(RefreshBitmap()), this, SLOT(setBackgroundBitmap())); 574 connect( reader, SIGNAL(RefreshBitmap()), this, SLOT(setBackgroundBitmap()));
575 editorStack->addWidget( reader, get_unique_id() ); 575 editorStack->addWidget( reader, get_unique_id() );
576 576
577 m_preferences_action = new QAction( tr( "Configuration" ), geticon( "SettingsIcon" ), QString::null, 0, this, NULL); 577 m_preferences_action = new QAction( tr( "Configuration" ), geticon( "SettingsIcon" ), QString::null, 0, this, NULL);
578 connect( m_preferences_action, SIGNAL( activated() ), this, SLOT( showprefs() ) ); 578 connect( m_preferences_action, SIGNAL( activated() ), this, SLOT( showprefs() ) );
579 m_preferences_action->addTo( settings ); 579 m_preferences_action->addTo( settings );
580 580
581 m_saveconfig_action = new QAction( tr( "Save Config" ), QString::null, 0, this, NULL); 581 m_saveconfig_action = new QAction( tr( "Save Config" ), QString::null, 0, this, NULL);
582 connect( m_saveconfig_action, SIGNAL( activated() ), this, SLOT( SaveConfig() ) ); 582 connect( m_saveconfig_action, SIGNAL( activated() ), this, SLOT( SaveConfig() ) );
583 m_saveconfig_action->addTo( settings ); 583 m_saveconfig_action->addTo( settings );
584 584
585 m_loadconfig_action = new QAction( tr( "Load Config" ), QString::null, 0, this, NULL); 585 m_loadconfig_action = new QAction( tr( "Load Config" ), QString::null, 0, this, NULL);
586 connect( m_loadconfig_action, SIGNAL( activated() ), this, SLOT( LoadConfig() ) ); 586 connect( m_loadconfig_action, SIGNAL( activated() ), this, SLOT( LoadConfig() ) );
587 m_loadconfig_action->addTo( settings ); 587 m_loadconfig_action->addTo( settings );
588 588
589 m_tidyconfig_action = new QAction( tr( "Delete Config" ), QString::null, 0, this, NULL); 589 m_tidyconfig_action = new QAction( tr( "Delete Config" ), QString::null, 0, this, NULL);
590 connect( m_tidyconfig_action, SIGNAL( activated() ), this, SLOT( TidyConfig() ) ); 590 connect( m_tidyconfig_action, SIGNAL( activated() ), this, SLOT( TidyConfig() ) );
591 m_tidyconfig_action->addTo( settings ); 591 m_tidyconfig_action->addTo( settings );
592 592
593 settings->insertSeparator(); 593 settings->insertSeparator();
594 m_toolbarprefs_action = new QAction( tr( "Toolbars" ), QString::null, 0, this, NULL); 594 m_toolbarprefs_action = new QAction( tr( "Toolbars" ), QString::null, 0, this, NULL);
595 connect( m_toolbarprefs_action, SIGNAL( activated() ), this, SLOT( showtoolbarprefs() ) ); 595 connect( m_toolbarprefs_action, SIGNAL( activated() ), this, SLOT( showtoolbarprefs() ) );
596 m_toolbarprefs_action->addTo( settings ); 596 m_toolbarprefs_action->addTo( settings );
597 597
598 m_buttonprefs_action = new QAction( tr( "Buttons" ), QString::null, 0, this, NULL); 598 m_buttonprefs_action = new QAction( tr( "Buttons" ), QString::null, 0, this, NULL);
599 connect( m_buttonprefs_action, SIGNAL( activated() ), this, SLOT( showbuttonprefs() ) ); 599 connect( m_buttonprefs_action, SIGNAL( activated() ), this, SLOT( showbuttonprefs() ) );
600 m_buttonprefs_action->addTo( settings ); 600 m_buttonprefs_action->addTo( settings );
601 601
602 m_loadtheme_action = new QAction( tr( "Load Theme" ), QString::null, 0, this, NULL); 602 m_loadtheme_action = new QAction( tr( "Load Theme" ), QString::null, 0, this, NULL);
603 connect( m_loadtheme_action, SIGNAL( activated() ), this, SLOT( LoadTheme() ) ); 603 connect( m_loadtheme_action, SIGNAL( activated() ), this, SLOT( LoadTheme() ) );
604 m_loadtheme_action->addTo( settings ); 604 m_loadtheme_action->addTo( settings );
605 605
606 m_repara_action = new QAction( tr( "EOP Marker" ), QString::null, 0, this, NULL); 606 m_repara_action = new QAction( tr( "EOP Marker" ), QString::null, 0, this, NULL);
607 connect( m_repara_action, SIGNAL( activated() ), this, SLOT( reparastring() ) ); 607 connect( m_repara_action, SIGNAL( activated() ), this, SLOT( reparastring() ) );
608 m_repara_action->addTo(settings); 608 m_repara_action->addTo(settings);
609 609
610#ifdef USEQPE 610#ifdef USEQPE
611 m_grab_action = new QAction( tr( "Grab Buttons" ), QString::null, 0, this, NULL, true ); 611 m_grab_action = new QAction( tr( "Grab Buttons" ), QString::null, 0, this, NULL, true );
612 connect( m_grab_action, SIGNAL( toggled(bool) ), this, SLOT( setgrab(bool) ) ); 612 connect( m_grab_action, SIGNAL( toggled(bool) ), this, SLOT( setgrab(bool) ) );
613 m_grab_action->setOn(m_grabkeyboard); 613 m_grab_action->setOn(m_grabkeyboard);
614 m_grab_action->addTo( settings ); 614 m_grab_action->addTo( settings );
615#endif 615#endif
616 616
617 m_open_action = new QAction( tr( "Open" ), geticon( "fileopen" ), QString::null, 0, this, 0 ); 617 m_open_action = new QAction( tr( "Open" ), geticon( "fileopen" ), QString::null, 0, this, 0 );
618 connect( m_open_action, SIGNAL( activated() ), this, SLOT( fileOpen() ) ); 618 connect( m_open_action, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
619 m_open_action->addTo( file ); 619 m_open_action->addTo( file );
620 620
621 m_close_action = new QAction( tr( "Close" ), geticon( "close" ), QString::null, 0, this, 0 ); 621 m_close_action = new QAction( tr( "Close" ), geticon( "close" ), QString::null, 0, this, 0 );
622 connect( m_close_action, SIGNAL( activated() ), this, SLOT( fileClose() ) ); 622 connect( m_close_action, SIGNAL( activated() ), this, SLOT( fileClose() ) );
623 m_close_action->addTo( file ); 623 m_close_action->addTo( file );
624 624
625#ifdef _SCRIPT 625#ifdef _SCRIPT
626 a = new QAction( tr( "Run Script" ), QString::null, 0, this, NULL); 626 a = new QAction( tr( "Run Script" ), QString::null, 0, this, NULL);
627 connect( a, SIGNAL( activated() ), this, SLOT( RunScript() ) ); 627 connect( a, SIGNAL( activated() ), this, SLOT( RunScript() ) );
628 a->addTo( file ); 628 a->addTo( file );
629#endif 629#endif
630 /* 630 /*
631 a = new QAction( tr( "Revert" ), geticon( "close" ), QString::null, 0, this, 0 ); 631 a = new QAction( tr( "Revert" ), geticon( "close" ), QString::null, 0, this, 0 );
632 connect( a, SIGNAL( activated() ), this, SLOT( fileRevert() ) ); 632 connect( a, SIGNAL( activated() ), this, SLOT( fileRevert() ) );
633 a->addTo( file ); 633 a->addTo( file );
634 634
635 a = new QAction( tr( "Cut" ), geticon( "cut" ), QString::null, 0, this, 0 ); 635 a = new QAction( tr( "Cut" ), geticon( "cut" ), QString::null, 0, this, 0 );
636 connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) ); 636 connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
637 a->addTo( filebar() ); 637 a->addTo( filebar() );
638 a->addTo( edit ); 638 a->addTo( edit );
639 */ 639 */
640 640
641 m_info_action = new QAction( tr( "Info" ), geticon( "UtilsIcon" ), QString::null, 0, this, NULL); 641 m_info_action = new QAction( tr( "Info" ), geticon( "UtilsIcon" ), QString::null, 0, this, NULL);
642 connect( m_info_action, SIGNAL( activated() ), this, SLOT( showinfo() ) ); 642 connect( m_info_action, SIGNAL( activated() ), this, SLOT( showinfo() ) );
643 m_info_action->addTo( file ); 643 m_info_action->addTo( file );
644 644
645 m_touch_action = new QAction( tr( "Two/One Touch" ), geticon( "1to1" ), QString::null, 0, this, NULL, true ); 645 m_touch_action = new QAction( tr( "Two/One Touch" ), geticon( "1to1" ), QString::null, 0, this, NULL, true );
646 connect( m_touch_action, SIGNAL( toggled(bool) ), this, SLOT( setTwoTouch(bool) ) ); 646 connect( m_touch_action, SIGNAL( toggled(bool) ), this, SLOT( setTwoTouch(bool) ) );
647 m_touch_action->setOn(m_twoTouch); 647 m_touch_action->setOn(m_twoTouch);
648 m_touch_action->addTo( file ); 648 m_touch_action->addTo( file );
649 649
650 m_find_action = new QAction( tr( "Find..." ), geticon( "find" ), QString::null, 0, this, NULL); 650 m_find_action = new QAction( tr( "Find..." ), geticon( "find" ), QString::null, 0, this, NULL);
651 connect( m_find_action, SIGNAL( activated() ), this, SLOT( editFind() ) ); 651 connect( m_find_action, SIGNAL( activated() ), this, SLOT( editFind() ) );
652 file->insertSeparator(); 652 file->insertSeparator();
653// a->addTo( bar ); 653// a->addTo( bar );
654 m_find_action->addTo( file ); 654 m_find_action->addTo( file );
655 655
656 m_exportlinks_action = new QAction( tr( "Export Links" ), QString::null, 0, this, NULL); 656 m_exportlinks_action = new QAction( tr( "Export Links" ), QString::null, 0, this, NULL);
657 connect( m_exportlinks_action, SIGNAL( activated() ), this, SLOT( ExportLinks() ) ); 657 connect( m_exportlinks_action, SIGNAL( activated() ), this, SLOT( ExportLinks() ) );
658 m_exportlinks_action->addTo( file ); 658 m_exportlinks_action->addTo( file );
659 659
660 m_scrollButton = new QAction( tr( "Scroll" ), getmyicon( "panel-arrow-down" ), QString::null, 0, this, 0, true ); 660 m_scrollButton = new QAction( tr( "Scroll" ), getmyicon( "panel-arrow-down" ), QString::null, 0, this, 0, true );
661 connect( m_scrollButton, SIGNAL( toggled(bool) ), this, SLOT( autoScroll(bool) ) ); 661 connect( m_scrollButton, SIGNAL( toggled(bool) ), this, SLOT( autoScroll(bool) ) );
662 m_scrollButton->addTo(navigation); 662 m_scrollButton->addTo(navigation);
663 m_scrollButton->setOn(false); 663 m_scrollButton->setOn(false);
664 664
665 m_start_action = new QAction( tr( "Goto Start" ), geticon( "start" ), QString::null, 0, this, NULL); 665 m_start_action = new QAction( tr( "Goto Start" ), geticon( "start" ), QString::null, 0, this, NULL);
666 connect( m_start_action, SIGNAL( activated() ), this, SLOT( gotoStart() ) ); 666 connect( m_start_action, SIGNAL( activated() ), this, SLOT( gotoStart() ) );
667 m_start_action->addTo(navigation); 667 m_start_action->addTo(navigation);
668 668
669 m_end_action = new QAction( tr( "Goto End" ), geticon( "finish" ), QString::null, 0, this, NULL); 669 m_end_action = new QAction( tr( "Goto End" ), geticon( "finish" ), QString::null, 0, this, NULL);
670 connect( m_end_action, SIGNAL( activated() ), this, SLOT( gotoEnd() ) ); 670 connect( m_end_action, SIGNAL( activated() ), this, SLOT( gotoEnd() ) );
671 m_end_action->addTo(navigation); 671 m_end_action->addTo(navigation);
672 672
673 m_jump_action = new QAction( tr( "Jump" ), geticon( "rotate" ), QString::null, 0, this, NULL); 673 m_jump_action = new QAction( tr( "Jump" ), geticon( "rotate" ), QString::null, 0, this, NULL);
674 connect( m_jump_action, SIGNAL( activated() ), this, SLOT( jump() ) ); 674 connect( m_jump_action, SIGNAL( activated() ), this, SLOT( jump() ) );
675 m_jump_action->addTo(navigation); 675 m_jump_action->addTo(navigation);
676 676
677 m_pageline_action = new QAction( tr( "Page/Line Scroll" ), geticon( "pass" ), QString::null, 0, this, NULL, true ); 677 m_pageline_action = new QAction( tr( "Page/Line Scroll" ), geticon( "pass" ), QString::null, 0, this, NULL, true );
678 connect( m_pageline_action, SIGNAL( toggled(bool) ), this, SLOT( pagemode(bool) ) ); 678 connect( m_pageline_action, SIGNAL( toggled(bool) ), this, SLOT( pagemode(bool) ) );
679 m_pageline_action->addTo(navigation); 679 m_pageline_action->addTo(navigation);
680 m_pageline_action->setOn(reader->m_bpagemode); 680 m_pageline_action->setOn(reader->m_bpagemode);
681 681
682 m_pageup_action = new QAction( tr( "Up" ), geticon( "up" ), QString::null, 0, this, 0 ); 682 m_pageup_action = new QAction( tr( "Up" ), geticon( "up" ), QString::null, 0, this, 0 );
683 connect( m_pageup_action, SIGNAL( activated() ), this, SLOT( pageup() ) ); 683 connect( m_pageup_action, SIGNAL( activated() ), this, SLOT( pageup() ) );
684 m_pageup_action->addTo( navigation ); 684 m_pageup_action->addTo( navigation );
685 685
686 m_pagedn_action = new QAction( tr( "Down" ), geticon( "down" ), QString::null, 0, this, 0 ); 686 m_pagedn_action = new QAction( tr( "Down" ), geticon( "down" ), QString::null, 0, this, 0 );
687 connect( m_pagedn_action, SIGNAL( activated() ), this, SLOT( pagedn() ) ); 687 connect( m_pagedn_action, SIGNAL( activated() ), this, SLOT( pagedn() ) );
688 m_pagedn_action->addTo( navigation ); 688 m_pagedn_action->addTo( navigation );
689 689
690 m_back_action = new QAction( tr( "Back" ), geticon( "back" ), QString::null, 0, this, 0 ); 690 m_back_action = new QAction( tr( "Back" ), geticon( "back" ), QString::null, 0, this, 0 );
691 connect( m_back_action, SIGNAL( activated() ), reader, SLOT( goBack() ) ); 691 connect( m_back_action, SIGNAL( activated() ), reader, SLOT( goBack() ) );
692 m_back_action->addTo( navigation ); 692 m_back_action->addTo( navigation );
693 693
694 m_home_action = new QAction( tr( "Home" ), geticon( "home" ), QString::null, 0, this, 0 ); 694 m_home_action = new QAction( tr( "Home" ), geticon( "home" ), QString::null, 0, this, 0 );
695 connect( m_home_action, SIGNAL( activated() ), reader, SLOT( goHome() ) ); 695 connect( m_home_action, SIGNAL( activated() ), reader, SLOT( goHome() ) );
696 m_home_action->addTo( navigation ); 696 m_home_action->addTo( navigation );
697 697
698 m_forward_action = new QAction( tr( "Forward" ), geticon( "forward" ), QString::null, 0, this, 0 ); 698 m_forward_action = new QAction( tr( "Forward" ), geticon( "forward" ), QString::null, 0, this, 0 );
699 connect( m_forward_action, SIGNAL( activated() ), reader, SLOT( goForward() ) ); 699 connect( m_forward_action, SIGNAL( activated() ), reader, SLOT( goForward() ) );
700 m_forward_action->addTo( navigation ); 700 m_forward_action->addTo( navigation );
701 701
702 /* 702 /*
703 a = new QAction( tr( "Find" ), QString::null, 0, this, NULL, true ); 703 a = new QAction( tr( "Find" ), QString::null, 0, this, NULL, true );
704 // connect( a, SIGNAL( activated() ), this, SLOT( pagedn() ) ); 704 // connect( a, SIGNAL( activated() ), this, SLOT( pagedn() ) );
705 a->addTo( file ); 705 a->addTo( file );
706 706
707 a = new QAction( tr( "Find Again" ), QString::null, 0, this, NULL, true ); 707 a = new QAction( tr( "Find Again" ), QString::null, 0, this, NULL, true );
708 // connect( a, SIGNAL( activated() ), this, SLOT( pagedn() ) ); 708 // connect( a, SIGNAL( activated() ), this, SLOT( pagedn() ) );
709 a->addTo( file ); 709 a->addTo( file );
710 */ 710 */
711 711
712// file->insertSeparator(); 712// file->insertSeparator();
713 713
714#ifdef _SCROLLPIPE 714#ifdef _SCROLLPIPE
715 715
716 QActionGroup* ag = new QActionGroup(this); 716 QActionGroup* ag = new QActionGroup(this);
717 ag->setExclusive(false); 717 ag->setExclusive(false);
718 spacemenu = new QPopupMenu(this); 718 spacemenu = new QPopupMenu(this);
719 file->insertItem( tr( "Scrolling" ), spacemenu ); 719 file->insertItem( tr( "Scrolling" ), spacemenu );
720 720
721 a = new QAction( tr( "Set Target" ), QString::null, 0, ag, NULL); 721 a = new QAction( tr( "Set Target" ), QString::null, 0, ag, NULL);
722 connect( a, SIGNAL( activated() ), this, SLOT( setpipetarget() ) ); 722 connect( a, SIGNAL( activated() ), this, SLOT( setpipetarget() ) );
723 723
724 a = new QAction( tr( "Pause Paras" ), QString::null, 0, ag, NULL, true ); 724 a = new QAction( tr( "Pause Paras" ), QString::null, 0, ag, NULL, true );
725 connect( a, SIGNAL( toggled(bool) ), this, SLOT( setpause(bool) ) ); 725 connect( a, SIGNAL( toggled(bool) ), this, SLOT( setpause(bool) ) );
726 a->setOn(reader->m_pauseAfterEachPara); 726 a->setOn(reader->m_pauseAfterEachPara);
727 727
728 ag->addTo(spacemenu); 728 ag->addTo(spacemenu);
729// file->insertSeparator(); 729// file->insertSeparator();
730 730
731#endif 731#endif
732 732
733/* 733/*
734 a = new QAction( tr( "Import" ), QString::null, 0, this, NULL ); 734 a = new QAction( tr( "Import" ), QString::null, 0, this, NULL );
735 connect( a, SIGNAL( activated() ), this, SLOT( importFiles() ) ); 735 connect( a, SIGNAL( activated() ), this, SLOT( importFiles() ) );
736 a->addTo( file ); 736 a->addTo( file );
737*/ 737*/
738 738
739 /* 739 /*
740 a = new QAction( tr( "Paste" ), geticon( "paste" ), QString::null, 0, this, 0 ); 740 a = new QAction( tr( "Paste" ), geticon( "paste" ), QString::null, 0, this, 0 );
741 connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) ); 741 connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) );
742 a->addTo( fileBar ); 742 a->addTo( fileBar );
743 a->addTo( edit ); 743 a->addTo( edit );
744 */ 744 */
745 745
746// a = new QAction( tr( "Find..." ), geticon( "find" ), QString::null, 0, this, 0 ); 746// a = new QAction( tr( "Find..." ), geticon( "find" ), QString::null, 0, this, 0 );
747 747
748 m_fullscreen = false; 748 m_fullscreen = false;
749 m_actFullscreen = new QAction( tr( "Fullscreen" ), geticon( "fullscreen" ), QString::null, 0, this, NULL, true ); 749 m_actFullscreen = new QAction( tr( "Fullscreen" ), geticon( "fullscreen" ), QString::null, 0, this, NULL, true );
750 connect( m_actFullscreen, SIGNAL( toggled(bool) ), this, SLOT( setfullscreen(bool) ) ); 750 connect( m_actFullscreen, SIGNAL( toggled(bool) ), this, SLOT( setfullscreen(bool) ) );
751 m_actFullscreen->setOn(m_fullscreen); 751 m_actFullscreen->setOn(m_fullscreen);
752 m_actFullscreen->addTo( view ); 752 m_actFullscreen->addTo( view );
753 753
754 m_rotate_action = new QAction( tr( "Rotate" ), geticon( "repeat" ), QString::null, 0, this, NULL, true ); 754 m_rotate_action = new QAction( tr( "Rotate" ), geticon( "repeat" ), QString::null, 0, this, NULL, true );
755 connect( m_rotate_action, SIGNAL( toggled(bool) ), this, SLOT( setrotated(bool) ) ); 755 connect( m_rotate_action, SIGNAL( toggled(bool) ), this, SLOT( setrotated(bool) ) );
756 m_rotate_action->setOn(reader->m_rotated); 756 m_rotate_action->setOn(reader->m_rotated);
757 m_rotate_action->addTo( view ); 757 m_rotate_action->addTo( view );
758 758
759 m_inverse_action = new QAction( tr( "Invert" ), getmyicon( "invert" ), QString::null, 0, this, NULL, true ); 759 m_inverse_action = new QAction( tr( "Invert" ), getmyicon( "invert" ), QString::null, 0, this, NULL, true );
760 connect( m_inverse_action, SIGNAL( toggled(bool) ), this, SLOT( setinverted(bool) ) ); 760 connect( m_inverse_action, SIGNAL( toggled(bool) ), this, SLOT( setinverted(bool) ) );
761 m_inverse_action->setOn(reader->bInverse); 761 m_inverse_action->setOn(reader->bInverse);
762 m_inverse_action->addTo( view ); 762 m_inverse_action->addTo( view );
763 763
764 view->insertSeparator(); 764 view->insertSeparator();
765 765
766 m_zoomin_action = new QAction( tr( "Zoom In" ), geticon( "zoom" ), QString::null, 0, this); 766 m_zoomin_action = new QAction( tr( "Zoom In" ), geticon( "zoom" ), QString::null, 0, this);
767 connect( m_zoomin_action, SIGNAL( activated() ), this, SLOT( zoomin() ) ); 767 connect( m_zoomin_action, SIGNAL( activated() ), this, SLOT( zoomin() ) );
768 m_zoomin_action->addTo( view ); 768 m_zoomin_action->addTo( view );
769 769
770 m_zoomout_action = new QAction( tr( "Zoom Out" ), geticon( "mag" ), QString::null, 0, this); 770 m_zoomout_action = new QAction( tr( "Zoom Out" ), geticon( "mag" ), QString::null, 0, this);
771 connect( m_zoomout_action, SIGNAL( activated() ), this, SLOT( zoomout() ) ); 771 connect( m_zoomout_action, SIGNAL( activated() ), this, SLOT( zoomout() ) );
772 m_zoomout_action->addTo( view ); 772 m_zoomout_action->addTo( view );
773 773
774 view->insertSeparator(); 774 view->insertSeparator();
775 m_setfont_action = new QAction( tr( "Set Font" ), getmyicon( "font" ), QString::null, 0, this); 775 m_setfont_action = new QAction( tr( "Set Font" ), getmyicon( "font" ), QString::null, 0, this);
776 connect( m_setfont_action, SIGNAL( activated() ), this, SLOT( setfont() ) ); 776 connect( m_setfont_action, SIGNAL( activated() ), this, SLOT( setfont() ) );
777 m_setfont_action->addTo( view ); 777 m_setfont_action->addTo( view );
778 778
779 view->insertSeparator(); 779 view->insertSeparator();
780 m_setenc_action = new QAction( tr( "Set Encoding" ), getmyicon( "charset" ), QString::null, 0, this); 780 m_setenc_action = new QAction( tr( "Set Encoding" ), getmyicon( "charset" ), QString::null, 0, this);
781 connect( m_setenc_action, SIGNAL( activated() ), this, SLOT( chooseencoding() ) ); 781 connect( m_setenc_action, SIGNAL( activated() ), this, SLOT( chooseencoding() ) );
782 m_setenc_action->addTo( view ); 782 m_setenc_action->addTo( view );
783 783
784 m_setmono_action = new QAction( tr( "Ideogram" ), getmyicon( "ideogram" ), QString::null, 0, this, NULL, true); 784 m_setmono_action = new QAction( tr( "Ideogram" ), getmyicon( "ideogram" ), QString::null, 0, this, NULL, true);
785 connect( m_setmono_action, SIGNAL( toggled(bool) ), this, SLOT( monospace(bool) ) ); 785 connect( m_setmono_action, SIGNAL( toggled(bool) ), this, SLOT( monospace(bool) ) );
786 m_setmono_action->addTo( view ); 786 m_setmono_action->addTo( view );
787 m_setmono_action->setOn(reader->m_bMonoSpaced); 787 m_setmono_action->setOn(reader->m_bMonoSpaced);
788 788
789 789
790 // a = new QAction( tr( "Zoom" ), QString::null, 0, this, NULL, true ); 790 // a = new QAction( tr( "Zoom" ), QString::null, 0, this, NULL, true );
791 // a = new QAction( tr( "Zoom" ), geticon( "mag" ), QString::null, 0, this, 0 ); 791 // a = new QAction( tr( "Zoom" ), geticon( "mag" ), QString::null, 0, this, 0 );
792 792
793 793
794 794
795 // a->addTo( filebar() ); 795 // a->addTo( filebar() );
796// view->insertSeparator(); 796// view->insertSeparator();
797 797
798/* 798/*
799 a = new QAction( tr( "Ideogram/Word" ), QString::null, 0, this, NULL, true ); 799 a = new QAction( tr( "Ideogram/Word" ), QString::null, 0, this, NULL, true );
800 connect( a, SIGNAL( toggled(bool) ), this, SLOT( monospace(bool) ) ); 800 connect( a, SIGNAL( toggled(bool) ), this, SLOT( monospace(bool) ) );
801 a->setOn(reader->m_bMonoSpaced); 801 a->setOn(reader->m_bMonoSpaced);
802 a->addTo( view ); 802 a->addTo( view );
803*/ 803*/
804/* 804/*
805 a = new QAction( tr( "Set Width" ), QString::null, 0, this, NULL); 805 a = new QAction( tr( "Set Width" ), QString::null, 0, this, NULL);
806 connect( a, SIGNAL( activated() ), this, SLOT( setspacing() ) ); 806 connect( a, SIGNAL( activated() ), this, SLOT( setspacing() ) );
807 a->addTo( view ); 807 a->addTo( view );
808*/ 808*/
809 809
810 m_mark_action = new QAction( tr( "Bookmark" ), getmyicon( "bookmark" ), QString::null, 0, this, NULL); 810 m_mark_action = new QAction( tr( "Bookmark" ), getmyicon( "bookmark" ), QString::null, 0, this, NULL);
811 connect( m_mark_action, SIGNAL( activated() ), this, SLOT( addbkmk() ) ); 811 connect( m_mark_action, SIGNAL( activated() ), this, SLOT( addbkmk() ) );
812 m_mark_action->addTo( marks ); 812 m_mark_action->addTo( marks );
813 813
814 m_annotate_action = new QAction( tr( "Annotate" ), getmyicon( "annotate" ), QString::null, 0, this, NULL); 814 m_annotate_action = new QAction( tr( "Annotate" ), getmyicon( "annotate" ), QString::null, 0, this, NULL);
815 connect( m_annotate_action, SIGNAL( activated() ), this, SLOT( addanno() ) ); 815 connect( m_annotate_action, SIGNAL( activated() ), this, SLOT( addanno() ) );
816 m_annotate_action->addTo( marks ); 816 m_annotate_action->addTo( marks );
817 817
818 m_goto_action = new QAction( tr( "Goto" ), getmyicon( "bookmark_goto" ), QString::null, 0, this, NULL, false ); 818 m_goto_action = new QAction( tr( "Goto" ), getmyicon( "bookmark_goto" ), QString::null, 0, this, NULL, false );
819 connect( m_goto_action, SIGNAL( activated() ), this, SLOT( do_gotomark() ) ); 819 connect( m_goto_action, SIGNAL( activated() ), this, SLOT( do_gotomark() ) );
820 m_goto_action->addTo( marks ); 820 m_goto_action->addTo( marks );
821 821
822 m_delete_action = new QAction( tr( "Delete" ), getmyicon( "bookmark_delete" ), QString::null, 0, this, NULL); 822 m_delete_action = new QAction( tr( "Delete" ), getmyicon( "bookmark_delete" ), QString::null, 0, this, NULL);
823 connect( m_delete_action, SIGNAL( activated() ), this, SLOT( do_delmark() ) ); 823 connect( m_delete_action, SIGNAL( activated() ), this, SLOT( do_delmark() ) );
824 m_delete_action->addTo( marks ); 824 m_delete_action->addTo( marks );
825 825
826 m_autogen_action = new QAction( tr( "Autogen" ), geticon( "exec" ), QString::null, 0, this, NULL, false ); 826 m_autogen_action = new QAction( tr( "Autogen" ), geticon( "exec" ), QString::null, 0, this, NULL, false );
827 connect( m_autogen_action, SIGNAL( activated() ), this, SLOT( do_autogen() ) ); 827 connect( m_autogen_action, SIGNAL( activated() ), this, SLOT( do_autogen() ) );
828 marks->insertSeparator(); 828 marks->insertSeparator();
829 m_autogen_action->addTo( marks ); 829 m_autogen_action->addTo( marks );
830 830
831 m_clear_action = new QAction( tr( "Clear" ), getmyicon( "bookmark_clear" ), QString::null, 0, this, NULL); 831 m_clear_action = new QAction( tr( "Clear" ), getmyicon( "bookmark_clear" ), QString::null, 0, this, NULL);
832 connect( m_clear_action, SIGNAL( activated() ), this, SLOT( clearBkmkList() ) ); 832 connect( m_clear_action, SIGNAL( activated() ), this, SLOT( clearBkmkList() ) );
833 m_clear_action->addTo( marks ); 833 m_clear_action->addTo( marks );
834 834
835 m_save_action = new QAction( tr( "Save" ), getmyicon( "bookmark_save" ), QString::null, 0, this, NULL ); 835 m_save_action = new QAction( tr( "Save" ), getmyicon( "bookmark_save" ), QString::null, 0, this, NULL );
836 connect( m_save_action, SIGNAL( activated() ), this, SLOT( savebkmks() ) ); 836 connect( m_save_action, SIGNAL( activated() ), this, SLOT( savebkmks() ) );
837 m_save_action->addTo( marks ); 837 m_save_action->addTo( marks );
838 838
839 m_tidy_action = new QAction( tr( "Tidy" ), getmyicon( "bookmark_tidy" ), QString::null, 0, this, NULL); 839 m_tidy_action = new QAction( tr( "Tidy" ), getmyicon( "bookmark_tidy" ), QString::null, 0, this, NULL);
840 connect( m_tidy_action, SIGNAL( activated() ), this, SLOT( listBkmkFiles() ) ); 840 connect( m_tidy_action, SIGNAL( activated() ), this, SLOT( listBkmkFiles() ) );
841 marks->insertSeparator(); 841 marks->insertSeparator();
842 m_tidy_action->addTo( marks ); 842 m_tidy_action->addTo( marks );
843 843
844 m_startBlock_action = new QAction( tr( "Start Block" ), geticon( "new" ), QString::null, 0, this, NULL); 844 m_startBlock_action = new QAction( tr( "Start Block" ), geticon( "new" ), QString::null, 0, this, NULL);
845 connect( m_startBlock_action, SIGNAL( activated() ), this, SLOT( editMark() ) ); 845 connect( m_startBlock_action, SIGNAL( activated() ), this, SLOT( editMark() ) );
846 marks->insertSeparator(); 846 marks->insertSeparator();
847 m_startBlock_action->addTo( marks ); 847 m_startBlock_action->addTo( marks );
848 848
849 m_endBlock_action = new QAction( tr( "Copy Block" ), geticon( "copy" ), QString::null, 0, this, NULL); 849 m_endBlock_action = new QAction( tr( "Copy Block" ), geticon( "copy" ), QString::null, 0, this, NULL);
850 connect( m_endBlock_action, SIGNAL( activated() ), this, SLOT( editCopy() ) ); 850 connect( m_endBlock_action, SIGNAL( activated() ), this, SLOT( editCopy() ) );
851 m_endBlock_action->addTo( marks ); 851 m_endBlock_action->addTo( marks );
852 852
853 m_bkmkAvail = NULL; 853 m_bkmkAvail = NULL;
854 854
855 855
856 setToolBarsMovable(m_tbmove); 856 setToolBarsMovable(m_tbmove);
857 addtoolbars(&config); 857 addtoolbars(&config);
858 if (m_hidebars) 858 if (m_hidebars)
859 { 859 {
860#if defined(USEQPE) 860#if defined(USEQPE)
861 menubar->hide(); 861 menubar->hide();
862#endif 862#endif
863 if (fileBar != NULL) fileBar->hide(); 863 if (fileBar != NULL) fileBar->hide();
864 if (viewBar != NULL) viewBar->hide(); 864 if (viewBar != NULL) viewBar->hide();
865 if (navBar != NULL) navBar->hide(); 865 if (navBar != NULL) navBar->hide();
866 if (markBar != NULL) markBar->hide(); 866 if (markBar != NULL) markBar->hide();
867 mb->hide(); 867 mb->hide();
868 } 868 }
869 869
870 870
871 pbar = new QProgressBar(this); 871 pbar = new QProgressBar(this);
872 pbar->hide(); 872 pbar->hide();
873 873
874 searchBar = new QFloatBar( "Search", this, QMainWindow::Top, TRUE ); 874 searchBar = new QFloatBar( "Search", this, QMainWindow::Top, TRUE );
875 875
876 searchBar->setHorizontalStretchable( TRUE ); 876 searchBar->setHorizontalStretchable( TRUE );
877 877
878 connect(searchBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() )); 878 connect(searchBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() ));
879 879
880 searchEdit = new QLineEdit( searchBar, "searchEdit" ); 880 searchEdit = new QLineEdit( searchBar, "searchEdit" );
881// QFont f("unifont", 16 /*, QFont::Bold*/); 881// QFont f("unifont", 16 /*, QFont::Bold*/);
882// searchEdit->setFont( f ); 882// searchEdit->setFont( f );
883 searchBar->setStretchableWidget( searchEdit ); 883 searchBar->setStretchableWidget( searchEdit );
884 884
885 885
886#ifdef __ISEARCH 886#ifdef __ISEARCH
887 connect( searchEdit, SIGNAL( textChanged( const QString & ) ), 887 connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
888 this, SLOT( search( const QString& ) ) ); 888 this, SLOT( search( const QString& ) ) );
889#else 889#else
890 connect( searchEdit, SIGNAL( returnPressed( ) ), 890 connect( searchEdit, SIGNAL( returnPressed( ) ),
891 this, SLOT( search( ) ) ); 891 this, SLOT( search( ) ) );
892#endif 892#endif
893 QAction*a = new QAction( tr( "Find Next" ), geticon( "next" ), QString::null, 0, this, 0 ); 893 QAction*a = new QAction( tr( "Find Next" ), geticon( "next" ), QString::null, 0, this, 0 );
894 connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) ); 894 connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) );
895 a->addTo( searchBar ); 895 a->addTo( searchBar );
896 896
897 a = new QAction( tr( "Close Find" ), geticon( "close" ), QString::null, 0, this, 0 ); 897 a = new QAction( tr( "Close Find" ), geticon( "close" ), QString::null, 0, this, 0 );
898 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); 898 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
899 a->addTo( searchBar ); 899 a->addTo( searchBar );
900 900
901 searchBar->hide(); 901 searchBar->hide();
902 902
903 regBar = new QFloatBar( "Autogen", this, QMainWindow::Top, TRUE ); 903 regBar = new QFloatBar( "Autogen", this, QMainWindow::Top, TRUE );
904 connect(regBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() )); 904 connect(regBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() ));
905 905
906 regBar->setHorizontalStretchable( TRUE ); 906 regBar->setHorizontalStretchable( TRUE );
907 907
908 regEdit = new QLineEdit( regBar, "regEdit" ); 908 regEdit = new QLineEdit( regBar, "regEdit" );
909// regEdit->setFont( f ); 909// regEdit->setFont( f );
910 910
911 regBar->setStretchableWidget( regEdit ); 911 regBar->setStretchableWidget( regEdit );
912 912
913 connect( regEdit, SIGNAL( returnPressed( ) ), 913 connect( regEdit, SIGNAL( returnPressed( ) ),
914 this, SLOT( do_regaction() ) ); 914 this, SLOT( do_regaction() ) );
915 915
916 a = new QAction( tr( "Do Reg" ), geticon( "enter" ), QString::null, 0, this, 0 ); 916 a = new QAction( tr( "Do Reg" ), geticon( "enter" ), QString::null, 0, this, 0 );
917 connect( a, SIGNAL( activated() ), this, SLOT( do_regaction() ) ); 917 connect( a, SIGNAL( activated() ), this, SLOT( do_regaction() ) );
918 a->addTo( regBar ); 918 a->addTo( regBar );
919 919
920 a = new QAction( tr( "Close Edit" ), geticon( "close" ), QString::null, 0, this, 0 ); 920 a = new QAction( tr( "Close Edit" ), geticon( "close" ), QString::null, 0, this, 0 );
921 connect( a, SIGNAL( activated() ), this, SLOT( regClose() ) ); 921 connect( a, SIGNAL( activated() ), this, SLOT( regClose() ) );
922 a->addTo( regBar ); 922 a->addTo( regBar );
923 923
924 regBar->hide(); 924 regBar->hide();
925 925
926 m_fontBar = new QToolBar( "Autogen", this, QMainWindow::Top, TRUE ); 926 m_fontBar = new QToolBar( "Autogen", this, QMainWindow::Top, TRUE );
927 927
928 m_fontBar->setHorizontalStretchable( TRUE ); 928 m_fontBar->setHorizontalStretchable( TRUE );
929 929
930// qDebug("Font selector"); 930// qDebug("Font selector");
931 m_fontSelector = new QComboBox(false, m_fontBar); 931 m_fontSelector = new QComboBox(false, m_fontBar);
932 m_fontBar->setStretchableWidget( m_fontSelector ); 932 m_fontBar->setStretchableWidget( m_fontSelector );
933 { 933 {
934 QFontDatabase f; 934 QFontDatabase f;
935 QStringList flist = f.families(); 935 QStringList flist = f.families();
936 bool realfont = false; 936 bool realfont = false;
937 for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++) 937 for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++)
938 { 938 {
939 if (reader->m_fontname == *nm) 939 if (reader->m_fontname == *nm)
940 { 940 {
941 realfont = true; 941 realfont = true;
942 } 942 }
943 if ((*nm).contains(FIXEDFONT,false)) reader->m_fontControl.hasCourier(true, *nm); 943 if ((*nm).contains(FIXEDFONT,false)) reader->m_fontControl.hasCourier(true, *nm);
944 } 944 }
945 if (!realfont) reader->m_fontname = flist[0]; 945 if (!realfont) reader->m_fontname = flist[0];
946 } // delete the FontDatabase!!! 946 } // delete the FontDatabase!!!
947 connect( m_fontSelector, SIGNAL( activated(const QString& ) ), 947 connect( m_fontSelector, SIGNAL( activated(const QString& ) ),
948 this, SLOT( do_setfont(const QString&) ) ); 948 this, SLOT( do_setfont(const QString&) ) );
949 connect( m_fontSelector, SIGNAL( activated(int ) ), 949 connect( m_fontSelector, SIGNAL( activated(int ) ),
950 this, SLOT( do_setencoding(int) ) ); 950 this, SLOT( do_setencoding(int) ) );
951 951
952 m_fontBar->hide(); 952 m_fontBar->hide();
953 m_fontVisible = false; 953 m_fontVisible = false;
954#ifdef USEMSGS 954#ifdef USEMSGS
955 connect(qApp, SIGNAL( appMessage(const QCString&, const QByteArray& ) ), 955 connect(qApp, SIGNAL( appMessage(const QCString&, const QByteArray& ) ),
956 this, SLOT( msgHandler(const QCString&, const QByteArray&) ) ); 956 this, SLOT( msgHandler(const QCString&, const QByteArray&) ) );
957#endif 957#endif
958// qDebug("Initing"); 958// qDebug("Initing");
959 959
960 m_layout->addWidget(editorStack); 960 m_layout->addWidget(editorStack);
961 if (m_qtscroll != 0) 961 if (m_qtscroll != 0)
962 { 962 {
963 /* 963 /*
964 m_scrollbar = new QToolBar( "Autogen", this, (m_localscrollbar) ? QMainWindow::Left : QMainWindow::Right, TRUE ); 964 m_scrollbar = new QToolBar( "Autogen", this, (m_localscrollbar) ? QMainWindow::Left : QMainWindow::Right, TRUE );
965 965
966 m_scrollbar->setVerticalStretchable( TRUE ); 966 m_scrollbar->setVerticalStretchable( TRUE );
967 */ 967 */
968 scrollbar = m_scrollbar = new QScrollBar(QScrollBar::Vertical, widge); 968 scrollbar = m_scrollbar = new QScrollBar(QScrollBar::Vertical, widge);
969 m_layout->addWidget(scrollbar); 969 m_layout->addWidget(scrollbar);
970 scrollbar->setTracking(false); 970 scrollbar->setTracking(false);
971 //connect(scrollbar, SIGNAL(sliderMoved(int)), this, SLOT(actionscroll(int)) ); 971 //connect(scrollbar, SIGNAL(sliderMoved(int)), this, SLOT(actionscroll(int)) );
972 //m_scrollbar->setStretchableWidget( scrollbar ); 972 //m_scrollbar->setStretchableWidget( scrollbar );
973 if (m_scrollishidden) 973 if (m_scrollishidden)
974 { 974 {
975 m_scrollbar->hide(); 975 m_scrollbar->hide();
976 } 976 }
977 else 977 else
978 { 978 {
979 m_scrollbar->show(); 979 m_scrollbar->show();
980 } 980 }
981 981
982 setrotated(reader->m_rotated); 982 setrotated(reader->m_rotated);
983 } 983 }
984 else 984 else
985 { 985 {
986 m_scrollbar = NULL; 986 m_scrollbar = NULL;
987 } 987 }
988 setBackgroundBitmap(); 988 setBackgroundBitmap();
989 m_inverse_action->setOn(reader->bInverse); 989 m_inverse_action->setOn(reader->bInverse);
990 reader->init(); 990 reader->init();
991 991
992// qDebug("Inited"); 992// qDebug("Inited");
993// m_buttonAction[m_spaceTarget]->setOn(true); 993// m_buttonAction[m_spaceTarget]->setOn(true);
994// qDebug("fonting"); 994// qDebug("fonting");
995 do_setfont(reader->m_fontname); 995 do_setfont(reader->m_fontname);
996 // qDebug("fonted"); 996 // qDebug("fonted");
997 QFont progfont(reader->m_fontname, reader->m_fontControl.getsize(0)); 997 QFont progfont(reader->m_fontname, reader->m_fontControl.getsize(0));
998 m_prog->setFont( progfont ); 998 m_prog->setFont( progfont );
999 if (m_statusishidden) m_prog->hide(); 999 if (m_statusishidden) m_prog->hide();
1000 showEditTools(); 1000 showEditTools();
1001 if (!reader->m_lastfile.isEmpty()) 1001 if (!reader->m_lastfile.isEmpty())
1002 { 1002 {
1003 //qDebug("doclnk"); 1003 //qDebug("doclnk");
1004 //doc = new DocLnk(reader->m_lastfile); 1004 //doc = new DocLnk(reader->m_lastfile);
1005 //qDebug("doclnk done"); 1005 //qDebug("doclnk done");
1006 if (pOpenlist != NULL) 1006 if (pOpenlist != NULL)
1007 { 1007 {
1008 1008
1009/* 1009/*
1010 int ind = 0; 1010 int ind = 0;
1011 Bkmk* p = (*pOpenlist)[ind]; 1011 Bkmk* p = (*pOpenlist)[ind];
1012 while (p != NULL && toQString(CFiledata(p->anno()).name()) != reader->m_lastfile) 1012 while (p != NULL && toQString(CFiledata(p->anno()).name()) != reader->m_lastfile)
1013 { 1013 {
1014 p = (*pOpenlist)[++ind]; 1014 p = (*pOpenlist)[++ind];
1015 } 1015 }
1016*/ 1016*/
1017 Bkmk* p = NULL; 1017 Bkmk* p = NULL;
1018 for (CList<Bkmk>::iterator iter = pOpenlist->begin(); iter != pOpenlist->end(); iter++) 1018 for (CList<Bkmk>::iterator iter = pOpenlist->begin(); iter != pOpenlist->end(); iter++)
1019 { 1019 {
1020 p = iter.pContent(); 1020 p = iter.pContent();
1021 if (toQString(CFiledata(p->anno()).name()) == reader->m_lastfile) 1021 if (toQString(CFiledata(p->anno()).name()) == reader->m_lastfile)
1022 { 1022 {
1023 break; 1023 break;
1024 } 1024 }
1025 // qDebug("Item:%s", (const char*)toQString(CFiledata(p->anno()).name())); 1025 // qDebug("Item:%s", (const char*)toQString(CFiledata(p->anno()).name()));
1026 p = NULL; 1026 p = NULL;
1027 } 1027 }
1028 if (p != NULL) 1028 if (p != NULL)
1029 { 1029 {
1030 if (!openfrombkmk(p)) 1030 if (!openfrombkmk(p))
1031 { 1031 {
1032 showEditTools(); 1032 showEditTools();
1033 } 1033 }
1034 } 1034 }
1035 else 1035 else
1036 { 1036 {
1037 openFile( reader->m_lastfile ); 1037 openFile( reader->m_lastfile );
1038 } 1038 }
1039 } 1039 }
1040 else 1040 else
1041 { 1041 {
1042 if (!reader->m_lastfile.isEmpty()) 1042 if (!reader->m_lastfile.isEmpty())
1043 { 1043 {
1044 openFile( reader->m_lastfile ); 1044 openFile( reader->m_lastfile );
1045 } 1045 }
1046 } 1046 }
1047 } 1047 }
1048 else 1048 else
1049 { 1049 {
1050 showEditTools(); 1050 showEditTools();
1051 } 1051 }
1052// qApp->processEvents(); 1052// qApp->processEvents();
1053 if (m_scrollbar == NULL || m_scrollbar->isHidden()) 1053 if (m_scrollbar == NULL || m_scrollbar->isHidden())
1054 { 1054 {
1055 reader->m_scrollpos = m_localscroll; 1055 reader->m_scrollpos = m_localscroll;
1056 } 1056 }
1057 else 1057 else
1058 { 1058 {
1059 reader->m_scrollpos = (m_qtscroll == 0) ? m_localscroll : 0; 1059 reader->m_scrollpos = (m_qtscroll == 0) ? m_localscroll : 0;
1060 } 1060 }
1061 // reader->bDoUpdates = true; 1061 // reader->bDoUpdates = true;
1062 // reader->update(); 1062 // reader->update();
1063 config.setGroup("Version"); 1063 config.setGroup("Version");
1064 int major = config.readNumEntry("Major", 0); 1064 int major = config.readNumEntry("Major", 0);
1065 int bkmktype = config.readNumEntry("BkmkType", 0); 1065 int bkmktype = config.readNumEntry("BkmkType", 0);
1066 char minor = config.readNumEntry("Minor", 0); 1066 char minor = config.readNumEntry("Minor", 0);
1067 if (CheckVersion(major, bkmktype, minor, this)) 1067 if (CheckVersion(major, bkmktype, minor, this))
1068 { 1068 {
1069 config.writeEntry("Major", major); 1069 config.writeEntry("Major", major);
1070 config.writeEntry("BkmkType", bkmktype); 1070 config.writeEntry("BkmkType", bkmktype);
1071 config.writeEntry("Minor", (int)minor); 1071 config.writeEntry("Minor", (int)minor);
1072 } 1072 }
1073// qDebug("finished update"); 1073// qDebug("finished update");
1074 if (kmap.isEmpty()) 1074 if (kmap.isEmpty())
1075 { 1075 {
1076 QMessageBox::warning(this, PROGNAME, "You haven't mapped any keys yet!\n\nYou will be taken to the key\nmapping dialog.\nA few defaults are provided\nbut you can change then to\nsuit yourself.\n\nYou can change the key\nmapping at any time by\nselecting the Settings/Button\noption on the menu."); 1076 QMessageBox::warning(this, PROGNAME, "You haven't mapped any keys yet!\n\nYou will be taken to the key\nmapping dialog.\nA few defaults are provided\nbut you can change then to\nsuit yourself.\n\nYou can change the key\nmapping at any time by\nselecting the Settings/Button\noption on the menu.");
1077 1077
1078 m_buttonprefs->mapkey(Qt::NoButton, Key_Up, cesPageUp); 1078 m_buttonprefs->mapkey(Qt::NoButton, Key_Up, cesPageUp);
1079 m_buttonprefs->mapkey(Qt::NoButton, Key_Down, cesPageDown); 1079 m_buttonprefs->mapkey(Qt::NoButton, Key_Down, cesPageDown);
1080 1080
1081 m_buttonprefs->mapkey(Qt::NoButton, Key_Right, cesZoomIn); 1081 m_buttonprefs->mapkey(Qt::NoButton, Key_Right, cesZoomIn);
1082 m_buttonprefs->mapkey(Qt::NoButton, Key_Left, cesZoomOut); 1082 m_buttonprefs->mapkey(Qt::NoButton, Key_Left, cesZoomOut);
1083 1083
1084 showbuttonprefs(); 1084 showbuttonprefs();
1085 } 1085 }
1086} 1086}
1087 1087
1088void QTReaderApp::addtoolbars(Config* config) 1088void QTReaderApp::addtoolbars(Config* config)
1089{ 1089{
1090 config->setGroup("Toolbar"); 1090 config->setGroup("Toolbar");
1091 1091
1092 if (fileBar != NULL) 1092 if (fileBar != NULL)
1093 { 1093 {
1094#if defined(USEQPE) 1094#if defined(USEQPE)
1095 if (fileBar != menubar) 1095 if (fileBar != menubar)
1096 { 1096 {
1097 fileBar->clear(); 1097 fileBar->clear();
1098 } 1098 }
1099 else 1099 else
1100 { 1100 {
1101 m_preferences_action->removeFrom( filebar() ); 1101 m_preferences_action->removeFrom( filebar() );
1102 m_open_action->removeFrom( filebar() ); 1102 m_open_action->removeFrom( filebar() );
1103 m_close_action->removeFrom( filebar() ); 1103 m_close_action->removeFrom( filebar() );
1104 m_info_action->removeFrom( filebar() ); 1104 m_info_action->removeFrom( filebar() );
1105 m_touch_action->removeFrom( filebar() ); 1105 m_touch_action->removeFrom( filebar() );
1106 m_find_action->removeFrom( filebar() ); 1106 m_find_action->removeFrom( filebar() );
1107 } 1107 }
1108#else 1108#else
1109 fileBar->clear(); 1109 fileBar->clear();
1110#endif 1110#endif
1111 } 1111 }
1112 1112
1113 m_preferences_action->addTo( filebar() ); 1113 m_preferences_action->addTo( filebar() );
1114 addfilebar(config, "Open", m_open_action); 1114 addfilebar(config, "Open", m_open_action);
1115 addfilebar(config, "Close", m_close_action); 1115 addfilebar(config, "Close", m_close_action);
1116 addfilebar(config, "Info", m_info_action); 1116 addfilebar(config, "Info", m_info_action);
1117 addfilebar(config, "Two/One Touch", m_touch_action); 1117 addfilebar(config, "Two/One Touch", m_touch_action);
1118 addfilebar(config, "Find", m_find_action); 1118 addfilebar(config, "Find", m_find_action);
1119 1119
1120 if (navBar != NULL) 1120 if (navBar != NULL)
1121 { 1121 {
1122#if defined(USEQPE) 1122#if defined(USEQPE)
1123 if ((navBar == fileBar) && (fileBar == menubar)) 1123 if ((navBar == fileBar) && (fileBar == menubar))
1124#else 1124#else
1125 if (navBar == fileBar) 1125 if (navBar == fileBar)
1126#endif 1126#endif
1127 { 1127 {
1128 m_scrollButton->removeFrom( navbar() ); 1128 m_scrollButton->removeFrom( navbar() );
1129 m_start_action->removeFrom( navbar() ); 1129 m_start_action->removeFrom( navbar() );
1130 m_end_action->removeFrom( navbar() ); 1130 m_end_action->removeFrom( navbar() );
1131 m_jump_action->removeFrom( navbar() ); 1131 m_jump_action->removeFrom( navbar() );
1132 m_pageline_action->removeFrom( navbar() ); 1132 m_pageline_action->removeFrom( navbar() );
1133 m_pageup_action->removeFrom( navbar() ); 1133 m_pageup_action->removeFrom( navbar() );
1134 m_pagedn_action->removeFrom( navbar() ); 1134 m_pagedn_action->removeFrom( navbar() );
1135 m_back_action->removeFrom( navbar() ); 1135 m_back_action->removeFrom( navbar() );
1136 m_home_action->removeFrom( navbar() ); 1136 m_home_action->removeFrom( navbar() );
1137 m_forward_action->removeFrom( navbar() ); 1137 m_forward_action->removeFrom( navbar() );
1138 } 1138 }
1139 else if (navBar != fileBar) 1139 else if (navBar != fileBar)
1140 { 1140 {
1141 navBar->clear(); 1141 navBar->clear();
1142 } 1142 }
1143 } 1143 }
1144 1144
1145 addnavbar(config, "Scroll", m_scrollButton); 1145 addnavbar(config, "Scroll", m_scrollButton);
1146 addnavbar(config, "Goto Start", m_start_action); 1146 addnavbar(config, "Goto Start", m_start_action);
1147 addnavbar(config, "Goto End", m_end_action); 1147 addnavbar(config, "Goto End", m_end_action);
1148 1148
1149 addnavbar(config, "Jump", m_jump_action); 1149 addnavbar(config, "Jump", m_jump_action);
1150 addnavbar(config, "Page/Line Scroll", m_pageline_action); 1150 addnavbar(config, "Page/Line Scroll", m_pageline_action);
1151 1151
1152 addnavbar(config, "Page Up", m_pageup_action); 1152 addnavbar(config, "Page Up", m_pageup_action);
1153 addnavbar(config, "Page Down", m_pagedn_action); 1153 addnavbar(config, "Page Down", m_pagedn_action);
1154 1154
1155 addnavbar(config, "Back", m_back_action); 1155 addnavbar(config, "Back", m_back_action);
1156 addnavbar(config, "Home", m_home_action); 1156 addnavbar(config, "Home", m_home_action);
1157 addnavbar(config, "Forward", m_forward_action); 1157 addnavbar(config, "Forward", m_forward_action);
1158 1158
1159 if (viewBar != NULL) 1159 if (viewBar != NULL)
1160 { 1160 {
1161#if defined(USEQPE) 1161#if defined(USEQPE)
1162 if ((viewBar == fileBar) && (fileBar == menubar)) 1162 if ((viewBar == fileBar) && (fileBar == menubar))
1163#else 1163#else
1164 if (viewBar == fileBar) 1164 if (viewBar == fileBar)
1165#endif 1165#endif
1166 { 1166 {
1167 m_actFullscreen->removeFrom( filebar() ); 1167 m_actFullscreen->removeFrom( filebar() );
1168 m_rotate_action->removeFrom( viewbar() ); 1168 m_rotate_action->removeFrom( viewbar() );
1169 m_inverse_action->removeFrom( viewbar() ); 1169 m_inverse_action->removeFrom( viewbar() );
1170 m_zoomin_action->removeFrom( viewbar() ); 1170 m_zoomin_action->removeFrom( viewbar() );
1171 m_zoomout_action->removeFrom( viewbar() ); 1171 m_zoomout_action->removeFrom( viewbar() );
1172 m_setfont_action->removeFrom( viewbar() ); 1172 m_setfont_action->removeFrom( viewbar() );
1173 m_setenc_action->removeFrom( viewbar() ); 1173 m_setenc_action->removeFrom( viewbar() );
1174 m_setmono_action->removeFrom( viewbar() ); 1174 m_setmono_action->removeFrom( viewbar() );
1175 } 1175 }
1176 else if (viewBar != fileBar) 1176 else if (viewBar != fileBar)
1177 { 1177 {
1178 viewBar->clear(); 1178 viewBar->clear();
1179 } 1179 }
1180 } 1180 }
1181 1181
1182 addviewbar(config, "Fullscreen", m_actFullscreen); 1182 addviewbar(config, "Fullscreen", m_actFullscreen);
1183 addviewbar(config, "Rotate", m_rotate_action); 1183 addviewbar(config, "Rotate", m_rotate_action);
1184 addviewbar(config, "Invert Action", m_inverse_action); 1184 addviewbar(config, "Invert Action", m_inverse_action);
1185 addviewbar(config, "Zoom In", m_zoomin_action); 1185 addviewbar(config, "Zoom In", m_zoomin_action);
1186 addviewbar(config, "Zoom Out", m_zoomout_action); 1186 addviewbar(config, "Zoom Out", m_zoomout_action);
1187 addviewbar(config, "Set Font", m_setfont_action); 1187 addviewbar(config, "Set Font", m_setfont_action);
1188 addviewbar(config, "Encoding Select", m_setenc_action); 1188 addviewbar(config, "Encoding Select", m_setenc_action);
1189 addviewbar(config, "Ideogram Mode", m_setmono_action); 1189 addviewbar(config, "Ideogram Mode", m_setmono_action);
1190 1190
1191 if (markBar != NULL) 1191 if (markBar != NULL)
1192 { 1192 {
1193#if defined(USEQPE) 1193#if defined(USEQPE)
1194 if ((markBar == fileBar) && (fileBar == menubar)) 1194 if ((markBar == fileBar) && (fileBar == menubar))
1195#else 1195#else
1196 if (markBar == fileBar) 1196 if (markBar == fileBar)
1197#endif 1197#endif
1198 { 1198 {
1199 m_mark_action->removeFrom( markbar() ); 1199 m_mark_action->removeFrom( markbar() );
1200 m_annotate_action->removeFrom( markbar()); 1200 m_annotate_action->removeFrom( markbar());
1201 m_goto_action->removeFrom( markbar() ); 1201 m_goto_action->removeFrom( markbar() );
1202 m_delete_action->removeFrom( markbar() ); 1202 m_delete_action->removeFrom( markbar() );
1203 m_autogen_action->removeFrom( markbar() ); 1203 m_autogen_action->removeFrom( markbar() );
1204 m_clear_action->removeFrom( markbar() ); 1204 m_clear_action->removeFrom( markbar() );
1205 m_save_action->removeFrom( markbar() ); 1205 m_save_action->removeFrom( markbar() );
1206 m_tidy_action->removeFrom( markbar() ); 1206 m_tidy_action->removeFrom( markbar() );
1207 m_startBlock_action->removeFrom( markbar() ); 1207 m_startBlock_action->removeFrom( markbar() );
1208 m_endBlock_action->removeFrom( markbar() ); 1208 m_endBlock_action->removeFrom( markbar() );
1209 } 1209 }
1210 else if (markBar != fileBar) 1210 else if (markBar != fileBar)
1211 { 1211 {
1212 markBar->clear(); 1212 markBar->clear();
1213 } 1213 }
1214 } 1214 }
1215 addmarkbar(config, "Mark", m_mark_action); 1215 addmarkbar(config, "Mark", m_mark_action);
1216 addmarkbar(config, "Annotate", m_annotate_action); 1216 addmarkbar(config, "Annotate", m_annotate_action);
1217 addmarkbar(config, "Goto", m_goto_action); 1217 addmarkbar(config, "Goto", m_goto_action);
1218 addmarkbar(config, "Delete", m_delete_action); 1218 addmarkbar(config, "Delete", m_delete_action);
1219 addmarkbar(config, "Autogen", m_autogen_action); 1219 addmarkbar(config, "Autogen", m_autogen_action);
1220 addmarkbar(config, "Clear", m_clear_action); 1220 addmarkbar(config, "Clear", m_clear_action);
1221 addmarkbar(config, "Save", m_save_action); 1221 addmarkbar(config, "Save", m_save_action);
1222 addmarkbar(config, "Tidy", m_tidy_action); 1222 addmarkbar(config, "Tidy", m_tidy_action);
1223 addmarkbar(config, "Start Block", m_startBlock_action); 1223 addmarkbar(config, "Start Block", m_startBlock_action);
1224 addmarkbar(config, "Copy Block", m_endBlock_action); 1224 addmarkbar(config, "Copy Block", m_endBlock_action);
1225 if (checkbar(config, "Annotation indicator")) 1225 if (checkbar(config, "Annotation indicator"))
1226 { 1226 {
1227 if (m_bkmkAvail == NULL) 1227 if (m_bkmkAvail == NULL)
1228 { 1228 {
1229 m_bkmkAvail = new QAction( tr( "Annotation" ), geticon( "find" ), QString::null, 0, this, 0 ); 1229 m_bkmkAvail = new QAction( tr( "Annotation" ), geticon( "find" ), QString::null, 0, this, 0 );
1230 connect( m_bkmkAvail, SIGNAL( activated() ), this, SLOT( showAnnotation() ) ); 1230 connect( m_bkmkAvail, SIGNAL( activated() ), this, SLOT( showAnnotation() ) );
1231 1231
1232 m_bkmkAvail->setEnabled(false); 1232 m_bkmkAvail->setEnabled(false);
1233 } 1233 }
1234 QLabel *spacer = new QLabel(markBar, ""); 1234 QLabel *spacer = new QLabel(markBar, "");
1235 markbar()->setStretchableWidget(spacer); 1235 markbar()->setStretchableWidget(spacer);
1236 m_bkmkAvail->removeFrom( markbar() ); 1236 m_bkmkAvail->removeFrom( markbar() );
1237 m_bkmkAvail->addTo( markbar() ); 1237 m_bkmkAvail->addTo( markbar() );
1238 } 1238 }
1239 else 1239 else
1240 { 1240 {
1241 if (m_bkmkAvail != NULL) 1241 if (m_bkmkAvail != NULL)
1242 { 1242 {
1243 m_bkmkAvail->removeFrom( markbar() ); 1243 m_bkmkAvail->removeFrom( markbar() );
1244 delete m_bkmkAvail; 1244 delete m_bkmkAvail;
1245 m_bkmkAvail = NULL; 1245 m_bkmkAvail = NULL;
1246 } 1246 }
1247 } 1247 }
1248} 1248}
1249 1249
1250bool QTReaderApp::checkbar(Config* _config, const QString& key) 1250bool QTReaderApp::checkbar(Config* _config, const QString& key)
1251{ 1251{
1252 return _config->readBoolEntry(key, false); 1252 return _config->readBoolEntry(key, false);
1253} 1253}
1254 1254
1255 1255
1256QToolBar* QTReaderApp::filebar() 1256QToolBar* QTReaderApp::filebar()
1257{ 1257{
1258 if (fileBar == NULL) 1258 if (fileBar == NULL)
1259 { 1259 {
1260 switch (m_tbpol) 1260 switch (m_tbpol)
1261 { 1261 {
1262#if defined(USEQPE) 1262#if defined(USEQPE)
1263 case cesSingle: 1263 case cesSingle:
1264 // qDebug("Setting filebar to menubar"); 1264 // qDebug("Setting filebar to menubar");
1265 fileBar = menubar; 1265 fileBar = menubar;
1266 break; 1266 break;
1267#endif 1267#endif
1268 default: 1268 default:
1269 qDebug("Incorrect toolbar policy set"); 1269 qDebug("Incorrect toolbar policy set");
1270 case cesMenuTool: 1270 case cesMenuTool:
1271 case cesMultiple: 1271 case cesMultiple:
1272 // qDebug("Creating new file bar"); 1272 // qDebug("Creating new file bar");
1273 fileBar = new QToolBar("File", this, m_tbposition); 1273 fileBar = new QToolBar("File", this, m_tbposition);
1274 break; 1274 break;
1275 } 1275 }
1276 //fileBar->setHorizontalStretchable( true ); 1276 //fileBar->setHorizontalStretchable( true );
1277 } 1277 }
1278 return fileBar; 1278 return fileBar;
1279} 1279}
1280QToolBar* QTReaderApp::viewbar() 1280QToolBar* QTReaderApp::viewbar()
1281{ 1281{
1282 if (viewBar == NULL) 1282 if (viewBar == NULL)
1283 { 1283 {
1284 switch (m_tbpol) 1284 switch (m_tbpol)
1285 { 1285 {
1286 case cesMultiple: 1286 case cesMultiple:
1287 viewBar = new QToolBar("View", this, m_tbposition); 1287 viewBar = new QToolBar("View", this, m_tbposition);
1288 break; 1288 break;
1289 default: 1289 default:
1290 qDebug("Incorrect toolbar policy set"); 1290 qDebug("Incorrect toolbar policy set");
1291#ifdef USEQPE 1291#ifdef USEQPE
1292 case cesSingle: 1292 case cesSingle:
1293#endif 1293#endif
1294 case cesMenuTool: 1294 case cesMenuTool:
1295 viewBar = fileBar; 1295 viewBar = fileBar;
1296 break; 1296 break;
1297 } 1297 }
1298 } 1298 }
1299 return viewBar; 1299 return viewBar;
1300} 1300}
1301QToolBar* QTReaderApp::navbar() 1301QToolBar* QTReaderApp::navbar()
1302{ 1302{
1303 if (navBar == NULL) 1303 if (navBar == NULL)
1304 { 1304 {
1305 switch (m_tbpol) 1305 switch (m_tbpol)
1306 { 1306 {
1307 case cesMultiple: 1307 case cesMultiple:
1308 // qDebug("Creating new nav bar"); 1308 // qDebug("Creating new nav bar");
1309 navBar = new QToolBar("Navigation", this, m_tbposition); 1309 navBar = new QToolBar("Navigation", this, m_tbposition);
1310 break; 1310 break;
1311 default: 1311 default:
1312 qDebug("Incorrect toolbar policy set"); 1312 qDebug("Incorrect toolbar policy set");
1313#ifdef USEQPE 1313#ifdef USEQPE
1314 case cesSingle: 1314 case cesSingle:
1315#endif 1315#endif
1316 case cesMenuTool: 1316 case cesMenuTool:
1317 navBar = fileBar; 1317 navBar = fileBar;
1318 // qDebug("Setting navbar to filebar"); 1318 // qDebug("Setting navbar to filebar");
1319 break; 1319 break;
1320 } 1320 }
1321 } 1321 }
1322 return navBar; 1322 return navBar;
1323} 1323}
1324QToolBar* QTReaderApp::markbar() 1324QToolBar* QTReaderApp::markbar()
1325{ 1325{
1326 if (markBar == NULL) 1326 if (markBar == NULL)
1327 { 1327 {
1328 switch (m_tbpol) 1328 switch (m_tbpol)
1329 { 1329 {
1330 case cesMultiple: 1330 case cesMultiple:
1331 markBar = new QToolBar("Marks", this, m_tbposition); 1331 markBar = new QToolBar("Marks", this, m_tbposition);
1332 break; 1332 break;
1333 default: 1333 default:
1334 qDebug("Incorrect toolbar policy set"); 1334 qDebug("Incorrect toolbar policy set");
1335#ifdef USEQPE 1335#ifdef USEQPE
1336 case cesSingle: 1336 case cesSingle:
1337#endif 1337#endif
1338 case cesMenuTool: 1338 case cesMenuTool:
1339 markBar = fileBar; 1339 markBar = fileBar;
1340 break; 1340 break;
1341 } 1341 }
1342 } 1342 }
1343 return markBar; 1343 return markBar;
1344} 1344}
1345 1345
1346void QTReaderApp::addfilebar(Config* _config, const QString& key, QAction* a) 1346void QTReaderApp::addfilebar(Config* _config, const QString& key, QAction* a)
1347{ 1347{
1348 if (_config->readBoolEntry(key, false)) a->addTo( filebar() ); 1348 if (_config->readBoolEntry(key, false)) a->addTo( filebar() );
1349} 1349}
1350void QTReaderApp::addnavbar(Config* _config, const QString& key, QAction* a) 1350void QTReaderApp::addnavbar(Config* _config, const QString& key, QAction* a)
1351{ 1351{
1352 if (_config->readBoolEntry(key, false)) a->addTo( navbar() ); 1352 if (_config->readBoolEntry(key, false)) a->addTo( navbar() );
1353} 1353}
1354void QTReaderApp::addmarkbar(Config* _config, const QString& key, QAction* a) 1354void QTReaderApp::addmarkbar(Config* _config, const QString& key, QAction* a)
1355{ 1355{
1356 if (_config->readBoolEntry(key, false)) a->addTo( markbar() ); 1356 if (_config->readBoolEntry(key, false)) a->addTo( markbar() );
1357} 1357}
1358void QTReaderApp::addviewbar(Config* _config, const QString& key, QAction* a) 1358void QTReaderApp::addviewbar(Config* _config, const QString& key, QAction* a)
1359{ 1359{
1360 if (_config->readBoolEntry(key, false)) a->addTo( viewbar() ); 1360 if (_config->readBoolEntry(key, false)) a->addTo( viewbar() );
1361} 1361}
1362 1362
1363void QTReaderApp::suspend() { reader->suspend(); } 1363void QTReaderApp::suspend() { reader->suspend(); }
1364 1364
1365void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) 1365void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
1366{ 1366{
1367#ifndef USEMSGS 1367#ifndef USEMSGS
1368 return; 1368 return;
1369#else 1369#else
1370 QString msg = QString::fromUtf8(_msg); 1370 QString msg = QString::fromUtf8(_msg);
1371 1371
1372 qDebug("Received:%s", (const char*)msg); 1372 qDebug("Received:%s", (const char*)msg);
1373 QDataStream stream( _data, IO_ReadOnly ); 1373 QDataStream stream( _data, IO_ReadOnly );
1374 if ( msg == "suspend()" ) 1374 if ( msg == "suspend()" )
1375 { 1375 {
1376 qDebug("Suspending"); 1376 qDebug("Suspending");
1377 suspend(); 1377 suspend();
1378 qDebug("Suspendedb"); 1378 qDebug("Suspendedb");
1379 } 1379 }
1380 return; 1380 return;
1381 /* 1381 /*
1382 QDataStream stream( _data, IO_ReadOnly ); 1382 QDataStream stream( _data, IO_ReadOnly );
1383 if ( msg == "info(QString)" ) 1383 if ( msg == "info(QString)" )
1384 { 1384 {
1385 QString info; 1385 QString info;
1386 stream >> info; 1386 stream >> info;
1387 QMessageBox::information(this, PROGNAME, info); 1387 QMessageBox::information(this, PROGNAME, info);
1388 } 1388 }
1389 else if ( msg == "Update(int)" ) 1389 else if ( msg == "Update(int)" )
1390 { 1390 {
1391 int info; 1391 int info;
1392 stream >> info; 1392 stream >> info;
1393 if (info) 1393 if (info)
1394 { 1394 {
1395 reader->bDoUpdates = true; 1395 reader->bDoUpdates = true;
1396 reader->refresh(); 1396 reader->refresh();
1397 } 1397 }
1398 else 1398 else
1399 { 1399 {
1400 reader->bDoUpdates = false; 1400 reader->bDoUpdates = false;
1401 } 1401 }
1402 } 1402 }
1403 else if ( msg == "warn(QString)" ) 1403 else if ( msg == "warn(QString)" )
1404 { 1404 {
1405 QString info; 1405 QString info;
1406 stream >> info; 1406 stream >> info;
1407 QMessageBox::warning(this, PROGNAME, info); 1407 QMessageBox::warning(this, PROGNAME, info);
1408 } 1408 }
1409 else if ( msg == "exit()" ) 1409 else if ( msg == "exit()" )
1410 { 1410 {
1411 m_dontSave = true; 1411 m_dontSave = true;
1412 close(); 1412 close();
1413 } 1413 }
1414 else if ( msg == "pageDown()" ) 1414 else if ( msg == "pageDown()" )
1415 { 1415 {
1416 reader->dopagedn(); 1416 reader->dopagedn();
1417 } 1417 }
1418 else if ( msg == "pageUp()" ) 1418 else if ( msg == "pageUp()" )
1419 { 1419 {
1420 reader->dopageup(); 1420 reader->dopageup();
1421 } 1421 }
1422 else if ( msg == "lineDown()" ) 1422 else if ( msg == "lineDown()" )
1423 { 1423 {
1424 reader->lineDown(); 1424 reader->lineDown();
1425 } 1425 }
1426 else if ( msg == "lineUp()" ) 1426 else if ( msg == "lineUp()" )
1427 { 1427 {
1428 reader->lineUp(); 1428 reader->lineUp();
1429 } 1429 }
1430 else if ( msg == "showText()" ) 1430 else if ( msg == "showText()" )
1431 { 1431 {
1432 showEditTools(); 1432 showEditTools();
1433 } 1433 }
1434 else if ( msg == "home()" ) 1434 else if ( msg == "home()" )
1435 { 1435 {
1436 reader->goHome(); 1436 reader->goHome();
1437 } 1437 }
1438 else if ( msg == "back()" ) 1438 else if ( msg == "back()" )
1439 { 1439 {
1440 reader->goBack(); 1440 reader->goBack();
1441 } 1441 }
1442 else if ( msg == "forward()" ) 1442 else if ( msg == "forward()" )
1443 { 1443 {
1444 reader->goForward(); 1444 reader->goForward();
1445 } 1445 }
1446 else if ( msg == "File/Open(QString)" ) 1446 else if ( msg == "File/Open(QString)" )
1447 { 1447 {
1448 QString info; 1448 QString info;
1449 stream >> info; 1449 stream >> info;
1450 openFile( info ); 1450 openFile( info );
1451 } 1451 }
1452 else if ( msg == "File/Info()" ) 1452 else if ( msg == "File/Info()" )
1453 { 1453 {
1454 showinfo(); 1454 showinfo();
1455 } 1455 }
1456 else if ( msg == "File/Action(QString)" ) 1456 else if ( msg == "File/Action(QString)" )
1457 { 1457 {
1458 QString info; 1458 QString info;
1459 stream >> info; 1459 stream >> info;
1460 m_spaceTarget = ActNameToInt(info); 1460 m_spaceTarget = ActNameToInt(info);
1461 } 1461 }
1462 else if ( msg == "Navigation/Scroll(int)" ) 1462 else if ( msg == "Navigation/Scroll(int)" )
1463 { 1463 {
1464 int info; 1464 int info;
1465 stream >> info; 1465 stream >> info;
1466 autoScroll(info); 1466 autoScroll(info);
1467 } 1467 }
1468 1468
1469 else if ( msg == "Navigation/GotoStart()" ) 1469 else if ( msg == "Navigation/GotoStart()" )
1470 { 1470 {
1471 gotoStart(); 1471 gotoStart();
1472 } 1472 }
1473 else if ( msg == "Navigation/GotoEnd()" ) 1473 else if ( msg == "Navigation/GotoEnd()" )
1474 { 1474 {
1475 gotoEnd(); 1475 gotoEnd();
1476 } 1476 }
1477 else if ( msg == "Navigation/Jump(int)" ) 1477 else if ( msg == "Navigation/Jump(int)" )
1478 { 1478 {
1479 int info; 1479 int info;
1480 stream >> info; 1480 stream >> info;
1481 reader->locate(info); 1481 reader->locate(info);
1482 } 1482 }
1483 else if ( msg == "Navigation/Page/LineScroll(int)" ) 1483 else if ( msg == "Navigation/Page/LineScroll(int)" )
1484 { 1484 {
1485 int info; 1485 int info;
1486 stream >> info; 1486 stream >> info;
1487 pagemode(info); 1487 pagemode(info);
1488 } 1488 }
1489 else if ( msg == "Navigation/SetOverlap(int)" ) 1489 else if ( msg == "Navigation/SetOverlap(int)" )
1490 { 1490 {
1491 int info; 1491 int info;
1492 stream >> info; 1492 stream >> info;
1493 reader->m_overlap = info; 1493 reader->m_overlap = info;
1494 } 1494 }
1495 else if ( msg == "Navigation/SetMargin(int)" ) 1495 else if ( msg == "Navigation/SetMargin(int)" )
1496 { 1496 {
1497 int info; 1497 int info;
1498 stream >> info; 1498 stream >> info;
1499 do_margin(info); 1499 do_margin(info);
1500 } 1500 }
1501 else if ( msg == "File/SetDictionary(QString)" ) 1501 else if ( msg == "File/SetDictionary(QString)" )
1502 { 1502 {
1503 QString info; 1503 QString info;
1504 stream >> info; 1504 stream >> info;
1505 do_settarget(info); 1505 do_settarget(info);
1506 } 1506 }
1507#ifdef _SCROLLPIPE 1507#ifdef _SCROLLPIPE
1508 else if ( msg == "File/SetScrollTarget(QString)" ) 1508 else if ( msg == "File/SetScrollTarget(QString)" )
1509 { 1509 {
1510 QString info; 1510 QString info;
1511 stream >> info; 1511 stream >> info;
1512 reader->m_pipetarget = info; 1512 reader->m_pipetarget = info;
1513 } 1513 }
1514#endif 1514#endif
1515 else if ( msg == "File/Two/OneTouch(int)" ) 1515 else if ( msg == "File/Two/OneTouch(int)" )
1516 { 1516 {
1517 int info; 1517 int info;
1518 stream >> info; 1518 stream >> info;
1519 setTwoTouch(info); 1519 setTwoTouch(info);
1520 } 1520 }
1521 else if ( msg == "Target/Annotation(int)" ) 1521 else if ( msg == "Target/Annotation(int)" )
1522 { 1522 {
1523 int info; 1523 int info;
1524 stream >> info; 1524 stream >> info;
1525 OnAnnotation(info); 1525 OnAnnotation(info);
1526 } 1526 }
1527 else if ( msg == "Target/Dictionary(int)" ) 1527 else if ( msg == "Target/Dictionary(int)" )
1528 { 1528 {
1529 int info; 1529 int info;
1530 stream >> info; 1530 stream >> info;
1531 OnDictionary(info); 1531 OnDictionary(info);
1532 } 1532 }
1533 else if ( msg == "Target/Clipboard(int)" ) 1533 else if ( msg == "Target/Clipboard(int)" )
1534 { 1534 {
1535 int info; 1535 int info;
1536 stream >> info; 1536 stream >> info;
1537 OnClipboard(info); 1537 OnClipboard(info);
1538 } 1538 }
1539 else if ( msg == "File/Find(QString)" ) 1539 else if ( msg == "File/Find(QString)" )
1540 { 1540 {
1541 QString info; 1541 QString info;
1542 stream >> info; 1542 stream >> info;
1543 QRegExp arg(info); 1543 QRegExp arg(info);
1544 size_t pos = reader->pagelocate(); 1544 size_t pos = reader->pagelocate();
1545 size_t start = pos; 1545 size_t start = pos;
1546 CDrawBuffer test(&(reader->m_fontControl)); 1546 CDrawBuffer test(&(reader->m_fontControl));
1547 reader->getline(&test); 1547 reader->getline(&test);
1548 while (arg.match(toQString(test.data())) == -1) 1548 while (arg.match(toQString(test.data())) == -1)
1549 { 1549 {
1550 pos = reader->locate(); 1550 pos = reader->locate();
1551 if (!reader->getline(&test)) 1551 if (!reader->getline(&test))
1552 { 1552 {
1553 QMessageBox::information(this, PROGNAME, QString("Can't find\n")+info); 1553 QMessageBox::information(this, PROGNAME, QString("Can't find\n")+info);
1554 pos = start; 1554 pos = start;
1555 break; 1555 break;
1556 } 1556 }
1557 } 1557 }
1558 reader->locate(pos); 1558 reader->locate(pos);
1559 } 1559 }
1560 else if ( msg == "File/Fullscreen(int)" ) 1560 else if ( msg == "File/Fullscreen(int)" )
1561 { 1561 {
1562 int info; 1562 int info;
1563 stream >> info; 1563 stream >> info;
1564 setfullscreen(info); 1564 setfullscreen(info);
1565 } 1565 }
1566 else if ( msg == "File/Continuous(int)" ) 1566 else if ( msg == "File/Continuous(int)" )
1567 { 1567 {
1568 int info; 1568 int info;
1569 stream >> info; 1569 stream >> info;
1570 setcontinuous(info); 1570 setcontinuous(info);
1571 } 1571 }
1572 else if ( msg == "Markup(QString)" ) 1572 else if ( msg == "Markup(QString)" )
1573 { 1573 {
1574 QString info; 1574 QString info;
1575 stream >> info; 1575 stream >> info;
1576 if (info == "Auto") 1576 if (info == "Auto")
1577 { 1577 {
1578 autofmt(true); 1578 autofmt(true);
1579 } 1579 }
1580 if (info == "None") 1580 if (info == "None")
1581 { 1581 {
1582 autofmt(false); 1582 autofmt(false);
1583 textfmt(false); 1583 textfmt(false);
1584 striphtml(false); 1584 striphtml(false);
1585 peanut(false); 1585 peanut(false);
1586 } 1586 }
1587 if (info == "Text") 1587 if (info == "Text")
1588 { 1588 {
1589 textfmt(true); 1589 textfmt(true);
1590 } 1590 }
1591 if (info == "HTML") 1591 if (info == "HTML")
1592 { 1592 {
1593 striphtml(true); 1593 striphtml(true);
1594 } 1594 }
1595 if (info == "Peanut/PML") 1595 if (info == "Peanut/PML")
1596 { 1596 {
1597 peanut(true); 1597 peanut(true);
1598 } 1598 }
1599 } 1599 }
1600 else if ( msg == "Layout/StripCR(int)" ) 1600 else if ( msg == "Layout/StripCR(int)" )
1601 { 1601 {
1602 int info; 1602 int info;
1603 stream >> info; 1603 stream >> info;
1604 stripcr(info); 1604 stripcr(info);
1605 } 1605 }
1606 else if ( msg == "Layout/Dehyphen(int)" ) 1606 else if ( msg == "Layout/Dehyphen(int)" )
1607 { 1607 {
1608 int info; 1608 int info;
1609 stream >> info; 1609 stream >> info;
1610 dehyphen(info); 1610 dehyphen(info);
1611 } 1611 }
1612 else if ( msg == "Layout/Depluck(int)" ) 1612 else if ( msg == "Layout/Depluck(int)" )
1613 { 1613 {
1614 int info; 1614 int info;
1615 stream >> info; 1615 stream >> info;
1616 depluck(info); 1616 depluck(info);
1617 } 1617 }
1618 else if ( msg == "Layout/Dejpluck(int)" ) 1618 else if ( msg == "Layout/Dejpluck(int)" )
1619 { 1619 {
1620 int info; 1620 int info;
1621 stream >> info; 1621 stream >> info;
1622 dejpluck(info); 1622 dejpluck(info);
1623 } 1623 }
1624 else if ( msg == "Layout/SingleSpace(int)" ) 1624 else if ( msg == "Layout/SingleSpace(int)" )
1625 { 1625 {
1626 int info; 1626 int info;
1627 stream >> info; 1627 stream >> info;
1628 onespace(info); 1628 onespace(info);
1629 } 1629 }
1630 else if ( msg == "Layout/Repalm(int)" ) 1630 else if ( msg == "Layout/Repalm(int)" )
1631 { 1631 {
1632 int info; 1632 int info;
1633 stream >> info; 1633 stream >> info;
1634 repalm(info); 1634 repalm(info);
1635 } 1635 }
1636 else if ( msg == "Layout/Unindent(int)" ) 1636 else if ( msg == "Layout/Unindent(int)" )
1637 { 1637 {
1638 int info; 1638 int info;
1639 stream >> info; 1639 stream >> info;
1640 unindent(info); 1640 unindent(info);
1641 } 1641 }
1642 else if ( msg == "Layout/Re-paragraph(int)" ) 1642 else if ( msg == "Layout/Re-paragraph(int)" )
1643 { 1643 {
1644 int info; 1644 int info;
1645 stream >> info; 1645 stream >> info;
1646 repara(info); 1646 repara(info);
1647 } 1647 }
1648 else if ( msg == "Layout/DoubleSpace(int)" ) 1648 else if ( msg == "Layout/DoubleSpace(int)" )
1649 { 1649 {
1650 int info; 1650 int info;
1651 stream >> info; 1651 stream >> info;
1652 dblspce(info); 1652 dblspce(info);
1653 } 1653 }
1654 else if ( msg == "Layout/Indent(int)" ) 1654 else if ( msg == "Layout/Indent(int)" )
1655 { 1655 {
1656 int info; 1656 int info;
1657 stream >> info; 1657 stream >> info;
1658 reader->bindenter = info; 1658 reader->bindenter = info;
1659 reader->setfilter(reader->getfilter()); 1659 reader->setfilter(reader->getfilter());
1660 } 1660 }
1661 else if ( msg == "Layout/Remap(int)" ) 1661 else if ( msg == "Layout/Remap(int)" )
1662 { 1662 {
1663 int info; 1663 int info;
1664 stream >> info; 1664 stream >> info;
1665 remap(info); 1665 remap(info);
1666 } 1666 }
1667 else if ( msg == "Layout/Embolden(int)" ) 1667 else if ( msg == "Layout/Embolden(int)" )
1668 { 1668 {
1669 int info; 1669 int info;
1670 stream >> info; 1670 stream >> info;
1671 embolden(info); 1671 embolden(info);
1672 } 1672 }
1673 else if ( msg == "Format/Ideogram/Word(int)" ) 1673 else if ( msg == "Format/Ideogram/Word(int)" )
1674 { 1674 {
1675 int info; 1675 int info;
1676 stream >> info; 1676 stream >> info;
1677 monospace(info); 1677 monospace(info);
1678 } 1678 }
1679 else if ( msg == "Format/SetWidth(int)" ) 1679 else if ( msg == "Format/SetWidth(int)" )
1680 { 1680 {
1681 int info; 1681 int info;
1682 stream >> info; 1682 stream >> info;
1683 reader->m_charpc = info; 1683 reader->m_charpc = info;
1684 reader->setfont(); 1684 reader->setfont();
1685 reader->refresh(); 1685 reader->refresh();
1686 } 1686 }
1687 else if ( msg == "Format/SetFont(QString,int)" ) 1687 else if ( msg == "Format/SetFont(QString,int)" )
1688 { 1688 {
1689 QString fontname; 1689 QString fontname;
1690 int size; 1690 int size;
1691 stream >> fontname; 1691 stream >> fontname;
1692 stream >> size; 1692 stream >> size;
1693 setfontHelper(fontname, size); 1693 setfontHelper(fontname, size);
1694 } 1694 }
1695 else if ( msg == "Marks/Autogen(QString)" ) 1695 else if ( msg == "Marks/Autogen(QString)" )
1696 { 1696 {
1697 QString info; 1697 QString info;
1698 stream >> info; 1698 stream >> info;
1699 do_autogen(info); 1699 do_autogen(info);
1700 } 1700 }
1701 else if ( msg == "File/StartBlock()" ) 1701 else if ( msg == "File/StartBlock()" )
1702 { 1702 {
1703 editMark(); 1703 editMark();
1704 } 1704 }
1705 else if ( msg == "File/CopyBlock()" ) 1705 else if ( msg == "File/CopyBlock()" )
1706 { 1706 {
1707 editCopy(); 1707 editCopy();
1708 } 1708 }
1709 */ 1709 */
1710#endif 1710#endif
1711} 1711}
1712 1712
1713ActionTypes QTReaderApp::ActNameToInt(const QString& _enc) 1713ActionTypes QTReaderApp::ActNameToInt(const QString& _enc)
1714{ 1714{
1715 for (int i = 0; i < MAX_ACTIONS; i++) 1715 for (int i = 0; i < MAX_ACTIONS; i++)
1716 { 1716 {
1717 if (m_buttonAction[i]->text() == _enc) return (ActionTypes)i; 1717 if (m_buttonAction[i]->text() == _enc) return (ActionTypes)i;
1718 } 1718 }
1719 return cesAutoScroll; 1719 return cesAutoScroll;
1720} 1720}
1721 1721
1722void QTReaderApp::setinverted(bool sfs) 1722void QTReaderApp::setinverted(bool sfs)
1723{ 1723{
1724 reader->setInverse(sfs); 1724 reader->setInverse(sfs);
1725 reader->setfilter(reader->getfilter()); 1725 reader->setfilter(reader->getfilter());
1726 reader->refresh(); 1726 reader->refresh();
1727} 1727}
1728 1728
1729void QTReaderApp::setrotated(bool sfs) 1729void QTReaderApp::setrotated(bool sfs)
1730{ 1730{
1731 reader->setrotated(sfs); 1731 reader->setrotated(sfs);
1732 if (sfs) 1732 if (sfs)
1733 { 1733 {
1734 m_layout->setDirection( (m_qtscroll == 2) ? QBoxLayout::BottomToTop : QBoxLayout::TopToBottom ); 1734 m_layout->setDirection( (m_qtscroll == 2) ? QBoxLayout::BottomToTop : QBoxLayout::TopToBottom );
1735 if (m_scrollbar != NULL) 1735 if (m_scrollbar != NULL)
1736 { 1736 {
1737 scrollbar->disconnect(); 1737 scrollbar->disconnect();
1738 m_scrollbar->setOrientation(Qt::Horizontal); 1738 m_scrollbar->setOrientation(Qt::Horizontal);
1739 connect(scrollbar, SIGNAL(nextLine()), reader, SLOT(lineUp()) ); 1739 connect(scrollbar, SIGNAL(nextLine()), reader, SLOT(lineUp()) );
1740 connect(scrollbar, SIGNAL(prevLine()), reader, SLOT(lineDown()) ); 1740 connect(scrollbar, SIGNAL(prevLine()), reader, SLOT(lineDown()) );
1741 connect(scrollbar, SIGNAL(nextPage()), reader, SLOT(dopageup()) ); 1741 connect(scrollbar, SIGNAL(nextPage()), reader, SLOT(dopageup()) );
1742 connect(scrollbar, SIGNAL(prevPage()), reader, SLOT(dopagedn()) ); 1742 connect(scrollbar, SIGNAL(prevPage()), reader, SLOT(dopagedn()) );
1743 connect(scrollbar, SIGNAL(sliderMoved(int)), this, SLOT(actionscroll(int)) ); 1743 connect(scrollbar, SIGNAL(sliderMoved(int)), this, SLOT(actionscroll(int)) );
1744 } 1744 }
1745 //reader->repaint(0, reader->m_left_border, reader->width(), reader->height()-2*reader->m_border); 1745 //reader->repaint(0, reader->m_left_border, reader->width(), reader->height()-2*reader->m_border);
1746 } 1746 }
1747 else 1747 else
1748 { 1748 {
1749 m_layout->setDirection( (m_qtscroll == 2) ? QBoxLayout::RightToLeft : QBoxLayout::LeftToRight ); 1749 m_layout->setDirection( (m_qtscroll == 2) ? QBoxLayout::RightToLeft : QBoxLayout::LeftToRight );
1750 if (m_scrollbar != NULL) 1750 if (m_scrollbar != NULL)
1751 { 1751 {
1752 scrollbar->disconnect(); 1752 scrollbar->disconnect();
1753 m_scrollbar->setOrientation(Qt::Vertical); 1753 m_scrollbar->setOrientation(Qt::Vertical);
1754 connect(scrollbar, SIGNAL(nextLine()), reader, SLOT(lineDown()) ); 1754 connect(scrollbar, SIGNAL(nextLine()), reader, SLOT(lineDown()) );
1755 connect(scrollbar, SIGNAL(prevLine()), reader, SLOT(lineUp()) ); 1755 connect(scrollbar, SIGNAL(prevLine()), reader, SLOT(lineUp()) );
1756 connect(scrollbar, SIGNAL(nextPage()), reader, SLOT(dopagedn()) ); 1756 connect(scrollbar, SIGNAL(nextPage()), reader, SLOT(dopagedn()) );
1757 connect(scrollbar, SIGNAL(prevPage()), reader, SLOT(dopageup()) ); 1757 connect(scrollbar, SIGNAL(prevPage()), reader, SLOT(dopageup()) );
1758 connect(scrollbar, SIGNAL(sliderMoved(int)), this, SLOT(actionscroll(int)) ); 1758 connect(scrollbar, SIGNAL(sliderMoved(int)), this, SLOT(actionscroll(int)) );
1759 } 1759 }
1760 //reader->repaint(reader->m_border, 0, reader->width()-2*reader->m_border, reader->height()); 1760 //reader->repaint(reader->m_border, 0, reader->width()-2*reader->m_border, reader->height());
1761 } 1761 }
1762 reader->refresh(); 1762 reader->refresh();
1763} 1763}
1764 1764
1765void QTReaderApp::setgrab(bool sfs) 1765void QTReaderApp::setgrab(bool sfs)
1766{ 1766{
1767#ifdef USEQPE 1767#ifdef USEQPE
1768 m_grabkeyboard = sfs; 1768 m_grabkeyboard = sfs;
1769 if (m_grabkeyboard) 1769 if (m_grabkeyboard)
1770 { 1770 {
1771 ((QPEApplication*)qApp)->grabKeyboard(); 1771 ((QPEApplication*)qApp)->grabKeyboard();
1772 } 1772 }
1773 else 1773 else
1774 { 1774 {
1775 ((QPEApplication*)qApp)->ungrabKeyboard(); 1775 ((QPEApplication*)qApp)->ungrabKeyboard();
1776 } 1776 }
1777#endif 1777#endif
1778} 1778}
1779 1779
1780void QTReaderApp::setfullscreen(bool sfs) 1780void QTReaderApp::setfullscreen(bool sfs)
1781{ 1781{
1782 reader->bDoUpdates = false; 1782 reader->bDoUpdates = false;
1783 m_fullscreen = sfs; 1783 m_fullscreen = sfs;
1784 showEditTools(); 1784 showEditTools();
1785// qApp->processEvents(); 1785// qApp->processEvents();
1786 reader->bDoUpdates = true; 1786 reader->bDoUpdates = true;
1787 reader->update(); 1787 reader->update();
1788} 1788}
1789/* 1789/*
1790void QTReaderApp::buttonActionSelected(QAction* _a) 1790void QTReaderApp::buttonActionSelected(QAction* _a)
1791{ 1791{
1792//// qDebug("es:%x : %s (%u)", _a, (const char *)(_a->text()), ActNameToInt(_a->text())); 1792//// qDebug("es:%x : %s (%u)", _a, (const char *)(_a->text()), ActNameToInt(_a->text()));
1793 m_spaceTarget = ActNameToInt(_a->text()); 1793 m_spaceTarget = ActNameToInt(_a->text());
1794} 1794}
1795*/ 1795*/
1796QTReaderApp::~QTReaderApp() 1796QTReaderApp::~QTReaderApp()
1797{ 1797{
1798} 1798}
1799 1799
1800void QTReaderApp::autoScroll(bool _b) 1800void QTReaderApp::autoScroll(bool _b)
1801{ 1801{
1802 reader->setautoscroll(_b); 1802 reader->setautoscroll(_b);
1803 setScrollState(reader->m_autoScroll); 1803 setScrollState(reader->m_autoScroll);
1804} 1804}
1805 1805
1806void QTReaderApp::zoomin() 1806void QTReaderApp::zoomin()
1807{ 1807{
1808 reader->zoomin(); 1808 reader->zoomin();
1809 QFont f(reader->m_fontname, reader->m_fontControl.getsize(0)); 1809 QFont f(reader->m_fontname, reader->m_fontControl.getsize(0));
1810 m_prog->setFont( f ); 1810 m_prog->setFont( f );
1811} 1811}
1812 1812
1813void QTReaderApp::zoomout() 1813void QTReaderApp::zoomout()
1814{ 1814{
1815 reader->zoomout(); 1815 reader->zoomout();
1816 QFont f(reader->m_fontname, reader->m_fontControl.getsize(0)); 1816 QFont f(reader->m_fontname, reader->m_fontControl.getsize(0));
1817 m_prog->setFont( f ); 1817 m_prog->setFont( f );
1818} 1818}
1819 1819
1820void QTReaderApp::clearBkmkList() 1820void QTReaderApp::clearBkmkList()
1821{ 1821{
1822 delete pBkmklist; 1822 delete pBkmklist;
1823 reader->pBkmklist = pBkmklist = NULL; 1823 reader->pBkmklist = pBkmklist = NULL;
1824 m_fBkmksChanged = false; 1824 m_fBkmksChanged = false;
1825 reader->refresh(true); 1825 reader->refresh(true);
1826} 1826}
1827 1827
1828void QTReaderApp::fileClose() 1828void QTReaderApp::fileClose()
1829{ 1829{
1830 CCloseDialog* cd = new CCloseDialog(reader->m_string, false, this); 1830 CCloseDialog* cd = new CCloseDialog(reader->m_string, false, this);
1831 if (cd->exec()) 1831 if (cd->exec())
1832 { 1832 {
1833 if (pOpenlist != NULL) 1833 if (pOpenlist != NULL)
1834 { 1834 {
1835 int ind = 0; 1835 int ind = 0;
1836 Bkmk* p = (*pOpenlist)[ind]; 1836 Bkmk* p = (*pOpenlist)[ind];
1837 while (p != NULL && toQString(CFiledata(p->anno()).name()) != reader->m_lastfile) 1837 while (p != NULL && toQString(CFiledata(p->anno()).name()) != reader->m_lastfile)
1838 { 1838 {
1839 p = (*pOpenlist)[++ind]; 1839 p = (*pOpenlist)[++ind];
1840 } 1840 }
1841 if (p != NULL) pOpenlist->erase(ind); 1841 if (p != NULL) pOpenlist->erase(ind);
1842 if (cd->delFile()) 1842 if (cd->delFile())
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