Skip to content

Commit

Permalink
Tilandis{UWP,LTD} gone bye-bye. While TilandisUWP will probably retur…
Browse files Browse the repository at this point in the history
…n in C++, TilandisLTD may be restarted in Rust.
  • Loading branch information
Nicholas O'Connor committed Mar 6, 2016
1 parent dee5738 commit 75c5713
Show file tree
Hide file tree
Showing 24 changed files with 71 additions and 739 deletions.
32 changes: 0 additions & 32 deletions Tilandis.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tilandis", "Tilandis\Tiland
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TilandisGUI", "TilandisGUI\TilandisGUI.vcxproj", "{70FF911F-A735-4190-B33F-6359F4CC84F4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TilandisUWP", "TilandisUWP\TilandisUWP.vcxproj", "{46C8D76E-E90A-4C60-8254-4D2618E82AF3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TilandisLTD", "TilandisLTD\TilandisLTD.vcxproj", "{EBE4D2E7-191E-4F7C-BC25-08A3C3384572}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Expand Down Expand Up @@ -41,34 +37,6 @@ Global
{70FF911F-A735-4190-B33F-6359F4CC84F4}.Release|x64.Build.0 = Release|x64
{70FF911F-A735-4190-B33F-6359F4CC84F4}.Release|x86.ActiveCfg = Release|Win32
{70FF911F-A735-4190-B33F-6359F4CC84F4}.Release|x86.Build.0 = Release|Win32
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Debug|ARM.ActiveCfg = Debug|ARM
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Debug|ARM.Build.0 = Debug|ARM
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Debug|ARM.Deploy.0 = Debug|ARM
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Debug|x64.ActiveCfg = Debug|x64
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Debug|x64.Build.0 = Debug|x64
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Debug|x64.Deploy.0 = Debug|x64
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Debug|x86.ActiveCfg = Debug|Win32
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Debug|x86.Build.0 = Debug|Win32
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Debug|x86.Deploy.0 = Debug|Win32
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Release|ARM.ActiveCfg = Release|ARM
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Release|ARM.Build.0 = Release|ARM
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Release|ARM.Deploy.0 = Release|ARM
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Release|x64.ActiveCfg = Release|x64
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Release|x64.Build.0 = Release|x64
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Release|x64.Deploy.0 = Release|x64
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Release|x86.ActiveCfg = Release|Win32
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Release|x86.Build.0 = Release|Win32
{46C8D76E-E90A-4C60-8254-4D2618E82AF3}.Release|x86.Deploy.0 = Release|Win32
{EBE4D2E7-191E-4F7C-BC25-08A3C3384572}.Debug|ARM.ActiveCfg = Debug|Win32
{EBE4D2E7-191E-4F7C-BC25-08A3C3384572}.Debug|x64.ActiveCfg = Debug|x64
{EBE4D2E7-191E-4F7C-BC25-08A3C3384572}.Debug|x64.Build.0 = Debug|x64
{EBE4D2E7-191E-4F7C-BC25-08A3C3384572}.Debug|x86.ActiveCfg = Debug|Win32
{EBE4D2E7-191E-4F7C-BC25-08A3C3384572}.Debug|x86.Build.0 = Debug|Win32
{EBE4D2E7-191E-4F7C-BC25-08A3C3384572}.Release|ARM.ActiveCfg = Release|Win32
{EBE4D2E7-191E-4F7C-BC25-08A3C3384572}.Release|x64.ActiveCfg = Release|x64
{EBE4D2E7-191E-4F7C-BC25-08A3C3384572}.Release|x64.Build.0 = Release|x64
{EBE4D2E7-191E-4F7C-BC25-08A3C3384572}.Release|x86.ActiveCfg = Release|Win32
{EBE4D2E7-191E-4F7C-BC25-08A3C3384572}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
78 changes: 67 additions & 11 deletions TilandisGUI/TilandisGUIDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ void CTilandisGUIDlg::DoDataExchange(CDataExchange* pDX)
DDX_Control(pDX, IDC_REGISTERPROTOCOL, BTN_RegisterProtocol);
DDX_Control(pDX, IDC_PATHBOX, EDT_PathBox);
DDX_Control(pDX, IDC_NAMEBOX, EDT_NameBox);
DDX_Control(pDX, IDC_WDBOX, EDT_WDBox);
DDX_Control(pDX, IDC_ARGSBOX, EDT_ArgBox);
}

BEGIN_MESSAGE_MAP(CTilandisGUIDlg, CDialogEx)
Expand Down Expand Up @@ -214,7 +216,7 @@ void CTilandisGUIDlg::OnBnClickedPathbrowse()
LPOLESTR dispname = NULL;
pItem->GetDisplayName(SIGDN_FILESYSPATH, &dispname); // *dispname == "C:\Some\Path\File.name"

SetDlgItemText(IDC_PATHBOX, (LPWSTR)dispname);
EDT_PathBox.SetWindowText((LPWSTR)dispname);
}
}

Expand Down Expand Up @@ -248,7 +250,7 @@ void CTilandisGUIDlg::OnBnClickedWdbrowse()
LPOLESTR dispname = NULL;
pItem->GetDisplayName(SIGDN_FILESYSPATH, &dispname); // *dispname == "C:\Some\Path"

SetDlgItemText(IDC_WDBOX, (LPWSTR) dispname);
EDT_WDBox.SetWindowText((LPWSTR) dispname);
}
}

Expand All @@ -264,12 +266,13 @@ void CTilandisGUIDlg::OnBnClickedDeletelink()
MessageBox(L"You're supposed to put a link name in the box to the left. (That's the thing you type into TileCreator)", L"Tilandis GUI Error", MB_ICONERROR);
return;
}
wchar_t* str_delarg = L"-d ";

wchar_t str_args[768];
for (int i = 0; i < 768; i++) {
str_args[i] = '\0';
}
wcscat_s(str_args, (size_t) 768, (const wchar_t*) str_delarg);

wcscat_s(str_args, (size_t) 768, L"-d ");
wcscat_s(str_args, (size_t) 768, (const wchar_t*) str_name);

ShellExecute(NULL, NULL, L"Tilandis.exe", str_args, NULL, 0);
Expand All @@ -278,23 +281,76 @@ void CTilandisGUIDlg::OnBnClickedDeletelink()

void CTilandisGUIDlg::OnBnClickedCreatelink()
{
int length;
LPWSTR str_name[512];
for (int i = 0; i < 512; i++) {
str_name[i] = '\0';
}
int length = EDT_NameBox.GetWindowText((LPTSTR) str_name, 512);
length = EDT_NameBox.GetWindowText((LPTSTR) str_name, 512);
if (length < 1) {
MessageBox(L"You're supposed to put a link name in the box to the left. (That's the thing you type into TileCreator)", L"Tilandis GUI Error", MB_ICONERROR);
return;
}
wchar_t* str_newarg = L"-n ";
wchar_t str_args[768];
for (int i = 0; i < 768; i++) {

// String containing the full list of arguments to Tilandis
wchar_t str_args[2048]; // Create args could run for a lot longer
for (int i = 0; i < 2048; i++) {
str_args[i] = '\0';
}
wcscat_s(str_args, (size_t) 768, (const wchar_t*) str_newarg);
wcscat_s(str_args, (size_t) 768, (const wchar_t*) str_name);

// Name
wcscat_s(str_args, (size_t) 2048, L"-n \"");
wcscat_s(str_args, (size_t) 2048, (const wchar_t*) str_name);
wcscat_s(str_args, (size_t) 2048, L"\"");

// Path
LPWSTR str_path[MAX_PATH];
length = EDT_PathBox.GetWindowText((LPTSTR) str_path, MAX_PATH);
if (length < 1) {
MessageBox(L"You need to specify a path. This is the thing you actually launch.");
return;
}

wcscat_s(str_args, (size_t) 2048, L" -p \"");
wcscat_s(str_args, (size_t) 2048, (const wchar_t*) str_path);
wcscat_s(str_args, (size_t) 2048, L"\"");

// Working directory
LPWSTR str_workdir[MAX_PATH];
for (int i = 0; i < MAX_PATH; i++) {
str_workdir[i] = '\0';
}
length = EDT_WDBox.GetWindowText((LPTSTR) str_workdir, MAX_PATH);
if (length > 0) {
// User specified a working directory, lets define it
// We skip this arg if the user does, because the code to automatically determine the path is already
// in Tilandis itself (specifically, linkmgmt.cpp)
wcscat_s(str_args, (size_t) 2048, L" -w \"");
wcscat_s(str_args, (size_t) 2048, (const wchar_t*) str_workdir);
wcscat_s(str_args, (size_t) 2048, L"\"");
}

// Arguments
LPWSTR str_linkargs[1024];
for (int i = 0; i < 1024; i++) {
str_linkargs[i] = '\0';
}
length = EDT_ArgBox.GetWindowText((LPTSTR) str_linkargs, 1024);
if (length > 0) {
// User specified args, lets define it
// We skip this arg if the user does, because no args = do nada
// Before we get into that though, we need to properly escape quotation marks
// that's easier to do with wstrings
// TODO: this is twiddly and somehow manages to replace the entire thing with just \"
std::wstring wstr_linkargs = (wchar_t*) str_linkargs;
wstr_linkargs.replace(wstr_linkargs.begin(), wstr_linkargs.end(), L"\"", L"\\\"");

// now we append the result to str_args
wcscat_s(str_args, (size_t) 2048, L" -a \"");
wcscat_s(str_args, (size_t) 2048, wstr_linkargs.c_str());
wcscat_s(str_args, (size_t) 2048, L"\"");
}

MessageBox((LPCWSTR) str_args);
ShellExecute(NULL, NULL, L"Tilandis.exe", str_del, NULL, 0);
ShellExecute(NULL, NULL, L"Tilandis.exe", str_args, NULL, 0);
}
4 changes: 4 additions & 0 deletions TilandisGUI/TilandisGUIDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class CTilandisGUIDlg : public CDialogEx
CEdit EDT_PathBox;
// Editbox: "Link Name"
CEdit EDT_NameBox;
// Editbox: "Working Directory"
CEdit EDT_WDBox;
// Editbox: "Arguments"
CEdit EDT_ArgBox;

public:
afx_msg void OnBnClickedPathbrowse();
Expand Down
118 changes: 0 additions & 118 deletions TilandisLTD/TilandisLTD.vcxproj

This file was deleted.

22 changes: 0 additions & 22 deletions TilandisLTD/TilandisLTD.vcxproj.filters

This file was deleted.

37 changes: 0 additions & 37 deletions TilandisLTD/tilandisltd.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions TilandisUWP/App.xaml

This file was deleted.

Loading

0 comments on commit 75c5713

Please sign in to comment.