Merge dev into multi-external-editor

This commit is contained in:
Lawrence Lee
2021-06-28 22:03:14 -07:00
144 changed files with 8191 additions and 2187 deletions

View File

@@ -1253,11 +1253,57 @@ Gtk::Widget* Preferences::getGeneralPanel()
externalEditors->set_size_request(-1, 200);
#ifdef EXT_EDITORS_RADIOS
externaleditorGrid->attach_next_to(*externalEditors, *edOther, Gtk::POS_BOTTOM, 2, 1);
fdg->add(*externaleditorGrid);
#else
fdg->add(*externalEditors);
#endif
// fdg->add(*externaleditorGrid);
editor_dir_temp = Gtk::manage(new Gtk::RadioButton(M("PREFERENCES_EXTEDITOR_DIR_TEMP")));
editor_dir_current = Gtk::manage(new Gtk::RadioButton(M("PREFERENCES_EXTEDITOR_DIR_CURRENT")));
editor_dir_custom = Gtk::manage(new Gtk::RadioButton(M("PREFERENCES_EXTEDITOR_DIR_CUSTOM") + ": "));
editor_dir_custom_path = Gtk::manage(new MyFileChooserButton("", Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER));
#ifndef EXT_EDITORS_RADIOS
Gtk::RadioButton::Group ge;
#endif
ge = editor_dir_temp->get_group();
editor_dir_current->set_group(ge);
editor_dir_custom->set_group(ge);
editor_float32 = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_EXTEDITOR_FLOAT32")));
editor_bypass_output_profile = Gtk::manage(new Gtk::CheckButton(M("PREFERENCES_EXTEDITOR_BYPASS_OUTPUT_PROFILE")));
{
Gtk::Frame *f = Gtk::manage(new Gtk::Frame(M("PREFERENCES_EXTEDITOR_DIR")));
setExpandAlignProperties(f, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
Gtk::Box *vb = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
vb->pack_start(*editor_dir_temp);
vb->pack_start(*editor_dir_current);
Gtk::Box *hb = Gtk::manage(new Gtk::Box());
hb->pack_start(*editor_dir_custom, Gtk::PACK_SHRINK);
hb->pack_start(*editor_dir_custom_path, Gtk::PACK_EXPAND_WIDGET, 2);
vb->pack_start(*hb);
f->add(*vb);
hb = Gtk::manage(new Gtk::Box());
#ifdef EXT_EDITORS_RADIOS
externaleditorGrid->attach_next_to(*externalEditors, *edOther, Gtk::POS_BOTTOM, 2, 1);
hb->pack_start(*externaleditorGrid);
#else
hb->pack_start(*externalEditors);
#endif
hb->pack_start(*f, Gtk::PACK_EXPAND_WIDGET, 4);
vb = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
vb->pack_start(*hb);
hb = Gtk::manage(new Gtk::Box());
//I disabled these 2 functionnalities...easy to enable
// hb->pack_start(*editor_float32, Gtk::PACK_SHRINK);
// hb->pack_start(*editor_bypass_output_profile, Gtk::PACK_SHRINK, 4);
vb->pack_start(*hb, Gtk::PACK_SHRINK, 4);
vb->show_all_children();
vb->show();
fdg->add(*vb);
}
vbGeneral->attach_next_to (*fdg, *fclip, Gtk::POS_BOTTOM, 2, 1);
langAutoDetectConn = ckbLangAutoDetect->signal_toggled().connect(sigc::mem_fun(*this, &Preferences::langAutoDetectToggled));
tconn = themeCBT->signal_changed().connect ( sigc::mem_fun (*this, &Preferences::themeChanged) );
@@ -1755,6 +1801,17 @@ void Preferences::storePreferences()
}
}
if (editor_dir_temp->get_active()) {
moptions.editor_out_dir = Options::EDITOR_OUT_DIR_TEMP;
} else if (editor_dir_current->get_active()) {
moptions.editor_out_dir = Options::EDITOR_OUT_DIR_CURRENT;
} else {
moptions.editor_out_dir = Options::EDITOR_OUT_DIR_CUSTOM;
}
moptions.editor_custom_out_dir = editor_dir_custom_path->get_filename();
moptions.editor_float32 = editor_float32->get_active();
moptions.editor_bypass_output_profile = editor_bypass_output_profile->get_active();
moptions.CPBPath = txtCustProfBuilderPath->get_text();
moptions.CPBKeys = CPBKeyType(custProfBuilderLabelType->get_active_row_number());
@@ -2051,6 +2108,17 @@ void Preferences::fillPreferences()
}
externalEditors->setEditors(editorInfos);
editor_dir_temp->set_active(moptions.editor_out_dir == Options::EDITOR_OUT_DIR_TEMP);
editor_dir_current->set_active(moptions.editor_out_dir == Options::EDITOR_OUT_DIR_CURRENT);
editor_dir_custom->set_active(moptions.editor_out_dir == Options::EDITOR_OUT_DIR_CUSTOM);
if (Glib::file_test(moptions.editor_custom_out_dir, Glib::FILE_TEST_IS_DIR)) {
editor_dir_custom_path->set_current_folder(moptions.editor_custom_out_dir);
} else {
editor_dir_custom_path->set_current_folder(Glib::get_tmp_dir());
}
editor_float32->set_active(moptions.editor_float32);
editor_bypass_output_profile->set_active(moptions.editor_bypass_output_profile);
txtCustProfBuilderPath->set_text(moptions.CPBPath);
custProfBuilderLabelType->set_active(moptions.CPBKeys);