Merge pull request #1811 from ramox81/codex/txt2mtxt

TXT2MTXT: combine text into MText with a settings dialog

# Conflicts:
#	locales/ar-SA/opencadstudio.ftl
#	locales/bg-BG/opencadstudio.ftl
#	locales/cs-CZ/opencadstudio.ftl
#	locales/de-DE/opencadstudio.ftl
#	locales/el-GR/opencadstudio.ftl
#	locales/en-US/opencadstudio.ftl
#	locales/es-ES/opencadstudio.ftl
#	locales/fi-FI/opencadstudio.ftl
#	locales/fr-FR/opencadstudio.ftl
#	locales/hi-IN/opencadstudio.ftl
#	locales/hu-HU/opencadstudio.ftl
#	locales/it-IT/opencadstudio.ftl
#	locales/ja-JP/opencadstudio.ftl
#	locales/ko-KR/opencadstudio.ftl
#	locales/lo-LA/opencadstudio.ftl
#	locales/nl-NL/opencadstudio.ftl
#	locales/pl-PL/opencadstudio.ftl
#	locales/pt-BR/opencadstudio.ftl
#	locales/ru-RU/opencadstudio.ftl
#	locales/tr-TR/opencadstudio.ftl
#	locales/zh-CN/opencadstudio.ftl
#	locales/zh-TW/opencadstudio.ftl
This commit is contained in:
Hakan Seven committed 2026-10-15 16:47:19 +03:00
commit aa618b8327
40 files changed
+1222 -4

No files matched your search

+22
View File
@@ -105,6 +105,7 @@ pub(super) const NAMES: &[&str] = &[
#[cfg(not(target_arch = "wasm32"))]
"external_change_cancel",
"pdf_dialog_ok",
"txt2mtxt_settings",
"view_background",
"image_adjust",
"refedit_dialog",
@@ -2202,6 +2203,27 @@ impl OpenCADStudio {
_ => return Err(bad()),
}
}
// Text to MText Settings (TXT2MTXT SEttings): "combine=0",
// "order=select" / "order=top", "wrap=0", "uniform=1", "ok",
// "cancel".
"txt2mtxt_settings" => {
use crate::ui::window::pdf_dialogs::PdfDialogMsg as M;
if self.active_modal != Some(crate::app::ModalKind::Txt2MtxtSettings) {
return Err(failure("no_dialog", "Text to MText Settings is not open"));
}
let value = string(req, "value")?;
let (key, arg) = value.split_once('=').unwrap_or((value, ""));
let on = arg != "0";
match key {
"combine" => Message::PdfDialog(M::T2mCombine(on)),
"order" => Message::PdfDialog(M::T2mSelectOrder(arg == "select")),
"wrap" => Message::PdfDialog(M::T2mWrap(on)),
"uniform" => Message::PdfDialog(M::T2mUniform(on)),
"ok" => Message::PdfDialog(M::T2mOk),
"cancel" => Message::CloseModal,
_ => return Err(failure("invalid_value", "Unknown setting")),
}
}
"pdf_dialog_ok" => {
use crate::ui::window::pdf_dialogs::PdfDialogMsg;
Message::PdfDialog(match self.active_modal {
+1
View File
@@ -381,6 +381,7 @@ fn command_selection_policy(name: &str) -> &'static str {
"ERASE",
"EXPLODE",
"TXTEXP",
"TXT2MTXT",
"GROUP",
"LAYFRZ",
"LAYLCK",