Skip to content

Commit

Permalink
Merge pull request FreeApophis#12 from waywardgeek/master
Browse files Browse the repository at this point in the history
Changed more file cases, and fixes to compile with wxgtk 3.0
  • Loading branch information
FreeApophis committed Jun 9, 2014
2 parents ba3c11c + dbd23de commit 0ccbbe4
Show file tree
Hide file tree
Showing 65 changed files with 3,136 additions and 39 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions Common/Common.rc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#include "Resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -487,7 +487,7 @@ IDR_LICENSE TEXT "..\\Resources\\Texts\\License.r

1 TEXTINCLUDE
BEGIN
"resource.h\0"
"Resource.h\0"
END

2 TEXTINCLUDE
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions Driver/Driver.rc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#include "Resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -67,7 +67,7 @@ END

1 TEXTINCLUDE
BEGIN
"resource.h\0"
"Resource.h\0"
END

2 TEXTINCLUDE
Expand Down
2 changes: 1 addition & 1 deletion Driver/Driver.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
>
</File>
<File
RelativePath=".\resource.h"
RelativePath=".\Resource.h"
>
</File>
<File
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions Format/Format.rc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#include "Resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
#include "..\\common\\resource.h"
#include "..\\common\\Resource.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
Expand Down Expand Up @@ -65,7 +65,7 @@ END
// HEADER
//

IDR_FORMAT_RSRC_HEADER HEADER "resource.h"
IDR_FORMAT_RSRC_HEADER HEADER "Resource.h"

/////////////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -426,13 +426,13 @@ END

1 TEXTINCLUDE
BEGIN
"resource.h\0"
"Resource.h\0"
END

2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"#include ""..\\\\common\\\\resource.h""\r\n"
"#include ""..\\\\common\\\\Resource.h""\r\n"
"\0"
END

Expand Down
2 changes: 1 addition & 1 deletion Format/Format.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@
>
</File>
<File
RelativePath=".\resource.h"
RelativePath=".\Resource.h"
>
</File>
<File
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 3 additions & 4 deletions Main/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace TrueCrypt

FilePath Application::GetConfigFilePath (const wxString &configFileName, bool createConfigDir)
{
wxStandardPaths stdPaths;
DirectoryPath configDir;

if (!Core->IsInPortableMode())
Expand All @@ -46,7 +45,7 @@ namespace TrueCrypt
configPath.Normalize();
configDir = wstring (configPath.GetFullPath());
#else
configDir = wstring (stdPaths.GetUserDataDir());
configDir = wstring (wxStandardPaths::Get().GetUserDataDir());
#endif
}
else
Expand All @@ -61,12 +60,12 @@ namespace TrueCrypt

DirectoryPath Application::GetExecutableDirectory ()
{
return wstring (wxFileName (wxStandardPaths().GetExecutablePath()).GetPath());
return wstring (wxFileName (wxStandardPaths::Get().GetExecutablePath()).GetPath());
}

FilePath Application::GetExecutablePath ()
{
return wstring (wxStandardPaths().GetExecutablePath());
return wstring (wxStandardPaths::Get().GetExecutablePath());
}

void Application::Initialize (UserInterfaceType::Enum type)
Expand Down
12 changes: 6 additions & 6 deletions Main/CommandLineInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ namespace TrueCrypt
ArgQuick = parser.Found (L"quick");

if (parser.Found (L"random-source", &str))
ArgRandomSourcePath = FilesystemPath (str);
ArgRandomSourcePath = FilesystemPath (str.ToStdWstring());

if (parser.Found (L"restore-headers"))
{
Expand Down Expand Up @@ -471,7 +471,7 @@ namespace TrueCrypt

if (param1IsFile)
{
ArgFilePath.reset (new FilePath (parser.GetParam (0)));
ArgFilePath.reset (new FilePath (parser.GetParam (0).ToStdWstring()));
}
}

Expand Down Expand Up @@ -524,7 +524,7 @@ namespace TrueCrypt
arr.Add (L"");
continue;
}
arr.Last() += token.empty() ? L',' : token;
arr.Last() += token.empty() ? L"," : token;
}
else
arr.Add (token);
Expand Down Expand Up @@ -562,12 +562,12 @@ namespace TrueCrypt
{
filteredVolumes.push_back (volume);
}
else if (wxString (volume->Path) == pathFilter.GetFullPath())
else if (wxString (wstring(volume->Path)) == pathFilter.GetFullPath())
{
filteredVolumes.push_back (volume);
}
else if (wxString (volume->MountPoint) == pathFilter.GetFullPath()
|| (wxString (volume->MountPoint) + wxFileName::GetPathSeparator()) == pathFilter.GetFullPath())
else if (wxString (wstring(volume->MountPoint)) == pathFilter.GetFullPath()
|| (wxString (wstring(volume->MountPoint)) + wxFileName::GetPathSeparator()) == pathFilter.GetFullPath())
{
filteredVolumes.push_back (volume);
}
Expand Down
2 changes: 1 addition & 1 deletion Main/Forms/MainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ namespace TrueCrypt
// File-hosted volumes
if (!volume->Path.IsDevice() && !mountPoint.IsEmpty())
{
if (wxString (volume->Path).Upper().StartsWith (wstring (mountPoint).c_str()))
if (wxString (wstring(volume->Path)).Upper().StartsWith (wstring (mountPoint).c_str()))
{
removedVolumes.push_back (volume);
continue;
Expand Down
2 changes: 1 addition & 1 deletion Main/Forms/SelectDirectoryWizardPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace TrueCrypt
{
if (!DirectoryTextCtrl->IsEmpty())
{
return FilesystemPath (DirectoryTextCtrl->GetValue()).IsDirectory();
return FilesystemPath (wstring(DirectoryTextCtrl->GetValue())).IsDirectory();
}

return false;
Expand Down
2 changes: 1 addition & 1 deletion Main/Forms/SelectDirectoryWizardPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace TrueCrypt
public:
SelectDirectoryWizardPage (wxPanel* parent) : SelectDirectoryWizardPageBase (parent) { }

DirectoryPath GetDirectory () const { return DirectoryPath (DirectoryTextCtrl->GetValue()); }
DirectoryPath GetDirectory () const { return DirectoryPath (wstring(DirectoryTextCtrl->GetValue())); }
bool IsValid ();
void SetDirectory (const DirectoryPath &path) { DirectoryTextCtrl->SetValue (wstring (path)); }
void SetMaxStaticTextWidth (int width) { InfoStaticText->Wrap (width); }
Expand Down
15 changes: 8 additions & 7 deletions Main/GraphicUserInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1250,19 +1250,19 @@ namespace TrueCrypt
File backupFile;
backupFile.Open (*files.front(), File::OpenRead);

uint64 headerSize;
//uint64 headerSize;
bool legacyBackup;

// Determine the format of the backup file
switch (backupFile.Length())
{
case TC_VOLUME_HEADER_GROUP_SIZE:
headerSize = TC_VOLUME_HEADER_SIZE;
//headerSize = TC_VOLUME_HEADER_SIZE;
legacyBackup = false;
break;

case TC_VOLUME_HEADER_SIZE_LEGACY * 2:
headerSize = TC_VOLUME_HEADER_SIZE_LEGACY;
//headerSize = TC_VOLUME_HEADER_SIZE_LEGACY;
legacyBackup = true;
break;

Expand Down Expand Up @@ -1378,13 +1378,14 @@ namespace TrueCrypt

DirectoryPath GraphicUserInterface::SelectDirectory (wxWindow *parent, const wxString &message, bool existingOnly) const
{
return DirectoryPath (::wxDirSelector (!message.empty() ? message :
return DirectoryPath (wstring(::wxDirSelector (!message.empty() ? message :
#ifdef __WXGTK__
wxDirSelectorPromptStr,
#else
L"",
#endif
L"", wxDD_DEFAULT_STYLE | (existingOnly ? wxDD_DIR_MUST_EXIST : 0), wxDefaultPosition, parent));
L"", wxDD_DEFAULT_STYLE | (existingOnly ? wxDD_DIR_MUST_EXIST :
0), wxDefaultPosition, parent)));
}

FilePathList GraphicUserInterface::SelectFiles (wxWindow *parent, const wxString &caption, bool saveMode, bool allowMultiple, const list < pair <wstring, wstring> > &fileExtensions, const DirectoryPath &directory) const
Expand Down Expand Up @@ -1428,14 +1429,14 @@ namespace TrueCrypt
if (dialog.ShowModal() == wxID_OK)
{
if (!allowMultiple)
files.push_back (make_shared <FilePath> (dialog.GetPath()));
files.push_back (make_shared <FilePath> (wstring(dialog.GetPath())));
else
{
wxArrayString paths;
dialog.GetPaths (paths);

foreach (const wxString &path, paths)
files.push_back (make_shared <FilePath> (path));
files.push_back (make_shared <FilePath> (wstring(path)));
}
}

Expand Down
2 changes: 1 addition & 1 deletion Main/TextUserInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace TrueCrypt
for (size_t i = 0; i < length && i < VolumePassword::MaxSize; ++i)
{
passwordBuf[i] = (wchar_t) passwordStr[i];
const_cast <wchar_t *> (passwordStr.c_str())[i] = L'X';
const_cast <wchar_t *> (passwordStr.wc_str())[i] = L'X';
}

if (verify && verPhase)
Expand Down
2 changes: 1 addition & 1 deletion Main/UserPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ namespace TrueCrypt

foreach_ref (const Keyfile &keyfile, DefaultKeyfiles)
{
keyfilesXml.InnerNodes.push_back (XmlNode (L"keyfile", wxString (FilesystemPath (keyfile))));
keyfilesXml.InnerNodes.push_back (XmlNode (L"keyfile", wxString (wstring(FilesystemPath (keyfile)))));
}

XmlWriter keyfileWriter (keyfilesCfgPath);
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export CXXFLAGS := -Wall -Wno-unused-parameter
C_CXX_FLAGS := -MMD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -I$(BASE_DIR) -I$(BASE_DIR)/Crypto
export ASFLAGS := -Ox -D __GNUC__
export LFLAGS :=
export LIBS := -ldl

export PKG_CONFIG_PATH ?= /usr/local/lib/pkgconfig

Expand Down
10 changes: 5 additions & 5 deletions Mount/Mount.rc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#include "Resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
#include "..\\common\\resource.h"
#include "..\\common\\Resource.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
Expand All @@ -27,7 +27,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// HEADER
//

IDR_MOUNT_RSRC_HEADER HEADER "resource.h"
IDR_MOUNT_RSRC_HEADER HEADER "Resource.h"

/////////////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -461,13 +461,13 @@ END

1 TEXTINCLUDE
BEGIN
"resource.h\0"
"Resource.h\0"
END

2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"#include ""..\\\\common\\\\resource.h""\r\n"
"#include ""..\\\\common\\\\Resource.h""\r\n"
"\0"
END

Expand Down
2 changes: 1 addition & 1 deletion Mount/Mount.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@
>
</File>
<File
RelativePath=".\resource.h"
RelativePath=".\Resource.h"
>
</File>
<File
Expand Down
File renamed without changes.
Loading

0 comments on commit 0ccbbe4

Please sign in to comment.