Changeset 108


Ignore:
Timestamp:
12/23/06 16:34:56 (13 years ago)
Author:
Eoin
Message:

Added a dialog for displaying debug messages.

Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • Halite.iss

    r107 r108  
    3131Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked 
    3232Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked 
    33 Name: associate_torrent; Description: {cm:AssocFileExtension, Halite, .torrent}; GroupDescription: Other tasks:; Flags: unchecked 
     33Name: associate_torrent; Description: {cm:AssocFileExtension,Halite,.torrent}; GroupDescription: Other tasks:; Flags: unchecked 
    3434 
    3535[Files] 
     
    4444Name: {group}\{cm:ProgramOnTheWeb,{#MyAppName}}; Filename: {app}\{#MyAppUrlName} 
    4545Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe} 
    46 Name: {userdesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon 
    47 Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: quicklaunchicon 
     46Name: {userdesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; WorkingDir: {app}; Tasks: desktopicon 
     47Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {app}\{#MyAppExeName}; WorkingDir: {app}; Tasks: quicklaunchicon 
    4848 
    4949[Run] 
  • Halite.pnproj

    r107 r108  
    1 <Project name="Halite"><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="res" path="res\"><File path="Golem.ico"></File><File path="Halite.aps"></File><File path="Halite.bak.ico"></File><File path="halite.ico"></File><File path="Halite.rc"></File><File path="Manifest.xml"></File><File path="Oc.ico"></File><File path="resource.h"></File><File path="toolbar.bmp"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="src" path="src\"><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="ini" path="ini\"><File path="BitTConfig.hpp"></File><File path="Dialog.hpp"></File><File path="General.hpp"></File><File path="Remote.hpp"></File><File path="Splash.hpp"></File><File path="Torrent.hpp"></File><File path="Window.hpp"></File></MagicFolder><File path="AdvHaliteDialog.cpp"></File><File path="AdvHaliteDialog.hpp"></File><File path="ConfigOptions.cpp"></File><File path="ConfigOptions.hpp"></File><File path="CSSFileDialog.hpp"></File><File path="DdxEx.hpp"></File><File path="DropFileTarget.h"></File><File path="GlobalIni.cpp"></File><File path="GlobalIni.hpp"></File><File path="Halite.cpp"></File><File path="Halite.hpp"></File><File path="HaliteDialog.cpp"></File><File path="HaliteDialog.hpp"></File><File path="HaliteListViewCtrl.cpp"></File><File path="HaliteListViewCtrl.hpp"></File><File path="HaliteWindow.cpp"></File><File path="HaliteWindow.hpp"></File><File path="HalTabCtrl.hpp"></File><File path="halTorrent.cpp"></File><File path="halTorrent.hpp"></File><File path="halXmlRpc.cpp"></File><File path="halXmlRpc.hpp"></File><File path="NTray.cpp"></File><File path="NTray.hpp"></File><File path="SimpleHtml.h"></File><File path="SplashDialog.hpp"></File><File path="SSFileDialog.hpp"></File><File path="stdAfx.cpp"></File><File path="stdAfx.hpp"></File><File path="ThemeTestDialog.hpp"></File><File path="WinAPIMutex.hpp"></File></MagicFolder><File path="Jamfile"></File></Project> 
     1<Project name="Halite"><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="res" path="res\"><File path="Halite.aps"></File><File path="Halite.ico"></File><File path="Halite.rc"></File><File path="Manifest.xml"></File><File path="resource.h"></File><File path="toolbar.bmp"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="src" path="src\"><MagicFolder excludeFolders="CVS;.svn" filter="*.*" name="ini" path="ini\"><File path="BitTConfig.hpp"></File><File path="Dialog.hpp"></File><File path="General.hpp"></File><File path="Remote.hpp"></File><File path="Splash.hpp"></File><File path="Torrent.hpp"></File><File path="Window.hpp"></File></MagicFolder><File path="AdvHaliteDialog.cpp"></File><File path="AdvHaliteDialog.hpp"></File><File path="ConfigOptions.cpp"></File><File path="ConfigOptions.hpp"></File><File path="CSSFileDialog.hpp"></File><File path="DdxEx.hpp"></File><File path="debugDialog.hpp"></File><File path="DropFileTarget.h"></File><File path="GlobalIni.cpp"></File><File path="GlobalIni.hpp"></File><File path="Halite.cpp"></File><File path="Halite.hpp"></File><File path="HaliteDialog.cpp"></File><File path="HaliteDialog.hpp"></File><File path="HaliteListViewCtrl.cpp"></File><File path="HaliteListViewCtrl.hpp"></File><File path="HaliteWindow.cpp"></File><File path="HaliteWindow.hpp"></File><File path="HalTabCtrl.hpp"></File><File path="halTorrent.cpp"></File><File path="halTorrent.hpp"></File><File path="halXmlRpc.cpp"></File><File path="halXmlRpc.hpp"></File><File path="NTray.cpp"></File><File path="NTray.hpp"></File><File path="SimpleHtml.h"></File><File path="SplashDialog.hpp"></File><File path="SSFileDialog.hpp"></File><File path="stdAfx.cpp"></File><File path="stdAfx.hpp"></File><File path="ThemeTestDialog.hpp"></File><File path="WinAPIMutex.hpp"></File></MagicFolder><File path="Jamfile"></File></Project> 
  • Jamfile

    r107 r108  
    55use-project /WTL : $(/WTL) ; 
    66use-project /osLibs : $(/osLibs) ; 
     7use-project /global_log : $(/global_log) ; 
    78 
    89SOURCES = 
     
    3132        advapi32 
    3233        gdi32    
    33         UxTheme.lib      
     34        uxtheme  
    3435        ; 
    3536 
     
    4344    <library>/libtorrent//torrent/<link>static 
    4445         
     46        <library>/global_log//global_log/<link>static 
    4547        <library>/WTL 
    4648        <library>/osLibs//$(LIBS) 
     
    5153        <toolset>msvc:<define>WIN32 
    5254        <toolset>msvc:<define>_WINDOWS 
     55         
     56        <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE 
     57        <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE 
     58        <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS 
    5359         
    5460        <runtime-link>static 
  • res/Halite.rc

    r107 r108  
    194194IDD_CLOSESPLASH DIALOGEX 0, 0, 191, 54 
    195195STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION 
    196 EXSTYLE WS_EX_STATICEDGE 
    197 CAPTION "Halite Shutting down..." 
    198 FONT 8, "MS Shell Dlg", 400, 0, 0x1 
    199 BEGIN 
    200     ICON            IDR_APP_ICON,IDC_STATIC,7,10,20,20 
     196EXSTYLE WS_EX_PALETTEWINDOW | WS_EX_STATICEDGE 
     197CAPTION "Halite shutting down..." 
     198FONT 8, "MS Shell Dlg", 400, 0, 0x1 
     199BEGIN 
     200    ICON            IDR_APP_ICON,IDC_STATIC,7,10,21,20 
    201201    LTEXT           "It will take the BitTorrent session a moment to shutdown cleanly after which this message will disappear and the program will close.",IDC_STATIC,35,7,149,27 
    202202    CONTROL         "Show this message in future.",IDC_SPLASH_MSG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,77,35,107,12 
     
    253253END 
    254254 
     255IDD_DEBUGDIALOG DIALOGEX 150, 50, 252, 105 
     256STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME 
     257EXSTYLE WS_EX_PALETTEWINDOW 
     258CAPTION "Halite Debug Dialog" 
     259FONT 8, "MS Sans Serif", 0, 0, 0x0 
     260BEGIN 
     261    EDITTEXT        ED_CON,3,3,246,99,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL 
     262END 
     263 
    255264 
    256265#ifdef APSTUDIO_INVOKED 
     
    349358        TOPMARGIN, 7 
    350359        BOTTOMMARGIN, 86 
     360    END 
     361 
     362    IDD_DEBUGDIALOG, DIALOG 
     363    BEGIN 
     364        LEFTMARGIN, 3 
     365        RIGHTMARGIN, 249 
     366        TOPMARGIN, 3 
     367        BOTTOMMARGIN, 102 
    351368    END 
    352369END 
  • res/resource.h

    r107 r108  
    33// Used by Halite.rc 
    44// 
     5#define IDD_DEBUGDIALOG                 116 
    56#define IDD_CONFIGBIT                   102 
    67#define IDD_CONFIGREMOTE                103 
     
    7071#define IDC_CHECK1                      1045 
    7172#define IDC_RADIO1                      1046 
     73#define ED_CON                          3000 
    7274#define ID_ABOUT_OPENHALITE             40001 
    7375#define ID_ABOUT_PAUSEALL               40002 
     
    8385#ifndef APSTUDIO_READONLY_SYMBOLS 
    8486#define _APS_NO_MFC                     1 
    85 #define _APS_NEXT_RESOURCE_VALUE        116 
     87#define _APS_NEXT_RESOURCE_VALUE        117 
    8688#define _APS_NEXT_COMMAND_VALUE         40010 
    8789#define _APS_NEXT_CONTROL_VALUE         1048 
  • src/Halite.cpp

    r107 r108  
    99#include "HaliteWindow.hpp" 
    1010#include "SplashDialog.hpp" 
     11 
     12#ifndef NDEBUG 
     13#       include <global_log.hpp> 
     14        using glb::wlog; 
     15#       include "DebugDialog.hpp" 
     16         
     17        static DebugDialog global_debugDialog_;  
     18 
     19        static class global_log_file 
     20        { 
     21        public: 
     22                global_log_file(); 
     23                 
     24                void operator()(const wstring& text) 
     25                { 
     26                        if (!wofs.is_open()) wofs.open("Log.txt");                       
     27                        wofs << text; 
     28                } 
     29                 
     30        private:         
     31                std::wofstream wofs; 
     32                boost::signals::scoped_connection conn_; 
     33                 
     34        } global_log_file_; 
     35         
     36        global_log_file::global_log_file() : 
     37                conn_(wlog().attach(bind(global_log_file::operator(), &global_log_file_, _1))) 
     38        {} 
     39 
     40#endif 
    1141 
    1242static const unsigned WMU_ARE_YOU_ME = ::RegisterWindowMessage(WMU_ARE_YOU_ME_STRING); 
     
    4171        HRESULT hRes = _Module.Init(NULL, hInstance); 
    4272        assert (SUCCEEDED(hRes));        
    43         {                                
    44         WinAPIMutex oneInstance(HALITE_GUID); 
     73         
     74        { WinAPIMutex oneInstance(HALITE_GUID); 
    4575         
    4676        if (!oneInstance.owner() && INI().generalConfig().oneInst) 
     
    92122                                INI().windowConfig().rect.bottom-INI().windowConfig().rect.top, 
    93123                                false); 
     124                                 
     125                        wndMain.SetIcon(LoadIcon(hInstance, MAKEINTRESOURCE(IDR_APP_ICON)), false); 
    94126                        wndMain.ShowWindow(nCmdShow); 
     127                         
     128                        #ifndef NDEBUG 
     129                        global_debugDialog_.Create(wndMain); 
     130                        global_debugDialog_.ShowWindow(true); 
     131                        #endif 
    95132                         
    96133                        nRet = theLoop.Run();                            
  • src/HaliteDialog.cpp

    r107 r108  
    152152         
    153153        return 0; 
     154} 
     155 
     156LRESULT HaliteDialog::OnCltColor(HDC hDC, HWND hWnd) 
     157{        
     158        ::SetTextColor(hDC, RGB(255, 0, 255));  
     159         
     160        return (LRESULT)::GetStockObject(DC_BRUSH); 
    154161} 
    155162 
  • src/HaliteDialog.hpp

    r104 r108  
    4141                COMMAND_ID_HANDLER_EX(BTNREANNOUNCE, onReannounce) 
    4242                COMMAND_ID_HANDLER_EX(BTNREMOVE, onRemove) 
     43                 
     44//              MSG_WM_CTLCOLORSTATIC(OnCltColor) 
    4345                 
    4446                CHAIN_MSG_MAP(resizeClass) 
     
    8789        void onRemove(UINT, int, HWND); 
    8890         
    89         LRESULT OnEditKillFocus(UINT uCode, int nCtrlID, HWND hwndCtrl ); 
     91        LRESULT OnEditKillFocus(UINT uCode, int nCtrlID, HWND hwndCtrl); 
     92        LRESULT OnCltColor(HDC hDC, HWND hWnd); 
    9093         
    9194        void selectionChanged();         
  • src/ThemeTestDialog.hpp

    r107 r108  
    44#include "stdAfx.hpp" 
    55#include "DdxEx.hpp" 
     6 
     7#ifndef NDEBUG 
     8#       include <global_log.hpp> 
     9        using glb::wlog; 
     10#endif 
    611 
    712class ThemeTestDialog : 
     
    3136                MSG_WM_CTLCOLORBTN(OnCltColor) 
    3237                MSG_WM_CTLCOLORSTATIC(OnCltColor) 
    33                 MSG_WM_CTLCOLOREDIT(OnCltColor) 
    3438                 
    3539                if (uMsg == WM_FORWARDMSG) 
     
    4347        END_DLGRESIZE_MAP() 
    4448         
     49        LRESULT onInitDialog(HWND, LPARAM)  
     50        { 
     51                ::SetWindowText(GetDlgItem(IDC_EDIT2), L"Eoin"); 
     52                return 0;  
     53        }        
     54         
    4555        LRESULT OnCltColorDlg(HDC pDC, HWND pWnd) 
    4656        { 
     
    4959                DrawThemeParentBackground(pWnd, pDC, &rect); 
    5060                 
    51                 return  (LRESULT)::GetStockObject(HOLLOW_BRUSH); 
     61                return (LRESULT)::GetStockObject(HOLLOW_BRUSH); 
    5262        } 
    5363         
    54         LRESULT OnCltColor(HDC pDC, HWND pWnd) 
    55         { 
     64        LRESULT OnCltColor(HDC hDC, HWND hWnd) 
     65        {        
    5666                RECT rect; 
    57                 ::GetClientRect(pWnd, &rect); 
    58                 DrawThemeParentBackground(pWnd, pDC, &rect); 
     67                ::GetClientRect(hWnd, &rect); 
     68                ::SetBkMode(hDC, TRANSPARENT);  
     69                DrawThemeParentBackground(hWnd, hDC, &rect); 
    5970                 
    60                 return  (LRESULT)::GetStockObject(HOLLOW_BRUSH); 
    61         }        
     71                return (LRESULT)::GetStockObject(HOLLOW_BRUSH); 
     72        } 
    6273         
    63         LRESULT onInitDialog(HWND, LPARAM) { return 0; }         
    6474         
    6575//      void OnSize(UINT, CSize); 
Note: See TracChangeset for help on using the changeset viewer.