Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

DlgDonkeyImport.cpp

Go to the documentation of this file.
00001 //
00002 // DlgDonkeyImport.cpp
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 
00022 #include "StdAfx.h"
00023 #include "Shareaza.h"
00024 #include "Settings.h"
00025 #include "DlgDonkeyImport.h"
00026 
00027 #ifdef _DEBUG
00028 #define new DEBUG_NEW
00029 #undef THIS_FILE
00030 static char THIS_FILE[] = __FILE__;
00031 #endif
00032 
00033 BEGIN_MESSAGE_MAP(CDonkeyImportDlg, CSkinDialog)
00034         //{{AFX_MSG_MAP(CDonkeyImportDlg)
00035         ON_BN_CLICKED(IDC_IMPORT, OnImport)
00036         ON_WM_TIMER()
00037         ON_BN_CLICKED(IDC_CLOSE, OnClose)
00038         //}}AFX_MSG_MAP
00039 END_MESSAGE_MAP()
00040 
00041 
00043 // CDonkeyImportDlg dialog
00044 
00045 CDonkeyImportDlg::CDonkeyImportDlg(CWnd* pParent /*=NULL*/)
00046         : CSkinDialog(CDonkeyImportDlg::IDD, pParent)
00047 {
00048         //{{AFX_DATA_INIT(CDonkeyImportDlg)
00049         //}}AFX_DATA_INIT
00050 }
00051 
00052 void CDonkeyImportDlg::DoDataExchange(CDataExchange* pDX)
00053 {
00054         CSkinDialog::DoDataExchange(pDX);
00055         //{{AFX_DATA_MAP(CDonkeyImportDlg)
00056         DDX_Control(pDX, IDC_CLOSE, m_wndClose);
00057         DDX_Control(pDX, IDCANCEL, m_wndCancel);
00058         DDX_Control(pDX, IDC_IMPORT, m_wndImport);
00059         DDX_Control(pDX, IDC_LOG, m_wndLog);
00060         //}}AFX_DATA_MAP
00061 }
00062 
00064 // CDonkeyImportDlg message handlers
00065 
00066 BOOL CDonkeyImportDlg::OnInitDialog()
00067 {
00068         CSkinDialog::OnInitDialog();
00069 
00070         SkinMe( _T("CDonkeyImportDlg"), IDR_MAINFRAME );
00071 
00072         CString str;
00073         m_wndCancel.GetWindowText( str );
00074         int nPos = str.Find( '|' );
00075         if ( nPos > 0 )
00076         {
00077                 m_sCancel = str.Mid( nPos + 1 );
00078                 m_wndCancel.SetWindowText( str.Left( nPos ) );
00079         }
00080 
00081         return TRUE;
00082 }
00083 
00084 void CDonkeyImportDlg::OnImport()
00085 {
00086         m_wndImport.EnableWindow( FALSE );
00087         m_wndCancel.SetWindowText( m_sCancel );
00088         m_pImporter.Start( &m_wndLog );
00089         SetTimer( 1, 1000, NULL );
00090 }
00091 
00092 void CDonkeyImportDlg::OnCancel()
00093 {
00094         m_pImporter.Stop();
00095         CSkinDialog::OnCancel();
00096 }
00097 
00098 void CDonkeyImportDlg::OnTimer(UINT nIDEvent)
00099 {
00100         if ( ! m_pImporter.IsRunning() )
00101         {
00102                 KillTimer( 1 );
00103                 m_wndCancel.EnableWindow( FALSE );
00104                 m_wndClose.ModifyStyle( 0, BS_DEFPUSHBUTTON );
00105                 m_wndClose.ShowWindow( SW_SHOW );
00106                 m_wndClose.SetFocus();
00107         }
00108 }
00109 
00110 void CDonkeyImportDlg::OnClose()
00111 {
00112         EndDialog( IDOK );
00113 }

Generated on Thu Dec 15 10:39:39 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2