comparison Applications/Generic/NativeStoneApplicationRunner.cpp @ 296:ac9fd144feae am-2

fix
author am@osimis.io
date Mon, 10 Sep 2018 12:20:14 +0200
parents 87376a645ee1
children 8eb4fe74000f
comparison
equal deleted inserted replaced
295:b04b13810540 296:ac9fd144feae
119 std::cout << std::endl 119 std::cout << std::endl
120 << "Usage: " << argv[0] << " [OPTION]..." 120 << "Usage: " << argv[0] << " [OPTION]..."
121 << std::endl 121 << std::endl
122 << "Orthanc, lightweight, RESTful DICOM server for healthcare and medical research." 122 << "Orthanc, lightweight, RESTful DICOM server for healthcare and medical research."
123 << std::endl << std::endl 123 << std::endl << std::endl
124 << "Demonstration application of Orthanc Stone using SDL." 124 << "Demonstration application of Orthanc Stone in native environment."
125 << std::endl; 125 << std::endl;
126 126
127 std::cout << options << "\n"; 127 std::cout << options << "\n";
128 return error ? -1 : 0; 128 return error ? -1 : 0;
129 } 129 }
155 if (parameters.count("orthanc")) 155 if (parameters.count("orthanc"))
156 { 156 {
157 webServiceParameters.SetUrl(parameters["orthanc"].as<std::string>()); 157 webServiceParameters.SetUrl(parameters["orthanc"].as<std::string>());
158 } 158 }
159 159
160 if (parameters.count("username")) 160 if (parameters.count("username") && parameters.count("password"))
161 { 161 {
162 webServiceParameters.SetUsername(parameters["username"].as<std::string>()); 162 webServiceParameters.SetCredentials(parameters["username"].as<std::string>(),
163 } 163 parameters["password"].as<std::string>());
164
165 if (parameters.count("password"))
166 {
167 webServiceParameters.SetPassword(parameters["password"].as<std::string>());
168 } 164 }
169 165
170 LOG(WARNING) << "URL to the Orthanc REST API: " << webServiceParameters.GetUrl(); 166 LOG(WARNING) << "URL to the Orthanc REST API: " << webServiceParameters.GetUrl();
171 167
172 { 168 {