Diffstat (limited to 'noncore/apps/opie-reader/QTReaderApp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/QTReaderApp.cpp | 24 |
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 | |||
@@ -320,45 +320,45 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
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; |
@@ -444,25 +444,25 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
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); |
@@ -717,51 +717,51 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
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 | ||
@@ -781,34 +781,34 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
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"); |