source: trunk/src/SplashDialog.hpp @ 356

Revision 356, 1.3 KB checked in by Eoin, 13 years ago (diff)

Fixed a bug with blocking non-visible uiUpdate connections.

Line 
1
2//         Copyright Eóin O'Callaghan 2006 - 2007.
3// Distributed under the Boost Software License, Version 1.0.
4//    (See accompanying file LICENSE_1_0.txt or copy at
5//          http://www.boost.org/LICENSE_1_0.txt)
6
7#pragma once
8
9#ifndef HALITE_MINI
10#       include "Halite.hpp"
11#else
12#       include "Halite.hpp"
13#endif
14
15#include "halTorrent.hpp"
16
17class SplashDialog :
18        public CDialogImpl<SplashDialog>,
19        public CWinDataExchange<SplashDialog>
20{
21protected:
22        typedef HaliteDialog thisClass;
23        typedef CDialogImpl<SplashDialog> baseClass;
24
25public:
26        enum { IDD = IDD_CLOSESPLASH };
27
28    BEGIN_MSG_MAP_EX(CMainDlg)
29        MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
30    END_MSG_MAP()
31       
32        BEGIN_DDX_MAP(CMainDlg)
33        DDX_CHECK(IDC_SPLASH_MSG, halite().showMessage)
34    END_DDX_MAP()
35       
36        LRESULT SplashDialog::OnInitDialog(...)
37        {
38                CenterWindow();
39                DoDataExchange(false);
40               
41                thread_ptr.reset(new thread(bind(&SplashDialog::SplashThread, this)));
42               
43                return TRUE;
44        }
45
46        void SplashThread()
47        {
48                hal::bittorrent().closeAll();
49                hal::bittorrent().shutDownSession();
50               
51                DoDataExchange(true);
52                EndDialog(0);
53        }
54       
55        BOOL PreTranslateMessage(MSG* pMsg)
56        {
57                return this->IsDialogMessage(pMsg);
58        }
59       
60private:
61        boost::scoped_ptr<thread> thread_ptr;
62};
Note: See TracBrowser for help on using the repository browser.