summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/QTReaderApp.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/QTReaderApp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReaderApp.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp
index e759249..b0d589e 100644
--- a/noncore/apps/opie-reader/QTReaderApp.cpp
+++ b/noncore/apps/opie-reader/QTReaderApp.cpp
@@ -140,855 +140,855 @@ void QTReaderApp::listBkmkFiles()
140 const QFileInfoList *list = d.entryInfoList(); 140 const QFileInfoList *list = d.entryInfoList();
141 QFileInfoListIterator it( *list ); // create list iterator 141 QFileInfoListIterator it( *list ); // create list iterator
142 QFileInfo *fi; // pointer for traversing 142 QFileInfo *fi; // pointer for traversing
143 143
144 while ( (fi=it.current()) ) { // for each file... 144 while ( (fi=it.current()) ) { // for each file...
145 145
146 bkmkselector->insertItem(fi->fileName()); 146 bkmkselector->insertItem(fi->fileName());
147 cnt++; 147 cnt++;
148 148
149 //qDebug( "%10li %s", fi->size(), fi->fileName().data() ); 149 //qDebug( "%10li %s", fi->size(), fi->fileName().data() );
150 ++it; // goto next list element 150 ++it; // goto next list element
151 } 151 }
152 152
153#else /* USEQPE */ 153#else /* USEQPE */
154 int cnt = 0; 154 int cnt = 0;
155 DIR *d; 155 DIR *d;
156 d = opendir((const char *)Global::applicationFileName(APPDIR,"")); 156 d = opendir((const char *)Global::applicationFileName(APPDIR,""));
157 157
158 while(1) 158 while(1)
159 { 159 {
160 struct dirent* de; 160 struct dirent* de;
161 struct stat buf; 161 struct stat buf;
162 de = readdir(d); 162 de = readdir(d);
163 if (de == NULL) break; 163 if (de == NULL) break;
164 164
165 if (lstat((const char *)Global::applicationFileName(APPDIR,de->d_name),&buf) == 0 && S_ISREG(buf.st_mode)) 165 if (lstat((const char *)Global::applicationFileName(APPDIR,de->d_name),&buf) == 0 && S_ISREG(buf.st_mode))
166 { 166 {
167 bkmkselector->insertItem(de->d_name); 167 bkmkselector->insertItem(de->d_name);
168 cnt++; 168 cnt++;
169 } 169 }
170 } 170 }
171 171
172 closedir(d); 172 closedir(d);
173#endif 173#endif
174 if (cnt > 0) 174 if (cnt > 0)
175 { 175 {
176//tjw menu->hide(); 176//tjw menu->hide();
177 editorStack->raiseWidget( bkmkselector ); 177 editorStack->raiseWidget( bkmkselector );
178 hidetoolbars(); 178 hidetoolbars();
179 m_nBkmkAction = cRmBkmkFile; 179 m_nBkmkAction = cRmBkmkFile;
180 } 180 }
181 else 181 else
182 QMessageBox::information(this, PROGNAME, "No bookmark files"); 182 QMessageBox::information(this, PROGNAME, "No bookmark files");
183} 183}
184 184
185void QTReaderApp::hidetoolbars() 185void QTReaderApp::hidetoolbars()
186{ 186{
187 menubar->hide(); 187 menubar->hide();
188 if (fileBar != NULL) fileBar->hide(); 188 if (fileBar != NULL) fileBar->hide();
189 if (viewBar != NULL) viewBar->hide(); 189 if (viewBar != NULL) viewBar->hide();
190 if (navBar != NULL) navBar->hide(); 190 if (navBar != NULL) navBar->hide();
191 if (markBar != NULL) markBar->hide(); 191 if (markBar != NULL) markBar->hide();
192 if (m_fontVisible) m_fontBar->hide(); 192 if (m_fontVisible) m_fontBar->hide();
193 if (regVisible) 193 if (regVisible)
194 { 194 {
195#ifdef USEQPE 195#ifdef USEQPE
196 Global::hideInputMethod(); 196 Global::hideInputMethod();
197#endif 197#endif
198 regBar->hide(); 198 regBar->hide();
199 } 199 }
200 if (searchVisible) 200 if (searchVisible)
201 { 201 {
202#ifdef USEQPE 202#ifdef USEQPE
203 Global::hideInputMethod(); 203 Global::hideInputMethod();
204#endif 204#endif
205 searchBar->hide(); 205 searchBar->hide();
206 } 206 }
207} 207}
208 208
209QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) 209QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
210 : QMainWindow( parent, name, f ), bFromDocView( FALSE ), m_dontSave(false), 210 : QMainWindow( parent, name, f ), bFromDocView( FALSE ), m_dontSave(false),
211 fileBar(NULL), navBar(NULL), viewBar(NULL), markBar(NULL) 211 fileBar(NULL), navBar(NULL), viewBar(NULL), markBar(NULL)
212{ 212{
213 m_url_clipboard = false; 213 m_url_clipboard = false;
214 m_url_localfile = false; 214 m_url_localfile = false;
215 m_url_globalfile = false; 215 m_url_globalfile = false;
216 ftime(&m_lastkeytime); 216 ftime(&m_lastkeytime);
217//// qDebug("Application directory = %s", (const tchar *)QPEApplication::documentDir()); 217//// qDebug("Application directory = %s", (const tchar *)QPEApplication::documentDir());
218//// qDebug("Application directory = %s", (const tchar *)Global::applicationFileName("uqtreader","bkmks.xml")); 218//// qDebug("Application directory = %s", (const tchar *)Global::applicationFileName("uqtreader","bkmks.xml"));
219 219
220 m_bcloseDisabled = true; 220 m_bcloseDisabled = true;
221 m_disableesckey = false; 221 m_disableesckey = false;
222 pBkmklist = NULL; 222 pBkmklist = NULL;
223 pOpenlist = NULL; 223 pOpenlist = NULL;
224// doc = 0; 224// doc = 0;
225 225
226 m_fBkmksChanged = false; 226 m_fBkmksChanged = false;
227 227
228 QString lang = getenv( "LANG" ); 228 QString lang = getenv( "LANG" );
229 QString rot = getenv( "QWS_DISPLAY" ); 229 QString rot = getenv( "QWS_DISPLAY" );
230 230
231/* 231/*
232 int m_rot = 0; 232 int m_rot = 0;
233 if (rot.contains("Rot90")) 233 if (rot.contains("Rot90"))
234 { 234 {
235 m_rot = 90; 235 m_rot = 90;
236 } 236 }
237 else if (rot.contains("Rot180")) 237 else if (rot.contains("Rot180"))
238 { 238 {
239 m_rot = 180; 239 m_rot = 180;
240 } 240 }
241 else if (rot.contains("Rot270")) 241 else if (rot.contains("Rot270"))
242 { 242 {
243 m_rot = 270; 243 m_rot = 270;
244 } 244 }
245 245
246// qDebug("Initial Rotation(%d):%s", m_rot, (const char*)rot); 246// qDebug("Initial Rotation(%d):%s", m_rot, (const char*)rot);
247*/ 247*/
248 m_autogenstr = "^ *[A-Z].*[a-z] *$"; 248 m_autogenstr = "^ *[A-Z].*[a-z] *$";
249 249
250#ifdef USEQPE 250#ifdef USEQPE
251 setIcon( Resource::loadPixmap( PICDIR "uqtreader") ); 251 setIcon( Resource::loadPixmap( PICDIR "uqtreader") );
252#else 252#else
253 setIcon( QPixmap (PICDIR "uqtreader.png") ); 253 setIcon( QPixmap (PICDIR "uqtreader.png") );
254#endif /* USEQPE */ 254#endif /* USEQPE */
255 255
256// QToolBar *bar = new QToolBar( this ); 256// QToolBar *bar = new QToolBar( this );
257// menubar = new QToolBar( this ); 257// menubar = new QToolBar( this );
258#ifdef USEQPE 258#ifdef USEQPE
259 Config config( APPDIR ); 259 Config config( APPDIR );
260#else 260#else
261 QDir d = QDir::home(); // "/" 261 QDir d = QDir::home(); // "/"
262 if ( !d.cd(APPDIR) ) { // "/tmp" 262 if ( !d.cd(APPDIR) ) { // "/tmp"
263 qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); 263 qWarning( "Cannot find the \"~/" APPDIR "\" directory" );
264 d = QDir::home(); 264 d = QDir::home();
265 d.mkdir(APPDIR); 265 d.mkdir(APPDIR);
266 d.cd(APPDIR); 266 d.cd(APPDIR);
267 } 267 }
268 QFileInfo fi(d, INIFILE); 268 QFileInfo fi(d, INIFILE);
269// qDebug("Path:%s", (const char*)fi.absFilePath()); 269// qDebug("Path:%s", (const char*)fi.absFilePath());
270 Config config(fi.absFilePath()); 270 Config config(fi.absFilePath());
271#endif 271#endif
272 config.setGroup("Toolbar"); 272 config.setGroup("Toolbar");
273 m_tbmovesave = m_tbmove = config.readBoolEntry("Movable", false); 273 m_tbmovesave = m_tbmove = config.readBoolEntry("Movable", false);
274 m_tbpolsave = m_tbpol = (ToolbarPolicy)config.readNumEntry("Policy", 1); 274 m_tbpolsave = m_tbpol = (ToolbarPolicy)config.readNumEntry("Policy", 1);
275 m_tbposition = (ToolBarDock)config.readNumEntry("Position", 2); 275 m_tbposition = (ToolBarDock)config.readNumEntry("Position", 2);
276 menubar = new QToolBar("Menus", this, m_tbposition); 276 menubar = new QToolBar("Menus", this, m_tbposition);
277 277
278// fileBar = new QToolBar("File", this); 278// fileBar = new QToolBar("File", this);
279// QToolBar* viewBar = new QToolBar("File", this); 279// QToolBar* viewBar = new QToolBar("File", this);
280// QToolBar* navBar = new QToolBar("File", this); 280// QToolBar* navBar = new QToolBar("File", this);
281// QToolBar* markBar = new QToolBar("File", this); 281// QToolBar* markBar = new QToolBar("File", this);
282 282
283#ifdef USEQPE 283#ifdef USEQPE
284 mb = new QMenuBar( menubar ); 284 mb = new QMenuBar( menubar );
285#else 285#else
286 mb = new QMenuBar( menubar ); 286 mb = new QMenuBar( menubar );
287#endif 287#endif
288 288
289//#ifdef USEQPE 289//#ifdef USEQPE
290 QPopupMenu* tmp = new QPopupMenu(mb); 290 QPopupMenu* tmp = new QPopupMenu(mb);
291 mb->insertItem( geticon( "AppsIcon" ), tmp ); 291 mb->insertItem( geticon( "AppsIcon" ), tmp );
292//#else 292//#else
293// QMenuBar* tmp = mb; 293// QMenuBar* tmp = mb;
294//#endif 294//#endif
295 295
296 QPopupMenu *file = new QPopupMenu( mb ); 296 QPopupMenu *file = new QPopupMenu( mb );
297 tmp->insertItem( tr( "File" ), file ); 297 tmp->insertItem( tr( "File" ), file );
298 298
299 QPopupMenu *navigation = new QPopupMenu(mb); 299 QPopupMenu *navigation = new QPopupMenu(mb);
300 tmp->insertItem( tr( "Navigation" ), navigation ); 300 tmp->insertItem( tr( "Navigation" ), navigation );
301 301
302 QPopupMenu *view = new QPopupMenu( mb ); 302 QPopupMenu *view = new QPopupMenu( mb );
303 tmp->insertItem( tr( "View" ), view ); 303 tmp->insertItem( tr( "View" ), view );
304 304
305 QPopupMenu *marks = new QPopupMenu( this ); 305 QPopupMenu *marks = new QPopupMenu( this );
306 tmp->insertItem( tr( "Marks" ), marks ); 306 tmp->insertItem( tr( "Marks" ), marks );
307 307
308 QPopupMenu *settings = new QPopupMenu( this ); 308 QPopupMenu *settings = new QPopupMenu( this );
309 tmp->insertItem( tr( "Settings" ), settings ); 309 tmp->insertItem( tr( "Settings" ), settings );
310 310
311// addToolBar(menubar, "Menus",QMainWindow::Top); 311// addToolBar(menubar, "Menus",QMainWindow::Top);
312// addToolBar(fileBar, "Toolbar",QMainWindow::Top); 312// addToolBar(fileBar, "Toolbar",QMainWindow::Top);
313 313
314 // QPopupMenu *edit = new QPopupMenu( this ); 314 // QPopupMenu *edit = new QPopupMenu( this );
315 315
316 /* 316 /*
317 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); 317 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
318 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); 318 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
319 a->addTo( bar ); 319 a->addTo( bar );
320 a->addTo( file ); 320 a->addTo( file );
321 */ 321 */
322 322
323 editorStack = new QWidgetStack( this ); 323 editorStack = new QWidgetStack( this );
324 setCentralWidget( editorStack ); 324 setCentralWidget( editorStack );
325 325
326 searchVisible = FALSE; 326 searchVisible = FALSE;
327 regVisible = FALSE; 327 regVisible = FALSE;
328 m_fontVisible = false; 328 m_fontVisible = false;
329 329
330 m_annoWin = new CAnnoEdit(editorStack); 330 m_annoWin = new CAnnoEdit(editorStack);
331 editorStack->addWidget(m_annoWin, get_unique_id()); 331 editorStack->addWidget(m_annoWin, get_unique_id());
332 connect( m_annoWin, SIGNAL( finished(const QString&, const QString&) ), this, SLOT( addAnno(const QString&, const QString&) ) ); 332 connect( m_annoWin, SIGNAL( finished(const QString&,const QString&) ), this, SLOT( addAnno(const QString&,const QString&) ) );
333 connect( m_annoWin, SIGNAL( cancelled() ), this, SLOT( infoClose() ) ); 333 connect( m_annoWin, SIGNAL( cancelled() ), this, SLOT( infoClose() ) );
334 334
335 m_infoWin = new infowin(editorStack); 335 m_infoWin = new infowin(editorStack);
336 editorStack->addWidget(m_infoWin, get_unique_id()); 336 editorStack->addWidget(m_infoWin, get_unique_id());
337 connect( m_infoWin, SIGNAL( Close() ), this, SLOT( infoClose() ) ); 337 connect( m_infoWin, SIGNAL( Close() ), this, SLOT( infoClose() ) );
338 338
339 m_graphicwin = new GraphicWin(editorStack); 339 m_graphicwin = new GraphicWin(editorStack);
340 editorStack->addWidget(m_graphicwin, get_unique_id()); 340 editorStack->addWidget(m_graphicwin, get_unique_id());
341 connect( m_graphicwin, SIGNAL( Closed() ), this, SLOT( infoClose() ) ); 341 connect( m_graphicwin, SIGNAL( Closed() ), this, SLOT( infoClose() ) );
342 342
343// bkmkselector = new QListBox(editorStack, "Bookmarks"); 343// bkmkselector = new QListBox(editorStack, "Bookmarks");
344 bkmkselector = new CBkmkSelector(editorStack, "Bookmarks"); 344 bkmkselector = new CBkmkSelector(editorStack, "Bookmarks");
345 // connect(bkmkselector, SIGNAL( selected(const QString&) ), this, SLOT( gotobkmk(const QString&) ) ); 345 // connect(bkmkselector, SIGNAL( selected(const QString&) ), this, SLOT( gotobkmk(const QString&) ) );
346 connect(bkmkselector, SIGNAL( selected(int) ), this, SLOT( gotobkmk(int) ) ); 346 connect(bkmkselector, SIGNAL( selected(int) ), this, SLOT( gotobkmk(int) ) );
347 connect(bkmkselector, SIGNAL( cancelled() ), this, SLOT( cancelbkmk() ) ); 347 connect(bkmkselector, SIGNAL( cancelled() ), this, SLOT( cancelbkmk() ) );
348 editorStack->addWidget( bkmkselector, get_unique_id() ); 348 editorStack->addWidget( bkmkselector, get_unique_id() );
349 349
350/* 350/*
351 importSelector = new FileSelector( "*", editorStack, "importselector", false ); 351 importSelector = new FileSelector( "*", editorStack, "importselector", false );
352 connect( importSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( importFile( const DocLnk & ) ) ); 352 connect( importSelector, SIGNAL( fileSelected(const DocLnk&) ), this, SLOT( importFile(const DocLnk&) ) );
353 353
354 editorStack->addWidget( importSelector, get_unique_id() ); 354 editorStack->addWidget( importSelector, get_unique_id() );
355 355
356 // don't need the close visible, it is redundant... 356 // don't need the close visible, it is redundant...
357 importSelector->setCloseVisible( FALSE ); 357 importSelector->setCloseVisible( FALSE );
358*/ 358*/
359// qDebug("Reading file list"); 359// qDebug("Reading file list");
360 readfilelist(); 360 readfilelist();
361 361
362 reader = new QTReader( editorStack ); 362 reader = new QTReader( editorStack );
363 363
364 reader->bDoUpdates = false; 364 reader->bDoUpdates = false;
365 365
366#ifdef USEQPE 366#ifdef USEQPE
367 ((QPEApplication*)qApp)->setStylusOperation(reader, QPEApplication::RightOnHold); 367 ((QPEApplication*)qApp)->setStylusOperation(reader, QPEApplication::RightOnHold);
368#endif 368#endif
369 369
370// qDebug("Reading config"); 370// qDebug("Reading config");
371// Config config( APPDIR ); 371// Config config( APPDIR );
372 config.setGroup( "View" ); 372 config.setGroup( "View" );
373 m_debounce = config.readNumEntry("Debounce", 0); 373 m_debounce = config.readNumEntry("Debounce", 0);
374#ifdef USEQPE 374#ifdef USEQPE
375 m_bFloatingDialog = config.readBoolEntry("FloatDialogs", false); 375 m_bFloatingDialog = config.readBoolEntry("FloatDialogs", false);
376#else 376#else
377 m_bFloatingDialog = config.readBoolEntry("FloatDialogs", true); 377 m_bFloatingDialog = config.readBoolEntry("FloatDialogs", true);
378#endif 378#endif
379 reader->bstripcr = config.readBoolEntry( "StripCr", true ); 379 reader->bstripcr = config.readBoolEntry( "StripCr", true );
380 reader->bfulljust = config.readBoolEntry( "FullJust", false ); 380 reader->bfulljust = config.readBoolEntry( "FullJust", false );
381 reader->setextraspace(config.readNumEntry( "ExtraSpace", 0 )); 381 reader->setextraspace(config.readNumEntry( "ExtraSpace", 0 ));
382 reader->setlead(config.readNumEntry( "ExtraLead", 0 )); 382 reader->setlead(config.readNumEntry( "ExtraLead", 0 ));
383 reader->btextfmt = config.readBoolEntry( "TextFmt", false ); 383 reader->btextfmt = config.readBoolEntry( "TextFmt", false );
384 reader->bautofmt = config.readBoolEntry( "AutoFmt", true ); 384 reader->bautofmt = config.readBoolEntry( "AutoFmt", true );
385 reader->bstriphtml = config.readBoolEntry( "StripHtml", false ); 385 reader->bstriphtml = config.readBoolEntry( "StripHtml", false );
386 reader->bpeanut = config.readBoolEntry( "Peanut", false ); 386 reader->bpeanut = config.readBoolEntry( "Peanut", false );
387 reader->bdehyphen = config.readBoolEntry( "Dehyphen", false ); 387 reader->bdehyphen = config.readBoolEntry( "Dehyphen", false );
388 reader->bdepluck = config.readBoolEntry( "Depluck", false ); 388 reader->bdepluck = config.readBoolEntry( "Depluck", false );
389 reader->bdejpluck = config.readBoolEntry( "Dejpluck", false ); 389 reader->bdejpluck = config.readBoolEntry( "Dejpluck", false );
390 reader->bonespace = config.readBoolEntry( "OneSpace", false ); 390 reader->bonespace = config.readBoolEntry( "OneSpace", false );
391 reader->bunindent = config.readBoolEntry( "Unindent", false ); 391 reader->bunindent = config.readBoolEntry( "Unindent", false );
392 reader->brepara = config.readBoolEntry( "Repara", false ); 392 reader->brepara = config.readBoolEntry( "Repara", false );
393 reader->bdblspce = config.readBoolEntry( "DoubleSpace", false ); 393 reader->bdblspce = config.readBoolEntry( "DoubleSpace", false );
394 reader->bindenter = config.readNumEntry( "Indent", 0 ); 394 reader->bindenter = config.readNumEntry( "Indent", 0 );
395 reader->m_textsize = config.readNumEntry( "FontSize", 12 ); 395 reader->m_textsize = config.readNumEntry( "FontSize", 12 );
396 reader->m_delay = config.readNumEntry( "ScrollDelay", 5184); 396 reader->m_delay = config.readNumEntry( "ScrollDelay", 5184);
397 reader->m_lastfile = config.readEntry( "LastFile", QString::null ); 397 reader->m_lastfile = config.readEntry( "LastFile", QString::null );
398 reader->m_lastposn = config.readNumEntry( "LastPosn", 0 ); 398 reader->m_lastposn = config.readNumEntry( "LastPosn", 0 );
399 reader->m_bpagemode = config.readBoolEntry( "PageMode", true ); 399 reader->m_bpagemode = config.readBoolEntry( "PageMode", true );
400 reader->m_bMonoSpaced = config.readBoolEntry( "MonoSpaced", false); 400 reader->m_bMonoSpaced = config.readBoolEntry( "MonoSpaced", false);
401 reader->m_swapmouse = config.readBoolEntry( "SwapMouse", false); 401 reader->m_swapmouse = config.readBoolEntry( "SwapMouse", false);
402 reader->m_fontname = config.readEntry( "Fontname", "helvetica" ); 402 reader->m_fontname = config.readEntry( "Fontname", "helvetica" );
403 reader->m_encd = config.readNumEntry( "Encoding", 0 ); 403 reader->m_encd = config.readNumEntry( "Encoding", 0 );
404 reader->m_charpc = config.readNumEntry( "CharSpacing", 100 ); 404 reader->m_charpc = config.readNumEntry( "CharSpacing", 100 );
405 reader->m_overlap = config.readNumEntry( "Overlap", 0 ); 405 reader->m_overlap = config.readNumEntry( "Overlap", 0 );
406 reader->m_border = config.readNumEntry( "Margin", 6 ); 406 reader->m_border = config.readNumEntry( "Margin", 6 );
407#ifdef REPALM 407#ifdef REPALM
408 reader->brepalm = config.readBoolEntry( "Repalm", true ); 408 reader->brepalm = config.readBoolEntry( "Repalm", true );
409#endif 409#endif
410 reader->bremap = config.readBoolEntry( "Remap", true ); 410 reader->bremap = config.readBoolEntry( "Remap", true );
411 reader->bmakebold = config.readBoolEntry( "MakeBold", false ); 411 reader->bmakebold = config.readBoolEntry( "MakeBold", false );
412 reader->setContinuous(config.readBoolEntry( "Continuous", true )); 412 reader->setContinuous(config.readBoolEntry( "Continuous", true ));
413 m_targetapp = config.readEntry( "TargetApp", QString::null ); 413 m_targetapp = config.readEntry( "TargetApp", QString::null );
414 m_targetmsg = config.readEntry( "TargetMsg", QString::null ); 414 m_targetmsg = config.readEntry( "TargetMsg", QString::null );
415#ifdef _SCROLLPIPE 415#ifdef _SCROLLPIPE
416 reader->m_pipetarget = config.readEntry( "PipeTarget", QString::null ); 416 reader->m_pipetarget = config.readEntry( "PipeTarget", QString::null );
417 reader->m_pauseAfterEachPara = config.readBoolEntry( "PauseAfterPara", true ); 417 reader->m_pauseAfterEachPara = config.readBoolEntry( "PauseAfterPara", true );
418#endif 418#endif
419 m_twoTouch = config.readBoolEntry( "TwoTouch", false); 419 m_twoTouch = config.readBoolEntry( "TwoTouch", false);
420 m_doAnnotation = config.readBoolEntry( "Annotation", false); 420 m_doAnnotation = config.readBoolEntry( "Annotation", false);
421 m_doDictionary = config.readBoolEntry( "Dictionary", false); 421 m_doDictionary = config.readBoolEntry( "Dictionary", false);
422 m_doClipboard = config.readBoolEntry( "Clipboard", false); 422 m_doClipboard = config.readBoolEntry( "Clipboard", false);
423 m_spaceTarget = (ActionTypes)config.readNumEntry("SpaceTarget", cesAutoScroll); 423 m_spaceTarget = (ActionTypes)config.readNumEntry("SpaceTarget", cesAutoScroll);
424 m_escapeTarget = (ActionTypes)config.readNumEntry("EscapeTarget", cesNone); 424 m_escapeTarget = (ActionTypes)config.readNumEntry("EscapeTarget", cesNone);
425 m_returnTarget = (ActionTypes)config.readNumEntry("ReturnTarget", cesFullScreen); 425 m_returnTarget = (ActionTypes)config.readNumEntry("ReturnTarget", cesFullScreen);
426 m_leftTarget = (ActionTypes)config.readNumEntry("LeftTarget", cesZoomOut); 426 m_leftTarget = (ActionTypes)config.readNumEntry("LeftTarget", cesZoomOut);
427 m_rightTarget = (ActionTypes)config.readNumEntry("RightTarget", cesZoomIn); 427 m_rightTarget = (ActionTypes)config.readNumEntry("RightTarget", cesZoomIn);
428 m_upTarget = (ActionTypes)config.readNumEntry("UpTarget", cesPageUp); 428 m_upTarget = (ActionTypes)config.readNumEntry("UpTarget", cesPageUp);
429 m_downTarget = (ActionTypes)config.readNumEntry("DownTarget", cesPageDown); 429 m_downTarget = (ActionTypes)config.readNumEntry("DownTarget", cesPageDown);
430 430
431 m_leftScroll = config.readBoolEntry("LeftScroll", false); 431 m_leftScroll = config.readBoolEntry("LeftScroll", false);
432 m_rightScroll = config.readBoolEntry("RightScroll", false); 432 m_rightScroll = config.readBoolEntry("RightScroll", false);
433 m_upScroll = config.readBoolEntry("UpScroll", true); 433 m_upScroll = config.readBoolEntry("UpScroll", true);
434 m_downScroll = config.readBoolEntry("DownScroll", true); 434 m_downScroll = config.readBoolEntry("DownScroll", true);
435 435
436 m_propogatefontchange = config.readBoolEntry( "RequestorFontChange", false); 436 m_propogatefontchange = config.readBoolEntry( "RequestorFontChange", false);
437 reader->setBaseSize(config.readNumEntry( "Basesize", 10 )); 437 reader->setBaseSize(config.readNumEntry( "Basesize", 10 ));
438 438
439#ifndef USEQPE 439#ifndef USEQPE
440 config.setGroup( "Geometry" ); 440 config.setGroup( "Geometry" );
441 setGeometry(0,0, 441 setGeometry(0,0,
442 config.readNumEntry( "width", QApplication::desktop()->width()/2 ), 442 config.readNumEntry( "width", QApplication::desktop()->width()/2 ),
443 config.readNumEntry( "height", QApplication::desktop()->height()/2 )); 443 config.readNumEntry( "height", QApplication::desktop()->height()/2 ));
444 move( 444 move(
445 config.readNumEntry( "x", 20 ), 445 config.readNumEntry( "x", 20 ),
446 config.readNumEntry( "y", 20 )); 446 config.readNumEntry( "y", 20 ));
447#endif 447#endif
448 448
449 449
450 450
451 setTwoTouch(m_twoTouch); 451 setTwoTouch(m_twoTouch);
452 452
453 connect( reader, SIGNAL( OnShowPicture(QImage&) ), this, SLOT( showgraphic(QImage&) ) ); 453 connect( reader, SIGNAL( OnShowPicture(QImage&) ), this, SLOT( showgraphic(QImage&) ) );
454 454
455 connect( reader, SIGNAL( OnRedraw() ), this, SLOT( OnRedraw() ) ); 455 connect( reader, SIGNAL( OnRedraw() ), this, SLOT( OnRedraw() ) );
456 connect( reader, SIGNAL( OnWordSelected(const QString&, size_t, const QString&) ), this, SLOT( OnWordSelected(const QString&, size_t, const QString&) ) ); 456 connect( reader, SIGNAL( OnWordSelected(const QString&,size_t,const QString&) ), this, SLOT( OnWordSelected(const QString&,size_t,const QString&) ) );
457 connect( reader, SIGNAL( OnURLSelected(const QString&) ), this, SLOT( OnURLSelected(const QString&) ) ); 457 connect( reader, SIGNAL( OnURLSelected(const QString&) ), this, SLOT( OnURLSelected(const QString&) ) );
458 editorStack->addWidget( reader, get_unique_id() ); 458 editorStack->addWidget( reader, get_unique_id() );
459 459
460 m_preferences_action = new QAction( tr( "Configuration" ), geticon( "SettingsIcon" ), QString::null, 0, this, NULL); 460 m_preferences_action = new QAction( tr( "Configuration" ), geticon( "SettingsIcon" ), QString::null, 0, this, NULL);
461 connect( m_preferences_action, SIGNAL( activated() ), this, SLOT( showprefs() ) ); 461 connect( m_preferences_action, SIGNAL( activated() ), this, SLOT( showprefs() ) );
462 m_preferences_action->addTo( settings ); 462 m_preferences_action->addTo( settings );
463 463
464 m_saveconfig_action = new QAction( tr( "Save Config" ), QString::null, 0, this, NULL); 464 m_saveconfig_action = new QAction( tr( "Save Config" ), QString::null, 0, this, NULL);
465 connect( m_saveconfig_action, SIGNAL( activated() ), this, SLOT( SaveConfig() ) ); 465 connect( m_saveconfig_action, SIGNAL( activated() ), this, SLOT( SaveConfig() ) );
466 m_saveconfig_action->addTo( settings ); 466 m_saveconfig_action->addTo( settings );
467 467
468 m_loadconfig_action = new QAction( tr( "Load Config" ), QString::null, 0, this, NULL); 468 m_loadconfig_action = new QAction( tr( "Load Config" ), QString::null, 0, this, NULL);
469 connect( m_loadconfig_action, SIGNAL( activated() ), this, SLOT( LoadConfig() ) ); 469 connect( m_loadconfig_action, SIGNAL( activated() ), this, SLOT( LoadConfig() ) );
470 m_loadconfig_action->addTo( settings ); 470 m_loadconfig_action->addTo( settings );
471 471
472 m_tidyconfig_action = new QAction( tr( "Delete Config" ), QString::null, 0, this, NULL); 472 m_tidyconfig_action = new QAction( tr( "Delete Config" ), QString::null, 0, this, NULL);
473 connect( m_tidyconfig_action, SIGNAL( activated() ), this, SLOT( TidyConfig() ) ); 473 connect( m_tidyconfig_action, SIGNAL( activated() ), this, SLOT( TidyConfig() ) );
474 m_tidyconfig_action->addTo( settings ); 474 m_tidyconfig_action->addTo( settings );
475 475
476 settings->insertSeparator(); 476 settings->insertSeparator();
477 m_toolbarprefs_action = new QAction( tr( "Toolbars" ), QString::null, 0, this, NULL); 477 m_toolbarprefs_action = new QAction( tr( "Toolbars" ), QString::null, 0, this, NULL);
478 connect( m_toolbarprefs_action, SIGNAL( activated() ), this, SLOT( showtoolbarprefs() ) ); 478 connect( m_toolbarprefs_action, SIGNAL( activated() ), this, SLOT( showtoolbarprefs() ) );
479 m_toolbarprefs_action->addTo( settings ); 479 m_toolbarprefs_action->addTo( settings );
480 480
481 m_open_action = new QAction( tr( "Open" ), geticon( "fileopen" ), QString::null, 0, this, 0 ); 481 m_open_action = new QAction( tr( "Open" ), geticon( "fileopen" ), QString::null, 0, this, 0 );
482 connect( m_open_action, SIGNAL( activated() ), this, SLOT( fileOpen() ) ); 482 connect( m_open_action, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
483 m_open_action->addTo( file ); 483 m_open_action->addTo( file );
484 484
485 m_close_action = new QAction( tr( "Close" ), geticon( "close" ), QString::null, 0, this, 0 ); 485 m_close_action = new QAction( tr( "Close" ), geticon( "close" ), QString::null, 0, this, 0 );
486 connect( m_close_action, SIGNAL( activated() ), this, SLOT( fileClose() ) ); 486 connect( m_close_action, SIGNAL( activated() ), this, SLOT( fileClose() ) );
487 m_close_action->addTo( file ); 487 m_close_action->addTo( file );
488 488
489#ifdef _SCRIPT 489#ifdef _SCRIPT
490 a = new QAction( tr( "Run Script" ), QString::null, 0, this, NULL); 490 a = new QAction( tr( "Run Script" ), QString::null, 0, this, NULL);
491 connect( a, SIGNAL( activated() ), this, SLOT( RunScript() ) ); 491 connect( a, SIGNAL( activated() ), this, SLOT( RunScript() ) );
492 a->addTo( file ); 492 a->addTo( file );
493#endif 493#endif
494 /* 494 /*
495 a = new QAction( tr( "Revert" ), geticon( "close" ), QString::null, 0, this, 0 ); 495 a = new QAction( tr( "Revert" ), geticon( "close" ), QString::null, 0, this, 0 );
496 connect( a, SIGNAL( activated() ), this, SLOT( fileRevert() ) ); 496 connect( a, SIGNAL( activated() ), this, SLOT( fileRevert() ) );
497 a->addTo( file ); 497 a->addTo( file );
498 498
499 a = new QAction( tr( "Cut" ), geticon( "cut" ), QString::null, 0, this, 0 ); 499 a = new QAction( tr( "Cut" ), geticon( "cut" ), QString::null, 0, this, 0 );
500 connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) ); 500 connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
501 a->addTo( filebar() ); 501 a->addTo( filebar() );
502 a->addTo( edit ); 502 a->addTo( edit );
503 */ 503 */
504 504
505 m_info_action = new QAction( tr( "Info" ), geticon( "UtilsIcon" ), QString::null, 0, this, NULL); 505 m_info_action = new QAction( tr( "Info" ), geticon( "UtilsIcon" ), QString::null, 0, this, NULL);
506 connect( m_info_action, SIGNAL( activated() ), this, SLOT( showinfo() ) ); 506 connect( m_info_action, SIGNAL( activated() ), this, SLOT( showinfo() ) );
507 m_info_action->addTo( file ); 507 m_info_action->addTo( file );
508 508
509 m_touch_action = new QAction( tr( "Two/One Touch" ), geticon( "1to1" ), QString::null, 0, this, NULL, true ); 509 m_touch_action = new QAction( tr( "Two/One Touch" ), geticon( "1to1" ), QString::null, 0, this, NULL, true );
510 connect( m_touch_action, SIGNAL( toggled(bool) ), this, SLOT( setTwoTouch(bool) ) ); 510 connect( m_touch_action, SIGNAL( toggled(bool) ), this, SLOT( setTwoTouch(bool) ) );
511 m_touch_action->setOn(m_twoTouch); 511 m_touch_action->setOn(m_twoTouch);
512 m_touch_action->addTo( file ); 512 m_touch_action->addTo( file );
513 513
514 m_find_action = new QAction( tr( "Find..." ), geticon( "find" ), QString::null, 0, this, NULL); 514 m_find_action = new QAction( tr( "Find..." ), geticon( "find" ), QString::null, 0, this, NULL);
515 connect( m_find_action, SIGNAL( activated() ), this, SLOT( editFind() ) ); 515 connect( m_find_action, SIGNAL( activated() ), this, SLOT( editFind() ) );
516 file->insertSeparator(); 516 file->insertSeparator();
517// a->addTo( bar ); 517// a->addTo( bar );
518 m_find_action->addTo( file ); 518 m_find_action->addTo( file );
519 519
520 m_exportlinks_action = new QAction( tr( "Export Links" ), QString::null, 0, this, NULL); 520 m_exportlinks_action = new QAction( tr( "Export Links" ), QString::null, 0, this, NULL);
521 connect( m_exportlinks_action, SIGNAL( activated() ), this, SLOT( ExportLinks() ) ); 521 connect( m_exportlinks_action, SIGNAL( activated() ), this, SLOT( ExportLinks() ) );
522 m_exportlinks_action->addTo( file ); 522 m_exportlinks_action->addTo( file );
523 523
524 m_scrollButton = new QAction( tr( "Scroll" ), getmyicon( "panel-arrow-down" ), QString::null, 0, this, 0, true ); 524 m_scrollButton = new QAction( tr( "Scroll" ), getmyicon( "panel-arrow-down" ), QString::null, 0, this, 0, true );
525 connect( m_scrollButton, SIGNAL( toggled(bool) ), this, SLOT( autoScroll(bool) ) ); 525 connect( m_scrollButton, SIGNAL( toggled(bool) ), this, SLOT( autoScroll(bool) ) );
526 m_scrollButton->addTo(navigation); 526 m_scrollButton->addTo(navigation);
527 m_scrollButton->setOn(false); 527 m_scrollButton->setOn(false);
528 528
529 m_start_action = new QAction( tr( "Goto Start" ), geticon( "start" ), QString::null, 0, this, NULL); 529 m_start_action = new QAction( tr( "Goto Start" ), geticon( "start" ), QString::null, 0, this, NULL);
530 connect( m_start_action, SIGNAL( activated() ), this, SLOT( gotoStart() ) ); 530 connect( m_start_action, SIGNAL( activated() ), this, SLOT( gotoStart() ) );
531 m_start_action->addTo(navigation); 531 m_start_action->addTo(navigation);
532 532
533 m_end_action = new QAction( tr( "Goto End" ), geticon( "finish" ), QString::null, 0, this, NULL); 533 m_end_action = new QAction( tr( "Goto End" ), geticon( "finish" ), QString::null, 0, this, NULL);
534 connect( m_end_action, SIGNAL( activated() ), this, SLOT( gotoEnd() ) ); 534 connect( m_end_action, SIGNAL( activated() ), this, SLOT( gotoEnd() ) );
535 m_end_action->addTo(navigation); 535 m_end_action->addTo(navigation);
536 536
537 m_jump_action = new QAction( tr( "Jump" ), geticon( "rotate" ), QString::null, 0, this, NULL); 537 m_jump_action = new QAction( tr( "Jump" ), geticon( "rotate" ), QString::null, 0, this, NULL);
538 connect( m_jump_action, SIGNAL( activated() ), this, SLOT( jump() ) ); 538 connect( m_jump_action, SIGNAL( activated() ), this, SLOT( jump() ) );
539 m_jump_action->addTo(navigation); 539 m_jump_action->addTo(navigation);
540 540
541 m_pageline_action = new QAction( tr( "Page/Line Scroll" ), geticon( "pass" ), QString::null, 0, this, NULL, true ); 541 m_pageline_action = new QAction( tr( "Page/Line Scroll" ), geticon( "pass" ), QString::null, 0, this, NULL, true );
542 connect( m_pageline_action, SIGNAL( toggled(bool) ), this, SLOT( pagemode(bool) ) ); 542 connect( m_pageline_action, SIGNAL( toggled(bool) ), this, SLOT( pagemode(bool) ) );
543 m_pageline_action->addTo(navigation); 543 m_pageline_action->addTo(navigation);
544 m_pageline_action->setOn(reader->m_bpagemode); 544 m_pageline_action->setOn(reader->m_bpagemode);
545 545
546 m_pageup_action = new QAction( tr( "Up" ), geticon( "up" ), QString::null, 0, this, 0 ); 546 m_pageup_action = new QAction( tr( "Up" ), geticon( "up" ), QString::null, 0, this, 0 );
547 connect( m_pageup_action, SIGNAL( activated() ), this, SLOT( pageup() ) ); 547 connect( m_pageup_action, SIGNAL( activated() ), this, SLOT( pageup() ) );
548 m_pageup_action->addTo( navigation ); 548 m_pageup_action->addTo( navigation );
549 549
550 m_pagedn_action = new QAction( tr( "Down" ), geticon( "down" ), QString::null, 0, this, 0 ); 550 m_pagedn_action = new QAction( tr( "Down" ), geticon( "down" ), QString::null, 0, this, 0 );
551 connect( m_pagedn_action, SIGNAL( activated() ), this, SLOT( pagedn() ) ); 551 connect( m_pagedn_action, SIGNAL( activated() ), this, SLOT( pagedn() ) );
552 m_pagedn_action->addTo( navigation ); 552 m_pagedn_action->addTo( navigation );
553 553
554 m_back_action = new QAction( tr( "Back" ), geticon( "back" ), QString::null, 0, this, 0 ); 554 m_back_action = new QAction( tr( "Back" ), geticon( "back" ), QString::null, 0, this, 0 );
555 connect( m_back_action, SIGNAL( activated() ), reader, SLOT( goBack() ) ); 555 connect( m_back_action, SIGNAL( activated() ), reader, SLOT( goBack() ) );
556 m_back_action->addTo( navigation ); 556 m_back_action->addTo( navigation );
557 557
558 m_home_action = new QAction( tr( "Home" ), geticon( "home" ), QString::null, 0, this, 0 ); 558 m_home_action = new QAction( tr( "Home" ), geticon( "home" ), QString::null, 0, this, 0 );
559 connect( m_home_action, SIGNAL( activated() ), reader, SLOT( goHome() ) ); 559 connect( m_home_action, SIGNAL( activated() ), reader, SLOT( goHome() ) );
560 m_home_action->addTo( navigation ); 560 m_home_action->addTo( navigation );
561 561
562 m_forward_action = new QAction( tr( "Forward" ), geticon( "forward" ), QString::null, 0, this, 0 ); 562 m_forward_action = new QAction( tr( "Forward" ), geticon( "forward" ), QString::null, 0, this, 0 );
563 connect( m_forward_action, SIGNAL( activated() ), reader, SLOT( goForward() ) ); 563 connect( m_forward_action, SIGNAL( activated() ), reader, SLOT( goForward() ) );
564 m_forward_action->addTo( navigation ); 564 m_forward_action->addTo( navigation );
565 565
566 /* 566 /*
567 a = new QAction( tr( "Find" ), QString::null, 0, this, NULL, true ); 567 a = new QAction( tr( "Find" ), QString::null, 0, this, NULL, true );
568 // connect( a, SIGNAL( activated() ), this, SLOT( pagedn() ) ); 568 // connect( a, SIGNAL( activated() ), this, SLOT( pagedn() ) );
569 a->addTo( file ); 569 a->addTo( file );
570 570
571 a = new QAction( tr( "Find Again" ), QString::null, 0, this, NULL, true ); 571 a = new QAction( tr( "Find Again" ), QString::null, 0, this, NULL, true );
572 // connect( a, SIGNAL( activated() ), this, SLOT( pagedn() ) ); 572 // connect( a, SIGNAL( activated() ), this, SLOT( pagedn() ) );
573 a->addTo( file ); 573 a->addTo( file );
574 */ 574 */
575 575
576// file->insertSeparator(); 576// file->insertSeparator();
577 577
578#ifdef _SCROLLPIPE 578#ifdef _SCROLLPIPE
579 579
580 QActionGroup* ag = new QActionGroup(this); 580 QActionGroup* ag = new QActionGroup(this);
581 ag->setExclusive(false); 581 ag->setExclusive(false);
582 spacemenu = new QPopupMenu(this); 582 spacemenu = new QPopupMenu(this);
583 file->insertItem( tr( "Scrolling" ), spacemenu ); 583 file->insertItem( tr( "Scrolling" ), spacemenu );
584 584
585 a = new QAction( tr( "Set Target" ), QString::null, 0, ag, NULL); 585 a = new QAction( tr( "Set Target" ), QString::null, 0, ag, NULL);
586 connect( a, SIGNAL( activated() ), this, SLOT( setpipetarget() ) ); 586 connect( a, SIGNAL( activated() ), this, SLOT( setpipetarget() ) );
587 587
588 a = new QAction( tr( "Pause Paras" ), QString::null, 0, ag, NULL, true ); 588 a = new QAction( tr( "Pause Paras" ), QString::null, 0, ag, NULL, true );
589 connect( a, SIGNAL( toggled(bool) ), this, SLOT( setpause(bool) ) ); 589 connect( a, SIGNAL( toggled(bool) ), this, SLOT( setpause(bool) ) );
590 a->setOn(reader->m_pauseAfterEachPara); 590 a->setOn(reader->m_pauseAfterEachPara);
591 591
592 ag->addTo(spacemenu); 592 ag->addTo(spacemenu);
593// file->insertSeparator(); 593// file->insertSeparator();
594 594
595#endif 595#endif
596 596
597/* 597/*
598 a = new QAction( tr( "Import" ), QString::null, 0, this, NULL ); 598 a = new QAction( tr( "Import" ), QString::null, 0, this, NULL );
599 connect( a, SIGNAL( activated() ), this, SLOT( importFiles() ) ); 599 connect( a, SIGNAL( activated() ), this, SLOT( importFiles() ) );
600 a->addTo( file ); 600 a->addTo( file );
601*/ 601*/
602 602
603 /* 603 /*
604 a = new QAction( tr( "Paste" ), geticon( "paste" ), QString::null, 0, this, 0 ); 604 a = new QAction( tr( "Paste" ), geticon( "paste" ), QString::null, 0, this, 0 );
605 connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) ); 605 connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) );
606 a->addTo( fileBar ); 606 a->addTo( fileBar );
607 a->addTo( edit ); 607 a->addTo( edit );
608 */ 608 */
609 609
610// a = new QAction( tr( "Find..." ), geticon( "find" ), QString::null, 0, this, 0 ); 610// a = new QAction( tr( "Find..." ), geticon( "find" ), QString::null, 0, this, 0 );
611 611
612 m_fullscreen = false; 612 m_fullscreen = false;
613 m_actFullscreen = new QAction( tr( "Fullscreen" ), geticon( "fullscreen" ), QString::null, 0, this, NULL, true ); 613 m_actFullscreen = new QAction( tr( "Fullscreen" ), geticon( "fullscreen" ), QString::null, 0, this, NULL, true );
614 connect( m_actFullscreen, SIGNAL( toggled(bool) ), this, SLOT( setfullscreen(bool) ) ); 614 connect( m_actFullscreen, SIGNAL( toggled(bool) ), this, SLOT( setfullscreen(bool) ) );
615 m_actFullscreen->setOn(m_fullscreen); 615 m_actFullscreen->setOn(m_fullscreen);
616 m_actFullscreen->addTo( view ); 616 m_actFullscreen->addTo( view );
617 617
618 view->insertSeparator(); 618 view->insertSeparator();
619 619
620 m_zoomin_action = new QAction( tr( "Zoom In" ), geticon( "zoom" ), QString::null, 0, this); 620 m_zoomin_action = new QAction( tr( "Zoom In" ), geticon( "zoom" ), QString::null, 0, this);
621 connect( m_zoomin_action, SIGNAL( activated() ), this, SLOT( zoomin() ) ); 621 connect( m_zoomin_action, SIGNAL( activated() ), this, SLOT( zoomin() ) );
622 m_zoomin_action->addTo( view ); 622 m_zoomin_action->addTo( view );
623 623
624 m_zoomout_action = new QAction( tr( "Zoom Out" ), geticon( "mag" ), QString::null, 0, this); 624 m_zoomout_action = new QAction( tr( "Zoom Out" ), geticon( "mag" ), QString::null, 0, this);
625 connect( m_zoomout_action, SIGNAL( activated() ), this, SLOT( zoomout() ) ); 625 connect( m_zoomout_action, SIGNAL( activated() ), this, SLOT( zoomout() ) );
626 m_zoomout_action->addTo( view ); 626 m_zoomout_action->addTo( view );
627 627
628 view->insertSeparator(); 628 view->insertSeparator();
629 m_setfont_action = new QAction( tr( "Set Font" ), getmyicon( "font" ), QString::null, 0, this); 629 m_setfont_action = new QAction( tr( "Set Font" ), getmyicon( "font" ), QString::null, 0, this);
630 connect( m_setfont_action, SIGNAL( activated() ), this, SLOT( setfont() ) ); 630 connect( m_setfont_action, SIGNAL( activated() ), this, SLOT( setfont() ) );
631 m_setfont_action->addTo( view ); 631 m_setfont_action->addTo( view );
632 632
633 view->insertSeparator(); 633 view->insertSeparator();
634 m_setenc_action = new QAction( tr( "Set Encoding" ), getmyicon( "charset" ), QString::null, 0, this); 634 m_setenc_action = new QAction( tr( "Set Encoding" ), getmyicon( "charset" ), QString::null, 0, this);
635 connect( m_setenc_action, SIGNAL( activated() ), this, SLOT( chooseencoding() ) ); 635 connect( m_setenc_action, SIGNAL( activated() ), this, SLOT( chooseencoding() ) );
636 m_setenc_action->addTo( view ); 636 m_setenc_action->addTo( view );
637 637
638 m_setmono_action = new QAction( tr( "Ideogram" ), getmyicon( "ideogram" ), QString::null, 0, this, NULL, true); 638 m_setmono_action = new QAction( tr( "Ideogram" ), getmyicon( "ideogram" ), QString::null, 0, this, NULL, true);
639 connect( m_setmono_action, SIGNAL( toggled(bool) ), this, SLOT( monospace(bool) ) ); 639 connect( m_setmono_action, SIGNAL( toggled(bool) ), this, SLOT( monospace(bool) ) );
640 m_setmono_action->addTo( view ); 640 m_setmono_action->addTo( view );
641 m_setmono_action->setOn(reader->m_bMonoSpaced); 641 m_setmono_action->setOn(reader->m_bMonoSpaced);
642 642
643 643
644 // a = new QAction( tr( "Zoom" ), QString::null, 0, this, NULL, true ); 644 // a = new QAction( tr( "Zoom" ), QString::null, 0, this, NULL, true );
645 // a = new QAction( tr( "Zoom" ), geticon( "mag" ), QString::null, 0, this, 0 ); 645 // a = new QAction( tr( "Zoom" ), geticon( "mag" ), QString::null, 0, this, 0 );
646 646
647 647
648 648
649 // a->addTo( filebar() ); 649 // a->addTo( filebar() );
650// view->insertSeparator(); 650// view->insertSeparator();
651 651
652/* 652/*
653 a = new QAction( tr( "Ideogram/Word" ), QString::null, 0, this, NULL, true ); 653 a = new QAction( tr( "Ideogram/Word" ), QString::null, 0, this, NULL, true );
654 connect( a, SIGNAL( toggled(bool) ), this, SLOT( monospace(bool) ) ); 654 connect( a, SIGNAL( toggled(bool) ), this, SLOT( monospace(bool) ) );
655 a->setOn(reader->m_bMonoSpaced); 655 a->setOn(reader->m_bMonoSpaced);
656 a->addTo( view ); 656 a->addTo( view );
657*/ 657*/
658/* 658/*
659 a = new QAction( tr( "Set Width" ), QString::null, 0, this, NULL); 659 a = new QAction( tr( "Set Width" ), QString::null, 0, this, NULL);
660 connect( a, SIGNAL( activated() ), this, SLOT( setspacing() ) ); 660 connect( a, SIGNAL( activated() ), this, SLOT( setspacing() ) );
661 a->addTo( view ); 661 a->addTo( view );
662*/ 662*/
663 663
664 m_mark_action = new QAction( tr( "Bookmark" ), getmyicon( "bookmark" ), QString::null, 0, this, NULL); 664 m_mark_action = new QAction( tr( "Bookmark" ), getmyicon( "bookmark" ), QString::null, 0, this, NULL);
665 connect( m_mark_action, SIGNAL( activated() ), this, SLOT( addbkmk() ) ); 665 connect( m_mark_action, SIGNAL( activated() ), this, SLOT( addbkmk() ) );
666 m_mark_action->addTo( marks ); 666 m_mark_action->addTo( marks );
667 667
668 m_annotate_action = new QAction( tr( "Annotate" ), getmyicon( "annotate" ), QString::null, 0, this, NULL); 668 m_annotate_action = new QAction( tr( "Annotate" ), getmyicon( "annotate" ), QString::null, 0, this, NULL);
669 connect( m_annotate_action, SIGNAL( activated() ), this, SLOT( addanno() ) ); 669 connect( m_annotate_action, SIGNAL( activated() ), this, SLOT( addanno() ) );
670 m_annotate_action->addTo( marks ); 670 m_annotate_action->addTo( marks );
671 671
672 m_goto_action = new QAction( tr( "Goto" ), getmyicon( "bookmark_goto" ), QString::null, 0, this, NULL, false ); 672 m_goto_action = new QAction( tr( "Goto" ), getmyicon( "bookmark_goto" ), QString::null, 0, this, NULL, false );
673 connect( m_goto_action, SIGNAL( activated() ), this, SLOT( do_gotomark() ) ); 673 connect( m_goto_action, SIGNAL( activated() ), this, SLOT( do_gotomark() ) );
674 m_goto_action->addTo( marks ); 674 m_goto_action->addTo( marks );
675 675
676 m_delete_action = new QAction( tr( "Delete" ), getmyicon( "bookmark_delete" ), QString::null, 0, this, NULL); 676 m_delete_action = new QAction( tr( "Delete" ), getmyicon( "bookmark_delete" ), QString::null, 0, this, NULL);
677 connect( m_delete_action, SIGNAL( activated() ), this, SLOT( do_delmark() ) ); 677 connect( m_delete_action, SIGNAL( activated() ), this, SLOT( do_delmark() ) );
678 m_delete_action->addTo( marks ); 678 m_delete_action->addTo( marks );
679 679
680 m_autogen_action = new QAction( tr( "Autogen" ), geticon( "exec" ), QString::null, 0, this, NULL, false ); 680 m_autogen_action = new QAction( tr( "Autogen" ), geticon( "exec" ), QString::null, 0, this, NULL, false );
681 connect( m_autogen_action, SIGNAL( activated() ), this, SLOT( do_autogen() ) ); 681 connect( m_autogen_action, SIGNAL( activated() ), this, SLOT( do_autogen() ) );
682 marks->insertSeparator(); 682 marks->insertSeparator();
683 m_autogen_action->addTo( marks ); 683 m_autogen_action->addTo( marks );
684 684
685 m_clear_action = new QAction( tr( "Clear" ), getmyicon( "bookmark_clear" ), QString::null, 0, this, NULL); 685 m_clear_action = new QAction( tr( "Clear" ), getmyicon( "bookmark_clear" ), QString::null, 0, this, NULL);
686 connect( m_clear_action, SIGNAL( activated() ), this, SLOT( clearBkmkList() ) ); 686 connect( m_clear_action, SIGNAL( activated() ), this, SLOT( clearBkmkList() ) );
687 m_clear_action->addTo( marks ); 687 m_clear_action->addTo( marks );
688 688
689 m_save_action = new QAction( tr( "Save" ), getmyicon( "bookmark_save" ), QString::null, 0, this, NULL ); 689 m_save_action = new QAction( tr( "Save" ), getmyicon( "bookmark_save" ), QString::null, 0, this, NULL );
690 connect( m_save_action, SIGNAL( activated() ), this, SLOT( savebkmks() ) ); 690 connect( m_save_action, SIGNAL( activated() ), this, SLOT( savebkmks() ) );
691 m_save_action->addTo( marks ); 691 m_save_action->addTo( marks );
692 692
693 m_tidy_action = new QAction( tr( "Tidy" ), getmyicon( "bookmark_tidy" ), QString::null, 0, this, NULL); 693 m_tidy_action = new QAction( tr( "Tidy" ), getmyicon( "bookmark_tidy" ), QString::null, 0, this, NULL);
694 connect( m_tidy_action, SIGNAL( activated() ), this, SLOT( listBkmkFiles() ) ); 694 connect( m_tidy_action, SIGNAL( activated() ), this, SLOT( listBkmkFiles() ) );
695 marks->insertSeparator(); 695 marks->insertSeparator();
696 m_tidy_action->addTo( marks ); 696 m_tidy_action->addTo( marks );
697 697
698 m_startBlock_action = new QAction( tr( "Start Block" ), geticon( "new" ), QString::null, 0, this, NULL); 698 m_startBlock_action = new QAction( tr( "Start Block" ), geticon( "new" ), QString::null, 0, this, NULL);
699 connect( m_startBlock_action, SIGNAL( activated() ), this, SLOT( editMark() ) ); 699 connect( m_startBlock_action, SIGNAL( activated() ), this, SLOT( editMark() ) );
700 marks->insertSeparator(); 700 marks->insertSeparator();
701 m_startBlock_action->addTo( marks ); 701 m_startBlock_action->addTo( marks );
702 702
703 m_endBlock_action = new QAction( tr( "Copy Block" ), geticon( "copy" ), QString::null, 0, this, NULL); 703 m_endBlock_action = new QAction( tr( "Copy Block" ), geticon( "copy" ), QString::null, 0, this, NULL);
704 connect( m_endBlock_action, SIGNAL( activated() ), this, SLOT( editCopy() ) ); 704 connect( m_endBlock_action, SIGNAL( activated() ), this, SLOT( editCopy() ) );
705 m_endBlock_action->addTo( marks ); 705 m_endBlock_action->addTo( marks );
706 706
707 m_bkmkAvail = NULL; 707 m_bkmkAvail = NULL;
708 708
709 709
710 setToolBarsMovable(m_tbmove); 710 setToolBarsMovable(m_tbmove);
711 addtoolbars(&config); 711 addtoolbars(&config);
712 712
713 pbar = new QProgressBar(this); 713 pbar = new QProgressBar(this);
714 pbar->hide(); 714 pbar->hide();
715 715
716 searchBar = new QFloatBar( "Search", this, QMainWindow::Top, TRUE ); 716 searchBar = new QFloatBar( "Search", this, QMainWindow::Top, TRUE );
717 717
718 searchBar->setHorizontalStretchable( TRUE ); 718 searchBar->setHorizontalStretchable( TRUE );
719 719
720 connect(searchBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() )); 720 connect(searchBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() ));
721 721
722 searchEdit = new QLineEdit( searchBar, "searchEdit" ); 722 searchEdit = new QLineEdit( searchBar, "searchEdit" );
723// QFont f("unifont", 16 /*, QFont::Bold*/); 723// QFont f("unifont", 16 /*, QFont::Bold*/);
724// searchEdit->setFont( f ); 724// searchEdit->setFont( f );
725 searchBar->setStretchableWidget( searchEdit ); 725 searchBar->setStretchableWidget( searchEdit );
726 726
727 727
728#ifdef __ISEARCH 728#ifdef __ISEARCH
729 connect( searchEdit, SIGNAL( textChanged( const QString & ) ), 729 connect( searchEdit, SIGNAL( textChanged(const QString&) ),
730 this, SLOT( search( const QString& ) ) ); 730 this, SLOT( search(const QString&) ) );
731#else 731#else
732 connect( searchEdit, SIGNAL( returnPressed( ) ), 732 connect( searchEdit, SIGNAL( returnPressed() ),
733 this, SLOT( search( ) ) ); 733 this, SLOT( search() ) );
734#endif 734#endif
735 QAction*a = new QAction( tr( "Find Next" ), geticon( "next" ), QString::null, 0, this, 0 ); 735 QAction*a = new QAction( tr( "Find Next" ), geticon( "next" ), QString::null, 0, this, 0 );
736 connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) ); 736 connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) );
737 a->addTo( searchBar ); 737 a->addTo( searchBar );
738 738
739 a = new QAction( tr( "Close Find" ), geticon( "close" ), QString::null, 0, this, 0 ); 739 a = new QAction( tr( "Close Find" ), geticon( "close" ), QString::null, 0, this, 0 );
740 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); 740 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
741 a->addTo( searchBar ); 741 a->addTo( searchBar );
742 742
743 searchBar->hide(); 743 searchBar->hide();
744 744
745 regBar = new QFloatBar( "Autogen", this, QMainWindow::Top, TRUE ); 745 regBar = new QFloatBar( "Autogen", this, QMainWindow::Top, TRUE );
746 connect(regBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() )); 746 connect(regBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() ));
747 747
748 regBar->setHorizontalStretchable( TRUE ); 748 regBar->setHorizontalStretchable( TRUE );
749 749
750 regEdit = new QLineEdit( regBar, "regEdit" ); 750 regEdit = new QLineEdit( regBar, "regEdit" );
751// regEdit->setFont( f ); 751// regEdit->setFont( f );
752 752
753 regBar->setStretchableWidget( regEdit ); 753 regBar->setStretchableWidget( regEdit );
754 754
755 connect( regEdit, SIGNAL( returnPressed( ) ), 755 connect( regEdit, SIGNAL( returnPressed() ),
756 this, SLOT( do_regaction() ) ); 756 this, SLOT( do_regaction() ) );
757 757
758 a = new QAction( tr( "Do Reg" ), geticon( "enter" ), QString::null, 0, this, 0 ); 758 a = new QAction( tr( "Do Reg" ), geticon( "enter" ), QString::null, 0, this, 0 );
759 connect( a, SIGNAL( activated() ), this, SLOT( do_regaction() ) ); 759 connect( a, SIGNAL( activated() ), this, SLOT( do_regaction() ) );
760 a->addTo( regBar ); 760 a->addTo( regBar );
761 761
762 a = new QAction( tr( "Close Edit" ), geticon( "close" ), QString::null, 0, this, 0 ); 762 a = new QAction( tr( "Close Edit" ), geticon( "close" ), QString::null, 0, this, 0 );
763 connect( a, SIGNAL( activated() ), this, SLOT( regClose() ) ); 763 connect( a, SIGNAL( activated() ), this, SLOT( regClose() ) );
764 a->addTo( regBar ); 764 a->addTo( regBar );
765 765
766 regBar->hide(); 766 regBar->hide();
767 767
768 m_fontBar = new QToolBar( "Autogen", this, QMainWindow::Top, TRUE ); 768 m_fontBar = new QToolBar( "Autogen", this, QMainWindow::Top, TRUE );
769 769
770 m_fontBar->setHorizontalStretchable( TRUE ); 770 m_fontBar->setHorizontalStretchable( TRUE );
771 771
772// qDebug("Font selector"); 772// qDebug("Font selector");
773 m_fontSelector = new QComboBox(false, m_fontBar); 773 m_fontSelector = new QComboBox(false, m_fontBar);
774 m_fontBar->setStretchableWidget( m_fontSelector ); 774 m_fontBar->setStretchableWidget( m_fontSelector );
775 { 775 {
776#ifndef USEQPE 776#ifndef USEQPE
777 QFontDatabase f; 777 QFontDatabase f;
778#else 778#else
779 FontDatabase f; 779 FontDatabase f;
780#endif 780#endif
781 QStringList flist = f.families(); 781 QStringList flist = f.families();
782 bool realfont = false; 782 bool realfont = false;
783 for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++) 783 for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++)
784 { 784 {
785 if (reader->m_fontname == *nm) 785 if (reader->m_fontname == *nm)
786 { 786 {
787 realfont = true; 787 realfont = true;
788 } 788 }
789 if ((*nm).contains(FIXEDFONT,false)) reader->m_fontControl.hasCourier(true, *nm); 789 if ((*nm).contains(FIXEDFONT,false)) reader->m_fontControl.hasCourier(true, *nm);
790 } 790 }
791 if (!realfont) reader->m_fontname = flist[0]; 791 if (!realfont) reader->m_fontname = flist[0];
792 } // delete the FontDatabase!!! 792 } // delete the FontDatabase!!!
793 connect( m_fontSelector, SIGNAL( activated(const QString& ) ), 793 connect( m_fontSelector, SIGNAL( activated(const QString&) ),
794 this, SLOT( do_setfont(const QString&) ) ); 794 this, SLOT( do_setfont(const QString&) ) );
795 connect( m_fontSelector, SIGNAL( activated(int ) ), 795 connect( m_fontSelector, SIGNAL( activated(int) ),
796 this, SLOT( do_setencoding(int) ) ); 796 this, SLOT( do_setencoding(int) ) );
797 797
798 m_fontBar->hide(); 798 m_fontBar->hide();
799 m_fontVisible = false; 799 m_fontVisible = false;
800#ifdef USEMSGS 800#ifdef USEMSGS
801 connect(qApp, SIGNAL( appMessage(const QCString&, const QByteArray& ) ), 801 connect(qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ),
802 this, SLOT( msgHandler(const QCString&, const QByteArray&) ) ); 802 this, SLOT( msgHandler(const QCString&,const QByteArray&) ) );
803#endif 803#endif
804// qDebug("Initing"); 804// qDebug("Initing");
805 reader->init(); 805 reader->init();
806// qDebug("Inited"); 806// qDebug("Inited");
807// m_buttonAction[m_spaceTarget]->setOn(true); 807// m_buttonAction[m_spaceTarget]->setOn(true);
808// qDebug("fonting"); 808// qDebug("fonting");
809 do_setfont(reader->m_fontname); 809 do_setfont(reader->m_fontname);
810 if (!reader->m_lastfile.isEmpty()) 810 if (!reader->m_lastfile.isEmpty())
811 { 811 {
812 //qDebug("doclnk"); 812 //qDebug("doclnk");
813 //doc = new DocLnk(reader->m_lastfile); 813 //doc = new DocLnk(reader->m_lastfile);
814 //qDebug("doclnk done"); 814 //qDebug("doclnk done");
815 if (pOpenlist != NULL) 815 if (pOpenlist != NULL)
816 { 816 {
817 817
818/* 818/*
819 int ind = 0; 819 int ind = 0;
820 Bkmk* p = (*pOpenlist)[ind]; 820 Bkmk* p = (*pOpenlist)[ind];
821 while (p != NULL && toQString(CFiledata(p->anno()).name()) != reader->m_lastfile) 821 while (p != NULL && toQString(CFiledata(p->anno()).name()) != reader->m_lastfile)
822 { 822 {
823 p = (*pOpenlist)[++ind]; 823 p = (*pOpenlist)[++ind];
824 } 824 }
825*/ 825*/
826 Bkmk* p = NULL; 826 Bkmk* p = NULL;
827 for (CList<Bkmk>::iterator iter = pOpenlist->begin(); iter != pOpenlist->end(); iter++) 827 for (CList<Bkmk>::iterator iter = pOpenlist->begin(); iter != pOpenlist->end(); iter++)
828 { 828 {
829 p = iter.pContent(); 829 p = iter.pContent();
830 if (toQString(CFiledata(p->anno()).name()) == reader->m_lastfile) 830 if (toQString(CFiledata(p->anno()).name()) == reader->m_lastfile)
831 { 831 {
832 break; 832 break;
833 } 833 }
834 // qDebug("Item:%s", (const char*)toQString(CFiledata(p->anno()).name())); 834 // qDebug("Item:%s", (const char*)toQString(CFiledata(p->anno()).name()));
835 p = NULL; 835 p = NULL;
836 } 836 }
837 if (p != NULL) 837 if (p != NULL)
838 { 838 {
839 //qDebug("openfrombkmk"); 839 //qDebug("openfrombkmk");
840 if (!openfrombkmk(p)) 840 if (!openfrombkmk(p))
841 showEditTools(); 841 showEditTools();
842 } 842 }
843 else 843 else
844 { 844 {
845 //qDebug("openfile"); 845 //qDebug("openfile");
846 openFile( reader->m_lastfile ); 846 openFile( reader->m_lastfile );
847 } 847 }
848 } 848 }
849 else 849 else
850 { 850 {
851 // qDebug("Openfile 2"); 851 // qDebug("Openfile 2");
852 if (!reader->m_lastfile.isEmpty()) 852 if (!reader->m_lastfile.isEmpty())
853 openFile( reader->m_lastfile ); 853 openFile( reader->m_lastfile );
854 } 854 }
855 } 855 }
856 else 856 else
857 { 857 {
858 showEditTools(); 858 showEditTools();
859 } 859 }
860// qApp->processEvents(); 860// qApp->processEvents();
861 reader->bDoUpdates = true; 861 reader->bDoUpdates = true;
862 reader->update(); 862 reader->update();
863 config.setGroup("Version"); 863 config.setGroup("Version");
864 int major = config.readNumEntry("Major", 0); 864 int major = config.readNumEntry("Major", 0);
865 int bkmktype = config.readNumEntry("BkmkType", 0); 865 int bkmktype = config.readNumEntry("BkmkType", 0);
866 char minor = config.readNumEntry("Minor", 0); 866 char minor = config.readNumEntry("Minor", 0);
867 if (CheckVersion(major, bkmktype, minor)) 867 if (CheckVersion(major, bkmktype, minor))
868 { 868 {
869 config.writeEntry("Major", major); 869 config.writeEntry("Major", major);
870 config.writeEntry("BkmkType", bkmktype); 870 config.writeEntry("BkmkType", bkmktype);
871 config.writeEntry("Minor", (int)minor); 871 config.writeEntry("Minor", (int)minor);
872 } 872 }
873// qDebug("finished update"); 873// qDebug("finished update");
874} 874}
875 875
876void QTReaderApp::addtoolbars(Config* config) 876void QTReaderApp::addtoolbars(Config* config)
877{ 877{
878 config->setGroup("Toolbar"); 878 config->setGroup("Toolbar");
879 879
880 if (fileBar != NULL) 880 if (fileBar != NULL)
881 { 881 {
882 if (fileBar != menubar) 882 if (fileBar != menubar)
883 { 883 {
884 fileBar->clear(); 884 fileBar->clear();
885 } 885 }
886 else 886 else
887 { 887 {
888 m_preferences_action->removeFrom( filebar() ); 888 m_preferences_action->removeFrom( filebar() );
889 m_open_action->removeFrom( filebar() ); 889 m_open_action->removeFrom( filebar() );
890 m_close_action->removeFrom( filebar() ); 890 m_close_action->removeFrom( filebar() );
891 m_info_action->removeFrom( filebar() ); 891 m_info_action->removeFrom( filebar() );
892 m_touch_action->removeFrom( filebar() ); 892 m_touch_action->removeFrom( filebar() );
893 m_find_action->removeFrom( filebar() ); 893 m_find_action->removeFrom( filebar() );
894 } 894 }
895 } 895 }
896 896
897 m_preferences_action->addTo( filebar() ); 897 m_preferences_action->addTo( filebar() );
898 addfilebar(config, "Open", m_open_action); 898 addfilebar(config, "Open", m_open_action);
899 addfilebar(config, "Close", m_close_action); 899 addfilebar(config, "Close", m_close_action);
900 addfilebar(config, "Info", m_info_action); 900 addfilebar(config, "Info", m_info_action);
901 addfilebar(config, "Two/One Touch", m_touch_action); 901 addfilebar(config, "Two/One Touch", m_touch_action);
902 addfilebar(config, "Find", m_find_action); 902 addfilebar(config, "Find", m_find_action);
903 903
904 if (navBar != NULL) 904 if (navBar != NULL)
905 { 905 {
906 if ((navBar == fileBar) && (fileBar == menubar)) 906 if ((navBar == fileBar) && (fileBar == menubar))
907 { 907 {
908 m_scrollButton->removeFrom( navbar() ); 908 m_scrollButton->removeFrom( navbar() );
909 m_start_action->removeFrom( navbar() ); 909 m_start_action->removeFrom( navbar() );
910 m_end_action->removeFrom( navbar() ); 910 m_end_action->removeFrom( navbar() );
911 m_jump_action->removeFrom( navbar() ); 911 m_jump_action->removeFrom( navbar() );
912 m_pageline_action->removeFrom( navbar() ); 912 m_pageline_action->removeFrom( navbar() );
913 m_pageup_action->removeFrom( navbar() ); 913 m_pageup_action->removeFrom( navbar() );
914 m_pagedn_action->removeFrom( navbar() ); 914 m_pagedn_action->removeFrom( navbar() );
915 m_back_action->removeFrom( navbar() ); 915 m_back_action->removeFrom( navbar() );
916 m_home_action->removeFrom( navbar() ); 916 m_home_action->removeFrom( navbar() );
917 m_forward_action->removeFrom( navbar() ); 917 m_forward_action->removeFrom( navbar() );
918 } 918 }
919 else if (navBar != fileBar) 919 else if (navBar != fileBar)
920 { 920 {
921 navBar->clear(); 921 navBar->clear();
922 } 922 }
923 } 923 }
924 924
925 addnavbar(config, "Scroll", m_scrollButton); 925 addnavbar(config, "Scroll", m_scrollButton);
926 addnavbar(config, "Goto Start", m_start_action); 926 addnavbar(config, "Goto Start", m_start_action);
927 addnavbar(config, "Goto End", m_end_action); 927 addnavbar(config, "Goto End", m_end_action);
928 928
929 addnavbar(config, "Jump", m_jump_action); 929 addnavbar(config, "Jump", m_jump_action);
930 addnavbar(config, "Page/Line Scroll", m_pageline_action); 930 addnavbar(config, "Page/Line Scroll", m_pageline_action);
931 931
932 addnavbar(config, "Page Up", m_pageup_action); 932 addnavbar(config, "Page Up", m_pageup_action);
933 addnavbar(config, "Page Down", m_pagedn_action); 933 addnavbar(config, "Page Down", m_pagedn_action);
934 934
935 addnavbar(config, "Back", m_back_action); 935 addnavbar(config, "Back", m_back_action);
936 addnavbar(config, "Home", m_home_action); 936 addnavbar(config, "Home", m_home_action);
937 addnavbar(config, "Forward", m_forward_action); 937 addnavbar(config, "Forward", m_forward_action);
938 938
939 if (viewBar != NULL) 939 if (viewBar != NULL)
940 { 940 {
941 if ((viewBar == fileBar) && (fileBar == menubar)) 941 if ((viewBar == fileBar) && (fileBar == menubar))
942 { 942 {
943 m_actFullscreen->removeFrom( filebar() ); 943 m_actFullscreen->removeFrom( filebar() );
944 m_zoomin_action->removeFrom( viewbar() ); 944 m_zoomin_action->removeFrom( viewbar() );
945 m_zoomout_action->removeFrom( viewbar() ); 945 m_zoomout_action->removeFrom( viewbar() );
946 m_setfont_action->removeFrom( viewbar() ); 946 m_setfont_action->removeFrom( viewbar() );
947 m_setenc_action->removeFrom( viewbar() ); 947 m_setenc_action->removeFrom( viewbar() );
948 m_setmono_action->removeFrom( viewbar() ); 948 m_setmono_action->removeFrom( viewbar() );
949 } 949 }
950 else if (viewBar != fileBar) 950 else if (viewBar != fileBar)
951 { 951 {
952 viewBar->clear(); 952 viewBar->clear();
953 } 953 }
954 } 954 }
955 955
956 addviewbar(config, "Fullscreen", m_actFullscreen); 956 addviewbar(config, "Fullscreen", m_actFullscreen);
957 addviewbar(config, "Zoom In", m_zoomin_action); 957 addviewbar(config, "Zoom In", m_zoomin_action);
958 addviewbar(config, "Zoom Out", m_zoomout_action); 958 addviewbar(config, "Zoom Out", m_zoomout_action);
959 addviewbar(config, "Set Font", m_setfont_action); 959 addviewbar(config, "Set Font", m_setfont_action);
960 addviewbar(config, "Encoding Select", m_setenc_action); 960 addviewbar(config, "Encoding Select", m_setenc_action);
961 addviewbar(config, "Ideogram Mode", m_setmono_action); 961 addviewbar(config, "Ideogram Mode", m_setmono_action);
962 962
963 if (markBar != NULL) 963 if (markBar != NULL)
964 { 964 {
965 if ((markBar == fileBar) && (fileBar == menubar)) 965 if ((markBar == fileBar) && (fileBar == menubar))
966 { 966 {
967 m_mark_action->removeFrom( markbar() ); 967 m_mark_action->removeFrom( markbar() );
968 m_annotate_action->removeFrom( markbar()); 968 m_annotate_action->removeFrom( markbar());
969 m_goto_action->removeFrom( markbar() ); 969 m_goto_action->removeFrom( markbar() );
970 m_delete_action->removeFrom( markbar() ); 970 m_delete_action->removeFrom( markbar() );
971 m_autogen_action->removeFrom( markbar() ); 971 m_autogen_action->removeFrom( markbar() );
972 m_clear_action->removeFrom( markbar() ); 972 m_clear_action->removeFrom( markbar() );
973 m_save_action->removeFrom( markbar() ); 973 m_save_action->removeFrom( markbar() );
974 m_tidy_action->removeFrom( markbar() ); 974 m_tidy_action->removeFrom( markbar() );
975 m_startBlock_action->removeFrom( markbar() ); 975 m_startBlock_action->removeFrom( markbar() );
976 m_endBlock_action->removeFrom( markbar() ); 976 m_endBlock_action->removeFrom( markbar() );
977 } 977 }
978 else if (markBar != fileBar) 978 else if (markBar != fileBar)
979 { 979 {
980 markBar->clear(); 980 markBar->clear();
981 } 981 }
982 } 982 }
983 addmarkbar(config, "Mark", m_mark_action); 983 addmarkbar(config, "Mark", m_mark_action);
984 addmarkbar(config, "Annotate", m_annotate_action); 984 addmarkbar(config, "Annotate", m_annotate_action);
985 addmarkbar(config, "Goto", m_goto_action); 985 addmarkbar(config, "Goto", m_goto_action);
986 addmarkbar(config, "Delete", m_delete_action); 986 addmarkbar(config, "Delete", m_delete_action);
987 addmarkbar(config, "Autogen", m_autogen_action); 987 addmarkbar(config, "Autogen", m_autogen_action);
988 addmarkbar(config, "Clear", m_clear_action); 988 addmarkbar(config, "Clear", m_clear_action);
989 addmarkbar(config, "Save", m_save_action); 989 addmarkbar(config, "Save", m_save_action);
990 addmarkbar(config, "Tidy", m_tidy_action); 990 addmarkbar(config, "Tidy", m_tidy_action);
991 addmarkbar(config, "Start Block", m_startBlock_action); 991 addmarkbar(config, "Start Block", m_startBlock_action);
992 addmarkbar(config, "Copy Block", m_endBlock_action); 992 addmarkbar(config, "Copy Block", m_endBlock_action);
993 if (checkbar(config, "Annotation indicator")) 993 if (checkbar(config, "Annotation indicator"))
994 { 994 {