#include <QCoreApplication>
#include <QDir>
+#include <QFont>
#include <QProcessEnvironment>
#include <QSslSocket>
#include <QString>
extern QString vymBuildDate;
extern Settings settings;
+extern QFont fixedFont;
+extern QFont varFont;
extern QString localeName;
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";
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."));
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() {}
class HeadingEditor : public TextEditor {
Q_OBJECT
public:
- HeadingEditor(QString scope);
+ HeadingEditor(const QString &eName = "undefined");
~HeadingEditor();
};
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
void JiraAgent::unknownStepWarning()
{
- qWarning() << "JA::contJob unknow step in jobType = "
+ qWarning() << "JA::contJob unknown step in jobType = "
<< jobTypeInt
<< "jobStep = " << jobStep;
}
#include <iostream>
#include <QApplication>
+#include <QFontDatabase>
#include <QJSEngine>
#include <QMessageBox>
#include <QStyleFactory>
Switchboard switchboard;
Settings settings("InSilmaril", QString(__VYM_NAME).toLower()); // Organization, Application name
+QFont fixedFont;
+QFont varFont;
bool zipToolAvailable = false;
bool unzipToolAvailable = false;
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);
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
// 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"));
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() {}
class NoteEditor : public TextEditor {
Q_OBJECT
public:
- NoteEditor(QString scope);
+ NoteEditor(const QString &eName = "undefined");
~NoteEditor();
VymNote getNote();
extern Main *mainWindow;
extern Options options;
extern Settings settings;
+extern QFont fixedFont;
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);
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";
}
#include <QString>
extern Settings settings;
+extern QFont fixedFont;
ShowTextDialog::ShowTextDialog(QWidget *parent) : QDialog(parent)
{
{
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);
}
extern Main *mainWindow;
extern Settings settings;
+extern QFont fixedFont;
+extern QFont varFont;
extern QString iconTheme;
extern QAction *actionViewToggleNoteEditor;
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
-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
// 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;
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());
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
format.setFont(font);
tc.setCharFormat(format);
tc.clearSelection();
- fontChanged(fixedFont);
+ fontChanged(fixedFontInt);
blockChangedSignal = false;
}
{
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);
}
}
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"));
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<int> sizes = fontDB.standardSizes();
+ QList<int> sizes = QFontDatabase::standardSizes();
QList<int>::iterator it = sizes.begin();
int i = 0;
while (it != sizes.end()) {
// 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
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());
}
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()
#define TEXTEDITOR_H
#include <QMainWindow>
+#include <QString>
#include <QtGui>
-
+#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);
QColor colorMapBackground;
bool useColorMapBackground;
- QFont varFont;
- QFont fixedFont;
+ QFont varFontInt;
+ QFont fixedFontInt;
QComboBox *comboFont, *comboSize;
QToolBar *editToolBar;
#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
// 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
<file alias="document-close-classic.svg">icons/classic/document-close.png</file>
<file alias="document-close-dark.svg">icons/dark/document-close.svg</file>
<file alias="document-export-bright.svg">icons/bright/document-export.svg</file>
- <file alias="document-export-classic.svg">icons/classic/document-export.svg</file>
+ <file alias="document-export-classic.svg">icons/classic/document-export.png</file>
<file alias="document-export-dark.svg">icons/dark/document-export.svg</file>
<file alias="document-new-bright.svg">icons/bright/document-new.svg</file>
<file alias="document-new-classic.svg">icons/classic/document-new.svg</file>