From: Sven Hoexter Date: Wed, 25 Jun 2025 17:58:35 +0000 (+0200) Subject: New upstream version 2.9.577 X-Git-Tag: upstream/2.9.577^0 X-Git-Url: https://git.sven.stormbind.net/?a=commitdiff_plain;h=3563b50e5fc659349a93da3af2e00979f0ec2ea8;p=sven%2Fvym.git New upstream version 2.9.577 --- diff --git a/icons/classic/document-export.png b/icons/classic/document-export.png new file mode 100644 index 0000000..ffb81f8 Binary files /dev/null and b/icons/classic/document-export.png differ diff --git a/icons/classic/document-export.svg b/icons/classic/document-export.svg deleted file mode 100644 index ffb81f8..0000000 Binary files a/icons/classic/document-export.svg and /dev/null differ diff --git a/src/debuginfo.cpp b/src/debuginfo.cpp index 2e67523..59eb2d5 100644 --- a/src/debuginfo.cpp +++ b/src/debuginfo.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -21,6 +22,8 @@ extern QString vymCodeName; extern QString vymBuildDate; extern Settings settings; +extern QFont fixedFont; +extern QFont varFont; extern QString localeName; @@ -56,6 +59,8 @@ QString debugInfo() s += QString(" Settings: %1\n\n").arg(settings.fileName()); s += QString(" Dark theme: %1 System seems dark: %2\n").arg(usingDarkTheme).arg(systemSeemsDark); s += QString("Avail. styles: %1\n\n").arg(QStyleFactory::keys().join(",")); + s += QString(" Fixed font: %1\n").arg(fixedFont.toString()); + s += QString(" Var font: %1\n").arg(varFont.toString()); s += " SSL status: "; QSslSocket::supportsSsl() ? s += "supported\n" : s += "not supported\n"; s += " SSL Qt: " + QSslSocket::sslLibraryBuildVersionString() + "\n"; @@ -71,7 +76,7 @@ QString debugInfo() s += QString(" localeName: %1\n").arg(localeName); s += QString(" system: %1\n").arg(QLocale::system().name()); s += QString(" language: %1\n").arg(QLocale::languageToString(QLocale::system().language())); - s += QString(" country: %1\n").arg(QLocale::countryToString(QLocale::system().country())); + s += QString(" country: %1\n").arg(QLocale::territoryToString(QLocale::system().territory())); s += QString(" uiLanguages: %1\n").arg(QLocale::system().uiLanguages().join(",")); s += QString(" LANG: %1\n") .arg(QProcessEnvironment::systemEnvironment().value("LANG", "not set.")); diff --git a/src/headingeditor.cpp b/src/headingeditor.cpp index 2e093a7..1455a5f 100644 --- a/src/headingeditor.cpp +++ b/src/headingeditor.cpp @@ -4,15 +4,12 @@ extern Settings settings; extern QString vymName; -HeadingEditor::HeadingEditor(QString scope) : TextEditor() +HeadingEditor::HeadingEditor(const QString &eName) : TextEditor(eName) { - editorName = tr("Heading Editor", "Name of editor shown as window title"); + editorName = eName; setWindowTitle(""); setUseMapBackgroundColor(true); - - // Load Settings - init(scope); } HeadingEditor::~HeadingEditor() {} diff --git a/src/headingeditor.h b/src/headingeditor.h index bd6dfd2..af2670b 100644 --- a/src/headingeditor.h +++ b/src/headingeditor.h @@ -6,7 +6,7 @@ class HeadingEditor : public TextEditor { Q_OBJECT public: - HeadingEditor(QString scope); + HeadingEditor(const QString &eName = "undefined"); ~HeadingEditor(); }; diff --git a/src/image-container.cpp b/src/image-container.cpp index bdb5ba6..f8fad77 100644 --- a/src/image-container.cpp +++ b/src/image-container.cpp @@ -118,6 +118,7 @@ void ImageContainer::select() bool ImageContainer::load(const QString &fn, bool createClone) { + // qDebug() << "IC::load " << fn; // createClone == true, if called via copy() if (imageType != ImageContainer::Undefined) { qWarning() << "ImageContainer::load (" << fn diff --git a/src/jira-agent.cpp b/src/jira-agent.cpp index a7e5414..97ceb1e 100644 --- a/src/jira-agent.cpp +++ b/src/jira-agent.cpp @@ -321,7 +321,7 @@ void JiraAgent::finishJob() void JiraAgent::unknownStepWarning() { - qWarning() << "JA::contJob unknow step in jobType = " + qWarning() << "JA::contJob unknown step in jobType = " << jobTypeInt << "jobStep = " << jobStep; } diff --git a/src/main.cpp b/src/main.cpp index 87e5ebd..25139d8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -105,6 +106,8 @@ QStringList lastSessionFiles; //! Will be overwritten in setting after load, s Switchboard switchboard; Settings settings("InSilmaril", QString(__VYM_NAME).toLower()); // Organization, Application name +QFont fixedFont; +QFont varFont; bool zipToolAvailable = false; bool unzipToolAvailable = false; @@ -181,6 +184,13 @@ int main(int argc, char *argv[]) vymCodeQuality = __VYM_CODE_QUALITY; vymHome = __VYM_HOME; + // Fonts + fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont); + // Linux: "Courier,12,-1,5,48,0,0,0,1,0" + // Mac : "Menlo" + varFont = QFontDatabase::systemFont(QFontDatabase::GeneralFont); + // Linux: "DejaVu Sans Mono,12,-1,0,50,0,0,0,0,0" + // // Install our own handler for messages qInstallMessageHandler(msgHandler); @@ -454,9 +464,8 @@ int main(int argc, char *argv[]) userFlagsMaster->setPrefix("user/"); // Initialize editors - noteEditor = new NoteEditor("noteeditor"); - noteEditor->setWindowIcon(QPixmap(":/vym-editor.png")); - headingEditor = new HeadingEditor("headingeditor"); + noteEditor = new NoteEditor(QObject::tr("Note Editor", "Name of editor shown as window title")); + headingEditor = new HeadingEditor(QObject::tr("Heading Editor", "Name of editor shown as window title")); branchPropertyEditor = new BranchPropertyEditor(); // Initially read filenames of last session, before settings are diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 56ac3c2..9c6fc30 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3366,7 +3366,7 @@ void Main::setupFlagActions() // Original khelpcenter.png setupFlag(":/flag-lifebelt.svg", Flag::StandardFlag, "lifebelt", tr("This will help", "Standardflag")); - + // FIXME-2 lifebelt.svg seems to cause warnings about buffer size setupFlag(":/flag-phone.svg", Flag::StandardFlag, "phone", tr("Call...", "Standardflag")); diff --git a/src/noteeditor.cpp b/src/noteeditor.cpp index b830571..b4f070f 100644 --- a/src/noteeditor.cpp +++ b/src/noteeditor.cpp @@ -8,17 +8,13 @@ extern Settings settings; extern QString vymName; -NoteEditor::NoteEditor(QString scope) : TextEditor() +NoteEditor::NoteEditor(const QString &eName) : TextEditor(eName) { - editorName = tr("Note Editor", "Name of editor shown as window title"); setWindowTitle(""); menuBar()->show(); setUseMapBackgroundColor(false); - - // Load Settings - init(scope); } NoteEditor::~NoteEditor() {} diff --git a/src/noteeditor.h b/src/noteeditor.h index 6316674..df4cd9b 100644 --- a/src/noteeditor.h +++ b/src/noteeditor.h @@ -8,7 +8,7 @@ class VymNote; class NoteEditor : public TextEditor { Q_OBJECT public: - NoteEditor(QString scope); + NoteEditor(const QString &eName = "undefined"); ~NoteEditor(); VymNote getNote(); diff --git a/src/scripteditor.cpp b/src/scripteditor.cpp index d1322fb..bebe735 100644 --- a/src/scripteditor.cpp +++ b/src/scripteditor.cpp @@ -25,6 +25,7 @@ extern Macros macros; extern Main *mainWindow; extern Options options; extern Settings settings; +extern QFont fixedFont; ScriptEditor::ScriptEditor(QWidget *parent) : QWidget(parent) { @@ -53,17 +54,12 @@ ScriptEditor::ScriptEditor(QWidget *parent) : QWidget(parent) vymModelID = -1; // Initialize Editor - QFont font; - font.setFamily("Courier"); - font.setFixedPitch(true); - font.setPointSize(12); - slideEditor->setFont(font); - macroEditor->setFont(font); - codeEditor->setFont(font); + slideEditor->setFont(fixedFont); + macroEditor->setFont(fixedFont); + codeEditor->setFont(fixedFont); // Define tab width const qreal d = 20; // unit is pixels - QFontMetrics metrics(font); codeEditor->setTabStopDistance(d); slideEditor->setTabStopDistance(d); macroEditor->setTabStopDistance(d); diff --git a/src/shortcuts.cpp b/src/shortcuts.cpp index 2e0a131..63f5d94 100644 --- a/src/shortcuts.cpp +++ b/src/shortcuts.cpp @@ -58,9 +58,11 @@ QString Switchboard::getASCII() for (int i = 0; i < values.size(); ++i) { QString desc = values.at(i).name; QString sc = values.at(i).keySequence.toString(); - desc = desc.remove('&'); - desc = desc.remove("..."); - s += QString(" %1: %2\n").arg(sc, 12).arg(desc); + if (!sc.isEmpty()) { + desc = desc.remove('&'); + desc = desc.remove("..."); + s += QString(" %1: %2\n").arg(sc, 12).arg(desc); + } } s += "\n"; } diff --git a/src/showtextdialog.cpp b/src/showtextdialog.cpp index 9051241..e18dfe5 100644 --- a/src/showtextdialog.cpp +++ b/src/showtextdialog.cpp @@ -5,6 +5,7 @@ #include extern Settings settings; +extern QFont fixedFont; ShowTextDialog::ShowTextDialog(QWidget *parent) : QDialog(parent) { @@ -23,14 +24,5 @@ void ShowTextDialog::useFixedFont(bool useFixedFont) { QFont font; if (useFixedFont) - font.fromString(settings - .value("/satellite/noteeditor/fonts/fixedFont", - "Courier,10,-1,5,48,0,0,0,1,0") - .toString()); - else - font.fromString(settings - .value("/satellite/noteeditor/fonts/varFont", - "DejaVu Sans Mono,12,-1,0,50,0,0,0,0,0") - .toString()); - ui.textBrowser->setFont(font); + ui.textBrowser->setFont(fixedFont); } diff --git a/src/texteditor.cpp b/src/texteditor.cpp index 38978f2..b3b838f 100644 --- a/src/texteditor.cpp +++ b/src/texteditor.cpp @@ -23,6 +23,8 @@ extern Main *mainWindow; extern Settings settings; +extern QFont fixedFont; +extern QFont varFont; extern QString iconTheme; extern QAction *actionViewToggleNoteEditor; @@ -37,8 +39,8 @@ extern bool debug; /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// -TextEditor::TextEditor() // FEATURE #137 insert images with drag & drop - // https://stackoverflow.com/questions/3254652/several-ways-of-placing-an-image-in-a-qtextedit +TextEditor::TextEditor(const QString eName) // FEATURE #137 insert images with drag & drop + // https://stackoverflow.com/questions/3254652/several-ways-of-placing-an-image-in-a-qtextedit { statusBar()->hide(); // Hide sizeGrip on default, which comes with statusBar @@ -56,11 +58,9 @@ TextEditor::TextEditor() // FEATURE #137 insert images with drag & drop // Don't show menubar per default menuBar()->hide(); - // Toolbars - setupFileActions(); - setupEditActions(); - setupFormatActions(); - setupSettingsActions(); + // Load settings + init (eName); + setWindowIcon(QPixmap(":/vym-editor.png")); // Various states blockChangedSignal = false; @@ -85,8 +85,8 @@ TextEditor::~TextEditor() else s = "variable"; settings.setValue(n + "fonts/fonthintDefault", s); - settings.setValue(n + "fonts/varFont", varFont.toString()); - settings.setValue(n + "fonts/fixedFont", fixedFont.toString()); + settings.setValue(n + "fonts/varFont", varFontInt.toString()); + settings.setValue(n + "fonts/fixedFont", fixedFontInt.toString()); settings.setValue(n + "colors/richTextEditorBackground", colorRichTextEditorBackground.name()); settings.setValue(n + "colors/richTextBackground", colorRichTextBackground.name()); @@ -96,25 +96,27 @@ TextEditor::~TextEditor() void TextEditor::init(const QString &scope) { shortcutScope = scope; + + // Toolbars + setupFileActions(); + setupEditActions(); + setupFormatActions(); + setupSettingsActions(); + QString n = QString("/satellite/%1/").arg(shortcutScope); restoreState(settings.value(n + "state", 0).toByteArray()); filenameHint = ""; - fixedFont.fromString( - settings.value(n + "fonts/fixedFont", "Courier,12,-1,5,48,0,0,0,1,0")// FIXME-2 Replace all occurences of Courier on Mac - .toString()); - varFont.fromString( - settings - .value(n + "fonts/varFont", "DejaVu Sans Mono,12,-1,0,50,0,0,0,0,0") - .toString()); + fixedFontInt = fixedFont; + varFontInt = varFont; QString s = settings.value(n + "fonts/fonthintDefault", "variable").toString(); if (s == "fixed") { actionSettingsFonthintDefault->setChecked(true); - editor->setCurrentFont(fixedFont); + editor->setCurrentFont(fixedFontInt); } else { actionSettingsFonthintDefault->setChecked(false); - editor->setCurrentFont(varFont); + editor->setCurrentFont(varFontInt); } // Default colors for RichText @@ -174,7 +176,7 @@ void TextEditor::setFont(const QFont &font) format.setFont(font); tc.setCharFormat(format); tc.clearSelection(); - fontChanged(fixedFont); + fontChanged(fixedFontInt); blockChangedSignal = false; } @@ -183,13 +185,13 @@ void TextEditor::setFontHint(const QString &fh) { if (fh == "fixed") { actionFormatUseFixedFont->setChecked(true); - editor->setCurrentFont(fixedFont); - setFont(fixedFont); + editor->setCurrentFont(fixedFontInt); + setFont(fixedFontInt); } else { actionFormatUseFixedFont->setChecked(false); - editor->setCurrentFont(varFont); - setFont(varFont); + editor->setCurrentFont(varFontInt); + setFont(varFontInt); } } @@ -363,7 +365,7 @@ void TextEditor::setupFileActions() actionFileDeleteAll = a; } -void TextEditor::setupEditActions() +void TextEditor::setupEditActions() // FIXME-2 Rework (default) toolbars and RT colors { QString tag = tr("Texteditor", "Shortcuts"); QToolBar *editToolBar = addToolBar(tr("Edit Actions")); @@ -481,14 +483,13 @@ void TextEditor::setupFormatActions() comboFont = new QComboBox; fontToolBar->addWidget(comboFont); - QFontDatabase fontDB; - comboFont->insertItems(0, fontDB.families()); - connect(comboFont, SIGNAL(currentTextChanged(const QString &)), this, + comboFont->insertItems(0, QFontDatabase::families()); connect(comboFont, + SIGNAL(currentTextChanged(const QString &)), this, SLOT(textFamily(const QString &))); comboSize = new QComboBox; fontToolBar->addWidget(comboSize); - QList sizes = fontDB.standardSizes(); + QList sizes = QFontDatabase::standardSizes(); QList::iterator it = sizes.begin(); int i = 0; while (it != sizes.end()) { @@ -769,7 +770,7 @@ void TextEditor::setPlainText(const QString &t) // Reset also text format QTextCharFormat textformat; textformat.setForeground(qApp->palette().color(QPalette::WindowText)); - textformat.setFont(varFont); + textformat.setFont(varFontInt); editor->setCurrentCharFormat(textformat); // Update state including colors @@ -948,12 +949,12 @@ void TextEditor::textEditUndo() {} void TextEditor::toggleFonthint() { if (!actionFormatUseFixedFont->isChecked()) { - editor->setCurrentFont(varFont); - setFont(varFont); + editor->setCurrentFont(varFontInt); + setFont(varFontInt); } else { - editor->setCurrentFont(fixedFont); - setFont(fixedFont); + editor->setCurrentFont(fixedFontInt); + setFont(fixedFontInt); } emit textHasChanged(getVymText()); } @@ -989,17 +990,17 @@ void TextEditor::toggleRichText() void TextEditor::setFixedFont() { bool ok; - QFont font = QFontDialog::getFont(&ok, fixedFont, this); + QFont font = QFontDialog::getFont(&ok, fixedFontInt, this); if (ok) - fixedFont = font; + fixedFontInt = font; } void TextEditor::setVarFont() { bool ok; - QFont font = QFontDialog::getFont(&ok, varFont, this); + QFont font = QFontDialog::getFont(&ok, varFontInt, this); if (ok) - varFont = font; + varFontInt = font; } void TextEditor::textBold() diff --git a/src/texteditor.h b/src/texteditor.h index 00a4664..fb29cd2 100644 --- a/src/texteditor.h +++ b/src/texteditor.h @@ -2,19 +2,18 @@ #define TEXTEDITOR_H #include +#include #include - +#include "vymtext.h" class QTextEdit; class QComboBox; -#include "vymtext.h" - enum EditorState { inactiveEditor, emptyEditor, filledEditor }; class TextEditor : public QMainWindow { Q_OBJECT public: - TextEditor(); + TextEditor(const QString eName = "undefinedEditorName"); ~TextEditor(); void init(const QString &ename); @@ -127,8 +126,8 @@ class TextEditor : public QMainWindow { QColor colorMapBackground; bool useColorMapBackground; - QFont varFont; - QFont fixedFont; + QFont varFontInt; + QFont fixedFontInt; QComboBox *comboFont, *comboSize; QToolBar *editToolBar; diff --git a/src/version.h b/src/version.h index 0498601..09004fd 100644 --- a/src/version.h +++ b/src/version.h @@ -1,16 +1,15 @@ #ifndef VERSION_H #define VERSION_H -#define __VYM_VERSION "2.9.576" -#define __VYM_BUILD_DATE "2025-06-02" +#define __VYM_VERSION "2.9.577" +#define __VYM_BUILD_DATE "2025-06-24" #define __VYM_NAME "VYMng" // FIXME "next generation" in in window title #define __VYM_HOME "http://www.insilmaril.de/vym" // //#define __VYM_CODE_QUALITY "Production" -#define __VYM_CODE_QUALITY "*Experimental*" -//#define __VYM_CODE_QUALITY "*Beta*" -//#define __VYM_CODENAME "Alpha 1 of upcoming 3.0.0" -#define __VYM_CODENAME "2025 21 year anniversary edition" +//#define __VYM_CODE_QUALITY "*Experimental*" +#define __VYM_CODE_QUALITY "*Beta*" +#define __VYM_CODENAME "Beta release of upcoming 3.0.0" #endif diff --git a/src/vymmodel.cpp b/src/vymmodel.cpp index 1bf316b..9a4756e 100644 --- a/src/vymmodel.cpp +++ b/src/vymmodel.cpp @@ -570,7 +570,7 @@ bool VymModel::loadMap(QString fname, const File::LoadMode &lmode, // which prevented subsequent loading QString warning = QString("Found multiple .xml files in %1: %2").arg(fname, xmlFileList.join(", ")); logWarning(warning, __func__); - QMessageBox::warning (0, "Multiple xml files found", warning + "\n\nWilll try to keep only map.xml"); + QMessageBox::warning (0, "Multiple xml files found", warning + "\n\nWill try to keep only map.xml"); // mainWindow->fileLoadFromTmp (xmlFileList); // returnCode = 1; // Silently forget this attempt to load diff --git a/vym.qrc b/vym.qrc index 58c367b..593d4af 100644 --- a/vym.qrc +++ b/vym.qrc @@ -116,7 +116,7 @@ icons/classic/document-close.png icons/dark/document-close.svg icons/bright/document-export.svg - icons/classic/document-export.svg + icons/classic/document-export.png icons/dark/document-export.svg icons/bright/document-new.svg icons/classic/document-new.svg