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

browserDialog.cpp

Go to the documentation of this file.
00001 /****************************************************************************
00002 copyright 2001 by L.J. Potter ljp@llornkcor.com
00003     copyright            : (C) 2000 -2004 by llornkcor
00004     email                : ljp@llornkcor.com
00005 
00006 ****************************************************************************/
00007 
00008 #include "optionsDialog.h"
00009 //#include "fileBrowser.h"
00010 
00011 /* OPIE */
00012 #include <opie2/ofiledialog.h>
00013 #include <opie2/odebug.h>
00014 using namespace Opie::Ui;
00015 
00016 /* QT */
00017 #include <qlabel.h>
00018 #include <qlistbox.h>
00019 #include <qpushbutton.h>
00020 #include <qlayout.h>
00021 
00022 void optionsDialog::BrowserDlg( )
00023 {
00024 //    setCaption( tr( "Choose Browser" ) );
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 //      QStringList fileList=browseForFiles->fileList;
00056 //      odebug << selFile << oendl;
00057 //      QStringList::ConstIterator f;
00058 //      QString fileTemp,filer;
00059 //      for (  f = fileList.begin(); f != fileList.end(); f++ ) {
00060 
00061 //          fileTemp = *f;
00062 //          fileTemp.right( fileTemp.length()-5);
00063 //          fileName = fileTemp;
00064 //          if( !fileName.isEmpty() ){
00065 //              filer = fileName;
00066 //          } else {
00067 //              QString sMsg;
00068 //              sMsg = "Error opening library filelist "+fileName;
00069 //          }
00070         if ( !fileName.isNull() ) {                 // got a file name
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 }

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