summaryrefslogtreecommitdiff
authorzecke <zecke>2004-10-16 22:31:18 (UTC)
committer zecke <zecke>2004-10-16 22:31:18 (UTC)
commit4a623a9afe68f8d2d2f9562cb5ab589c0023519c (patch) (unidiff)
tree63cfeb0e784db5dae6c93596cd07b04217ab4a22
parent1633552a8816eaa18b2b06da6573611b2636cee8 (diff)
downloadopie-4a623a9afe68f8d2d2f9562cb5ab589c0023519c.zip
opie-4a623a9afe68f8d2d2f9562cb5ab589c0023519c.tar.gz
opie-4a623a9afe68f8d2d2f9562cb5ab589c0023519c.tar.bz2
-Remove debug output on appMessage
-Check for Application Pages in help/lang/execname/execname.html as well. This is needed for qashmoney and could be used for the other help pages as well
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/helpbrowser/helpbrowser.cpp1
-rw-r--r--core/apps/helpbrowser/magictextbrowser.cpp11
2 files changed, 9 insertions, 3 deletions
diff --git a/core/apps/helpbrowser/helpbrowser.cpp b/core/apps/helpbrowser/helpbrowser.cpp
index cbb4059..4bd9565 100644
--- a/core/apps/helpbrowser/helpbrowser.cpp
+++ b/core/apps/helpbrowser/helpbrowser.cpp
@@ -97,49 +97,48 @@ void HelpBrowser::init( const QString& _home )
97 connect( bookm, SIGNAL( activated(int) ), 97 connect( bookm, SIGNAL( activated(int) ),
98 this, SLOT( bookmChosen(int) ) ); 98 this, SLOT( bookmChosen(int) ) );
99 99
100 readBookmarks(); 100 readBookmarks();
101 101
102 menu->insertItem( tr("Go"), go ); 102 menu->insertItem( tr("Go"), go );
103 menu->insertItem( tr( "Bookmarks" ), bookm ); 103 menu->insertItem( tr( "Bookmarks" ), bookm );
104 104
105 resize( 240, 300 ); 105 resize( 240, 300 );
106 browser->setFocus(); 106 browser->setFocus();
107 browser->setFrameStyle( QFrame::NoFrame ); 107 browser->setFrameStyle( QFrame::NoFrame );
108 108
109#if !defined(QT_NO_COP) 109#if !defined(QT_NO_COP)
110 QCopChannel *addressChannel = new QCopChannel("QPE/HelpBrowser" , this ); 110 QCopChannel *addressChannel = new QCopChannel("QPE/HelpBrowser" , this );
111 connect (addressChannel, SIGNAL( received(const QCString&,const QByteArray&)), 111 connect (addressChannel, SIGNAL( received(const QCString&,const QByteArray&)),
112 this, SLOT ( appMessage(const QCString&,const QByteArray&) ) ); 112 this, SLOT ( appMessage(const QCString&,const QByteArray&) ) );
113#endif 113#endif
114 114
115 connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), 115 connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)),
116 this, SLOT(appMessage(const QCString&,const QByteArray&)) ); 116 this, SLOT(appMessage(const QCString&,const QByteArray&)) );
117} 117}
118 118
119void HelpBrowser::appMessage(const QCString& msg, const QByteArray& data) 119void HelpBrowser::appMessage(const QCString& msg, const QByteArray& data)
120{ 120{
121 odebug << "reached appMessage" << oendl;
122 if ( msg == "showFile(QString)" ) { 121 if ( msg == "showFile(QString)" ) {
123 QDataStream ds(data,IO_ReadOnly); 122 QDataStream ds(data,IO_ReadOnly);
124 QString fn; 123 QString fn;
125 ds >> fn; 124 ds >> fn;
126 setDocument( fn ); 125 setDocument( fn );
127 126
128 QPEApplication::setKeepRunning(); 127 QPEApplication::setKeepRunning();
129 128
130 showMaximized(); 129 showMaximized();
131 setActiveWindow(); 130 setActiveWindow();
132 raise(); 131 raise();
133 } 132 }
134} 133}
135 134
136void HelpBrowser::setDocument( const QString &doc ) 135void HelpBrowser::setDocument( const QString &doc )
137{ 136{
138 if ( !doc.isEmpty() ) 137 if ( !doc.isEmpty() )
139 browser->setSource( doc ); 138 browser->setSource( doc );
140 raise(); 139 raise();
141} 140}
142 141
143 142
144void HelpBrowser::textChanged() 143void HelpBrowser::textChanged()
145{ 144{
diff --git a/core/apps/helpbrowser/magictextbrowser.cpp b/core/apps/helpbrowser/magictextbrowser.cpp
index 80495c9..44bf19f 100644
--- a/core/apps/helpbrowser/magictextbrowser.cpp
+++ b/core/apps/helpbrowser/magictextbrowser.cpp
@@ -62,36 +62,43 @@ bool MagicTextBrowser::magicOpe( const QString& source, const QString& name ) {
62 QString generated = generateOpe(name); 62 QString generated = generateOpe(name);
63 txt.replace(start,len,generated); 63 txt.replace(start,len,generated);
64 setText(txt); 64 setText(txt);
65 return true; 65 return true;
66 } 66 }
67 return false; 67 return false;
68} 68}
69QString MagicTextBrowser::generateOpe(const QString& name)const { 69QString MagicTextBrowser::generateOpe(const QString& name)const {
70 if ( name == QString::fromLatin1("applets") ) { 70 if ( name == QString::fromLatin1("applets") ) {
71 return QString::fromLatin1("<h3>No Applets found</h3>"); 71 return QString::fromLatin1("<h3>No Applets found</h3>");
72 }else if ( name == QString::fromLatin1("input") ) { 72 }else if ( name == QString::fromLatin1("input") ) {
73 return QString::fromLatin1("<h3>No input methods available</h3>"); 73 return QString::fromLatin1("<h3>No input methods available</h3>");
74 }else 74 }else
75 return QString::null; 75 return QString::null;
76} 76}
77 77
78QString MagicTextBrowser::generateQpe(const QString& name) const { 78QString MagicTextBrowser::generateQpe(const QString& name) const {
79 QString dir = MimeType::appsFolderName()+"/"+name[0].upper()+name.mid(1); 79 QString dir = MimeType::appsFolderName()+"/"+name[0].upper()+name.mid(1);
80 AppLnkSet lnkset(dir); 80 AppLnkSet lnkset(dir);
81 AppLnk* lnk; 81 AppLnk* lnk;
82 QString r; 82 QString r;
83 for (QListIterator<AppLnk> it(lnkset.children()); (lnk=it.current()); ++it) { 83 for (QListIterator<AppLnk> it(lnkset.children()); (lnk=it.current()); ++it) {
84 QString name = lnk->name(); 84 QString name = lnk->name();
85 QString icon = lnk->icon(); 85 QString icon = lnk->icon();
86 QString helpFile = lnk->exec()+".html"; 86 QString exec = lnk->exec();
87 QString helpFile = exec+".html";
87 QStringList helpPath = Global::helpPath(); 88 QStringList helpPath = Global::helpPath();
88 bool helpExists = FALSE; 89 bool helpExists = FALSE;
89 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) 90 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) {
90 helpExists = QFile::exists( *it + "/" + helpFile ); 91 helpExists = QFile::exists( *it + "/" + helpFile );
92
93 if( !helpExists && QFile::exists( *it + "/" + exec + "/" + helpFile ) ) {
94 helpFile = exec + "/" + helpFile;
95 helpExists = true;
96 }
97 }
91 98
92 if ( helpExists ) { 99 if ( helpExists ) {
93 r += "<h3><a href="+helpFile+"><img src="+icon+">"+name+"</a></h3>\n"; 100 r += "<h3><a href="+helpFile+"><img src="+icon+">"+name+"</a></h3>\n";
94 } 101 }
95 } 102 }
96 return r; 103 return r;
97} 104}