From d8a1bead23b352b7b2a5ccaa3a94c7ca0de5d0b5 Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 22 Dec 2016 22:12:49 +0100 Subject: UWP controller fixes - Scroll output to end after append new line - Remove Hostname combobox as was not used - Update cert hash in project file --- cpp/test/uwp/controller/ViewController.xaml.cpp | 29 ++++++------------------- 1 file changed, 7 insertions(+), 22 deletions(-) (limited to 'cpp/test/uwp/controller/ViewController.xaml.cpp') diff --git a/cpp/test/uwp/controller/ViewController.xaml.cpp b/cpp/test/uwp/controller/ViewController.xaml.cpp index 308e84ed431..af911053842 100644 --- a/cpp/test/uwp/controller/ViewController.xaml.cpp +++ b/cpp/test/uwp/controller/ViewController.xaml.cpp @@ -115,7 +115,7 @@ class ControllerHelper { public: - ControllerHelper(ViewController^, string); + ControllerHelper(ViewController^); virtual ~ControllerHelper(); void @@ -340,12 +340,12 @@ ProcessControllerI::getHost(string, bool, const Ice::Current&) return _hostname; } -ControllerHelper::ControllerHelper(ViewController^ controller, string hostname) +ControllerHelper::ControllerHelper(ViewController^ controller) { Ice::InitializationData initData = Ice::InitializationData(); initData.properties = Ice::createProperties(); initData.properties->setProperty("Ice.ThreadPool.Server.SizeMax", "10"); - initData.properties->setProperty("Ice.Default.Host", hostname); + initData.properties->setProperty("Ice.Default.Host", "127.0.0.1"); //initData.properties->setProperty("Ice.Trace.Network", "3"); //initData.properties->setProperty("Ice.Trace.Protocol", "1"); initData.properties->setProperty("ControllerAdapter.AdapterId", Ice::generateUUID()); @@ -357,7 +357,7 @@ ControllerHelper::ControllerHelper(ViewController^ controller, string hostname) Ice::ObjectAdapterPtr adapter = _communicator->createObjectAdapterWithEndpoints("ControllerAdapter", ""); Ice::Identity ident = { "ProcessController", "UWP"}; auto processController = Ice::uncheckedCast( - adapter->add(make_shared(controller, hostname), ident)); + adapter->add(make_shared(controller, "127.0.0.1"), ident)); adapter->activate(); registerProcessController(controller, adapter, registry, processController); @@ -417,29 +417,12 @@ ViewController::ViewController() void ViewController::OnNavigatedTo(NavigationEventArgs^) { - Hostname->Items->Clear(); - Hostname->Items->Append(L"127.0.0.1"); - for(auto i : NetworkInformation::GetHostNames()) - { - if(i->IPInformation != nullptr && i->IPInformation->NetworkAdapter != nullptr) - { - Hostname->Items->Append(i->CanonicalName); - } - } - Hostname->SelectedIndex = 0; -} - - -void -ViewController::Hostname_SelectionChanged(Platform::Object^ sender, SelectionChangedEventArgs^ e) -{ - String^ hostname = Hostname->SelectedItem->ToString(); if(controllerHelper) { delete controllerHelper; controllerHelper = 0; } - controllerHelper = new ControllerHelper(this, Ice::wstringToString(hostname->Data())); + controllerHelper = new ControllerHelper(this); } void @@ -449,6 +432,8 @@ ViewController::println(const string& s) [=]() { Output->Items->Append(ref new String(Ice::stringToWstring(s).c_str())); + Output->SelectedIndex = Output->Items->Size - 1; + Output->ScrollIntoView(Output->SelectedItem); })); } -- cgit v1.2.3