[libcalamaresui] Run clang-format on TranslationFix.cpp
This commit is contained in:
parent
d9f7726f7d
commit
aa332477fd
@ -10,34 +10,35 @@
|
|||||||
#include "TranslationFix.h"
|
#include "TranslationFix.h"
|
||||||
|
|
||||||
#include <QAbstractButton>
|
#include <QAbstractButton>
|
||||||
#include <QPushButton>
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
|
|
||||||
//Using QMessageBox's StandardButton enum here but according to headers they should be kept in-sync between multiple classes.
|
//Using QMessageBox's StandardButton enum here but according to headers they should be kept in-sync between multiple classes.
|
||||||
static std::pair< decltype( QMessageBox::Ok ), const char* > maps[] = {
|
static std::pair< decltype( QMessageBox::Ok ), const char* > maps[] = {
|
||||||
{ QMessageBox::Ok, QT_TRANSLATE_NOOP( "StandardButtons", "&OK" ) },
|
{ QMessageBox::Ok, QT_TRANSLATE_NOOP( "StandardButtons", "&OK" ) },
|
||||||
{ QMessageBox::Yes, QT_TRANSLATE_NOOP( "StandardButtons", "&Yes" ) },
|
{ QMessageBox::Yes, QT_TRANSLATE_NOOP( "StandardButtons", "&Yes" ) },
|
||||||
{ QMessageBox::No, QT_TRANSLATE_NOOP( "StandardButtons", "&No" ) },
|
{ QMessageBox::No, QT_TRANSLATE_NOOP( "StandardButtons", "&No" ) },
|
||||||
{ QMessageBox::Cancel, QT_TRANSLATE_NOOP( "StandardButtons", "&Cancel" ) },
|
{ QMessageBox::Cancel, QT_TRANSLATE_NOOP( "StandardButtons", "&Cancel" ) },
|
||||||
{ QMessageBox::Close, QT_TRANSLATE_NOOP( "StandardButtons", "&Close" ) },
|
{ QMessageBox::Close, QT_TRANSLATE_NOOP( "StandardButtons", "&Close" ) },
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename TButtonBox>
|
template < typename TButtonBox >
|
||||||
void fixButtonLabels ( TButtonBox* box )
|
void
|
||||||
|
fixButtonLabels( TButtonBox* box )
|
||||||
{
|
{
|
||||||
if ( !box )
|
if ( !box )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( auto [ sb, label ] : maps )
|
for ( auto [ sb, label ] : maps )
|
||||||
{
|
{
|
||||||
auto* button = box->button( static_cast<typename TButtonBox::StandardButton>(int(sb)) );
|
auto* button = box->button( static_cast< typename TButtonBox::StandardButton >( int( sb ) ) );
|
||||||
if ( button )
|
if ( button )
|
||||||
{
|
{
|
||||||
button->setText( QCoreApplication::translate( "StandardButtons", label ) );
|
button->setText( QCoreApplication::translate( "StandardButtons", label ) );
|
||||||
@ -48,13 +49,13 @@ void fixButtonLabels ( TButtonBox* box )
|
|||||||
void
|
void
|
||||||
fixButtonLabels( QMessageBox* box )
|
fixButtonLabels( QMessageBox* box )
|
||||||
{
|
{
|
||||||
fixButtonLabels<QMessageBox>(box);
|
fixButtonLabels< QMessageBox >( box );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fixButtonLabels(QDialogButtonBox *box)
|
fixButtonLabels( QDialogButtonBox* box )
|
||||||
{
|
{
|
||||||
fixButtonLabels<QDialogButtonBox>(box);
|
fixButtonLabels< QDialogButtonBox >( box );
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Calamares
|
} // namespace Calamares
|
||||||
|
Loading…
Reference in New Issue
Block a user