From e1e3e6756e0745088b9c2a828e380cc78cc075c5 Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Sat, 28 Nov 2015 13:54:27 -0600 Subject: [PATCH] Fixed bookmarks being completely useless --- LilithPort/MainForm.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/LilithPort/MainForm.h b/LilithPort/MainForm.h index 2eab20a..1571517 100644 --- a/LilithPort/MainForm.h +++ b/LilithPort/MainForm.h @@ -44,13 +44,18 @@ namespace LilithPort { toolStripMenuItemBookMark->Text = tmpName; toolStripMenuItemBookMark->Name = L"toolStripMenuItemBookMark" + i; toolStripMenuItemBookMark->Tag = i; - toolStripMenuItemBookMark->Click += gcnew System::EventHandler(this, &MainForm::toolStripMenuItemBookMark_Click); toolStripMenuItemDelBookMark = (gcnew System::Windows::Forms::MenuItem()); toolStripMenuItemBookMark->MenuItems->Add(toolStripMenuItemDelBookMark); toolStripMenuItemDelBookMark->Text = L"&Delete"; toolStripMenuItemDelBookMark->Tag = L"toolStripMenuItemBookMark" + i; toolStripMenuItemDelBookMark->Click += gcnew System::EventHandler(this, &MainForm::toolStripMenuItemDelBookMark_Click); + + toolStripMenuItemConnectToBookmark = gcnew System::Windows::Forms::MenuItem(); + toolStripMenuItemBookMark->MenuItems->Add(toolStripMenuItemConnectToBookmark); + toolStripMenuItemConnectToBookmark->Text = L"&Connect"; + toolStripMenuItemConnectToBookmark->Tag = i; + toolStripMenuItemConnectToBookmark->Click += gcnew System::EventHandler(this, &MainForm::toolStripMenuItemConnectToBookMark_Click); } } @@ -134,6 +139,7 @@ namespace LilithPort { private: System::Windows::Forms::MenuItem^ toolStripMenuItemAddBookMark; private: System::Windows::Forms::MenuItem^ toolStripMenuItemBookMark; private: System::Windows::Forms::MenuItem^ toolStripMenuItemDelBookMark; + private: System::Windows::Forms::MenuItem^ toolStripMenuItemConnectToBookmark; private: System::Windows::Forms::MenuItem^ toolStripSeparator8; private: System::Windows::Forms::MenuItem^ CommandToolStripMenuItem; @@ -2623,7 +2629,6 @@ private: System::Windows::Forms::ContextMenu^ contextMenuStrip2; toolStripMenuItemBookMark->Text = ServerName; toolStripMenuItemBookMark->Name = L"toolStripMenuItemBookMark" + MTOPTION.BOOKMARK_COUNT; toolStripMenuItemBookMark->Tag = MTOPTION.BOOKMARK_COUNT; - toolStripMenuItemBookMark->Click += gcnew System::EventHandler(this, &MainForm::toolStripMenuItemBookMark_Click); // 削除メニュー toolStripMenuItemDelBookMark = (gcnew System::Windows::Forms::MenuItem()); @@ -2632,6 +2637,12 @@ private: System::Windows::Forms::ContextMenu^ contextMenuStrip2; toolStripMenuItemDelBookMark->Tag = L"toolStripMenuItemBookMark" + MTOPTION.BOOKMARK_COUNT; toolStripMenuItemDelBookMark->Click += gcnew System::EventHandler(this, &MainForm::toolStripMenuItemDelBookMark_Click); + toolStripMenuItemConnectToBookmark = gcnew System::Windows::Forms::MenuItem(); + toolStripMenuItemBookMark->MenuItems->Add(toolStripMenuItemConnectToBookmark); + toolStripMenuItemConnectToBookmark->Text = L"&Connect"; + toolStripMenuItemConnectToBookmark->Tag = MTOPTION.BOOKMARK_COUNT; + toolStripMenuItemConnectToBookmark->Click += gcnew System::EventHandler(this, &MainForm::toolStripMenuItemConnectToBookMark_Click); + BookMarkServerName = Runtime::InteropServices::Marshal::StringToHGlobalAuto(tmpName); _tcscpy_s(MTOPTION.BOOKMARK_SERVER_NAME[tmpInt], static_cast(BookMarkServerName.ToPointer())); Runtime::InteropServices::Marshal::FreeHGlobal(BookMarkServerName); @@ -2648,10 +2659,11 @@ private: System::Windows::Forms::ContextMenu^ contextMenuStrip2; SaveMTOption(); } // ブックマーク接続 - System::Void toolStripMenuItemBookMark_Click(System::Object^ sender, System::EventArgs^ e) { + System::Void toolStripMenuItemConnectToBookMark_Click(System::Object^ sender, System::EventArgs^ e) { UINT tmpInt = (UINT)((MenuItem^)sender)->Tag; + String^ tmpName = gcnew String(MTOPTION.BOOKMARK_SERVER_NAME[tmpInt]); - if(MessageBox::Show(L"Connect to "+((MenuItem^)sender)->Text+ L"?\n", L"Connect from Bookmark", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == ::DialogResult::Yes){ + if(MessageBox::Show(L"Connect to "+ tmpName + L"?\n", L"Connect from Bookmark", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == ::DialogResult::Yes){ }else{ return; }