-rw-r--r-- | noncore/apps/opie-gutenbrowser/gutenbrowser.cpp | 27 | ||||
-rw-r--r-- | noncore/apps/opie-gutenbrowser/gutenbrowserData.cpp | 18 |
2 files changed, 25 insertions, 20 deletions
diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp index 413ab51..e639d4d 100644 --- a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp +++ b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp | |||
@@ -16,38 +16,39 @@ | |||
16 | // donate@gutenberg.net | 16 | // donate@gutenberg.net |
17 | 17 | ||
18 | 18 | ||
19 | #include "editTitle.h" | 19 | #include "editTitle.h" |
20 | #include "gutenbrowser.h" | 20 | #include "gutenbrowser.h" |
21 | #include "LibraryDialog.h" | 21 | #include "LibraryDialog.h" |
22 | //#include "bookmarksdlg.h" | 22 | //#include "bookmarksdlg.h" |
23 | #include "optionsDialog.h" | 23 | #include "optionsDialog.h" |
24 | #include "helpme.h" | 24 | #include "helpme.h" |
25 | #include "NetworkDialog.h" | 25 | #include "NetworkDialog.h" |
26 | 26 | ||
27 | #include "openetext.h" | 27 | #include "openetext.h" |
28 | #include "output.h" | 28 | #include "output.h" |
29 | 29 | ||
30 | /* OPIE */ | 30 | /* OPIE */ |
31 | #include <opie2/odebug.h> | 31 | #include <opie2/odebug.h> |
32 | #include <opie2/oresource.h> | ||
33 | |||
32 | #include <qpe/qpeapplication.h> | 34 | #include <qpe/qpeapplication.h> |
33 | #include <qpe/fontdatabase.h> | 35 | #include <qpe/fontdatabase.h> |
34 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
35 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
36 | #include <qpe/mimetype.h> | 38 | #include <qpe/mimetype.h> |
37 | #include <qpe/resource.h> | ||
38 | #include <qpe/applnk.h> | 39 | #include <qpe/applnk.h> |
39 | 40 | ||
40 | /* QT */ | 41 | /* QT */ |
41 | #include <qregexp.h> | 42 | #include <qregexp.h> |
42 | #include <qregion.h> | 43 | #include <qregion.h> |
43 | #include <qpaintdevicemetrics.h> | 44 | #include <qpaintdevicemetrics.h> |
44 | #include <qvaluelist.h> | 45 | #include <qvaluelist.h> |
45 | #include <qlabel.h> | 46 | #include <qlabel.h> |
46 | #include <qclipboard.h> | 47 | #include <qclipboard.h> |
47 | #include <qpainter.h> | 48 | #include <qpainter.h> |
48 | #include <qpalette.h> | 49 | #include <qpalette.h> |
49 | #include <qobjectlist.h> | 50 | #include <qobjectlist.h> |
50 | #include <qfontdialog.h> | 51 | #include <qfontdialog.h> |
51 | #include <qtextview.h> | 52 | #include <qtextview.h> |
52 | #include <qbrush.h> | 53 | #include <qbrush.h> |
53 | #include <qfile.h> | 54 | #include <qfile.h> |
@@ -274,41 +275,41 @@ void Gutenbrowser::goGetit( const QString &url, bool showMsg) { | |||
274 | } | 275 | } |
275 | 276 | ||
276 | chdir(local_library); | 277 | chdir(local_library); |
277 | // //odebug << "Issuing the sys command: " << cmd << "" << oendl; | 278 | // //odebug << "Issuing the sys command: " << cmd << "" << oendl; |
278 | system(cmd); | 279 | system(cmd); |
279 | } | 280 | } |
280 | } | 281 | } |
281 | 282 | ||
282 | void Gutenbrowser::toggleButtonIcons( bool useEm) { | 283 | void Gutenbrowser::toggleButtonIcons( bool useEm) { |
283 | QString pixDir; | 284 | QString pixDir; |
284 | if(useEm) | 285 | if(useEm) |
285 | useEm=TRUE; | 286 | useEm=TRUE; |
286 | pixDir=QPEApplication::qpeDir()+"pics/gutenbrowser"; | 287 | pixDir=QPEApplication::qpeDir()+"pics/gutenbrowser"; |
287 | odebug << "Docdir is "+QPEApplication::documentDir() << oendl; | 288 | odebug << "Docdir is "+QPEApplication::documentDir() << oendl; |
288 | 289 | ||
289 | if( useIcons && QDir( pixDir).exists() ) { | 290 | if( useIcons && QDir( pixDir).exists() ) { |
290 | LibraryButton->setPixmap( Resource::loadPixmap("home") ); //in inline | 291 | LibraryButton->setPixmap( Opie::Core::OResource::loadPixmap("home", Opie::Core::OResource::SmallIcon ) ); |
291 | OpenButton->setPixmap( Resource::loadPixmap("gutenbrowser/openbook")); | 292 | OpenButton->setPixmap( Opie::Core::OResource::loadPixmap("gutenbrowser/openbook", Opie::Core::OResource::SmallIcon )); |
292 | ForwardButton->setPixmap( Resource::loadPixmap("forward"));//in inline | 293 | ForwardButton->setPixmap( Opie::Core::OResource::loadPixmap("forward", Opie::Core::OResource::SmallIcon )); |
293 | BackButton->setPixmap( Resource::loadPixmap("back") );//in inline | 294 | BackButton->setPixmap( Opie::Core::OResource::loadPixmap("back", Opie::Core::OResource::SmallIcon ) ); |
294 | SearchButton->setPixmap( Resource::loadPixmap("gutenbrowser/search") );//in inline | 295 | SearchButton->setPixmap( Opie::Core::OResource::loadPixmap("gutenbrowser/search", Opie::Core::OResource::SmallIcon ) ); |
295 | lastBmkButton->setPixmap( Resource::loadPixmap("gutenbrowser/bookmark_folder")); | 296 | lastBmkButton->setPixmap( Opie::Core::OResource::loadPixmap("gutenbrowser/bookmark_folder", Opie::Core::OResource::SmallIcon )); |
296 | setBookmarkButton->setPixmap( Resource::loadPixmap("gutenbrowser/bookmark") ); | 297 | setBookmarkButton->setPixmap( Opie::Core::OResource::loadPixmap("gutenbrowser/bookmark", Opie::Core::OResource::SmallIcon ) ); |
297 | dictionaryButton->setPixmap( Resource::loadPixmap("gutenbrowser/spellcheck") ); | 298 | dictionaryButton->setPixmap( Opie::Core::OResource::loadPixmap("gutenbrowser/spellcheck", Opie::Core::OResource::SmallIcon ) ); |
298 | InfoBar->setPixmap( Resource::loadPixmap("gutenbrowser/google")); | 299 | InfoBar->setPixmap( Opie::Core::OResource::loadPixmap("gutenbrowser/google", Opie::Core::OResource::SmallIcon )); |
299 | } | 300 | } |
300 | } | 301 | } |
301 | 302 | ||
302 | 303 | ||
303 | bool Gutenbrowser::queryExit() | 304 | bool Gutenbrowser::queryExit() |
304 | { | 305 | { |
305 | int exit=QMessageBox::information(this, "Quit...", "Do your really want to quit?", | 306 | int exit=QMessageBox::information(this, "Quit...", "Do your really want to quit?", |
306 | QMessageBox::Ok, QMessageBox::Cancel); | 307 | QMessageBox::Ok, QMessageBox::Cancel); |
307 | if (exit==1) { | 308 | if (exit==1) { |
308 | writeConfig(); | 309 | writeConfig(); |
309 | qApp->quit(); | 310 | qApp->quit(); |
310 | } else { | 311 | } else { |
311 | }; | 312 | }; |
312 | return (exit==1); | 313 | return (exit==1); |
313 | } | 314 | } |
314 | 315 | ||
@@ -1758,33 +1759,34 @@ void Gutenbrowser::enableButtons(bool b) | |||
1758 | 1759 | ||
1759 | } | 1760 | } |
1760 | 1761 | ||
1761 | void Gutenbrowser::fillWithTitles() { | 1762 | void Gutenbrowser::fillWithTitles() { |
1762 | Config config("Gutenbrowser"); | 1763 | Config config("Gutenbrowser"); |
1763 | config.setGroup( "Files" ); | 1764 | config.setGroup( "Files" ); |
1764 | int i_numofFiles = config.readNumEntry("NumberOfFiles", 0); | 1765 | int i_numofFiles = config.readNumEntry("NumberOfFiles", 0); |
1765 | mainList->clear(); | 1766 | mainList->clear(); |
1766 | QString temp; | 1767 | QString temp; |
1767 | for (int i = 1; i <= i_numofFiles; i++) { | 1768 | for (int i = 1; i <= i_numofFiles; i++) { |
1768 | temp.setNum(i); | 1769 | temp.setNum(i); |
1769 | config.setGroup( "Files" ); | 1770 | config.setGroup( "Files" ); |
1770 | QString ramble = config.readEntry(temp, "" ); | 1771 | QString ramble = config.readEntry(temp, "" ); |
1771 | config.setGroup( "Titles" ); | 1772 | config.setGroup( "Titles" ); |
1772 | temp = config.readEntry(ramble, ""); | 1773 | temp = config.readEntry(ramble, ""); |
1773 | if( !temp.isEmpty()) { | 1774 | if( !temp.isEmpty()) { |
1774 | mainList->insertItem ( Resource::loadPixmap("gutenbrowser/gutenbrowser_sm"), temp, -1); | 1775 | mainList->insertItem ( Opie::Core::OResource::loadPixmap("gutenbrowser/gutenbrowser_sm", |
1776 | Opie::Core::OResource::SmallIcon ), temp, -1); | ||
1775 | } | 1777 | } |
1776 | } | 1778 | } |
1777 | } | 1779 | } |
1778 | 1780 | ||
1779 | void Gutenbrowser::listClickedSlot( QListBoxItem * index) { | 1781 | void Gutenbrowser::listClickedSlot( QListBoxItem * index) { |
1780 | // if( !working) { | 1782 | // if( !working) { |
1781 | // working=true; | 1783 | // working=true; |
1782 | if(index) { | 1784 | if(index) { |
1783 | // QCopEnvelope ( "QPE/System", "busy()" ); | 1785 | // QCopEnvelope ( "QPE/System", "busy()" ); |
1784 | title = index->text(); | 1786 | title = index->text(); |
1785 | showMainList=FALSE; | 1787 | showMainList=FALSE; |
1786 | mainList->hide(); | 1788 | mainList->hide(); |
1787 | Lview->show(); | 1789 | Lview->show(); |
1788 | qApp->processEvents(); | 1790 | qApp->processEvents(); |
1789 | QString temp; | 1791 | QString temp; |
1790 | temp.setNum( mainList->currentItem() + 1); | 1792 | temp.setNum( mainList->currentItem() + 1); |
@@ -1907,33 +1909,34 @@ void Gutenbrowser::menuEditTitle() | |||
1907 | fileNum.setNum(i); | 1909 | fileNum.setNum(i); |
1908 | config.setGroup( "Files" ); | 1910 | config.setGroup( "Files" ); |
1909 | QString s_filename = config.readEntry(fileNum, "" ); | 1911 | QString s_filename = config.readEntry(fileNum, "" ); |
1910 | config.setGroup( "Titles" ); | 1912 | config.setGroup( "Titles" ); |
1911 | QString file_title = config.readEntry( s_filename, ""); | 1913 | QString file_title = config.readEntry( s_filename, ""); |
1912 | //odebug << "file_title is "+file_title << oendl; | 1914 | //odebug << "file_title is "+file_title << oendl; |
1913 | if(title_text == file_title ) { | 1915 | if(title_text == file_title ) { |
1914 | // selFile = s_filename; | 1916 | // selFile = s_filename; |
1915 | //odebug << "Edit: "+ file_title << oendl; | 1917 | //odebug << "Edit: "+ file_title << oendl; |
1916 | i=i_numofFiles+1; | 1918 | i=i_numofFiles+1; |
1917 | Edit_Title *titleEdit; | 1919 | Edit_Title *titleEdit; |
1918 | titleEdit = new Edit_Title(this,file_title ,TRUE); | 1920 | titleEdit = new Edit_Title(this,file_title ,TRUE); |
1919 | if(titleEdit->exec() !=0) { | 1921 | if(titleEdit->exec() !=0) { |
1920 | //odebug << titleEdit->newTitle << oendl; | 1922 | //odebug << titleEdit->newTitle << oendl; |
1921 | config.writeEntry( s_filename, titleEdit->newTitle); | 1923 | config.writeEntry( s_filename, titleEdit->newTitle); |
1922 | mainList->removeItem(currentItem); | 1924 | mainList->removeItem(currentItem); |
1923 | mainList->insertItem ( Resource::loadPixmap("gutenbrowser/gutenbrowser_sm"), titleEdit->newTitle, currentItem); | 1925 | mainList->insertItem ( Opie::Core::OResource::loadPixmap("gutenbrowser/gutenbrowser_sm", |
1926 | Opie::Core::OResource::SmallIcon ), titleEdit->newTitle, currentItem); | ||
1924 | } | 1927 | } |
1925 | } | 1928 | } |
1926 | } | 1929 | } |
1927 | 1930 | ||
1928 | // getTitles(); | 1931 | // getTitles(); |
1929 | mainList->triggerUpdate(true); | 1932 | mainList->triggerUpdate(true); |
1930 | 1933 | ||
1931 | } | 1934 | } |
1932 | 1935 | ||
1933 | 1936 | ||
1934 | 1937 | ||
1935 | bool Gutenbrowser::UnZipIt(const QString &zipFile) { | 1938 | bool Gutenbrowser::UnZipIt(const QString &zipFile) { |
1936 | odebug << zipFile << oendl; | 1939 | odebug << zipFile << oendl; |
1937 | #ifndef Q_WS_QWS | 1940 | #ifndef Q_WS_QWS |
1938 | if( QFile::exists( zipFile)) { // TODO findsome other way of dealingwithzip files. | 1941 | if( QFile::exists( zipFile)) { // TODO findsome other way of dealingwithzip files. |
1939 | bool isPgWhole=false; | 1942 | bool isPgWhole=false; |
diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowserData.cpp b/noncore/apps/opie-gutenbrowser/gutenbrowserData.cpp index c93dbc5..d384c09 100644 --- a/noncore/apps/opie-gutenbrowser/gutenbrowserData.cpp +++ b/noncore/apps/opie-gutenbrowser/gutenbrowserData.cpp | |||
@@ -5,32 +5,34 @@ | |||
5 | copyright : (C) 2000 -2004 by llornkcor | 5 | copyright : (C) 2000 -2004 by llornkcor |
6 | email : ljp@llornkcor.com | 6 | email : ljp@llornkcor.com |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | /*************************************************************************** | 8 | /*************************************************************************** |
9 | * This program is free software; you can redistribute it and/or modify * | 9 | * This program is free software; you can redistribute it and/or modify * |
10 | * it under the terms of the GNU General Public License as published by * | 10 | * it under the terms of the GNU General Public License as published by * |
11 | * the Free Software Foundation; either version 2 of the License, or * | 11 | * the Free Software Foundation; either version 2 of the License, or * |
12 | * (at your option) any later version. * | 12 | * (at your option) any later version. * |
13 | ***************************************************************************/ | 13 | ***************************************************************************/ |
14 | 14 | ||
15 | //#include "gutenbrowserData.h" | 15 | //#include "gutenbrowserData.h" |
16 | #include "gutenbrowser.h" | 16 | #include "gutenbrowser.h" |
17 | #include "multiline_ex.h" | 17 | #include "multiline_ex.h" |
18 | 18 | ||
19 | /* OPIE */ | 19 | /* OPIE */ |
20 | #include <opie2/odebug.h> | 20 | #include <opie2/odebug.h> |
21 | #include <opie2/oresource.h> | ||
22 | |||
21 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
22 | #include <qpe/fontdatabase.h> | 24 | #include <qpe/fontdatabase.h> |
23 | #include <qpe/menubutton.h> | 25 | #include <qpe/menubutton.h> |
24 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
25 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
26 | 28 | ||
27 | /* QT */ | 29 | /* QT */ |
28 | #include <qfontinfo.h> | 30 | #include <qfontinfo.h> |
29 | #include <qtoolbutton.h> | 31 | #include <qtoolbutton.h> |
30 | 32 | ||
31 | void Gutenbrowser::initSlots() { | 33 | void Gutenbrowser::initSlots() { |
32 | 34 | ||
33 | connect(LibraryButton,SIGNAL(released()),SLOT(LibraryBtn())); | 35 | connect(LibraryButton,SIGNAL(released()),SLOT(LibraryBtn())); |
34 | connect(OpenButton,SIGNAL(released()),SLOT(OpenBtn())); | 36 | connect(OpenButton,SIGNAL(released()),SLOT(OpenBtn())); |
35 | connect(SearchButton,SIGNAL(released()),SLOT(SearchBtn())); | 37 | connect(SearchButton,SIGNAL(released()),SLOT(SearchBtn())); |
36 | connect(ForwardButton,SIGNAL(clicked()),SLOT(ForwardBtn())); | 38 | connect(ForwardButton,SIGNAL(clicked()),SLOT(ForwardBtn())); |
@@ -158,59 +160,59 @@ qDebug("lease query before leaving the library.");; | |||
158 | b_queryExit=FALSE; | 160 | b_queryExit=FALSE; |
159 | } | 161 | } |
160 | // bookmarks | 162 | // bookmarks |
161 | // config.setGroup("Titles"); | 163 | // config.setGroup("Titles"); |
162 | // QString tmpTitle=config.readEntry(file_name,""); | 164 | // QString tmpTitle=config.readEntry(file_name,""); |
163 | 165 | ||
164 | 166 | ||
165 | }// end initConfig() | 167 | }// end initConfig() |
166 | 168 | ||
167 | void Gutenbrowser::initMenuBar() | 169 | void Gutenbrowser::initMenuBar() |
168 | { | 170 | { |
169 | qDebug("Starting menu init."); | 171 | qDebug("Starting menu init."); |
170 | // menuBar entry fileMenu | 172 | // menuBar entry fileMenu |
171 | menubar = new QPEMenuBar(this); | 173 | menubar = new QPEMenuBar(this); |
172 | 174 | ||
173 | fileMenu=new QPopupMenu(); | 175 | fileMenu=new QPopupMenu(); |
174 | fileMenu->insertItem(Resource::loadPixmap("gutenbrowser/openbook"), | 176 | fileMenu->insertItem( Opie::Core::OResource::loadPixmap("gutenbrowser/openbook", Opie::Core::OResource::SmallIcon ), |
175 | "Open Local Library...", this, SLOT( OpenBtn()) ); | 177 | "Open Local Library...", this, SLOT( OpenBtn()) ); |
176 | // fileMenu->insertItem("Download FTPSite", this, SLOT( downloadFtpList()) ); | 178 | // fileMenu->insertItem("Download FTPSite", this, SLOT( downloadFtpList()) ); |
177 | fileMenu->insertItem( Resource::loadPixmap("home"), | 179 | fileMenu->insertItem( Opie::Core::OResource::loadPixmap("home", Opie::Core::OResource::SmallIcon ), |
178 | "Download Library Index", this, SLOT( downloadLibIndex()) ); | 180 | "Download Library Index", this, SLOT( downloadLibIndex()) ); |
179 | fileMenu->insertItem( Resource::loadPixmap("quit"), | 181 | fileMenu->insertItem( Opie::Core::OResource::loadPixmap("quit", Opie::Core::OResource::SmallIcon ), |
180 | "Quit Gutenbrowser...", this, SLOT( ByeBye()) ); | 182 | "Quit Gutenbrowser...", this, SLOT( ByeBye()) ); |
181 | // menuBar entry editMenu | 183 | // menuBar entry editMenu |
182 | 184 | ||
183 | editMenu=new QPopupMenu(); | 185 | editMenu=new QPopupMenu(); |
184 | 186 | ||
185 | editMenu->insertItem(Resource::loadPixmap("up"), "Top", | 187 | editMenu->insertItem( Opie::Core::OResource::loadPixmap("up", Opie::Core::OResource::SmallIcon ), "Top", |
186 | this, SLOT(TopBtn()) ); | 188 | this, SLOT(TopBtn()) ); |
187 | editMenu->insertItem( Resource::loadPixmap("back"), "Beginning", | 189 | editMenu->insertItem( Opie::Core::OResource::loadPixmap("back", Opie::Core::OResource::SmallIcon ), "Beginning", |
188 | this, SLOT(doBeginBtn()) ); | 190 | this, SLOT(doBeginBtn()) ); |
189 | editMenu->insertItem( Resource::loadPixmap("gutenbrowser/search"), "Search", | 191 | editMenu->insertItem( Opie::Core::OResource::loadPixmap("gutenbrowser/search", Opie::Core::OResource::SmallIcon ), "Search", |
190 | this, SLOT(SearchBtn()) ); | 192 | this, SLOT(SearchBtn()) ); |
191 | 193 | ||
192 | editMenu->insertItem("Clear", this, SLOT(ClearEdit()) ); | 194 | editMenu->insertItem("Clear", this, SLOT(ClearEdit()) ); |
193 | 195 | ||
194 | optionsMenu= new QPopupMenu(); | 196 | optionsMenu= new QPopupMenu(); |
195 | optionsMenu->insertItem( Resource::loadPixmap("gutenbrowser/configure"), | 197 | optionsMenu->insertItem( Opie::Core::OResource::loadPixmap("gutenbrowser/configure", Opie::Core::OResource::SmallIcon ), |
196 | "Configure", this, SLOT(doOptions()) ); | 198 | "Configure", this, SLOT(doOptions()) ); |
197 | 199 | ||
198 | donateMenu = new QPopupMenu(); | 200 | donateMenu = new QPopupMenu(); |
199 | // donateMenu->insertItem("Gutenberg", this, SLOT(donateGutenberg()) ); | 201 | // donateMenu->insertItem("Gutenberg", this, SLOT(donateGutenberg()) ); |
200 | donateMenu->insertItem( Resource::loadPixmap("gutenbrowser/gutenbrowser_sm"), | 202 | donateMenu->insertItem( Opie::Core::OResource::loadPixmap("gutenbrowser/gutenbrowser_sm", Opie::Core::OResource::SmallIcon ), |
201 | "Gutenbrowser Developer", this, SLOT(infoGutenbrowser()) ); | 203 | "Gutenbrowser Developer", this, SLOT(infoGutenbrowser()) ); |
202 | 204 | ||
203 | menubar->insertItem("File", fileMenu); | 205 | menubar->insertItem("File", fileMenu); |
204 | menubar->insertItem("Page", editMenu); | 206 | menubar->insertItem("Page", editMenu); |
205 | menubar->insertItem("Options", optionsMenu); | 207 | menubar->insertItem("Options", optionsMenu); |
206 | // menubar->insertItem("More Info", donateMenu); | 208 | // menubar->insertItem("More Info", donateMenu); |
207 | 209 | ||
208 | menu->addWidget( menubar,0); | 210 | menu->addWidget( menubar,0); |
209 | 211 | ||
210 | topLayout->addLayout( menu, 0); | 212 | topLayout->addLayout( menu, 0); |
211 | } | 213 | } |
212 | 214 | ||
213 | void Gutenbrowser::initButtonBar() | 215 | void Gutenbrowser::initButtonBar() |
214 | { | 216 | { |
215 | qDebug("Starting buttonbar init."); | 217 | qDebug("Starting buttonbar init."); |
216 | 218 | ||