summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-gutenbrowser/NetworkDialog.cpp30
-rw-r--r--noncore/apps/opie-gutenbrowser/NetworkDialog.h2
-rw-r--r--noncore/apps/opie-gutenbrowser/SearchDialog.cpp2
3 files changed, 17 insertions, 17 deletions
diff --git a/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp b/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
index 6e6b707..d629449 100644
--- a/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
+++ b/noncore/apps/opie-gutenbrowser/NetworkDialog.cpp
@@ -33,131 +33,131 @@
/* STD */
#include <unistd.h>
extern "C" {
#include <ftplib.h>
}
QProgressBar* ProgressBar1;
QPushButton* buttonCancel;
static netbuf *conn = NULL;
static int log_progress(netbuf *ctl, int xfered, void *arg) {
int fsz = *(int *)arg;
int pct = (xfered * 100) / fsz;
printf("%3d%%\r", pct);
fflush(stdout);
ProgressBar1->setProgress(xfered);
qApp->processEvents();
return 1;
}
NetworkDialog::NetworkDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QStringList netL)
: QDialog( parent, name, modal, fl )
{
ftp_host = netL[0];
networkUrl = strUrl = netL[0];
dir = ftp_base_dir = netL[1];
localFileName = netL[2];
s_partialFileName = netL[3];
- resize(240,110);
+ resize(240,120);
local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/";
// autoOk = autoDownload;
// if( networkUrl.find("ftp",0,false)== -1 ) {
// if ( !name )
// setName( "HTTP NetworkDialog" );
// setCaption( tr( "HTTP Download ) );
// qInitNetworkProtocols(); // registers ftp protocol // for now
// QNetworkProtocol::registerNetworkProtocol( "http", new QNetworkProtocolFactory<Http> );
// } else {
if ( !name )
setName( "FTP NetworkDialog" );
setCaption(tr("FTP Download"));
// }
initDialog(); //opens file to be written
}
NetworkDialog::~NetworkDialog() {
}
void NetworkDialog::initDialog() {
totalBytesDownloaded=0;
warnLabel = new QLabel( this, "TextLabel" );
warnLabel ->setText( tr( "Push Ok to download file...." ) );
TextLabel3 = new QLabel( this, "TextLabel3" );
TextLabel3->setText( "");
QWidget* Layout1 = new QWidget( this, "Layout1" );
hbox = new QHBoxLayout(Layout1);
hbox->setMargin(4);
ProgressBar1 = new QProgressBar( Layout1, "ProgressBar1" );
ProgressBar1->setProgress(0);
hbox->addWidget(ProgressBar1,10,AlignCenter);
- hbox->addStretch(1);
- buttonOk = new QPushButton( Layout1, "buttonOk" );
- buttonOk->setText( tr( "&OK" ) );
- hbox->addWidget(buttonOk,0,AlignRight);
- hbox->addSpacing(5);
+ // hbox->addStretch(1);
+// buttonOk = new QPushButton( Layout1, "buttonOk" );
+// buttonOk->setText( tr( "&OK" ) );
+// hbox->addWidget(buttonOk,0,AlignRight);
+// hbox->addSpacing(5);
buttonCancel = new QPushButton( Layout1, "buttonCancel" );
buttonCancel->setText( tr( "&Cancel" ) );
buttonCancel->setAutoDefault( TRUE );
buttonCancel->setDefault( TRUE );
hbox->addWidget(buttonCancel,0,AlignRight);
- ProgressBar1->setFixedSize(140,22);
- buttonOk->setFixedSize(35,22);
- buttonCancel->setFixedSize(35,22);
+ ProgressBar1->setFixedSize(150,25);
+// buttonOk->setFixedSize(35,22);
+ buttonCancel->setFixedSize(50,25);
warnLabel ->setGeometry( QRect( 5,1,230,25));
TextLabel3->setGeometry( QRect( 5,20,230,25));
Layout1->setGeometry( QRect(1,60,235,50)); //TODO check these!!
// timer= new QTimer(this,"vu timer");
// connectionTimer=new QTimer(this,"connectionTimeout");
- connect(buttonOk,SIGNAL(clicked()),this,SLOT(doOk()));
+// connect(buttonOk,SIGNAL(clicked()),this,SLOT(doOk()));
connect(buttonCancel,SIGNAL(clicked()),this,SLOT(reject()));
// connect( timer, SIGNAL(timeout()), this , SLOT(timeSlot()));
// connect( connectionTimer,SIGNAL( timeout()),this,SLOT( connectionTimeSlot()));
- if(autoOk) {
- owarn << "XXXXXXXXXXXXXXXXXXXXXXXX" << oendl;
- buttonOk->setDown(true);
- doOk();
- }
+// if(autoOk) {
+// buttonOk->setDown(true);
+ QTimer::singleShot( 1000, this, SLOT( doOk() ));
+// }
+
}
void NetworkDialog::timeSlot() {
// if(timerProgess < 19 && posTimer) {
// ProgressBar1->setProgress(timerProgess);
// timerProgess++;
// } else if(timerProgess > 19 && posTimer) {
// ProgressBar1->setProgress(timerProgess);
// timerProgess++;
// posTimer=FALSE;
// }
// if(timerProgess > 1 &&!posTimer) {
// ProgressBar1->setProgress(timerProgess);
// timerProgess--;
// } else if(timerProgess > 1 &&!posTimer){
// ProgressBar1->setProgress(timerProgess);
// timerProgess--;
// posTimer=TRUE;
// }
// // odebug << "timer event" << oendl;
// qApp->processEvents();
// repaint();
}
void NetworkDialog::connectionTimeSlot() {
// odebug << "Connections timed out" << oendl;
// ftpQuit();
// qApp->processEvents();
// repaint();
// reject();
}
diff --git a/noncore/apps/opie-gutenbrowser/NetworkDialog.h b/noncore/apps/opie-gutenbrowser/NetworkDialog.h
index 447979f..61595a8 100644
--- a/noncore/apps/opie-gutenbrowser/NetworkDialog.h
+++ b/noncore/apps/opie-gutenbrowser/NetworkDialog.h
@@ -25,60 +25,60 @@
#include <qpushbutton.h>
#include <qstringlist.h>
//#include <qtimer.h>
//class QProgressBar;
class NetworkDialog : public QDialog
{
Q_OBJECT
public:
NetworkDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QStringList netList=0);
/* NetworkDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QString & UrlStr = 0, const QString & dirStr=0,const QString & fileStr=0, const QString & psrtialFile=0); */
~NetworkDialog();
QFile fiole;
QTimer * connectionTimer;
QTimer * timer;
int timerProgess;
bool posTimer;
QString s_partialFileName, s_finally;
bool foundIt, successDownload;
QLabel * warnLabel;
QLabel* TextLabel3;
QPushButton* buttonHelp;
bool ok;
QString local_library;
QString ftp_host;
QString ftp_base_dir;
QString dir, strUrl, networkUrl;
- QPushButton* buttonOk;
+// QPushButton* buttonOk;
QPushButton* buttonCancel;
QString localFileName;
bool fileFound;
int i, totalBytesDownloaded;
bool autoOk;
void initDialog();
protected:
QHBoxLayout* hbox;
private slots:
bool downloadFile( QString strUrl);
void connectionTimeSlot();
void timeSlot();
void doOk();
private:
/* #ifndef Q_WS_QWS */
/* QString getOpenFileName(); */
/* QUrlOperator op; */
/* #endif */
};
#endif // NETWORKDIALOG_H
diff --git a/noncore/apps/opie-gutenbrowser/SearchDialog.cpp b/noncore/apps/opie-gutenbrowser/SearchDialog.cpp
index d989304..055ffee 100644
--- a/noncore/apps/opie-gutenbrowser/SearchDialog.cpp
+++ b/noncore/apps/opie-gutenbrowser/SearchDialog.cpp
@@ -1,65 +1,65 @@
/****************************************************************************
** Created: Tue Aug 29 11:45:00 2000**/
// copyright : (C) 2000 -2004 by llornkcor
// email : ljp@llornkcor.com
#include "SearchDialog.h"
#include "SearchResults.h"
#include <qlayout.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qmessagebox.h>
#include <qdir.h>
#include <qpe/config.h>
/*This is just a single text entry dialog */
SearchDialog::SearchDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( "SearchDialog" );
Config cfg("Gutenbrowser");
cfg.setGroup("General");
QString lastSearch=cfg.readEntry("LastSearch","");
#warning FIXME
// FIXME
- resize( 220,100);
+ resize( 220,110);
QGridLayout *layout = new QGridLayout( this );
layout->setSpacing( 2);
layout->setMargin( 2);
QString local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/";
TextLabel1 = new QLabel( this, "TextLabel1" );
layout->addMultiCellWidget( TextLabel1, 0, 0, 0, 1);
label1Str= "<P>Enter text to search etext for </P>" ;
TextLabel1->setText( tr( label1Str) );
SearchLineEdit = new QLineEdit( this, "SearchLineEdit" );
layout->addMultiCellWidget( SearchLineEdit, 1, 1, 0, 1);
buttonOk = new QPushButton( this, "buttonOk" );
buttonOk->setText( tr( "Sea&rch" ) );
buttonOk->setAutoDefault( TRUE );
buttonOk->setToggleButton( TRUE);
buttonOk->setDefault( TRUE );
layout->addMultiCellWidget(buttonOk, 2, 2, 0, 0);
buttonCancel = new QPushButton( this, "buttonCancel" );
buttonCancel->setText( tr( "&Cancel" ) );
buttonCancel->setAutoDefault( TRUE );
layout->addMultiCellWidget(buttonCancel, 2, 2, 1, 1);
// buttonCancel->setMaximumWidth(40);
if( (QString)name !="Etext Search" )
SearchLineEdit->setText(lastSearch);