RemoteControl.cpp   RemoteControl.cpp 
skipping to change at line 67 skipping to change at line 67
info.id = "RemoteControl"; info.id = "RemoteControl";
info.displayedName = N_("Remote Control"); info.displayedName = N_("Remote Control");
info.authors = "Florian Schaukowitsch and Georg Zotti"; info.authors = "Florian Schaukowitsch and Georg Zotti";
info.contact = "http://homepage.univie.ac.at/Georg.Zotti"; info.contact = "http://homepage.univie.ac.at/Georg.Zotti";
info.description = N_("Provides remote control functionality using a webserver interface. See manual for detailed description."); info.description = N_("Provides remote control functionality using a webserver interface. See manual for detailed description.");
info.version = REMOTECONTROL_VERSION; info.version = REMOTECONTROL_VERSION;
return info; return info;
} }
RemoteControl::RemoteControl() RemoteControl::RemoteControl()
: httpListener(NULL) : httpListener(Q_NULLPTR)
, requestHandler(NULL) , requestHandler(Q_NULLPTR)
, enabled(false) , enabled(false)
, autoStart(false) , autoStart(false)
, usePassword(false) , usePassword(false)
, password("") , password("")
, port(8090) , port(8090)
, minThreads(1) , minThreads(1)
, maxThreads(30) , maxThreads(30)
, toolbarButton(NULL) , toolbarButton(Q_NULLPTR)
{ {
setObjectName("RemoteControl"); setObjectName("RemoteControl");
configDialog = new RemoteControlDialog(); configDialog = new RemoteControlDialog();
conf = StelApp::getInstance().getSettings(); conf = StelApp::getInstance().getSettings();
//needed to ensure clean shutdown of server before threading errors can occur //needed to ensure clean shutdown of server before threading errors can occur
connect(&StelApp::getInstance(), &StelApp::aboutToQuit, this, &Remot eControl::stopServer, Qt::DirectConnection); connect(&StelApp::getInstance(), &StelApp::aboutToQuit, this, &Remot eControl::stopServer, Qt::DirectConnection);
} }
skipping to change at line 154 skipping to change at line 154
StelApp& app = StelApp::getInstance(); StelApp& app = StelApp::getInstance();
// Create action for enable/disable & hook up signals // Create action for enable/disable & hook up signals
addAction("actionShow_Remote_Control", N_("Remote Control"), N_("Rem ote control"), "enabled", ""); addAction("actionShow_Remote_Control", N_("Remote Control"), N_("Rem ote control"), "enabled", "");
// Add a toolbar button. TODO: decide whether a button is necessary at all. Maye the button should not only enable, but call the GUI dialog di rectly? // Add a toolbar button. TODO: decide whether a button is necessary at all. Maye the button should not only enable, but call the GUI dialog di rectly?
try try
{ {
StelGui* gui = dynamic_cast<StelGui*>(app.getGui()); StelGui* gui = dynamic_cast<StelGui*>(app.getGui());
if (gui!=NULL) if (gui!=Q_NULLPTR)
{ {
toolbarButton = new StelButton(NULL, toolbarButton = new StelButton(Q_NULLPTR,
QPixmap(":/RemoteCont rol/resources/bt_remote_on.png"), QPixmap(":/RemoteCont rol/resources/bt_remote_on.png"),
QPixmap(":/RemoteCont rol/resources/bt_remote_off.png"), QPixmap(":/RemoteCont rol/resources/bt_remote_off.png"),
QPixmap(":/graphicGui /glow32x32.png"), QPixmap(":/graphicGui /glow32x32.png"),
"actionShow_Remote_Co ntrol"); "actionShow_Remote_Co ntrol");
gui->getButtonBar()->addButton(toolbarButton, "065-p luginsGroup"); gui->getButtonBar()->addButton(toolbarButton, "065-p luginsGroup");
} }
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
qWarning() << "WARNING: unable to create toolbar button for RemoteControl plugin: " << e.what(); qWarning() << "WARNING: unable to create toolbar button for RemoteControl plugin: " << e.what();
skipping to change at line 239 skipping to change at line 239
{ {
if(port!=this->port) if(port!=this->port)
{ {
this->port = port; this->port = port;
emit portChanged(port); emit portChanged(port);
} }
} }
void RemoteControl::startServer() void RemoteControl::startServer()
{ {
Q_ASSERT(httpListener == NULL); Q_ASSERT(httpListener == Q_NULLPTR);
//set request handler password settings //set request handler password settings
requestHandler->setPassword(password); requestHandler->setPassword(password);
requestHandler->setUsePassword(usePassword); requestHandler->setUsePassword(usePassword);
HttpListenerSettings settings; HttpListenerSettings settings;
settings.port = port; settings.port = port;
settings.minThreads = minThreads; settings.minThreads = minThreads;
settings.maxThreads = maxThreads; settings.maxThreads = maxThreads;
httpListener = new HttpListener(settings,requestHandler); httpListener = new HttpListener(settings,requestHandler);
} }
void RemoteControl::stopServer() void RemoteControl::stopServer()
{ {
if(httpListener) if(httpListener)
{ {
delete httpListener; delete httpListener;
httpListener = NULL; httpListener = Q_NULLPTR;
} }
} }
void RemoteControl::restoreDefaultSettings() void RemoteControl::restoreDefaultSettings()
{ {
Q_ASSERT(conf); Q_ASSERT(conf);
// Remove the old values... // Remove the old values...
conf->remove("RemoteControl"); conf->remove("RemoteControl");
// ...load the default values... // ...load the default values...
loadSettings(); loadSettings();
 End of changes. 6 change blocks. 
7 lines changed or deleted 7 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/