00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "optionsDialog.h"
00019 #include "fontDialog.h"
00020
00021
00022
00023
00024
00025 #include <opie2/odebug.h>
00026 #include <qpe/config.h>
00027
00028
00029 #include <qfont.h>
00030 #include <qcheckbox.h>
00031 #include <qcombobox.h>
00032 #include <qlabel.h>
00033 #include <qlistbox.h>
00034 #include <qpushbutton.h>
00035 #include <qtabwidget.h>
00036 #include <qwidget.h>
00037 #include <qlayout.h>
00038 #include <qvariant.h>
00039 #include <qtooltip.h>
00040 #ifndef Q_WS_QWS
00041 #include <qwhatsthis.h>
00042 #endif
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 optionsDialog::optionsDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
00054 : QDialog( parent, name, modal, fl )
00055 {
00056 if ( !name )
00057 setName( "optionsDialog" );
00058 changedFonts=FALSE;
00059
00060
00061 b_qExit=TRUE;
00062 initDialog();
00063
00064 ftpSiteDlg();
00065 BrowserDlg();
00066 FontDialog();
00067 }
00068
00069 optionsDialog::~optionsDialog()
00070 {
00071
00072
00073 }
00074
00076 void optionsDialog::doOptions() {
00077
00078
00079 getConfig();
00080 }
00081
00082 void optionsDialog::getConfig()
00083 {
00084 Config config("Gutenbrowser");
00085 config.setGroup( "FTPsite" );
00086 ftp_host=config.readEntry("SiteName", "sailor.gutenberg.org");
00087 ftp_base_dir= config.readEntry("base", "/pub/gutenberg");
00088
00089 TextLabel3->setText( "Current ftp server:\n"+ftp_host);
00090
00091 config.setGroup( "Proxy" );
00092 if( config.readEntry("IsChecked", "FALSE") == "TRUE") {
00093 Ftp_CheckBox->setChecked( FALSE);
00094 } else {
00095 Ftp_CheckBox->setChecked( TRUE);
00096 }
00097
00098 config.setGroup( "HttpServer" );
00099 QString s_http = config.readEntry("Preferred", "http://sailor.gutenbook.org");
00100 if( s_http == "http://sailor.gutenbook.org")
00101 ComboBox1->setCurrentItem(0);
00102 else
00103 ComboBox1->setCurrentItem(1);
00104
00105 config.setGroup( "Browser" );
00106 brow = config.readEntry("Preferred", "Opera");
00107 browserName=brow;
00108
00109 TextLabel3_3->setText( "Current http browser:\n"+brow );
00110
00111 config.setGroup( "Geometry" );
00112
00113
00114 QString temp;
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132 config.setGroup("General");
00133 QString qExit=config.readEntry("queryExit","TRUE");
00134 if(qExit=="TRUE") {
00135 cb_queryExit->setChecked(TRUE);
00136 odebug << "Config Setting b_qExit=TRUE;" << oendl;
00137 b_qExit=TRUE;
00138 } else {
00139 cb_queryExit->setChecked(FALSE);
00140 odebug << "ConfigSetting b_qExit=FALSE;" << oendl;
00141 b_qExit=FALSE;
00142 }
00143
00144
00145 useWordWrap_CheckBox->setChecked( config.readBoolEntry("WordWrap", 1));
00146 QString downDir=config.readEntry( "DownloadDirectory",local_library);
00147 downloadDirEdit->setText(downDir);
00148 }
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174 void optionsDialog::slotQueryExit()
00175 {
00176 Config config("Gutenbrowser");
00177 config.setGroup("General");
00178 odebug << "writing queryExit" << oendl;
00179 if(cb_queryExit->isChecked()) {
00180 b_qExit=TRUE;
00181 config.writeEntry("queryExit","TRUE");
00182 odebug << "WritingConfig queryExit=TRUE" << oendl;
00183 } else {
00184 b_qExit=FALSE;
00185 config.writeEntry("queryExit","FALSE");
00186 odebug << "WritingConfig queryExit=FALSE" << oendl;
00187 }
00188 config.write();
00189 }
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201 void optionsDialog::changeFonts()
00202 {
00203 changedFonts=TRUE;
00204 }
00205
00206
00207 void optionsDialog::slotWordWrap(bool b) {
00208
00209 Config config("Gutenbrowser");
00210 config.setGroup("General");
00211
00212 config.writeEntry("WordWrap", b);
00213 config.write();
00214
00215 }