mirror of https://github.com/KLayout/klayout.git
Fixed #102 (Potential issue while upgrading from .25.1 to .25.2)
The reason was that for 0.25.1 "macro-editor-font-size" was allowed
to be an empty string (the default). Which meant: take default application
font size. In 0.25.2 this now was required to be a number and 0 was
the default for "auto" font size.
Two changes:
- The default is back to empty string ("0" is still allowed as default)
- The application was made safe against broken configuration files: an
error is printed to the log, but apart from that the application
will work (the configuration value is ignored however).
This commit is contained in:
parent
19f25cc90b
commit
21e2af2a97
|
|
@ -786,7 +786,9 @@ MacroEditorDialog::configure (const std::string &name, const std::string &value)
|
|||
} else if (name == cfg_macro_editor_font_size) {
|
||||
|
||||
int v = m_font_size;
|
||||
tl::from_string (value, v);
|
||||
if (! value.empty ()) {
|
||||
tl::from_string (value, v);
|
||||
}
|
||||
if (v != m_font_size) {
|
||||
m_font_size = v;
|
||||
m_needs_update = true;
|
||||
|
|
@ -3475,7 +3477,7 @@ public:
|
|||
options.push_back (std::pair<std::string, std::string> (cfg_macro_editor_save_all_on_run, "false"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_macro_editor_debugging_enabled, "true"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_macro_editor_file_watcher_enabled, "true"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_macro_editor_font_size, "0"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_macro_editor_font_size, ""));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_macro_editor_font_family, ""));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_macro_editor_stop_on_exception, "true"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_macro_editor_tab_width, "8"));
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include "tlException.h"
|
||||
#include "tlAssert.h"
|
||||
#include "tlXMLParser.h"
|
||||
#include "tlLog.h"
|
||||
|
||||
#include "layPlugin.h"
|
||||
#include "tlExceptions.h"
|
||||
|
|
@ -37,6 +38,7 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
#include <QObject>
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
|
@ -293,8 +295,12 @@ Plugin::config_set (const std::string &name, const std::string &value)
|
|||
// look for plugins that receive that configuration statically if the root is addressed
|
||||
if (! mp_parent && ! m_standalone) {
|
||||
for (tl::Registrar<lay::PluginDeclaration>::iterator cls = tl::Registrar<lay::PluginDeclaration>::begin (); cls != tl::Registrar<lay::PluginDeclaration>::end (); ++cls) {
|
||||
if ((const_cast<lay::PluginDeclaration *> (&*cls))->configure (name, value)) {
|
||||
return;
|
||||
try {
|
||||
if ((const_cast<lay::PluginDeclaration *> (&*cls))->configure (name, value)) {
|
||||
return;
|
||||
}
|
||||
} catch (tl::Exception &ex) {
|
||||
tl::error << tl::to_string (QObject::tr ("Error on configure")) << " " << name << "='" << value << "': " << ex.msg ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -381,9 +387,13 @@ Plugin::do_config_end ()
|
|||
bool
|
||||
Plugin::do_config_set (const std::string &name, const std::string &value)
|
||||
{
|
||||
if (configure (name, value)) {
|
||||
// taken by us - don't propagate to the children
|
||||
return true;
|
||||
try {
|
||||
if (configure (name, value)) {
|
||||
// taken by us - don't propagate to the children
|
||||
return true;
|
||||
}
|
||||
} catch (tl::Exception &ex) {
|
||||
tl::error << tl::to_string (QObject::tr ("Error on configure")) << " " << name << "='" << value << "': " << ex.msg ();
|
||||
}
|
||||
|
||||
// propagate to all children (not only the first that takes it!)
|
||||
|
|
|
|||
Loading…
Reference in New Issue