Create vcproj for reporter and make it build (but not be very useful) on windows.

Originally committed to SVN as r3610.
This commit is contained in:
Thomas Goyne 2009-10-03 17:16:52 +00:00
parent d54ddc688b
commit e1469154ea
11 changed files with 614 additions and 38 deletions

View File

@ -0,0 +1,474 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="reporter_2008"
ProjectGUID="{DEA724A1-E735-410E-8290-CC7725A85CCA}"
RootNamespace="reporter_2008"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\aegisub_vs2008\compiler_options_debug.vsprops;..\aegisub_vs2008\libraries_outdirs.vsprops;..\aegisub_vs2008\suffix_debug32.vsprops;..\aegisub_vs2008\wxlib_include.vsprops;..\aegisub_vs2008\wxlib_lib32.vsprops;..\aegisub_vs2008\contrib_includedirs.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="CURL_STATICLIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="r_pre.h"
WarningLevel="3"
DebugInformationFormat="4"
ForcedIncludeFiles="r_pre.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(ExecutableOutDir)/reporter$(PlatformConfigSuffix).exe"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\aegisub_vs2008\compiler_options_debug.vsprops;..\aegisub_vs2008\libraries_outdirs.vsprops;..\aegisub_vs2008\suffix_debug64.vsprops;..\aegisub_vs2008\wxlib_include.vsprops;..\aegisub_vs2008\wxlib_lib64.vsprops;..\aegisub_vs2008\contrib_includedirs.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="CURL_STATICLIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="r_pre.h"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="r_pre.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(ExecutableOutDir)/reporter$(PlatformConfigSuffix).exe"
GenerateDebugInformation="true"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)build/$(ProjectName)/$(PlatformName)/$(ConfigurationName)/"
IntermediateDirectory="$(OutDir)"
ConfigurationType="1"
InheritedPropertySheets="..\aegisub_vs2008\compiler_options.vsprops;..\aegisub_vs2008\libraries_outdirs.vsprops;..\aegisub_vs2008\suffix_release32.vsprops;..\aegisub_vs2008\wxlib_include.vsprops;..\aegisub_vs2008\wxlib_lib32.vsprops;..\aegisub_vs2008\contrib_includedirs.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="CURL_STATICLIB"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="r_pre.h"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="r_pre.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(ExecutableOutDir)/reporter$(PlatformConfigSuffix).exe"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\aegisub_vs2008\compiler_options.vsprops;..\aegisub_vs2008\libraries_outdirs.vsprops;..\aegisub_vs2008\suffix_release64.vsprops;..\aegisub_vs2008\wxlib_include.vsprops;..\aegisub_vs2008\wxlib_lib32.vsprops;..\aegisub_vs2008\contrib_includedirs.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
ForcedIncludeFiles="r_pre.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\reporter\aegisub.cpp"
>
</File>
<File
RelativePath="..\..\reporter\libraries.cpp"
>
</File>
<File
RelativePath="..\..\reporter\main.cpp"
>
</File>
<File
RelativePath="..\..\reporter\name_map.cpp"
>
</File>
<File
RelativePath="..\..\reporter\platform.cpp"
>
</File>
<File
RelativePath="..\..\reporter\progress.cpp"
>
</File>
<File
RelativePath="..\..\reporter\r_pre.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\reporter\report.cpp"
>
</File>
<File
RelativePath="..\..\reporter\sha256.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
ForcedIncludeFiles=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\reporter\upload.cpp"
>
</File>
<File
RelativePath="..\..\reporter\view.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\reporter\aegisub.h"
>
</File>
<File
RelativePath="..\..\reporter\main.h"
>
</File>
<File
RelativePath="..\..\reporter\include\platform.h"
>
</File>
<File
RelativePath="..\..\reporter\progress.h"
>
</File>
<File
RelativePath="..\..\reporter\r_pre.h"
>
</File>
<File
RelativePath="..\..\reporter\report.h"
>
</File>
<File
RelativePath="..\..\reporter\sha256.h"
>
</File>
<File
RelativePath="..\..\reporter\upload.h"
>
</File>
<File
RelativePath="..\..\reporter\view.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -25,7 +25,12 @@
#endif
#include "aegisub.h"
#ifdef __WINDOWS__
#include "../src/config.h"
#else
#include "../acconf.h"
#endif
Aegisub::Aegisub() {
wxStandardPathsBase &paths = wxStandardPaths::Get();

View File

@ -33,4 +33,3 @@ public:
void Config(wxString config);
wxString Read(wxString key);
};

View File

@ -0,0 +1,68 @@
// Copyright (c) 2009, Amar Takhar <verm@aegisub.org>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
// $Id: libraries.cpp 3601 2009-09-28 08:08:16Z verm $
/// @file libraries.cpp
/// @brief Pragmas for automatically linking in required libraries during Windows build
/// @ingroup base
#if __VISUALC__ >= 1200
// wxWidgets
#if wxCHECK_VERSION(2, 9, 0)
#ifdef __WXDEBUG__
#pragma comment(lib, "wxzlibd.lib")
#pragma comment(lib, "wxpngd.lib")
#pragma comment(lib, "wxregexud.lib")
#pragma comment(lib, "wxbase29ud.lib")
#pragma comment(lib, "wxbase29ud_net.lib")
#pragma comment(lib, "wxmsw29ud_media.lib")
#pragma comment(lib, "wxmsw29ud_core.lib")
#pragma comment(lib, "wxmsw29ud_adv.lib")
#pragma comment(lib, "wxmsw29ud_gl.lib")
#pragma comment(lib, "wxmsw29ud_stc.lib")
#pragma comment(lib, "wxscintillad.lib")
#pragma comment(lib, "wxbase29ud_xml.lib")
#pragma comment(lib, "wxexpatd.lib")
#else
#pragma comment(lib, "wxzlib.lib")
#pragma comment(lib, "wxpng.lib")
#pragma comment(lib, "wxregexu.lib")
#pragma comment(lib, "wxbase29u.lib")
#pragma comment(lib, "wxbase29u_net.lib")
#pragma comment(lib, "wxmsw29u_media.lib")
#pragma comment(lib, "wxmsw29u_core.lib")
#pragma comment(lib, "wxmsw29u_adv.lib")
#pragma comment(lib, "wxmsw29u_gl.lib")
#pragma comment(lib, "wxmsw29u_stc.lib")
#pragma comment(lib, "wxscintilla.lib")
#pragma comment(lib, "wxbase29u_xml.lib")
#pragma comment(lib, "wxexpat.lib")
#endif
#else
#error "wxWidgets 2.9 is required"
#endif // wxWidgets
// Standard Win32 Libraries
#pragma comment(lib, "comctl32.lib")
#pragma comment(lib, "rpcrt4.lib")
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "wldap32.lib")
#pragma comment(lib, "libcurl.lib")
#endif // VisualC

View File

@ -77,7 +77,7 @@ bool Reporter::OnInit()
wxLocale *locale = new wxLocale();
locale->Init(wxLANGUAGE_ENGLISH);
#ifdef __WINDOWS__
locale->AddCatalogLookupPathPrefix(StandardPaths::DecodePath(_T("?data/locale")));
//locale->AddCatalogLookupPathPrefix(Aegisub::DecodePath(_T("?data/locale")));
locale->AddCatalog(_T("reporter"));
#else
locale->AddCatalog("reporter");
@ -86,7 +86,6 @@ bool Reporter::OnInit()
setlocale(LC_NUMERIC, "C");
setlocale(LC_CTYPE, "C");
mFrame *frame = new mFrame(_("Aegisub Reporter"));
Report *r = new Report;
@ -96,7 +95,6 @@ bool Reporter::OnInit()
return false;
}
SetTopWindow(frame);
frame->SetReport(r);
@ -158,8 +156,8 @@ void mFrame::Cancel(wxCommandEvent& WXUNUSED(event)) {
/// @brief Submit report
void mFrame::Submit(wxCommandEvent& WXUNUSED(event)) {
Progress *progress = new Progress::Progress(this);
Upload *upload = new Upload::Upload(progress);
Progress *progress = new Progress(this);
Upload *upload = new Upload(progress);
upload->Report(_("./test.xml"));
}

View File

@ -45,7 +45,6 @@ extern "C" {
/// @brief Constructor.
Platform* Platform::GetPlatform() {
#ifdef __UNIX__
# if defined(__FREEBSD__)
Platform *p = new PlatformUnixBSD;
@ -56,6 +55,8 @@ Platform* Platform::GetPlatform() {
# else
Platform *p = new PlatformUnix;
# endif
#else
Platform *p = NULL;
#endif // __UNIX__
p->Init();
return p;
@ -160,9 +161,11 @@ wxString Platform::Signature() {
return "";
}
#ifdef __UNIX__
wxString Platform::DesktopEnvironment() {
return "";
}
#endif
wxString Platform::OpenGLVendor() {
return GetVideoInfo(VIDEO_VENDOR);

View File

@ -0,0 +1,23 @@
// Copyright (c) 2009, Amar Takhar <verm@aegisub.org>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
// $Id: r_pre.h 3591 2009-09-27 03:12:17Z greg $
/// @file wx_pre.h
/// @brief Precompiled header.
/// @ingroup base
#ifndef R_PRE
#include "r_pre.h"
#endif

View File

@ -18,8 +18,12 @@
/// @brief Precompiled header.
/// @ingroup base
#ifdef __cplusplus
#define R_PRECOMP
#define _CRT_SECURE_NO_WARNINGS
// C + System.
#include <locale.h>
#include <stdint.h>
@ -63,3 +67,5 @@
#include <wx/wxchar.h>
#include <wx/wxprec.h>
#include <wx/xml/xml.h>
#endif

View File

@ -24,7 +24,7 @@
#endif
#include "report.h"
#include "platform.h"
#include "include/platform.h"
#include "aegisub.h"
/// @brief Contstructor
@ -43,7 +43,7 @@ Report::XMLReport Report::ReportCreate() {
doc.report = new wxXmlNode(wxXML_ELEMENT_NODE, "report");
doc.doc->SetRoot(doc.report);
Platform *p = Platform::GetPlatform();
Platform *p = Platform::GetPlatform();
doc.general = new wxXmlNode(doc.report, wxXML_ELEMENT_NODE, "general");
Add(doc.general, "signature", p->Signature());
@ -61,7 +61,7 @@ Report::XMLReport Report::ReportCreate() {
doc.aegisub = new wxXmlNode(wxXML_ELEMENT_NODE, "aegisub");
doc.report->AddChild(doc.aegisub);
Aegisub *config = new Aegisub::Aegisub();
Aegisub *config = new Aegisub();
Add(doc.aegisub, "lastversion", config->Read("Config/last version"));
Add(doc.aegisub, "spelllang", config->Read("Config/spell checker language"));
Add(doc.aegisub, "thesauruslang", config->Read("Config/thesaurus language"));
@ -81,29 +81,29 @@ Report::XMLReport Report::ReportCreate() {
doc.report->AddChild(doc.hardware);
Add(doc.hardware, "memory", p->Memory());
wxXmlNode *cpu = new wxXmlNode(wxXML_ELEMENT_NODE, "cpu");
doc.hardware->AddChild(cpu);
Add(cpu, "id", p->CPUId());
Add(cpu, "speed", p->CPUSpeed());
Add(cpu, "count", p->CPUCount());
Add(cpu, "cores", p->CPUCores());
Add(cpu, "features", p->CPUFeatures());
Add(cpu, "features2", p->CPUFeatures2());
wxXmlNode *cpu = new wxXmlNode(wxXML_ELEMENT_NODE, "cpu");
doc.hardware->AddChild(cpu);
Add(cpu, "id", p->CPUId());
Add(cpu, "speed", p->CPUSpeed());
Add(cpu, "count", p->CPUCount());
Add(cpu, "cores", p->CPUCores());
Add(cpu, "features", p->CPUFeatures());
Add(cpu, "features2", p->CPUFeatures2());
wxXmlNode *display = new wxXmlNode(wxXML_ELEMENT_NODE, "display");
doc.hardware->AddChild(display);
Add(display, "depth", p->DisplayDepth());
Add(display, "colour", p->DisplayColour());
Add(display, "size", p->DisplaySize());
Add(display, "ppi", p->DisplayPPI());
wxXmlNode *display = new wxXmlNode(wxXML_ELEMENT_NODE, "display");
doc.hardware->AddChild(display);
Add(display, "depth", p->DisplayDepth());
Add(display, "colour", p->DisplayColour());
Add(display, "size", p->DisplaySize());
Add(display, "ppi", p->DisplayPPI());
wxXmlNode *display_gl = new wxXmlNode(wxXML_ELEMENT_NODE, "opengl");
display->AddChild(display_gl);
wxXmlNode *display_gl = new wxXmlNode(wxXML_ELEMENT_NODE, "opengl");
display->AddChild(display_gl);
Add(display_gl, "vendor", p->OpenGLVendor());
Add(display_gl, "renderer", p->OpenGLRenderer());
Add(display_gl, "version", p->OpenGLVersion());
Add(display_gl, "extensions", p->OpenGLExt());
Add(display_gl, "vendor", p->OpenGLVendor());
Add(display_gl, "renderer", p->OpenGLRenderer());
Add(display_gl, "version", p->OpenGLVersion());
Add(display_gl, "extensions", p->OpenGLExt());
#ifdef __WINDOWS__
doc.windows = new wxXmlNode(wxXML_ELEMENT_NODE, "windows");
@ -111,8 +111,8 @@ Report::XMLReport Report::ReportCreate() {
Add(doc.windows, "sp", p->ServicePack());
Add(doc.windows, "graphicsver", p->DriverGraphicsVersion());
Add(doc.windows, "dshowfilter", p->DirectShowFilters());
Add(doc.windows, "antivirus", p->());
Add(doc.windows, "firewall", p->());
//Add(doc.windows, "antivirus", p->());
//Add(doc.windows, "firewall", p->());
Add(doc.windows, "dll", p->DLLVersions());
#endif
@ -143,7 +143,7 @@ void Report::Add(wxXmlNode *parent, wxString node, wxString text) {
// Using AddChild() keeps the nodes in their natural order. It's slower but our
// document is pretty small. Doing it the faster way results in reverse-ordered nodes.
wxXmlNode *tmp = new wxXmlNode(wxXML_ELEMENT_NODE, node);
tmp->AddChild(new wxXmlNode(wxXML_TEXT_NODE, node, text));
tmp->AddChild(new wxXmlNode(wxXML_TEXT_NODE, node, text));
parent->AddChild(tmp);
}
@ -172,7 +172,7 @@ void Report::ProcessNode(wxXmlNode *node, wxString *text, wxListView *listView)
int depth = child->GetDepth();
if (child->GetChildren()->GetType() == wxXML_ELEMENT_NODE) {
int font_size = 15 - (round(depth * 2));
int font_size = 15 - floor(depth * 2 + 0.5);
int bgcolour = 155 + (depth * 20);
listView->InsertItem(row,node_name);
listView->SetItemFont(row, wxFont(font_size, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
@ -195,7 +195,7 @@ void Report::ProcessNode(wxXmlNode *node, wxString *text, wxListView *listView)
void Report::Fill(wxString *text, wxListView *listView) {
listView->InsertColumn(0, _("Entry"), wxLIST_FORMAT_RIGHT);
listView->InsertColumn(1, _("Text"), wxLIST_FORMAT_LEFT, 100);
listView->InsertColumn(1, _("Text"), wxLIST_FORMAT_LEFT, 100);
ProcessNode(doc.report, text, listView);

View File

@ -44,7 +44,7 @@ public:
private:
/// Comparison callback for nameMap.
struct lst_comp {
bool operator() (const wxString &a, const wxString &b) { return a.Cmp(b) < 0; }
bool operator() (const wxString &a, const wxString &b) const { return a.Cmp(b) < 0; }
};
/// Map of internal XML elements to human readable names.

View File

@ -63,11 +63,11 @@ int Upload::CBProgress(void *p, double dlt, double dln, double ult, double uln)
if (uln > 0) {
Progress *progress = (Progress*) p;
// Update returns false if the user has hit abort.
if (progress->Update(round(ult / uln) * 100) == false)
if (!progress->Update(floor(ult / uln + 0.5) * 100))
// Returning non-zero will cause curl to abort the transfer.
return 1;
}
return 0;
return 0;
}