author | llornkcor <llornkcor> | 2004-06-15 10:18:36 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-06-15 10:18:36 (UTC) |
commit | c711eea6fb1fa136cd62dc8b7134ee72968c8a53 (patch) (unidiff) | |
tree | 5f467c8abff45e468c4b119122553c1eef7f3beb | |
parent | 83b4b2d2670b63a2a540006cea2ea8808100d308 (diff) | |
download | opie-c711eea6fb1fa136cd62dc8b7134ee72968c8a53.zip opie-c711eea6fb1fa136cd62dc8b7134ee72968c8a53.tar.gz opie-c711eea6fb1fa136cd62dc8b7134ee72968c8a53.tar.bz2 |
start download, fix dialogs
-rw-r--r-- | noncore/apps/opie-gutenbrowser/NetworkDialog.cpp | 30 | ||||
-rw-r--r-- | noncore/apps/opie-gutenbrowser/NetworkDialog.h | 14 | ||||
-rw-r--r-- | noncore/apps/opie-gutenbrowser/SearchDialog.cpp | 8 |
3 files changed, 26 insertions, 26 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 | |||
@@ -57,17 +57,17 @@ NetworkDialog::NetworkDialog( QWidget* parent, const char* name, bool modal, WF | |||
57 | 57 | ||
58 | ftp_host = netL[0]; | 58 | ftp_host = netL[0]; |
59 | networkUrl = strUrl = netL[0]; | 59 | networkUrl = strUrl = netL[0]; |
60 | 60 | ||
61 | dir = ftp_base_dir = netL[1]; | 61 | dir = ftp_base_dir = netL[1]; |
62 | localFileName = netL[2]; | 62 | localFileName = netL[2]; |
63 | s_partialFileName = netL[3]; | 63 | s_partialFileName = netL[3]; |
64 | 64 | ||
65 | resize(240,110); | 65 | resize(240,120); |
66 | 66 | ||
67 | local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/"; | 67 | local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/"; |
68 | // autoOk = autoDownload; | 68 | // autoOk = autoDownload; |
69 | // if( networkUrl.find("ftp",0,false)== -1 ) { | 69 | // if( networkUrl.find("ftp",0,false)== -1 ) { |
70 | // if ( !name ) | 70 | // if ( !name ) |
71 | // setName( "HTTP NetworkDialog" ); | 71 | // setName( "HTTP NetworkDialog" ); |
72 | // setCaption( tr( "HTTP Download ) ); | 72 | // setCaption( tr( "HTTP Download ) ); |
73 | // qInitNetworkProtocols(); // registers ftp protocol // for now | 73 | // qInitNetworkProtocols(); // registers ftp protocol // for now |
@@ -94,46 +94,46 @@ void NetworkDialog::initDialog() { | |||
94 | 94 | ||
95 | hbox = new QHBoxLayout(Layout1); | 95 | hbox = new QHBoxLayout(Layout1); |
96 | hbox->setMargin(4); | 96 | hbox->setMargin(4); |
97 | 97 | ||
98 | ProgressBar1 = new QProgressBar( Layout1, "ProgressBar1" ); | 98 | ProgressBar1 = new QProgressBar( Layout1, "ProgressBar1" ); |
99 | ProgressBar1->setProgress(0); | 99 | ProgressBar1->setProgress(0); |
100 | hbox->addWidget(ProgressBar1,10,AlignCenter); | 100 | hbox->addWidget(ProgressBar1,10,AlignCenter); |
101 | 101 | ||
102 | hbox->addStretch(1); | 102 | // hbox->addStretch(1); |
103 | buttonOk = new QPushButton( Layout1, "buttonOk" ); | 103 | // buttonOk = new QPushButton( Layout1, "buttonOk" ); |
104 | buttonOk->setText( tr( "&OK" ) ); | 104 | // buttonOk->setText( tr( "&OK" ) ); |
105 | hbox->addWidget(buttonOk,0,AlignRight); | 105 | // hbox->addWidget(buttonOk,0,AlignRight); |
106 | hbox->addSpacing(5); | 106 | // hbox->addSpacing(5); |
107 | buttonCancel = new QPushButton( Layout1, "buttonCancel" ); | 107 | buttonCancel = new QPushButton( Layout1, "buttonCancel" ); |
108 | buttonCancel->setText( tr( "&Cancel" ) ); | 108 | buttonCancel->setText( tr( "&Cancel" ) ); |
109 | buttonCancel->setAutoDefault( TRUE ); | 109 | buttonCancel->setAutoDefault( TRUE ); |
110 | buttonCancel->setDefault( TRUE ); | 110 | buttonCancel->setDefault( TRUE ); |
111 | hbox->addWidget(buttonCancel,0,AlignRight); | 111 | hbox->addWidget(buttonCancel,0,AlignRight); |
112 | 112 | ||
113 | ProgressBar1->setFixedSize(140,22); | 113 | ProgressBar1->setFixedSize(150,25); |
114 | buttonOk->setFixedSize(35,22); | 114 | // buttonOk->setFixedSize(35,22); |
115 | buttonCancel->setFixedSize(35,22); | 115 | buttonCancel->setFixedSize(50,25); |
116 | warnLabel ->setGeometry( QRect( 5,1,230,25)); | 116 | warnLabel ->setGeometry( QRect( 5,1,230,25)); |
117 | TextLabel3->setGeometry( QRect( 5,20,230,25)); | 117 | TextLabel3->setGeometry( QRect( 5,20,230,25)); |
118 | Layout1->setGeometry( QRect(1,60,235,50)); //TODO check these!! | 118 | Layout1->setGeometry( QRect(1,60,235,50)); //TODO check these!! |
119 | 119 | ||
120 | // timer= new QTimer(this,"vu timer"); | 120 | // timer= new QTimer(this,"vu timer"); |
121 | // connectionTimer=new QTimer(this,"connectionTimeout"); | 121 | // connectionTimer=new QTimer(this,"connectionTimeout"); |
122 | 122 | ||
123 | connect(buttonOk,SIGNAL(clicked()),this,SLOT(doOk())); | 123 | // connect(buttonOk,SIGNAL(clicked()),this,SLOT(doOk())); |
124 | connect(buttonCancel,SIGNAL(clicked()),this,SLOT(reject())); | 124 | connect(buttonCancel,SIGNAL(clicked()),this,SLOT(reject())); |
125 | // connect( timer, SIGNAL(timeout()), this , SLOT(timeSlot())); | 125 | // connect( timer, SIGNAL(timeout()), this , SLOT(timeSlot())); |
126 | // connect( connectionTimer,SIGNAL( timeout()),this,SLOT( connectionTimeSlot())); | 126 | // connect( connectionTimer,SIGNAL( timeout()),this,SLOT( connectionTimeSlot())); |
127 | if(autoOk) { | 127 | // if(autoOk) { |
128 | owarn << "XXXXXXXXXXXXXXXXXXXXXXXX" << oendl; | 128 | // buttonOk->setDown(true); |
129 | buttonOk->setDown(true); | 129 | QTimer::singleShot( 1000, this, SLOT( doOk() )); |
130 | doOk(); | 130 | // } |
131 | } | 131 | |
132 | } | 132 | } |
133 | 133 | ||
134 | void NetworkDialog::timeSlot() { | 134 | void NetworkDialog::timeSlot() { |
135 | 135 | ||
136 | // if(timerProgess < 19 && posTimer) { | 136 | // if(timerProgess < 19 && posTimer) { |
137 | // ProgressBar1->setProgress(timerProgess); | 137 | // ProgressBar1->setProgress(timerProgess); |
138 | // timerProgess++; | 138 | // timerProgess++; |
139 | // } else if(timerProgess > 19 && posTimer) { | 139 | // } else if(timerProgess > 19 && posTimer) { |
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,41 +25,41 @@ | |||
25 | #include <qpushbutton.h> | 25 | #include <qpushbutton.h> |
26 | #include <qstringlist.h> | 26 | #include <qstringlist.h> |
27 | 27 | ||
28 | //#include <qtimer.h> | 28 | //#include <qtimer.h> |
29 | 29 | ||
30 | //class QProgressBar; | 30 | //class QProgressBar; |
31 | 31 | ||
32 | class NetworkDialog : public QDialog | 32 | class NetworkDialog : public QDialog |
33 | { | 33 | { |
34 | Q_OBJECT | 34 | Q_OBJECT |
35 | 35 | ||
36 | public: | 36 | public: |
37 | NetworkDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QStringList netList=0); | 37 | NetworkDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QStringList netList=0); |
38 | /* 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); */ | 38 | /* 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); */ |
39 | ~NetworkDialog(); | 39 | ~NetworkDialog(); |
40 | 40 | ||
41 | QFile fiole; | 41 | QFile fiole; |
42 | QTimer * connectionTimer; | 42 | QTimer * connectionTimer; |
43 | QTimer * timer; | 43 | QTimer * timer; |
44 | int timerProgess; | 44 | int timerProgess; |
45 | bool posTimer; | 45 | bool posTimer; |
46 | QString s_partialFileName, s_finally; | 46 | QString s_partialFileName, s_finally; |
47 | bool foundIt, successDownload; | 47 | bool foundIt, successDownload; |
48 | QLabel * warnLabel; | 48 | QLabel * warnLabel; |
49 | QLabel* TextLabel3; | 49 | QLabel* TextLabel3; |
50 | QPushButton* buttonHelp; | 50 | QPushButton* buttonHelp; |
51 | bool ok; | 51 | bool ok; |
52 | QString local_library; | 52 | QString local_library; |
53 | QString ftp_host; | 53 | QString ftp_host; |
54 | QString ftp_base_dir; | 54 | QString ftp_base_dir; |
55 | QString dir, strUrl, networkUrl; | 55 | QString dir, strUrl, networkUrl; |
56 | 56 | ||
57 | QPushButton* buttonOk; | 57 | // QPushButton* buttonOk; |
58 | QPushButton* buttonCancel; | 58 | QPushButton* buttonCancel; |
59 | 59 | ||
60 | QString localFileName; | 60 | QString localFileName; |
61 | bool fileFound; | 61 | bool fileFound; |
62 | int i, totalBytesDownloaded; | 62 | int i, totalBytesDownloaded; |
63 | bool autoOk; | 63 | bool autoOk; |
64 | 64 | ||
65 | void initDialog(); | 65 | void initDialog(); |
@@ -67,17 +67,17 @@ public: | |||
67 | protected: | 67 | protected: |
68 | QHBoxLayout* hbox; | 68 | QHBoxLayout* hbox; |
69 | 69 | ||
70 | private slots: | 70 | private slots: |
71 | bool downloadFile( QString strUrl); | 71 | bool downloadFile( QString strUrl); |
72 | void connectionTimeSlot(); | 72 | void connectionTimeSlot(); |
73 | void timeSlot(); | 73 | void timeSlot(); |
74 | void doOk(); | 74 | void doOk(); |
75 | 75 | ||
76 | private: | 76 | private: |
77 | /* #ifndef Q_WS_QWS */ | 77 | /* #ifndef Q_WS_QWS */ |
78 | 78 | ||
79 | /* QString getOpenFileName(); */ | 79 | /* QString getOpenFileName(); */ |
80 | /* QUrlOperator op; */ | 80 | /* QUrlOperator op; */ |
81 | /* #endif */ | 81 | /* #endif */ |
82 | }; | 82 | }; |
83 | 83 | ||
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 | |||
@@ -25,18 +25,18 @@ SearchDialog::SearchDialog( QWidget* parent, const char* name, bool modal, WFla | |||
25 | if ( !name ) | 25 | if ( !name ) |
26 | setName( "SearchDialog" ); | 26 | setName( "SearchDialog" ); |
27 | Config cfg("Gutenbrowser"); | 27 | Config cfg("Gutenbrowser"); |
28 | cfg.setGroup("General"); | 28 | cfg.setGroup("General"); |
29 | QString lastSearch=cfg.readEntry("LastSearch",""); | 29 | QString lastSearch=cfg.readEntry("LastSearch",""); |
30 | 30 | ||
31 | #warning FIXME | 31 | #warning FIXME |
32 | // FIXME | 32 | // FIXME |
33 | resize( 220,100); | 33 | resize( 220,110); |
34 | 34 | ||
35 | QGridLayout *layout = new QGridLayout( this ); | 35 | QGridLayout *layout = new QGridLayout( this ); |
36 | layout->setSpacing( 2); | 36 | layout->setSpacing( 2); |
37 | layout->setMargin( 2); | 37 | layout->setMargin( 2); |
38 | 38 | ||
39 | QString local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/"; | 39 | QString local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/"; |
40 | TextLabel1 = new QLabel( this, "TextLabel1" ); | 40 | TextLabel1 = new QLabel( this, "TextLabel1" ); |
41 | layout->addMultiCellWidget( TextLabel1, 0, 0, 0, 1); | 41 | layout->addMultiCellWidget( TextLabel1, 0, 0, 0, 1); |
42 | 42 | ||
@@ -93,17 +93,17 @@ bool SearchDialog::case_sensitive() { | |||
93 | bool SearchDialog::forward_search() { | 93 | bool SearchDialog::forward_search() { |
94 | return true; | 94 | return true; |
95 | } | 95 | } |
96 | 96 | ||
97 | void SearchDialog::byeBye() | 97 | void SearchDialog::byeBye() |
98 | { | 98 | { |
99 | 99 | ||
100 | searchString = get_text(); | 100 | searchString = get_text(); |
101 | // odebug << "Search string is "+searchString << oendl; | 101 | // odebug << "Search string is "+searchString << oendl; |
102 | Config cfg("Gutenbrowser"); | 102 | Config cfg("Gutenbrowser"); |
103 | cfg.setGroup("General"); | 103 | cfg.setGroup("General"); |
104 | cfg.writeEntry("LastSearch",searchString); | 104 | cfg.writeEntry("LastSearch",searchString); |
105 | 105 | ||
106 | QString thisName=name(); | 106 | QString thisName=name(); |
107 | if( thisName.find("Library Search", 0, TRUE) != -1) { | 107 | if( thisName.find("Library Search", 0, TRUE) != -1) { |
108 | // searchString = SearchLineEdit->text(); | 108 | // searchString = SearchLineEdit->text(); |
109 | accept(); | 109 | accept(); |
@@ -114,17 +114,17 @@ void SearchDialog::byeBye() | |||
114 | emit search_signal(); | 114 | emit search_signal(); |
115 | buttonOk->setDown(FALSE); | 115 | buttonOk->setDown(FALSE); |
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | void SearchDialog::closed() | 119 | void SearchDialog::closed() |
120 | { | 120 | { |
121 | searchString = get_text(); | 121 | searchString = get_text(); |
122 | // odebug << "Search string is "+searchString << oendl; | 122 | // odebug << "Search string is "+searchString << oendl; |
123 | Config cfg("Gutenbrowser"); | 123 | Config cfg("Gutenbrowser"); |
124 | cfg.setGroup("General"); | 124 | cfg.setGroup("General"); |
125 | cfg.writeEntry("LastSearch",searchString); | 125 | cfg.writeEntry("LastSearch",searchString); |
126 | 126 | ||
127 | emit search_done_signal(); | 127 | emit search_done_signal(); |
128 | //this->reject(); | 128 | //this->reject(); |
129 | this->hide(); | 129 | this->hide(); |
130 | } | 130 | } |