- Timestamp:
- Aug 1, 2007 11:18:38 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r3951 r3957 220 220 , mProgressBar (0), mCancelButton (0) 221 221 , mAction (aAction), mStatus (0) 222 , mConnectDone (false), mSuicide (false) 222 223 { 223 224 /* Disable Install Guest Additions action */ … … 266 267 267 268 /* Try to get the required file for the information */ 268 mHttp->get (mPath + mFile);269 getFile(); 269 270 } 270 271 … … 286 287 void processProgress (int aRead, int aTotal) 287 288 { 289 mConnectDone = true; 288 290 if (aTotal != -1) 289 291 { … … 311 313 if (aError && mHttp->error() != QHttp::Aborted) 312 314 { 315 mConnectDone = true; 313 316 QString reason = mIsChecking ? 314 317 tr ("Could not connect to the server (%1).") : … … 346 349 } 347 350 351 /* This slot is used to control the connection timeout. */ 352 void processTimeout() 353 { 354 if (mConnectDone) return; 355 mHttp->abort(); 356 abortDownload (tr ("The download process has been cancelled " 357 "due to connection timeout.")); 358 } 359 348 360 /* This slot is used to process cancel-button clicking signal. */ 349 361 void processAbort() 350 362 { 363 mConnectDone = true; 351 364 mHttp->abort(); 352 365 abortDownload (tr ("The download process has been cancelled " … … 366 379 private: 367 380 381 /* This function is used to make a request to get a file */ 382 void getFile() 383 { 384 mConnectDone = false; 385 mHttp->get (mPath + mFile); 386 QTimer::singleShot (5000, this, SLOT (processTimeout())); 387 } 388 368 389 /* This function is used to ask the user about he wants to download the 369 390 * founded Guest Additions image or not. It also shows the progress-bar … … 377 398 { 378 399 mIsChecking = false; 379 mHttp->get (mPath + mFile);400 getFile(); 380 401 } 381 402 else … … 388 409 void abortDownload (const QString &aReason) 389 410 { 411 /* Protect against double kill request. */ 412 if (mSuicide) return; 413 mSuicide = true; 414 390 415 vboxProblem().cannotDownloadGuestAdditions (mProtocol + mHost + 391 416 mPath + mFile, aReason); … … 405 430 QAction *mAction; 406 431 int mStatus; 432 bool mConnectDone; 433 bool mSuicide; 407 434 }; 408 435
Note:
See TracChangeset
for help on using the changeset viewer.