00001
00002
00003
00004
00005
00006
00007
00008 #include "optionsDialog.h"
00009
00010
00011
00012 #include <opie2/ofiledialog.h>
00013 #include <opie2/odebug.h>
00014 using namespace Opie::Ui;
00015
00016
00017 #include <qlabel.h>
00018 #include <qlistbox.h>
00019 #include <qpushbutton.h>
00020 #include <qlayout.h>
00021
00022 void optionsDialog::BrowserDlg( )
00023 {
00024
00025 http_ListBox1->insertItem( tr( "Opera"));
00026 http_ListBox1->insertItem( tr( "Konqueror"));
00027 http_ListBox1->insertItem( tr( "wget"));
00028 }
00029
00030 void optionsDialog::select_title(int) {
00031 browserName = http_ListBox1->currentText();
00032 Config config("Gutenbrowser");
00033 config.setGroup( "Browser" );
00034 printf("Brow is: "+browserName+"\n");
00035 config.writeEntry("Preferred", browserName);
00036 TextLabel3_3->setText( "Current http browser: "+browserName );
00037 }
00038
00039 void optionsDialog::BrowseSelected() {
00040 QString fileName;
00041 Config cfg("Gutenbrowser");
00042 cfg. setGroup ( "View" );
00043 QString dir = cfg.readEntry("LastOpenDirectory", QPEApplication::documentDir());
00044 QMap<QString, QStringList> map;
00045 map.insert(tr("All"), QStringList() );
00046 QStringList text;
00047 text << "text/*";
00048 map.insert(tr("Text"), text );
00049 text << "*";
00050 map.insert(tr("All"), text );
00051
00052 QString str = OFileDialog::getOpenFileName( 2, dir , QString::null, map);
00053 if( !str.isEmpty() && QFile(str).exists() && !QFileInfo(str).isDir() ) {
00054 fileName = str;
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 if ( !fileName.isNull() ) {
00071
00072 }
00073 }
00074
00075 }
00076
00077 void optionsDialog::setHttp(int index) {
00078 Config config("Gutenbrowser");
00079 config.setGroup( "HttpServer" );
00080 odebug << "writing http server" << oendl;
00081 if( index== 0) {
00082 config.writeEntry("Preferred", "http://sailor.gutenberg.org");
00083 } else {
00084 config.writeEntry("Preferred", "http://www.prairienet.org/pg");
00085 }
00086
00087 }