author | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
commit | b6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff) | |
tree | d3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/apps/opie-reader | |
parent | 0d59c780513da78033f4d9040475dee9db0256d4 (diff) | |
download | opie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2 |
applied the patch generated by the optimize_connect script from
TT.
-rw-r--r-- | noncore/apps/opie-reader/QTReaderApp.cpp | 24 | ||||
-rw-r--r-- | noncore/apps/opie-reader/fileBrowser.cpp | 8 |
2 files changed, 16 insertions, 16 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 | |||
@@ -284,117 +284,117 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
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); |
@@ -408,97 +408,97 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
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 | ||
@@ -681,170 +681,170 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
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 | { |
diff --git a/noncore/apps/opie-reader/fileBrowser.cpp b/noncore/apps/opie-reader/fileBrowser.cpp index ebd14f3..e1cde6c 100644 --- a/noncore/apps/opie-reader/fileBrowser.cpp +++ b/noncore/apps/opie-reader/fileBrowser.cpp | |||
@@ -29,100 +29,100 @@ fileBrowser::fileBrowser( bool allownew, QWidget* parent, const char* name, boo | |||
29 | filterspec(QDir::All) | 29 | filterspec(QDir::All) |
30 | { | 30 | { |
31 | // showMaximized(); | 31 | // showMaximized(); |
32 | if ( !name ) | 32 | if ( !name ) |
33 | setName( "fileBrowser" ); | 33 | setName( "fileBrowser" ); |
34 | /* | 34 | /* |
35 | if (parent != NULL) | 35 | if (parent != NULL) |
36 | { | 36 | { |
37 | #ifdef OPIE | 37 | #ifdef OPIE |
38 | move(0,0); | 38 | move(0,0); |
39 | resize( parent->width(), parent->height() ); | 39 | resize( parent->width(), parent->height() ); |
40 | #else | 40 | #else |
41 | setGeometry(parent->x(), parent->y(), parent->width(), parent->height() ); | 41 | setGeometry(parent->x(), parent->y(), parent->width(), parent->height() ); |
42 | #endif | 42 | #endif |
43 | } | 43 | } |
44 | */ | 44 | */ |
45 | // showFullScreen(); | 45 | // showFullScreen(); |
46 | setCaption(tr( "Browse for file" ) ); | 46 | setCaption(tr( "Browse for file" ) ); |
47 | filterStr=filter; | 47 | filterStr=filter; |
48 | 48 | ||
49 | buttonOk = new QPushButton( this, "buttonOk" ); | 49 | buttonOk = new QPushButton( this, "buttonOk" ); |
50 | buttonOk->setFixedSize( 25, 25 ); | 50 | buttonOk->setFixedSize( 25, 25 ); |
51 | buttonOk->setAutoDefault( false ); | 51 | buttonOk->setAutoDefault( false ); |
52 | buttonOk->setText( tr( "/" ) ); | 52 | buttonOk->setText( tr( "/" ) ); |
53 | 53 | ||
54 | buttonShowHidden = new QPushButton( this, "buttonShowHidden" ); | 54 | buttonShowHidden = new QPushButton( this, "buttonShowHidden" ); |
55 | // buttonShowHidden->setFixedSize( 50, 25 ); | 55 | // buttonShowHidden->setFixedSize( 50, 25 ); |
56 | buttonShowHidden->setText( tr( "Hidden" ) ); | 56 | buttonShowHidden->setText( tr( "Hidden" ) ); |
57 | buttonShowHidden->setAutoDefault( false ); | 57 | buttonShowHidden->setAutoDefault( false ); |
58 | buttonShowHidden->setToggleButton( true ); | 58 | buttonShowHidden->setToggleButton( true ); |
59 | buttonShowHidden->setOn( false ); | 59 | buttonShowHidden->setOn( false ); |
60 | 60 | ||
61 | dirLabel = new QLabel(this, "DirLabel"); | 61 | dirLabel = new QLabel(this, "DirLabel"); |
62 | dirLabel->setAlignment(AlignLeft | AlignVCenter | ExpandTabs | WordBreak); | 62 | dirLabel->setAlignment(AlignLeft | AlignVCenter | ExpandTabs | WordBreak); |
63 | dirLabel->setText(currentDir.canonicalPath()); | 63 | dirLabel->setText(currentDir.canonicalPath()); |
64 | 64 | ||
65 | ListView = new QtrListView( this, "ListView" ); | 65 | ListView = new QtrListView( this, "ListView" ); |
66 | ListView->addColumn( tr( "Name" ) ); | 66 | ListView->addColumn( tr( "Name" ) ); |
67 | ListView->setSorting( 2, FALSE); | 67 | ListView->setSorting( 2, FALSE); |
68 | ListView->addColumn( tr( "Size" ) ); | 68 | ListView->addColumn( tr( "Size" ) ); |
69 | ListView->setSelectionMode(QListView::Single); | 69 | ListView->setSelectionMode(QListView::Single); |
70 | ListView->setAllColumnsShowFocus( TRUE ); | 70 | ListView->setAllColumnsShowFocus( TRUE ); |
71 | ListView->setColumnWidthMode(0, QListView::Manual); | 71 | ListView->setColumnWidthMode(0, QListView::Manual); |
72 | ListView->setColumnWidthMode(1, QListView::Manual); | 72 | ListView->setColumnWidthMode(1, QListView::Manual); |
73 | 73 | ||
74 | // signals and slots connections | 74 | // signals and slots connections |
75 | connect( buttonShowHidden, SIGNAL( toggled(bool) ), this, SLOT( setHidden(bool) ) ); | 75 | connect( buttonShowHidden, SIGNAL( toggled(bool) ), this, SLOT( setHidden(bool) ) ); |
76 | connect( buttonOk, SIGNAL( clicked() ), this, SLOT( OnRoot() ) ); | 76 | connect( buttonOk, SIGNAL( clicked() ), this, SLOT( OnRoot() ) ); |
77 | connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); | 77 | connect( ListView, SIGNAL(doubleClicked(QListViewItem*)), SLOT(listDoubleClicked(QListViewItem*)) ); |
78 | connect( ListView, SIGNAL(clicked( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); | 78 | connect( ListView, SIGNAL(clicked(QListViewItem*)), SLOT(listClicked(QListViewItem*)) ); |
79 | connect( ListView, SIGNAL(OnOKButton( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); | 79 | connect( ListView, SIGNAL(OnOKButton(QListViewItem*)), SLOT(listClicked(QListViewItem*)) ); |
80 | connect( ListView, SIGNAL(OnCentreButton( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); | 80 | connect( ListView, SIGNAL(OnCentreButton(QListViewItem*)), SLOT(listClicked(QListViewItem*)) ); |
81 | connect( ListView, SIGNAL(OnCancelButton()), SLOT(OnCancel()) ); | 81 | connect( ListView, SIGNAL(OnCancelButton()), SLOT(OnCancel()) ); |
82 | 82 | ||
83 | QVBoxLayout* grid = new QVBoxLayout(this); | 83 | QVBoxLayout* grid = new QVBoxLayout(this); |
84 | QHBoxLayout* hgrid = new QHBoxLayout(grid); | 84 | QHBoxLayout* hgrid = new QHBoxLayout(grid); |
85 | hgrid->addWidget(dirLabel,1); | 85 | hgrid->addWidget(dirLabel,1); |
86 | hgrid->addWidget(buttonShowHidden); | 86 | hgrid->addWidget(buttonShowHidden); |
87 | hgrid->addWidget(buttonOk); | 87 | hgrid->addWidget(buttonOk); |
88 | grid->addWidget(ListView,1); | 88 | grid->addWidget(ListView,1); |
89 | if (allownew) | 89 | if (allownew) |
90 | { | 90 | { |
91 | m_filename = new QLineEdit(this); | 91 | m_filename = new QLineEdit(this); |
92 | grid->addWidget(m_filename); | 92 | grid->addWidget(m_filename); |
93 | connect( m_filename, SIGNAL( returnPressed() ), this, SLOT( onReturn() )); | 93 | connect( m_filename, SIGNAL( returnPressed() ), this, SLOT( onReturn() )); |
94 | } | 94 | } |
95 | else | 95 | else |
96 | { | 96 | { |
97 | m_filename = NULL; | 97 | m_filename = NULL; |
98 | } | 98 | } |
99 | 99 | ||
100 | if (QFileInfo(iPath).exists()) | 100 | if (QFileInfo(iPath).exists()) |
101 | { | 101 | { |
102 | currentDir.setPath(iPath); | 102 | currentDir.setPath(iPath); |
103 | #ifdef _WINDOWS | 103 | #ifdef _WINDOWS |
104 | _chdir(iPath.latin1()); | 104 | _chdir(iPath.latin1()); |
105 | #else | 105 | #else |
106 | chdir(iPath.latin1()); | 106 | chdir(iPath.latin1()); |
107 | #endif | 107 | #endif |
108 | } | 108 | } |
109 | else | 109 | else |
110 | { | 110 | { |
111 | currentDir.setPath(QDir::currentDirPath()); | 111 | currentDir.setPath(QDir::currentDirPath()); |
112 | chdir(QDir::currentDirPath().latin1()); | 112 | chdir(QDir::currentDirPath().latin1()); |
113 | } | 113 | } |
114 | 114 | ||
115 | populateList(); | 115 | populateList(); |
116 | 116 | ||
117 | if (modal) | 117 | if (modal) |
118 | QPEApplication::showDialog( this ); | 118 | QPEApplication::showDialog( this ); |
119 | } | 119 | } |
120 | 120 | ||
121 | void fileBrowser::resizeEvent(QResizeEvent* e) | 121 | void fileBrowser::resizeEvent(QResizeEvent* e) |
122 | { | 122 | { |
123 | ListView->setColumnWidth(1,(ListView->width())/4); | 123 | ListView->setColumnWidth(1,(ListView->width())/4); |
124 | ListView->setColumnWidth(0,ListView->width()-20-ListView->columnWidth(1)); | 124 | ListView->setColumnWidth(0,ListView->width()-20-ListView->columnWidth(1)); |
125 | } | 125 | } |
126 | 126 | ||
127 | fileBrowser::~fileBrowser() | 127 | fileBrowser::~fileBrowser() |
128 | { | 128 | { |