mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Allow read-only flux sources in the GUI.
This commit is contained in:
@@ -442,7 +442,7 @@ void Config::clearOptions()
|
||||
invalidate();
|
||||
}
|
||||
|
||||
static void setFluxSourceImpl(std::string filename, FluxSourceProto* proto)
|
||||
static void setFluxSourceImpl(const std::string& filename, FluxSourceProto* proto)
|
||||
{
|
||||
for (const auto& it : fluxConstructors)
|
||||
{
|
||||
@@ -464,7 +464,7 @@ void Config::setFluxSource(std::string filename)
|
||||
setFluxSourceImpl(filename, overrides()->mutable_flux_source());
|
||||
}
|
||||
|
||||
static void setFluxSinkImpl(std::string filename, FluxSinkProto* proto)
|
||||
static void setFluxSinkImpl(const std::string& filename, FluxSinkProto* proto)
|
||||
{
|
||||
for (const auto& it : fluxConstructors)
|
||||
{
|
||||
|
||||
@@ -224,8 +224,23 @@ public:
|
||||
|
||||
case SELECTEDSOURCE_FLUX:
|
||||
{
|
||||
globalConfig().setFluxSink(_selectedFluxfilename);
|
||||
globalConfig().setFluxSource(_selectedFluxfilename);
|
||||
try
|
||||
{
|
||||
globalConfig().setFluxSink(_selectedFluxfilename);
|
||||
}
|
||||
catch (const InapplicableValueException* e)
|
||||
{
|
||||
/* ignore */
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
globalConfig().setFluxSource(_selectedFluxfilename);
|
||||
}
|
||||
catch (const InapplicableValueException* e)
|
||||
{
|
||||
/* ignore */
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -587,12 +602,12 @@ private:
|
||||
/* The current set of options is invalid for some reason. Just
|
||||
* swallow the errors. */
|
||||
}
|
||||
catch (const ErrorException& e)
|
||||
{
|
||||
/* This really isn't supposed to happen, but sometimes does and
|
||||
* it crashes the whole program. */
|
||||
return;
|
||||
}
|
||||
catch (const ErrorException& e)
|
||||
{
|
||||
/* This really isn't supposed to happen, but sometimes does and
|
||||
* it crashes the whole program. */
|
||||
return;
|
||||
}
|
||||
|
||||
assert(!wxGetApp().IsWorkerThreadRunning());
|
||||
|
||||
|
||||
@@ -53,11 +53,19 @@ private:
|
||||
|
||||
bool FluxEngineApp::OnInit()
|
||||
{
|
||||
try
|
||||
{
|
||||
wxImage::AddHandler(new wxPNGHandler());
|
||||
Bind(EXEC_EVENT_TYPE, &FluxEngineApp::OnExec, this);
|
||||
_mainWindow = CreateMainWindow();
|
||||
_mainWindow->Show(true);
|
||||
return true;
|
||||
}
|
||||
catch (const ErrorException* e)
|
||||
{
|
||||
fmt::print(stderr, "Exception on startup: {}\n", e->message);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
wxThread::ExitCode FluxEngineApp::Entry()
|
||||
|
||||
Reference in New Issue
Block a user