summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/.cvsignore3
-rw-r--r--noncore/apps/opie-reader/QTReaderApp.cpp470
2 files changed, 238 insertions, 235 deletions
diff --git a/noncore/apps/opie-reader/.cvsignore b/noncore/apps/opie-reader/.cvsignore
new file mode 100644
index 0000000..5344d1b
--- a/dev/null
+++ b/noncore/apps/opie-reader/.cvsignore
@@ -0,0 +1,3 @@
1Makefile
2Makefile.in
3moc* \ No newline at end of file
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp
index 620e93e..06a35f6 100644
--- a/noncore/apps/opie-reader/QTReaderApp.cpp
+++ b/noncore/apps/opie-reader/QTReaderApp.cpp
@@ -70,12 +70,12 @@ void QTReaderApp::listBkmkFiles()
70 { 70 {
71 struct dirent* de; 71 struct dirent* de;
72 struct stat buf; 72 struct stat buf;
73 de = readdir(d); 73 de = readdir(d);
74 if (de == NULL) break; 74 if (de == NULL) break;
75 75
76 if (lstat((const char *)Global::applicationFileName("uqtreader",de->d_name),&buf) == 0 && S_ISREG(buf.st_mode)) 76 if (lstat((const char *)Global::applicationFileName("uqtreader",de->d_name),&buf) == 0 && S_ISREG(buf.st_mode))
77 { 77 {
78 bkmkselector->insertItem(de->d_name); 78 bkmkselector->insertItem(de->d_name);
79 cnt++; 79 cnt++;
80 } 80 }
81 } 81 }
@@ -91,3 +91,3 @@ void QTReaderApp::listBkmkFiles()
91 if (searchVisible) searchBar->hide(); 91 if (searchVisible) searchBar->hide();
92 m_nRegAction = cRmBkmkFile; 92 m_nRegAction = cRmBkmkFile;
93 editorStack->raiseWidget( bkmkselector ); 93 editorStack->raiseWidget( bkmkselector );
@@ -107,3 +107,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
107 107
108 m_fBkmksChanged = false; 108 m_fBkmksChanged = false;
109 109
@@ -111,3 +111,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
111 111
112 m_autogenstr = "^ *[A-Z].*[a-z] *$"; 112 m_autogenstr = "^ *[A-Z].*[a-z] *$";
113 setToolBarsMovable( FALSE ); 113 setToolBarsMovable( FALSE );
@@ -422,6 +422,6 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
422 connect( searchEdit, SIGNAL( textChanged( const QString & ) ), 422 connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
423 this, SLOT( search( const QString& ) ) ); 423 this, SLOT( search( const QString& ) ) );
424#else 424#else
425 connect( searchEdit, SIGNAL( returnPressed( ) ), 425 connect( searchEdit, SIGNAL( returnPressed( ) ),
426 this, SLOT( search( ) ) ); 426 this, SLOT( search( ) ) );
427#endif 427#endif
@@ -447,3 +447,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
447 connect( regEdit, SIGNAL( returnPressed( ) ), 447 connect( regEdit, SIGNAL( returnPressed( ) ),
448 this, SLOT( do_regaction() ) ); 448 this, SLOT( do_regaction() ) );
449 449
@@ -466,7 +466,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
466 { 466 {
467 FontDatabase f; 467 FontDatabase f;
468 m_fontSelector->insertStringList(f.families()); 468 m_fontSelector->insertStringList(f.families());
469 } // delete the FontDatabase!!! 469 } // delete the FontDatabase!!!
470 connect( m_fontSelector, SIGNAL( activated(const QString& ) ), 470 connect( m_fontSelector, SIGNAL( activated(const QString& ) ),
471 this, SLOT( do_setfont(const QString&) ) ); 471 this, SLOT( do_setfont(const QString&) ) );
472 472
@@ -476,3 +476,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
476 connect(qApp, SIGNAL( appMessage(const QCString&, const QByteArray& ) ), 476 connect(qApp, SIGNAL( appMessage(const QCString&, const QByteArray& ) ),
477 this, SLOT( msgHandler(const QCString&, const QByteArray&) ) ); 477 this, SLOT( msgHandler(const QCString&, const QByteArray&) ) );
478 478
@@ -481,4 +481,4 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
481 { 481 {
482 openFile( reader->m_lastfile ); 482 openFile( reader->m_lastfile );
483 doc = new DocLnk(reader->m_lastfile); 483 doc = new DocLnk(reader->m_lastfile);
484 } 484 }
@@ -497,10 +497,10 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
497 { 497 {
498 QString info; 498 QString info;
499 stream >> info; 499 stream >> info;
500 QMessageBox::information(this, "QTReader", info); 500 QMessageBox::information(this, "QTReader", info);
501 } else if ( msg == "warn(QString)" ) 501 } else if ( msg == "warn(QString)" )
502 { 502 {
503 QString info; 503 QString info;
504 stream >> info; 504 stream >> info;
505 QMessageBox::warning(this, "QTReader", info); 505 QMessageBox::warning(this, "QTReader", info);
506 } 506 }
@@ -512,3 +512,3 @@ int QTReaderApp::EncNameToInt(const QString& _enc)
512 { 512 {
513 if (m_EncodingAction[i]->text() == _enc) return i; 513 if (m_EncodingAction[i]->text() == _enc) return i;
514 } 514 }
@@ -550,5 +550,5 @@ void QTReaderApp::clearBkmkList()
550{ 550{
551 delete pBkmklist; 551 delete pBkmklist;
552 pBkmklist = NULL; 552 pBkmklist = NULL;
553 m_fBkmksChanged = false; 553 m_fBkmksChanged = false;
554} 554}
@@ -565,10 +565,10 @@ void QTReaderApp::fileOpen()
565 { 565 {
566 if (m_fBkmksChanged) 566 if (m_fBkmksChanged)
567 { 567 {
568 if (QMessageBox::warning(this, "QTReader", "Save bookmarks?", "Save", "Don't bother") == 0) 568 if (QMessageBox::warning(this, "QTReader", "Save bookmarks?", "Save", "Don't bother") == 0)
569 savebkmks(); 569 savebkmks();
570 } 570 }
571 delete pBkmklist; 571 delete pBkmklist;
572 pBkmklist = NULL; 572 pBkmklist = NULL;
573 m_fBkmksChanged = false; 573 m_fBkmksChanged = false;
574 } 574 }
@@ -580,5 +580,5 @@ void QTReaderApp::fileOpen()
580 fileBrowser* fb = new fileBrowser(this,"QTReader",TRUE, 580 fileBrowser* fb = new fileBrowser(this,"QTReader",TRUE,
581 0, 581 0,
582 // WStyle_Customize | WStyle_NoBorderEx, 582// WStyle_Customize | WStyle_NoBorderEx,
583 "*", QFileInfo(reader->m_lastfile).dirPath(true)); 583 "*", QFileInfo(reader->m_lastfile).dirPath(true));
584 584
@@ -586,5 +586,5 @@ void QTReaderApp::fileOpen()
586 { 586 {
587 QString fn(fb->fileList[0]); 587 QString fn(fb->fileList[0]);
588// fb->populateList(); 588// fb->populateList();
589 if (!fn.isEmpty() && QFileInfo(fn).isFile()) openFile(fn); 589 if (!fn.isEmpty() && QFileInfo(fn).isFile()) openFile(fn);
590 } 590 }
@@ -598,3 +598,3 @@ void QTReaderApp::showinfo()
598 { 598 {
599 QMessageBox::information(this, "QTReader", "No file loaded", 1); 599 QMessageBox::information(this, "QTReader", "No file loaded", 1);
600 } 600 }
@@ -602,11 +602,11 @@ void QTReaderApp::showinfo()
602 { 602 {
603 reader->sizes(fs,ts); 603 reader->sizes(fs,ts);
604 pl = reader->pagelocate(); 604 pl = reader->pagelocate();
605 m_infoWin->setFileSize(fs); 605 m_infoWin->setFileSize(fs);
606 m_infoWin->setTextSize(ts); 606 m_infoWin->setTextSize(ts);
607 m_infoWin->setRatio(100-(100*fs + (ts >> 1))/ts); 607 m_infoWin->setRatio(100-(100*fs + (ts >> 1))/ts);
608 m_infoWin->setLocation(pl); 608 m_infoWin->setLocation(pl);
609 m_infoWin->setRead((100*pl + (ts >> 1))/ts); 609 m_infoWin->setRead((100*pl + (ts >> 1))/ts);
610 editorStack->raiseWidget( m_infoWin ); 610 editorStack->raiseWidget( m_infoWin );
611 m_infoWin->setFocus(); 611 m_infoWin->setFocus();
612 } 612 }
@@ -640,17 +640,17 @@ void QTReaderApp::editCopy()
640{ 640{
641 QClipboard* cb = QApplication::clipboard(); 641 QClipboard* cb = QApplication::clipboard();
642 QString text; 642 QString text;
643 int ch; 643 int ch;
644 unsigned long currentpos = reader->pagelocate(); 644 unsigned long currentpos = reader->pagelocate();
645 unsigned long endpos = reader->locate(); 645 unsigned long endpos = reader->locate();
646 reader->jumpto(m_savedpos); 646 reader->jumpto(m_savedpos);
647 while (reader->locate() < endpos && (ch = reader->getch()) != UEOF) 647 while (reader->locate() < endpos && (ch = reader->getch()) != UEOF)
648 { 648 {
649 text += ch; 649 text += ch;
650 } 650 }
651 cb->setText(text); 651 cb->setText(text);
652 //text = cb->text(); 652// text = cb->text();
653 //if (text) 653// if (text)
654 // qDebug("The clipboard contains: %s", (const tchar*)text); 654// qDebug("The clipboard contains: %s", (const tchar*)text);
655 reader->locate(currentpos); 655 reader->locate(currentpos);
656#ifndef QT_NO_CLIPBOARD 656#ifndef QT_NO_CLIPBOARD
@@ -733,4 +733,4 @@ void QTReaderApp::settarget()
733 QString text = ((reader->m_targetapp.isEmpty()) ? QString("") : reader->m_targetapp) 733 QString text = ((reader->m_targetapp.isEmpty()) ? QString("") : reader->m_targetapp)
734 + "/" 734 + "/"
735 + ((reader->m_targetmsg.isEmpty()) ? QString("") : reader->m_targetmsg); 735 + ((reader->m_targetmsg.isEmpty()) ? QString("") : reader->m_targetmsg);
736 regEdit->setText(text); 736 regEdit->setText(text);
@@ -745,6 +745,6 @@ void QTReaderApp::do_overlap(const QString& lcn)
745 { 745 {
746 reader->m_overlap = ulcn; 746 reader->m_overlap = ulcn;
747 } 747 }
748 else 748 else
749 QMessageBox::information(this, "QTReader", "Must be a number"); 749 QMessageBox::information(this, "QTReader", "Must be a number");
750} 750}
@@ -757,7 +757,7 @@ void QTReaderApp::do_mono(const QString& lcn)
757 { 757 {
758 reader->m_charpc = ulcn; 758 reader->m_charpc = ulcn;
759 //reader->setmono(true); 759// reader->setmono(true);
760 } 760 }
761 else 761 else
762 QMessageBox::information(this, "QTReader", "Must be a number"); 762 QMessageBox::information(this, "QTReader", "Must be a number");
763} 763}
@@ -847,11 +847,11 @@ bool QTReaderApp::dosearch(size_t start, CBuffer& test, const QRegExp& arg)
847 if (!reader->buffdoc.getline(&test,reader->width())) 847 if (!reader->buffdoc.getline(&test,reader->width()))
848 { 848 {
849 if (QMessageBox::warning(this, "Can't find", searchEdit->text(), 1, 2) == 2) 849 if (QMessageBox::warning(this, "Can't find", searchEdit->text(), 1, 2) == 2)
850 pos = searchStart; 850 pos = searchStart;
851 else 851 else
852 pos = start; 852 pos = start;
853 ret = false; 853 ret = false;
854 findClose(); 854 findClose();
855 break; 855 break;
856 } 856 }
857 } 857 }
@@ -939,3 +939,3 @@ void QTReaderApp::openFile( const DocLnk &f )
939 } 939 }
940 940
941} 941}
@@ -945,3 +945,3 @@ void QTReaderApp::showEditTools()
945 if ( !doc ) 945 if ( !doc )
946 close(); 946 close();
947// fileSelector->hide(); 947// fileSelector->hide();
@@ -950,5 +950,5 @@ void QTReaderApp::showEditTools()
950 if ( searchVisible ) 950 if ( searchVisible )
951 searchBar->show(); 951 searchBar->show();
952 if ( regVisible ) 952 if ( regVisible )
953 regBar->show(); 953 regBar->show();
954 if (m_fontVisible) m_fontBar->show(); 954 if (m_fontVisible) m_fontBar->show();
@@ -963,5 +963,5 @@ void QTReaderApp::save()
963 if ( !doc ) 963 if ( !doc )
964 return; 964 return;
965 if ( !editor->edited() ) 965 if ( !editor->edited() )
966 return; 966 return;
967 967
@@ -971,15 +971,15 @@ void QTReaderApp::save()
971 if ( doc->name().isEmpty() ) { 971 if ( doc->name().isEmpty() ) {
972 unsigned ispace = pt.find( ' ' ); 972 unsigned ispace = pt.find( ' ' );
973 unsigned ienter = pt.find( '\n' ); 973 unsigned ienter = pt.find( '\n' );
974 int i = (ispace < ienter) ? ispace : ienter; 974 int i = (ispace < ienter) ? ispace : ienter;
975 QString docname; 975 QString docname;
976 if ( i == -1 ) { 976 if ( i == -1 ) {
977 if ( pt.isEmpty() ) 977 if ( pt.isEmpty() )
978 docname = "Empty Text"; 978 docname = "Empty Text";
979 else 979 else
980 docname = pt; 980 docname = pt;
981 } else { 981 } else {
982 docname = pt.left( i ); 982 docname = pt.left( i );
983 } 983 }
984 doc->setName(docname); 984 doc->setName(docname);
985 } 985 }
@@ -995,5 +995,5 @@ void QTReaderApp::clear()
995// QMessageBox::information(this, "QTReader", "Deleting doc", 1); 995// QMessageBox::information(this, "QTReader", "Deleting doc", 1);
996 delete doc; 996 delete doc;
997// QMessageBox::information(this, "QTReader", "Deleted doc", 1); 997// QMessageBox::information(this, "QTReader", "Deleted doc", 1);
998 doc = 0; 998 doc = 0;
999 } 999 }
@@ -1005,8 +1005,8 @@ void QTReaderApp::updateCaption()
1005 if ( !doc ) 1005 if ( !doc )
1006 setCaption( tr("QTReader") ); 1006 setCaption( tr("Opie Reader") );
1007 else { 1007 else {
1008 QString s = doc->name(); 1008 QString s = doc->name();
1009 if ( s.isEmpty() ) 1009 if ( s.isEmpty() )
1010 s = tr( "Unnamed" ); 1010 s = tr( "Unnamed" );
1011 setCaption( s + " - " + tr("QTReader") ); 1011 setCaption( s + " - " + tr("Opie Reader") );
1012 } 1012 }
@@ -1027,29 +1027,29 @@ void QTReaderApp::closeEvent( QCloseEvent *e )
1027 if (m_fontVisible) 1027 if (m_fontVisible)
1028 { 1028 {
1029 m_fontBar->hide(); 1029 m_fontBar->hide();
1030 m_fontVisible = false; 1030 m_fontVisible = false;
1031 } 1031 }
1032 if (regVisible) 1032 if (regVisible)
1033 { 1033 {
1034 regBar->hide(); 1034 regBar->hide();
1035 regVisible = false; 1035 regVisible = false;
1036 return; 1036 return;
1037 } 1037 }
1038 if (searchVisible) 1038 if (searchVisible)
1039 { 1039 {
1040 searchBar->hide(); 1040 searchBar->hide();
1041 searchVisible = false; 1041 searchVisible = false;
1042 return; 1042 return;
1043 } 1043 }
1044 if (m_fBkmksChanged && pBkmklist != NULL) 1044 if (m_fBkmksChanged && pBkmklist != NULL)
1045 { 1045 {
1046 if (QMessageBox::warning(this, "QTReader", "Save bookmarks?", "Save", "Don't bother") == 0) 1046 if (QMessageBox::warning(this, "QTReader", "Save bookmarks?", "Save", "Don't bother") == 0)
1047 savebkmks(); 1047 savebkmks();
1048 delete pBkmklist; 1048 delete pBkmklist;
1049 pBkmklist = NULL; 1049 pBkmklist = NULL;
1050 m_fBkmksChanged = false; 1050 m_fBkmksChanged = false;
1051 } 1051 }
1052 bFromDocView = FALSE; 1052 bFromDocView = FALSE;
1053 saveprefs(); 1053 saveprefs();
1054 e->accept(); 1054 e->accept();
1055 } 1055 }
@@ -1057,3 +1057,3 @@ void QTReaderApp::closeEvent( QCloseEvent *e )
1057 { 1057 {
1058 showEditTools(); 1058 showEditTools();
1059 } 1059 }
@@ -1079,12 +1079,12 @@ void QTReaderApp::listbkmk()
1079 { 1079 {
1080 if (m_fBkmksChanged) pBkmklist->sort(); 1080 if (m_fBkmksChanged) pBkmklist->sort();
1081 for (CList<Bkmk>::iterator i = pBkmklist->begin(); i != pBkmklist->end(); i++) 1081 for (CList<Bkmk>::iterator i = pBkmklist->begin(); i != pBkmklist->end(); i++)
1082 { 1082 {
1083#ifdef _UNICODE 1083#ifdef _UNICODE
1084 bkmkselector->insertItem(toQString(i->name())); 1084 bkmkselector->insertItem(toQString(i->name()));
1085#else 1085#else
1086 bkmkselector->insertItem(i->name()); 1086 bkmkselector->insertItem(i->name());
1087#endif 1087#endif
1088 cnt++; 1088 cnt++;
1089 } 1089 }
1090 } 1090 }
@@ -1122,13 +1122,13 @@ void QTReaderApp::gotobkmk(int ind)
1122 { 1122 {
1123 case cGotoBkmk: 1123 case cGotoBkmk:
1124 reader->locate((*pBkmklist)[ind]->value()); 1124 reader->locate((*pBkmklist)[ind]->value());
1125 break; 1125 break;
1126 case cDelBkmk: 1126 case cDelBkmk:
1127 // qDebug("Deleting:%s\n",(*pBkmklist)[ind]->name()); 1127// qDebug("Deleting:%s\n",(*pBkmklist)[ind]->name());
1128 pBkmklist->erase(ind); 1128 pBkmklist->erase(ind);
1129 m_fBkmksChanged = true; 1129 m_fBkmksChanged = true;
1130 break; 1130 break;
1131 case cRmBkmkFile: 1131 case cRmBkmkFile:
1132 unlink((const char *)Global::applicationFileName("uqtreader",bkmkselector->text(ind))); 1132 unlink((const char *)Global::applicationFileName("uqtreader",bkmkselector->text(ind)));
1133 break; 1133 break;
1134 } 1134 }
@@ -1156,5 +1156,5 @@ void QTReaderApp::do_jump(const QString& lcn)
1156 if (ok) 1156 if (ok)
1157 reader->locate(ulcn); 1157 reader->locate(ulcn);
1158 else 1158 else
1159 QMessageBox::information(this, "QTReader", "Must be a number"); 1159 QMessageBox::information(this, "QTReader", "Must be a number");
1160} 1160}
@@ -1168,19 +1168,19 @@ void QTReaderApp::do_regaction()
1168 case cAutoGen: 1168 case cAutoGen:
1169 do_autogen(regEdit->text()); 1169 do_autogen(regEdit->text());
1170 break; 1170 break;
1171 case cAddBkmk: 1171 case cAddBkmk:
1172 do_addbkmk(regEdit->text()); 1172 do_addbkmk(regEdit->text());
1173 break; 1173 break;
1174 case cJump: 1174 case cJump:
1175 do_jump(regEdit->text()); 1175 do_jump(regEdit->text());
1176 break; 1176 break;
1177 case cMonoSpace: 1177 case cMonoSpace:
1178 do_mono(regEdit->text()); 1178 do_mono(regEdit->text());
1179 break; 1179 break;
1180 case cOverlap: 1180 case cOverlap:
1181 do_overlap(regEdit->text()); 1181 do_overlap(regEdit->text());
1182 break; 1182 break;
1183 case cSetTarget: 1183 case cSetTarget:
1184 do_settarget(regEdit->text()); 1184 do_settarget(regEdit->text());
1185 break; 1185 break;
1186 } 1186 }
@@ -1196,5 +1196,5 @@ void QTReaderApp::do_settarget(const QString& _txt)
1196 { 1196 {
1197 reader->m_targetapp = ""; 1197 reader->m_targetapp = "";
1198 reader->m_targetmsg = ""; 1198 reader->m_targetmsg = "";
1199 QMessageBox::information(this, "QTReader", "Format is\nappname/messagename"); 1199 QMessageBox::information(this, "QTReader", "Format is\nappname/messagename");
1200 } 1200 }
@@ -1202,4 +1202,4 @@ void QTReaderApp::do_settarget(const QString& _txt)
1202 { 1202 {
1203 reader->m_targetapp = _txt.left(ind); 1203 reader->m_targetapp = _txt.left(ind);
1204 reader->m_targetmsg = _txt.right(_txt.length()-ind-1); 1204 reader->m_targetmsg = _txt.right(_txt.length()-ind-1);
1205 } 1205 }
@@ -1211,7 +1211,7 @@ void QTReaderApp::setfont()
1211 { 1211 {
1212 if (m_fontSelector->text(i) == reader->m_fontname) 1212 if (m_fontSelector->text(i) == reader->m_fontname)
1213 { 1213 {
1214 m_fontSelector->setCurrentItem(i); 1214 m_fontSelector->setCurrentItem(i);
1215 break; 1215 break;
1216 } 1216 }
1217 } 1217 }
@@ -1261,5 +1261,5 @@ pbar->resize(width(), editBar->height());
1261 pbar->setProgress(pc); 1261 pbar->setProgress(pc);
1262 qApp->processEvents(); 1262 qApp->processEvents();
1263 if (reader->locate() != lcn) reader->jumpto(lcn); 1263 if (reader->locate() != lcn) reader->jumpto(lcn);
1264 reader->setFocus(); 1264 reader->setFocus();
1265 lastpc = pc; 1265 lastpc = pc;
@@ -1272,3 +1272,3 @@ pbar->resize(width(), editBar->height());
1272#endif 1272#endif
1273 pBkmklist->push_back(Bkmk(buff.data(),lcn)); 1273 pBkmklist->push_back(Bkmk(buff.data(),lcn));
1274 } 1274 }
@@ -1336,14 +1336,14 @@ void info_cb(Fl_Widget* o, void* _data)
1336 { 1336 {
1337 1337
1338 infowin = new Fl_Window(160,240); 1338 infowin = new Fl_Window(160,240);
1339 filename = new Fl_Output(45,5,110,14,"Filename"); 1339 filename = new Fl_Output(45,5,110,14,"Filename");
1340 filesize = new Fl_Output(45,25,110,14,"Filesize"); 1340 filesize = new Fl_Output(45,25,110,14,"Filesize");
1341 textsize = new Fl_Output(45,45,110,14,"Textsize"); 1341 textsize = new Fl_Output(45,45,110,14,"Textsize");
1342 comprat = new CBar(45,65,110,14,"Ratio %"); 1342 comprat = new CBar(45,65,110,14,"Ratio %");
1343 posn = new Fl_Output(45,85,110,14,"Location"); 1343 posn = new Fl_Output(45,85,110,14,"Location");
1344 frcn = new CBar(45,105,110,14,"% Read"); 1344 frcn = new CBar(45,105,110,14,"% Read");
1345 about = new Fl_Multiline_Output(5,125,150,90); 1345 about = new Fl_Multiline_Output(5,125,150,90);
1346 about->value("TWReader - $Name$\n\nA file reader program for the Agenda\n\nReads text, PalmDoc and ppms format files"); 1346 about->value("TWReader - $Name$\n\nA file reader program for the Agenda\n\nReads text, PalmDoc and ppms format files");
1347 Fl_Button *jump_accept = new Fl_Button(62,220,35,14,"Okay"); 1347 Fl_Button *jump_accept = new Fl_Button(62,220,35,14,"Okay");
1348 infowin->set_modal(); 1348 infowin->set_modal();
1349 } 1349 }
@@ -1351,21 +1351,21 @@ void info_cb(Fl_Widget* o, void* _data)
1351 { 1351 {
1352 unsigned long fs,ts; 1352 unsigned long fs,ts;
1353 tchar sz[20]; 1353 tchar sz[20];
1354 ((reader_ui *)_data)->input->sizes(fs,ts); 1354 ((reader_ui *)_data)->input->sizes(fs,ts);
1355 unsigned long pl = ((reader_ui *)_data)->input->locate(); 1355 unsigned long pl = ((reader_ui *)_data)->input->locate();
1356 1356
1357 filename->value(((reader_ui *)_data)->g_filename); 1357 filename->value(((reader_ui *)_data)->g_filename);
1358 1358
1359 sprintf(sz,"%u",fs); 1359 sprintf(sz,"%u",fs);
1360 filesize->value(sz); 1360 filesize->value(sz);
1361 1361
1362 sprintf(sz,"%u",ts); 1362 sprintf(sz,"%u",ts);
1363 textsize->value(sz); 1363 textsize->value(sz);
1364 1364
1365 comprat->value(100-(100*fs + (ts >> 1))/ts); 1365 comprat->value(100-(100*fs + (ts >> 1))/ts);
1366 1366
1367 sprintf(sz,"%u",pl); 1367 sprintf(sz,"%u",pl);
1368 posn->value(sz); 1368 posn->value(sz);
1369 1369
1370 frcn->value((100*pl + (ts >> 1))/ts); 1370 frcn->value((100*pl + (ts >> 1))/ts);
1371 } 1371 }
@@ -1379,6 +1379,6 @@ void QTReaderApp::savebkmks()
1379 { 1379 {
1380 BkmkFile bf((const char *)Global::applicationFileName("uqtreader",reader->m_string), true); 1380 BkmkFile bf((const char *)Global::applicationFileName("uqtreader",reader->m_string), true);
1381 bf.write(*pBkmklist); 1381 bf.write(*pBkmklist);
1382 } 1382 }
1383 m_fBkmksChanged = false; 1383 m_fBkmksChanged = false;
1384} 1384}
@@ -1389,3 +1389,3 @@ void QTReaderApp::readbkmks()
1389 { 1389 {
1390 delete pBkmklist; 1390 delete pBkmklist;
1391 } 1391 }
@@ -1396,6 +1396,6 @@ void QTReaderApp::readbkmks()
1396 { 1396 {
1397 pBkmklist = reader->getbkmklist(); 1397 pBkmklist = reader->getbkmklist();
1398 } 1398 }
1399 if (pBkmklist != NULL) 1399 if (pBkmklist != NULL)
1400 pBkmklist->sort(); 1400 pBkmklist->sort();
1401} 1401}
@@ -1411,23 +1411,23 @@ void QTReaderApp::do_addbkmk(const QString& text)
1411{ 1411{
1412 if (text.isEmpty()) 1412 if (text.isEmpty())
1413 { 1413 {
1414 QMessageBox::information(this, "QTReader", "Need a name for the bookmark\nSelect add again", 1); 1414 QMessageBox::information(this, "QTReader", "Need a name for the bookmark\nSelect add again", 1);
1415 } 1415 }
1416 else 1416 else
1417 { 1417 {
1418 if (pBkmklist == NULL) pBkmklist = new CList<Bkmk>; 1418 if (pBkmklist == NULL) pBkmklist = new CList<Bkmk>;
1419#ifdef _UNICODE 1419#ifdef _UNICODE
1420 CBuffer buff; 1420 CBuffer buff;
1421 int i = 0; 1421 int i = 0;
1422 for (i = 0; i < text.length(); i++) 1422 for (i = 0; i < text.length(); i++)
1423 { 1423 {
1424 buff[i] = text[i].unicode(); 1424 buff[i] = text[i].unicode();
1425 } 1425 }
1426 buff[i] = 0; 1426 buff[i] = 0;
1427 pBkmklist->push_front(Bkmk(buff.data(), reader->pagelocate())); 1427 pBkmklist->push_front(Bkmk(buff.data(), reader->pagelocate()));
1428#else 1428#else
1429 pBkmklist->push_front(Bkmk((const tchar*)text,reader->pagelocate())); 1429 pBkmklist->push_front(Bkmk((const tchar*)text,reader->pagelocate()));
1430#endif 1430#endif
1431 m_fBkmksChanged = true; 1431 m_fBkmksChanged = true;
1432 } 1432 }
1433} 1433}