Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

optionsDialogData.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           optionsDialogData.cpp  -  description
00003                              -------------------
00004     begin                : Tue Jul 25 2000
00005     copyright            : (C) 2000 -2004 by llornkcor
00006     email                : ljp@llornkcor.com
00007  ***************************************************************************/
00008 /***************************************************************************
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; either version 2 of the License, or     *
00012  *   (at your option) any later version.                                   *
00013  ***************************************************************************/
00014 #include <qpixmap.h>
00015 #include "optionsDialog.h"
00016 #include "fontDialog.h"
00017 
00018 #include <qlabel.h>
00019 #include <qpushbutton.h>
00020 #include <qlineedit.h>
00021 #include <qcombobox.h>
00022 
00023 void optionsDialog::initDialog()
00024 {
00025 //    QWidget *d = QApplication::desktop();
00026 //    int width = d->width();
00027 //    int height = d->height();
00028 
00029     QGridLayout *layout = new QGridLayout( this );
00030     layout->setSpacing(2);
00031     layout->setMargin(2);
00032 
00033     tabWidget = new QTabWidget( this, "tabWidget" );
00034     layout->addMultiCellWidget( tabWidget, 0, 0, 0, 3);
00035 
00036     Widget2 = new QWidget( tabWidget, "Widget2" );
00037 
00038     QGridLayout *layout2 = new QGridLayout(Widget2 );
00039     layout2->setSpacing(2);
00040     layout2->setMargin(2);
00041 
00042 //    Http_CheckBox = new QCheckBox( Widget2, "Http_CheckBox" );
00043 
00044     QLabel *downLabel= new QLabel(Widget2,"Label1");
00045     downLabel->setText("Download Directory:");
00046     downLabel->setMaximumHeight(30);
00047 
00048     downloadDirEdit = new QLineEdit(Widget2,"downloadDir");
00049 
00050 //      ComboBoxStyle = new QComboBox( FALSE, Widget2, "ComboBoxStyle" );
00051 //      ComboBoxStyle->insertItem( tr( "styleMetal") );
00052 //      ComboBoxStyle->insertItem( tr( "styleWindows") );
00053 //      ComboBoxStyle->insertItem( tr( "default style") );
00054 
00055     cb_queryExit = new QCheckBox( Widget2, "cb_queryExit" );
00056     cb_queryExit->setText("Query before exit.");
00057 
00058     useWordWrap_CheckBox = new QCheckBox( Widget2, "WordWrap_CheckBox" );
00059     useWordWrap_CheckBox->setText("Use Word Wrap");
00060 //    Http_CheckBox->setText("Use pg index instead of ftp library index" ) ;
00061     Ftp_CheckBox = new QCheckBox( Widget2, "Ftp_CheckBox" );
00062     Ftp_CheckBox->setText("Use FTP");
00063     Ftp_CheckBox->hide();
00064 
00065     layout2->addMultiCellWidget( downLabel, 0, 0, 0, 2);
00066 //              downloadDirEdit->setMaximumWidth( 200);
00067     layout2->addMultiCellWidget( downloadDirEdit, 1, 1, 0, 0);
00068     //    layout2->addMultiCellWidget( ComboBoxStyle, 3, 3, 0, 0);
00069     layout2->addMultiCellWidget( cb_queryExit, 2, 2, 0, 1);
00070     layout2->addMultiCellWidget( useWordWrap_CheckBox, 3, 3, 0, 1);
00071     QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00072     layout2->addItem( spacer, 4, 0 );
00073 //    downloadDirEdit->hide();
00074 
00076     tabWidget->insertTab( Widget2, tr( "Main" ) );
00077 
00078     Widget3 = new QWidget( tabWidget, "Widget3" );
00079 
00080     QGridLayout *layout3 = new QGridLayout(Widget3 );
00081     layout3->setSpacing(2);
00082     layout3->setMargin(4);
00083 
00084     TextLabel3 = new QLabel( Widget3, "TextLabel3" );
00085   //  TextLabel3->setProperty( "text", tr( "Current ftp server:/n" ) );
00086     ftp_QListBox_1 = new QListBox( Widget3, "ftp_QListBox_1" );
00087     ftp_DownloadButton = new QPushButton( Widget3, "ftp_DownloadButton" );
00088 
00090     tabWidget->insertTab( Widget3, tr( "FTP" ) );
00091     tab = new QWidget( tabWidget, "tab" );
00092 
00093     TextLabel3_3 = new QLabel( tab, "TextLabel3_3" );
00094 
00095 //     TextLabel4 = new QLabel( tab, "TextLabel4" );
00096 //     TextLabel5 = new QLabel( tab, "TextLabel5" );
00097 
00098     PushButton_Browse = new QPushButton( tab, "PushButton_Browse" );
00099 
00100     ComboBox1 = new QComboBox( FALSE, tab, "ComboBox1" );
00101 
00102     ComboBox1->insertItem( tr( "http://sailor.gutenberg.org" ) );
00103     ComboBox1->insertItem( tr( "http://www.prairienet.org/pg" ) );
00104 
00105     http_ListBox1 = new QListBox( tab, "http_ListBox1" );
00106 
00108     tabWidget->insertTab( tab, tr( "HTTP" ) );
00109 
00110     QGridLayout *layout4 = new QGridLayout(tab );
00111     layout4->setSpacing(2);
00112     layout4->setMargin(2);
00113 
00114     fontDlg = new FontDialog( tabWidget,"FontDialog");
00115 //    fontWidget= new QWidget( tabWidget, "fontWidget" );
00116     tabWidget->insertTab( fontDlg,"Font");
00117 //    fontDlg = new FontDialog( fontWidget,"FontDialog");
00118 //      fontDlg->show();
00119 
00120     initConnections();
00121 
00122     ftp_DownloadButton->setText("New List");
00123     PushButton_Browse->setText("Browse");
00124 
00125     local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/";
00126 //    config = new CConfigFile( local_library+"gutenbrowserrc");
00127     doOptions();
00128 
00129     layout3->addMultiCellWidget( ftp_DownloadButton, 0, 0, 1, 2);
00130     layout3->addMultiCellWidget( TextLabel3, 1, 1, 0, 1);
00131     layout3->addMultiCellWidget( ftp_QListBox_1, 2, 2, 0, 2);
00132 
00133     TextLabel3_3->setMaximumHeight(50);
00134     layout4->addMultiCellWidget( PushButton_Browse, 0, 0, 1, 2);
00135     layout4->addMultiCellWidget( TextLabel3_3, 1, 1, 0, 1);
00136     layout4->addMultiCellWidget( http_ListBox1, 2, 3, 0, 2);
00137     layout4->addMultiCellWidget( ComboBox1, 4, 4, 0, 2);
00138     setCaption(tr("Gutenbrowser Options"));
00139 }
00140 
00141 void optionsDialog::initConnections() {
00142       // signals and slots connections
00143 //    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( OnExit()  ) );
00144 //    connect( fontChangeButton, SIGNAL( clicked() ), this, SLOT( changeFonts() ) );
00145 
00146 //  connect( s_Browser, SIGNAL( activated(const QString&)), SLOT( goBrowser(const QString&) ) );
00147 //    connect( Http_CheckBox, SIGNAL( clicked()), SLOT( httpCheckB()) );
00148 //    connect( downloadDirEdit, SIGNAL(textChanged(const QString &)),SLOT( lineEditChanged(const QString &) ));
00149 
00150 //    connect( Ftp_CheckBox, SIGNAL( clicked()), SLOT( FtpCheckB()) );
00151 //    downloadLineEdit
00152 
00153 // ftpsiteDlg
00154     connect( ftp_DownloadButton, SIGNAL( released() ),this, SLOT( getSite() ));
00155     connect( ftp_QListBox_1, SIGNAL( clicked (  QListBoxItem *)),this, SLOT( getSelection(  QListBoxItem *)) );
00156 
00157 //browserDialog
00158     connect( http_ListBox1, SIGNAL(highlighted ( int)),this, SLOT(select_title(int)) );
00159     connect( PushButton_Browse, SIGNAL( clicked() ), SLOT( BrowseSelected() ) );
00160 //    connect( ComboBox1,SIGNAL(activated(int)),this,SLOT( setHttp(int)));
00161 
00162 //      connect( tabWidget,SIGNAL(currentChanged(QWidget *tabber)),SLOT( onTab( QWidget * tabber)) );
00163 
00164     connect(cb_queryExit,SIGNAL(clicked()),SLOT( slotQueryExit()) );
00165                         //    connect(ComboBoxStyle,SIGNAL(activated(int)),this,SLOT(setStyle(int)));
00166                 connect( useWordWrap_CheckBox,SIGNAL( toggled(bool)),SLOT( slotWordWrap(bool)) );
00167 }
00168 
00169 void optionsDialog::listBoxMainSel( int index) {
00170     tabWidget->setCurrentPage( index);
00171 }

Generated on Sat Nov 5 16:16:53 2005 for OPIE by  doxygen 1.4.2