mirror of https://github.com/KLayout/klayout.git
Merge branch 'master' into pr-85
This commit is contained in:
commit
3295b630f3
|
|
@ -37,9 +37,11 @@ namespace lay
|
||||||
{
|
{
|
||||||
|
|
||||||
struct MacroEditorSetupDialogData
|
struct MacroEditorSetupDialogData
|
||||||
|
: public QObject
|
||||||
{
|
{
|
||||||
MacroEditorSetupDialogData ()
|
MacroEditorSetupDialogData (QObject *parent)
|
||||||
: basic_attributes (0), tab_width (8), indent (2), save_all_on_run (true), stop_on_exception (true), file_watcher_enabled (true), font_size (0)
|
: QObject(parent),
|
||||||
|
basic_attributes (0), tab_width (8), indent (2), save_all_on_run (true), stop_on_exception (true), file_watcher_enabled (true), font_size (0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,7 +58,7 @@ struct MacroEditorSetupDialogData
|
||||||
|
|
||||||
void setup (lay::PluginRoot *root)
|
void setup (lay::PluginRoot *root)
|
||||||
{
|
{
|
||||||
lay::MacroEditorHighlighters highlighters (lay::MacroEditorDialog::instance ());
|
lay::MacroEditorHighlighters highlighters (this);
|
||||||
std::string styles;
|
std::string styles;
|
||||||
root->config_get (cfg_macro_editor_styles, styles);
|
root->config_get (cfg_macro_editor_styles, styles);
|
||||||
highlighters.load (styles);
|
highlighters.load (styles);
|
||||||
|
|
@ -91,7 +93,7 @@ struct MacroEditorSetupDialogData
|
||||||
|
|
||||||
void commit (lay::PluginRoot *root)
|
void commit (lay::PluginRoot *root)
|
||||||
{
|
{
|
||||||
lay::MacroEditorHighlighters highlighters (lay::MacroEditorDialog::instance ());
|
lay::MacroEditorHighlighters highlighters (this);
|
||||||
|
|
||||||
if (highlighters.basic_attributes ()) {
|
if (highlighters.basic_attributes ()) {
|
||||||
highlighters.basic_attributes ()->assign (basic_attributes);
|
highlighters.basic_attributes ()->assign (basic_attributes);
|
||||||
|
|
@ -138,7 +140,8 @@ update_item (QListWidgetItem *item, QTextCharFormat format)
|
||||||
}
|
}
|
||||||
|
|
||||||
MacroEditorSetupPage::MacroEditorSetupPage (QWidget *parent)
|
MacroEditorSetupPage::MacroEditorSetupPage (QWidget *parent)
|
||||||
: lay::ConfigPage (parent), mp_data (0)
|
: lay::ConfigPage (parent),
|
||||||
|
mp_data (new MacroEditorSetupDialogData (this))
|
||||||
{
|
{
|
||||||
setupUi (this);
|
setupUi (this);
|
||||||
|
|
||||||
|
|
@ -156,8 +159,7 @@ MacroEditorSetupPage::MacroEditorSetupPage (QWidget *parent)
|
||||||
|
|
||||||
MacroEditorSetupPage::~MacroEditorSetupPage ()
|
MacroEditorSetupPage::~MacroEditorSetupPage ()
|
||||||
{
|
{
|
||||||
delete mp_data;
|
// .. nothing yet ..
|
||||||
mp_data = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -175,20 +177,16 @@ MacroEditorSetupPage::cb_changed (int)
|
||||||
void
|
void
|
||||||
MacroEditorSetupPage::clear_exception_list ()
|
MacroEditorSetupPage::clear_exception_list ()
|
||||||
{
|
{
|
||||||
if (mp_data) {
|
mp_data->ignore_exceptions_list.clear ();
|
||||||
mp_data->ignore_exceptions_list.clear ();
|
update_ignore_exception_list ();
|
||||||
update_ignore_exception_list ();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MacroEditorSetupPage::update_ignore_exception_list ()
|
MacroEditorSetupPage::update_ignore_exception_list ()
|
||||||
{
|
{
|
||||||
if (mp_data) {
|
exception_list->clear ();
|
||||||
exception_list->clear ();
|
for (std::set<std::string>::const_iterator i = mp_data->ignore_exceptions_list.begin (); i != mp_data->ignore_exceptions_list.end (); ++i) {
|
||||||
for (std::set<std::string>::const_iterator i = mp_data->ignore_exceptions_list.begin (); i != mp_data->ignore_exceptions_list.end (); ++i) {
|
exception_list->addItem (tl::to_qstring (*i));
|
||||||
exception_list->addItem (tl::to_qstring (*i));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -206,7 +204,7 @@ void
|
||||||
MacroEditorSetupPage::setup (PluginRoot *root)
|
MacroEditorSetupPage::setup (PluginRoot *root)
|
||||||
{
|
{
|
||||||
delete mp_data;
|
delete mp_data;
|
||||||
mp_data = new MacroEditorSetupDialogData ();
|
mp_data = new MacroEditorSetupDialogData (this);
|
||||||
mp_data->setup (root);
|
mp_data->setup (root);
|
||||||
|
|
||||||
update_ignore_exception_list ();
|
update_ignore_exception_list ();
|
||||||
|
|
@ -276,19 +274,16 @@ MacroEditorSetupPage::commit (PluginRoot *root)
|
||||||
commit_attributes (styles_list->currentItem ());
|
commit_attributes (styles_list->currentItem ());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mp_data) {
|
mp_data->tab_width = tab_width->value ();
|
||||||
|
mp_data->indent = indent->value ();
|
||||||
|
mp_data->save_all_on_run = save_all_cb->isChecked ();
|
||||||
|
mp_data->stop_on_exception = stop_on_exception->isChecked ();
|
||||||
|
mp_data->file_watcher_enabled = watch_files->isChecked ();
|
||||||
|
|
||||||
mp_data->tab_width = tab_width->value ();
|
mp_data->font_family = tl::to_string (font_sel->currentFont ().family ());
|
||||||
mp_data->indent = indent->value ();
|
mp_data->font_size = font_size->value ();
|
||||||
mp_data->save_all_on_run = save_all_cb->isChecked ();
|
|
||||||
mp_data->stop_on_exception = stop_on_exception->isChecked ();
|
|
||||||
mp_data->file_watcher_enabled = watch_files->isChecked ();
|
|
||||||
|
|
||||||
mp_data->font_family = tl::to_string (font_sel->currentFont ().family ());
|
mp_data->commit (root);
|
||||||
mp_data->font_size = font_size->value ();
|
|
||||||
|
|
||||||
mp_data->commit (root);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue