mirror of
https://github.com/leozide/leocad.git
synced 2026-10-27 06:20:55 +00:00
Provide contextual Help/F1 descriptions and label buddies in Model Properties, Category, Edge Colors, About, and Check for Updates. Explain category expression operators, prefixes, and grouping with examples available from both Help and the Keywords field. Retain Help when update results rebuild the dialog buttons. Document both edge-color modes and the parent Preferences workflow, and make About system information keyboard-selectable. Refresh catalogs without changing existing translations or reviewing new strings. Validation: debug build; five-dialog Help/F1, Escape, layouts and buddy checks; both edge-color modes; update response states; category syntax examples; and translation preservation checks passed.
56 lines
2.6 KiB
C++
56 lines
2.6 KiB
C++
#include "lc_global.h"
|
|
#include "lc_qutils.h"
|
|
#include "lc_aboutdialog.h"
|
|
#include "ui_lc_aboutdialog.h"
|
|
#include "lc_mainwindow.h"
|
|
#include "lc_view.h"
|
|
#include "lc_glextensions.h"
|
|
#include "lc_viewwidget.h"
|
|
|
|
lcAboutDialog::lcAboutDialog(QWidget* Parent)
|
|
: QDialog(Parent), ui(new Ui::lcAboutDialog)
|
|
{
|
|
ui->setupUi(this);
|
|
lcSetupDialogHelp(this, ui->buttonBox);
|
|
|
|
#ifdef LC_CONTINUOUS_BUILD
|
|
ui->version->setText(tr("LeoCAD Continuous Build %1").arg(QString::fromLatin1(QT_STRINGIFY(LC_CONTINUOUS_BUILD))));
|
|
#else
|
|
ui->version->setText(tr("LeoCAD Version %1").arg(QString::fromLatin1(LC_VERSION_TEXT)));
|
|
#endif
|
|
|
|
lcViewWidget* Widget = gMainWindow->GetActiveView()->GetWidget();
|
|
QOpenGLContext* Context = Widget->context();
|
|
QOpenGLFunctions* Functions = Context->functions();
|
|
QSurfaceFormat Format = Context->format();
|
|
|
|
int ColorDepth = Format.redBufferSize() + Format.greenBufferSize() + Format.blueBufferSize() + Format.alphaBufferSize();
|
|
|
|
const QString QtVersionFormat = tr("Qt Version %1 (compiled with %2)\n\n");
|
|
const QString QtVersion = QtVersionFormat.arg(qVersion(), QT_VERSION_STR);
|
|
|
|
const QString VersionFormat = tr("OpenGL Version %1 (GLSL %2)\n%3 - %4\n\n");
|
|
const QString GLVersion(reinterpret_cast<const char*>(Functions->glGetString(GL_VERSION)));
|
|
const QString ShaderVersion(reinterpret_cast<const char*>(Functions->glGetString(GL_SHADING_LANGUAGE_VERSION)));
|
|
const QString Renderer(reinterpret_cast<const char*>(Functions->glGetString(GL_RENDERER)));
|
|
const QString Vendor(reinterpret_cast<const char*>(Functions->glGetString(GL_VENDOR)));
|
|
const QString Version = VersionFormat.arg(GLVersion, ShaderVersion, Renderer, Vendor);
|
|
const QString BuffersFormat = tr("Color Buffer: %1 bits\nDepth Buffer: %2 bits\nStencil Buffer: %3 bits\n\n");
|
|
const QString Buffers = BuffersFormat.arg(QString::number(ColorDepth), QString::number(Format.depthBufferSize()), QString::number(Format.stencilBufferSize()));
|
|
|
|
const QString ExtensionsFormat = tr("Buffers: %1\nFramebuffers: %2\nBlendFuncSeparate: %3\nAnisotropic: %4\n");
|
|
const QString VertexBuffers = gSupportsVertexBufferObject ? tr("Supported") : tr("Not supported");
|
|
const QString Framebuffers = gSupportsFramebufferObject ? tr("Supported") : tr("Not supported");
|
|
const QString BlendFuncSeparate = gSupportsBlendFuncSeparate ? tr("Supported") : tr("Not supported");
|
|
const QString Anisotropic = gSupportsAnisotropic ? tr("Supported (max %1)").arg(gMaxAnisotropy) : tr("Not supported");
|
|
|
|
const QString Extensions = ExtensionsFormat.arg(VertexBuffers, Framebuffers, BlendFuncSeparate, Anisotropic);
|
|
|
|
ui->info->setText(QtVersion + Version + Buffers + Extensions);
|
|
}
|
|
|
|
lcAboutDialog::~lcAboutDialog()
|
|
{
|
|
delete ui;
|
|
}
|