author | llornkcor <llornkcor> | 2004-04-07 13:07:42 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-04-07 13:07:42 (UTC) |
commit | fc42c7317c956e5bc6e74bfbb1ec185d2faa79f4 (patch) (unidiff) | |
tree | 703e89c7178f764aab25028d4525f74340b28dcb /noncore/apps/opie-gutenbrowser/browserDialog.cpp | |
parent | 9e1ecade17a77c3d50aecc4c92091d852e99e8d9 (diff) | |
download | opie-fc42c7317c956e5bc6e74bfbb1ec185d2faa79f4.zip opie-fc42c7317c956e5bc6e74bfbb1ec185d2faa79f4.tar.gz opie-fc42c7317c956e5bc6e74bfbb1ec185d2faa79f4.tar.bz2 |
add gutenbrowser
Diffstat (limited to 'noncore/apps/opie-gutenbrowser/browserDialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-gutenbrowser/browserDialog.cpp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/noncore/apps/opie-gutenbrowser/browserDialog.cpp b/noncore/apps/opie-gutenbrowser/browserDialog.cpp new file mode 100644 index 0000000..5c48da1 --- a/dev/null +++ b/noncore/apps/opie-gutenbrowser/browserDialog.cpp | |||
@@ -0,0 +1,83 @@ | |||
1 | /**************************************************************************** | ||
2 | copyright 2001 by L.J. Potter ljp@llornkcor.com | ||
3 | copyright : (C) 2000 -2004 by llornkcor | ||
4 | email : ljp@llornkcor.com | ||
5 | |||
6 | ****************************************************************************/ | ||
7 | |||
8 | #include "optionsDialog.h" | ||
9 | //#include "fileBrowser.h" | ||
10 | |||
11 | #include <qlabel.h> | ||
12 | #include <qlistbox.h> | ||
13 | #include <qpushbutton.h> | ||
14 | #include <qlayout.h> | ||
15 | |||
16 | #include <opie/ofiledialog.h> | ||
17 | |||
18 | void optionsDialog::BrowserDlg( ) | ||
19 | { | ||
20 | // setCaption( tr( "Choose Browser" ) ); | ||
21 | http_ListBox1->insertItem( tr( "Opera")); | ||
22 | http_ListBox1->insertItem( tr( "Konqueror")); | ||
23 | http_ListBox1->insertItem( tr( "wget")); | ||
24 | } | ||
25 | |||
26 | void optionsDialog::select_title(int) { | ||
27 | browserName = http_ListBox1->currentText(); | ||
28 | Config config("Gutenbrowser"); | ||
29 | config.setGroup( "Browser" ); | ||
30 | printf("Brow is: "+browserName+"\n"); | ||
31 | config.writeEntry("Preferred", browserName); | ||
32 | TextLabel3_3->setText( "Current http browser: "+browserName ); | ||
33 | } | ||
34 | |||
35 | void optionsDialog::BrowseSelected() { | ||
36 | QString fileName; | ||
37 | Config cfg("Gutenbrowser"); | ||
38 | cfg. setGroup ( "View" ); | ||
39 | QString dir = cfg.readEntry("LastOpenDirectory", QPEApplication::documentDir()); | ||
40 | QMap<QString, QStringList> map; | ||
41 | map.insert(tr("All"), QStringList() ); | ||
42 | QStringList text; | ||
43 | text << "text/*"; | ||
44 | map.insert(tr("Text"), text ); | ||
45 | text << "*"; | ||
46 | map.insert(tr("All"), text ); | ||
47 | |||
48 | QString str = OFileDialog::getOpenFileName( 2, dir , QString::null, map); | ||
49 | if( !str.isEmpty() && QFile(str).exists() && !QFileInfo(str).isDir() ) { | ||
50 | fileName = str; | ||
51 | // QStringList fileList=browseForFiles->fileList; | ||
52 | // qDebug(selFile); | ||
53 | // QStringList::ConstIterator f; | ||
54 | // QString fileTemp,filer; | ||
55 | // for ( f = fileList.begin(); f != fileList.end(); f++ ) { | ||
56 | |||
57 | // fileTemp = *f; | ||
58 | // fileTemp.right( fileTemp.length()-5); | ||
59 | // fileName = fileTemp; | ||
60 | // if( !fileName.isEmpty() ){ | ||
61 | // filer = fileName; | ||
62 | // } else { | ||
63 | // QString sMsg; | ||
64 | // sMsg = "Error opening library filelist "+fileName; | ||
65 | // } | ||
66 | if ( !fileName.isNull() ) { // got a file name | ||
67 | // ... | ||
68 | } | ||
69 | } | ||
70 | |||
71 | } | ||
72 | |||
73 | void optionsDialog::setHttp(int index) { | ||
74 | Config config("Gutenbrowser"); | ||
75 | config.setGroup( "HttpServer" ); | ||
76 | qDebug("writing http server"); | ||
77 | if( index== 0) { | ||
78 | config.writeEntry("Preferred", "http://sailor.gutenberg.org"); | ||
79 | } else { | ||
80 | config.writeEntry("Preferred", "http://www.prairienet.org/pg"); | ||
81 | } | ||
82 | |||
83 | } | ||