Skip to content

Commit

Permalink
+ fix reported Qt warning
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Apr 13, 2016
1 parent 08df5cb commit df6eb69
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
17 changes: 8 additions & 9 deletions src/Gui/DlgCheckableMessageBox.cpp
Expand Up @@ -48,16 +48,15 @@ namespace Gui {
namespace Dialog {
QByteArray toParamEntry(QString name)
{
QString tmp = QString::fromLatin1(name.toLatin1());
name.replace(QString::fromLatin1(" "),QString::fromLatin1("_"));
name.replace(QString::fromLatin1(" "), QString::fromLatin1("_"));
return name.toLatin1();
}

void DlgCheckableMessageBox::showMessage(QString header, QString message, bool check,QString checkText )
void DlgCheckableMessageBox::showMessage(const QString& header, const QString& message, bool check, const QString& checkText)
{
bool checked = App::GetApplication().GetParameterGroupByPath( QByteArray("User parameter:BaseApp/CheckMessages"))->GetBool(toParamEntry(header));

if(!checked){
if (!checked) {
DlgCheckableMessageBox *mb = new DlgCheckableMessageBox(Gui::getMainWindow());
mb->setWindowTitle(header);
mb->setIconPixmap(QMessageBox::standardIcon(QMessageBox::Warning));
Expand Down Expand Up @@ -97,11 +96,11 @@ DlgCheckableMessageBox::~DlgCheckableMessageBox()
delete m_d;
}

void DlgCheckableMessageBox::setPrefEntry( const QString& entry )
void DlgCheckableMessageBox::setPrefEntry(const QString& entry)
{
paramEntry = toParamEntry(entry);
bool checked = App::GetApplication().GetParameterGroupByPath( QByteArray("User parameter:BaseApp/CheckMessages"))->GetBool(paramEntry);
setChecked(checked);
paramEntry = toParamEntry(entry);
bool checked = App::GetApplication().GetParameterGroupByPath(QByteArray("User parameter:BaseApp/CheckMessages"))->GetBool(paramEntry);
setChecked(checked);
}


Expand Down Expand Up @@ -236,4 +235,4 @@ QMessageBox::StandardButton DlgCheckableMessageBox::dialogButtonBoxToMessageBoxB
} // namespace Dialog
} // namespace Gui

#include "moc_DlgCheckableMessageBox.cpp"
#include "moc_DlgCheckableMessageBox.cpp"
8 changes: 4 additions & 4 deletions src/Gui/DlgCheckableMessageBox.h
Expand Up @@ -51,7 +51,7 @@ class GuiExport DlgCheckableMessageBox : public QDialog
Q_PROPERTY(QString text READ text WRITE setText)
Q_PROPERTY(QPixmap iconPixmap READ iconPixmap WRITE setIconPixmap)
Q_PROPERTY(bool isChecked READ isChecked WRITE setChecked)
Q_PROPERTY(QString prefEntry WRITE setPrefEntry)
//Q_PROPERTY(QString prefEntry WRITE setPrefEntry) // Must have a READ accessor!
Q_PROPERTY(QString checkBoxText READ checkBoxText WRITE setCheckBoxText)
Q_PROPERTY(QDialogButtonBox::StandardButtons buttons READ standardButtons WRITE setStandardButtons)
Q_PROPERTY(QDialogButtonBox::StandardButton defaultButton READ defaultButton WRITE setDefaultButton)
Expand All @@ -71,7 +71,7 @@ class GuiExport DlgCheckableMessageBox : public QDialog
QString text() const;
void setText(const QString &);

void setPrefEntry( const QString& entry );
void setPrefEntry(const QString& entry);

virtual void accept();
virtual void reject();
Expand Down Expand Up @@ -99,8 +99,8 @@ class GuiExport DlgCheckableMessageBox : public QDialog
// Conversion convenience
static QMessageBox::StandardButton dialogButtonBoxToMessageBoxButton(QDialogButtonBox::StandardButton);

// conviniant show method
static void showMessage(QString haeder, QString message, bool check=false,QString checkText = QString::fromLatin1("Don't show me again"));
// convenient show method
static void showMessage(const QString& haeder, const QString& message, bool check=false, const QString& checkText = QString::fromLatin1("Don't show me again"));

private Q_SLOTS:
void slotClicked(QAbstractButton *b);
Expand Down

0 comments on commit df6eb69

Please sign in to comment.