Skip to content

Commit

Permalink
App: fix code indentation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
HuguesDelorme committed Jun 13, 2024
1 parent dbd090b commit 4135cf4
Show file tree
Hide file tree
Showing 27 changed files with 220 additions and 208 deletions.
65 changes: 33 additions & 32 deletions src/app/app_module_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,76 +161,77 @@ void AppModuleProperties::retranslate()

// Application
this->language.setDescription(
textIdTr("Language used for the application. Change will take effect after application restart")
textIdTr("Language used for the application. Change will take effect after application restart")
);
this->reloadDocumentOnFileChange.setDescription(
textIdTr("Monitors the file system for changes to documents opened in the application\n\n"
"When such a file change is detected then the application proposes to reload(open again) the document")
);
this->linkWithDocumentSelector.setDescription(
textIdTr("In case where multiple documents are opened, make sure the document displayed in "
"the 3D view corresponds to what is selected in the model tree")
textIdTr("In case where multiple documents are opened, make sure the document displayed in "
"the 3D view corresponds to what is selected in the model tree")
);
this->forceOpenGlFallbackWidget.setDescription(
textIdTr("Force usage of the fallback Qt widget to display OpenGL graphics.\n\n"
"When `OFF` the application will try to use OpenGL framebuffer for rendering, "
"this allows to display overlay widgets(eg measure tools panel) with translucid "
"background. "
"However using OpenGL framebuffer might cause troubles for some users(eg empty "
"3D window) especially on macOS.\n\n"
"When `ON` the application will use a regular Qt widget for rendering which "
"proved to be more supported.\n\n"
"This option is applicable when OpenCascade ≥ 7.6 version. "
"Change will take effect after application restart")
textIdTr("Force usage of the fallback Qt widget to display OpenGL graphics.\n\n"
"When `OFF` the application will try to use OpenGL framebuffer for rendering, "
"this allows to display overlay widgets(eg measure tools panel) with translucid "
"background. "
"However using OpenGL framebuffer might cause troubles for some users(eg empty "
"3D window) especially on macOS.\n\n"
"When `ON` the application will use a regular Qt widget for rendering which "
"proved to be more supported.\n\n"
"This option is applicable when OpenCascade ≥ 7.6 version. "
"Change will take effect after application restart")
);

// Meshing
this->meshingQuality.setDescription(
textIdTr("Controls precision of the mesh to be computed from the BRep shape")
textIdTr("Controls precision of the mesh to be computed from the BRep shape")
);
this->meshingChordalDeflection.setDescription(
textIdTr("For the tessellation of faces the chordal deflection limits the distance between "
"a curve and its tessellation")
textIdTr("For the tessellation of faces the chordal deflection limits the distance between "
"a curve and its tessellation")
);
this->meshingAngularDeflection.setDescription(
textIdTr("For the tessellation of faces the angular deflection limits the angle between "
"subsequent segments in a polyline")
textIdTr("For the tessellation of faces the angular deflection limits the angle between "
"subsequent segments in a polyline")
);
this->meshingRelative.setDescription(
textIdTr("Relative computation of edge tolerance\n\n"
"If activated, deflection used for the polygonalisation of each edge will be "
"`ChordalDeflection` × `SizeOfEdge`. The deflection used for the faces will be "
"the maximum deflection of their edges.")
textIdTr("Relative computation of edge tolerance\n\n"
"If activated, deflection used for the polygonalisation of each edge will be "
"`ChordalDeflection` × `SizeOfEdge`. The deflection used for the faces will be "
"the maximum deflection of their edges.")
);

// Graphics
this->navigationStyle.setDescription(
textIdTr("3D view manipulation shortcuts configuration to mimic other common CAD applications")
textIdTr("3D view manipulation shortcuts configuration to mimic other common CAD applications")
);
this->turnViewAngleIncrement.setDescription(
textIdTr("Angle increment used to turn(rotate) the 3D view around the normal of the view plane(Z axis frame reference)")
textIdTr("Angle increment used to turn(rotate) the 3D view around the normal of the view plane(Z axis frame reference)")
);

// -- Graphics/ClipPlanes
this->defaultShowOriginTrihedron.setDescription(
textIdTr("Show or hide by default the trihedron centered at world origin. "
"This doesn't affect 3D view of currently opened documents")
textIdTr("Show or hide by default the trihedron centered at world origin. "
"This doesn't affect 3D view of currently opened documents")
);
this->clipPlanesCappingOn.setDescription(
textIdTr("Enable capping of currently clipped graphics")
textIdTr("Enable capping of currently clipped graphics")
);
this->clipPlanesCappingHatchOn.setDescription(
textIdTr("Enable capping hatch texture of currently clipped graphics")
textIdTr("Enable capping hatch texture of currently clipped graphics")
);
}

void AppModuleProperties::onPropertyChanged(Property* prop)
{
if (prop == &this->meshDefaultsColor
|| prop == &this->meshDefaultsEdgeColor
|| prop == &this->meshDefaultsMaterial
|| prop == &this->meshDefaultsShowEdges
|| prop == &this->meshDefaultsShowNodes)
|| prop == &this->meshDefaultsEdgeColor
|| prop == &this->meshDefaultsMaterial
|| prop == &this->meshDefaultsShowEdges
|| prop == &this->meshDefaultsShowNodes
)
{
auto values = GraphicsMeshObjectDriver::defaultValues();
values.color = this->meshDefaultsColor.value();
Expand Down
8 changes: 4 additions & 4 deletions src/app/button_flat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ void ButtonFlat::paintEvent(QPaintEvent*)
painter.fillRect(surface, this->backgroundBrush());

const QRect iconRect(
(surface.width() - m_iconSize.width()) / 2,
(surface.height() - m_iconSize.height()) / 2,
m_iconSize.width(),
m_iconSize.height()
(surface.width() - m_iconSize.width()) / 2,
(surface.height() - m_iconSize.height()) / 2,
m_iconSize.width(),
m_iconSize.height()
);
const QIcon::Mode iconMode = isEnabled ? QIcon::Normal : QIcon::Disabled;
m_icon.paint(&painter, iconRect, Qt::AlignCenter, iconMode);
Expand Down
33 changes: 20 additions & 13 deletions src/app/command_system_information.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,27 +188,28 @@ QString CommandSystemInformation::data()
<< " commit:" << strVersionCommitId
<< " revnum:" << versionRevisionNumber
<< " " << QT_POINTER_SIZE * 8 << "bit"
<< '\n';
<< '\n'
;

// OS version
ostr << '\n' << "OS: " << QSysInfo::prettyProductName()
<< " [" << QSysInfo::kernelType() << " version " << QSysInfo::kernelVersion() << "]" << '\n'
<< "Current CPU Architecture: " << QSysInfo::currentCpuArchitecture() << '\n';
<< "Current CPU Architecture: " << QSysInfo::currentCpuArchitecture() << '\n'
;

// Qt version
ostr << '\n' << QLibraryInfo::build() << " on \"" << QGuiApplication::platformName() << "\" " << '\n'
<< indent << "QStyle keys: " << QStyleFactory::keys().join("; ") << '\n'
<< indent << "Image formats(read): " << QImageReader::supportedImageFormats().join(' ') << '\n'
<< indent << "Image formats(write): " << QImageWriter::supportedImageFormats().join(' ') << '\n';
<< indent << "Image formats(write): " << QImageWriter::supportedImageFormats().join(' ') << '\n'
;

// OpenCascade version
ostr << '\n' << "OpenCascade: " << OCC_VERSION_STRING_EXT << " (build)" << '\n';

// Other registered libraries
for (const auto& libInfo : LibraryInfoArray::get()) {
ostr << '\n' << libInfo.name << ": " << libInfo.version
<< " " << libInfo.versionDetails
<< '\n';
ostr << '\n' << libInfo.name << ": " << libInfo.version << " " << libInfo.versionDetails << '\n';
}

// I/O supported formats
Expand Down Expand Up @@ -242,23 +243,26 @@ QString CommandSystemInformation::data()
<< indentx2 << "numpunct.thousands_sep: " << char1000Sep << " " << toUnicodeHexa(char1000Sep) << '\n'
<< indentx2 << "numpunct.grouping: " << to_QString(strGrouping) << '\n'
<< indentx2 << "numpunct.truename: " << to_QString(numFacet.truename()) << '\n'
<< indentx2 << "numpunct.falsename: " << to_QString(numFacet.falsename()) << '\n';
<< indentx2 << "numpunct.falsename: " << to_QString(numFacet.falsename()) << '\n'
;
const QLocale& qtLoc = AppModule::get()->qtLocale();
ostr << indent << "QLocale:" << '\n'
<< indentx2 << "name: " << qtLoc.name() << '\n'
<< indentx2 << "language: " << MetaEnum::name(qtLoc.language()) << '\n'
<< indentx2 << "measurementSytem: " << MetaEnum::name(qtLoc.measurementSystem()) << '\n'
<< indentx2 << "textDirection: " << MetaEnum::name(qtLoc.textDirection()) << '\n'
<< indentx2 << "decimalPoint: " << qtLoc.decimalPoint() << " " << toUnicodeHexa(qtLoc.decimalPoint()) << '\n'
<< indentx2 << "groupSeparator: " << qtLoc.groupSeparator() << " " << toUnicodeHexa(qtLoc.groupSeparator()) << '\n';
<< indentx2 << "groupSeparator: " << qtLoc.groupSeparator() << " " << toUnicodeHexa(qtLoc.groupSeparator()) << '\n'
;
}

// C++ StdLib
ostr << '\n' << "C++ StdLib:\n";
{
const QChar dirSeparator(FilePath::preferred_separator);
ostr << indent << "std::thread::hardware_concurrency: " << std::thread::hardware_concurrency() << '\n'
<< indent << "std::filepath::path::preferred_separator: " << dirSeparator << " " << toUnicodeHexa(dirSeparator) << '\n';
<< indent << "std::filepath::path::preferred_separator: " << dirSeparator << " " << toUnicodeHexa(dirSeparator) << '\n'
;
}

// OpenGL
Expand All @@ -277,7 +281,8 @@ QString CommandSystemInformation::data()
ostr << indent << "General font: " << QFontDatabase::systemFont(QFontDatabase::GeneralFont) << '\n'
<< indent << "Fixed font: " << QFontDatabase::systemFont(QFontDatabase::FixedFont) << '\n'
<< indent << "Title font: " << QFontDatabase::systemFont(QFontDatabase::TitleFont) << '\n'
<< indent << "Smallest font: " << QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont) << '\n';
<< indent << "Smallest font: " << QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont) << '\n'
;

// Screens
ostr << '\n' << "Screens:\n";
Expand Down Expand Up @@ -312,7 +317,8 @@ QString CommandSystemInformation::data()
<< indentx2 << "primaryOrientation: " << MetaEnum::name(screen->primaryOrientation()) << '\n'
<< indentx2 << "orientation: " << MetaEnum::name(screen->orientation()) << '\n'
<< indentx2 << "nativeOrientation: " << MetaEnum::name(screen->nativeOrientation()) << '\n'
<< indentx2 << "refreshRate: " << screen->refreshRate() << "Hz" << '\n';
<< indentx2 << "refreshRate: " << screen->refreshRate() << "Hz" << '\n'
;
}
}

Expand All @@ -321,7 +327,8 @@ QString CommandSystemInformation::data()
ostr << indent << "platformName: " << QGuiApplication::platformName() << '\n'
<< indent << "desktopFileName: " << QGuiApplication::desktopFileName() << '\n'
<< indent << "desktopSettingsAware: " << QGuiApplication::desktopSettingsAware() << '\n'
<< indent << "layoutDirection: " << MetaEnum::name(QGuiApplication::layoutDirection()) << '\n';
<< indent << "layoutDirection: " << MetaEnum::name(QGuiApplication::layoutDirection()) << '\n'
;
const QStyleHints* sh = QGuiApplication::styleHints();
if (sh) {
const auto pwdChar = sh->passwordMaskCharacter();
Expand Down Expand Up @@ -349,7 +356,7 @@ QString CommandSystemInformation::data()
<< indentx2 << "mouseDoubleClickDistance: " << sh->mouseDoubleClickDistance() << '\n'
<< indentx2 << "touchDoubleTapDistance: " << sh->touchDoubleTapDistance() << '\n'
#endif
;
;
}

// Library info
Expand Down
15 changes: 8 additions & 7 deletions src/app/commands_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ BaseCommandDisplay::BaseCommandDisplay(IAppContext* context)
bool BaseCommandDisplay::getEnabledStatus() const
{
return this->app()->documentCount() != 0
&& this->context()->currentPage() == IAppContext::Page::Documents;
&& this->context()->currentPage() == IAppContext::Page::Documents
;
}

CommandChangeProjection::CommandChangeProjection(IAppContext* context)
Expand Down Expand Up @@ -106,8 +107,8 @@ CommandChangeDisplayMode::CommandChangeDisplayMode(IAppContext* context, QMenu*
: CommandChangeDisplayMode(context)
{
QObject::connect(
containerMenu, &QMenu::aboutToShow,
this, &CommandChangeDisplayMode::recreateMenuDisplayMode
containerMenu, &QMenu::aboutToShow,
this, &CommandChangeDisplayMode::recreateMenuDisplayMode
);
}

Expand Down Expand Up @@ -167,8 +168,8 @@ CommandToggleOriginTrihedron::CommandToggleOriginTrihedron(IAppContext* context)
this->setAction(action);

QObject::connect(
context, &IAppContext::currentDocumentChanged,
this, &CommandToggleOriginTrihedron::onCurrentDocumentChanged
context, &IAppContext::currentDocumentChanged,
this, &CommandToggleOriginTrihedron::onCurrentDocumentChanged
);
}

Expand Down Expand Up @@ -205,8 +206,8 @@ CommandTogglePerformanceStats::CommandTogglePerformanceStats(IAppContext* contex
this->setAction(action);

QObject::connect(
context, &IAppContext::currentDocumentChanged,
this, &CommandTogglePerformanceStats::onCurrentDocumentChanged
context, &IAppContext::currentDocumentChanged,
this, &CommandTogglePerformanceStats::onCurrentDocumentChanged
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/commands_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,8 @@ CommandCloseAllDocumentsExceptCurrent::CommandCloseAllDocumentsExceptCurrent(IAp
this->setAction(action);

QObject::connect(
context, &IAppContext::currentDocumentChanged,
this, &CommandCloseAllDocumentsExceptCurrent::updateActionText
context, &IAppContext::currentDocumentChanged,
this, &CommandCloseAllDocumentsExceptCurrent::updateActionText
);
this->app()->signalDocumentNameChanged.connectSlot([=](const DocumentPtr& doc) {
if (this->currentDocument() == doc->identifier())
Expand Down
3 changes: 2 additions & 1 deletion src/app/commands_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ bool CommandInspectXde::getEnabledStatus() const
return spanSelectedAppItem.size() == 1
&& firstAppItem.isValid()
&& firstAppItem.document()->isXCafDocument()
&& this->context()->currentPage() == IAppContext::Page::Documents;
&& this->context()->currentPage() == IAppContext::Page::Documents
;
}

CommandEditOptions::CommandEditOptions(IAppContext* context)
Expand Down
6 changes: 4 additions & 2 deletions src/app/commands_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ bool CommandPreviousDocument::getEnabledStatus() const
{
return this->app()->documentCount() != 0
&& this->context()->currentPage() == IAppContext::Page::Documents
&& this->currentDocumentIndex() > 0;
&& this->currentDocumentIndex() > 0
;
}

CommandNextDocument::CommandNextDocument(IAppContext* context)
Expand All @@ -200,7 +201,8 @@ bool CommandNextDocument::getEnabledStatus() const
const int appDocumentCount = this->app()->documentCount();
return appDocumentCount != 0
&& this->context()->currentPage() == IAppContext::Page::Documents
&& this->currentDocumentIndex() < appDocumentCount - 1;
&& this->currentDocumentIndex() < appDocumentCount - 1
;
}

} // namespace Mayo
2 changes: 1 addition & 1 deletion src/app/dialog_about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ DialogAbout::DialogAbout(QWidget* parent)
{
m_ui->setupUi(this);
m_ui->label_AppByOrg->setText(
tr("%1 By %2").arg(QApplication::applicationName(), QApplication::organizationName())
tr("%1 By %2").arg(QApplication::applicationName(), QApplication::organizationName())
);

const QString strVersionFull =
Expand Down
6 changes: 4 additions & 2 deletions src/app/dialog_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ class CustomStyle : public QProxyStyle {
StyleHint hint,
const QStyleOption* option,
const QWidget* widget,
QStyleHintReturn* returnData) const override
QStyleHintReturn* returnData
) const override
{
if (hint == QStyle::SH_ComboBox_AllowWheelScrolling)
return 0;
Expand Down Expand Up @@ -238,7 +239,8 @@ DialogOptions::DialogOptions(Settings* settings, QWidget* parent)
m_ui->treeView_GroupSections->scrollTo(indexList.front(), QAbstractItemView::PositionAtTop);
QSignalBlocker _(m_ui->treeView_GroupSections);
m_ui->treeView_GroupSections->selectionModel()->select(
indexList.front(), QItemSelectionModel::SelectCurrent);
indexList.front(), QItemSelectionModel::SelectCurrent
);
}
});

Expand Down
Loading

0 comments on commit 4135cf4

Please sign in to comment.