Vera++.
--HG-- branch : release
This commit is contained in:
parent
364ae3f82c
commit
22055ab684
|
@ -40,7 +40,8 @@ const QString VSettings::SettingConfigurationSendReportState = QStringLit
|
|||
const QString VSettings::SettingConfigurationLocale = QStringLiteral("configuration/locale");
|
||||
const QString VSettings::SettingConfigurationUnit = QStringLiteral("configuration/unit");
|
||||
const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral("configuration/label_language");
|
||||
const QString VSettings::SettingConfigurationConfirmItemDeletion = QStringLiteral("configuration/confirm_item_deletion");
|
||||
const QString VSettings::SettingConfigurationConfirmItemDeletion
|
||||
= QStringLiteral("configuration/confirm_item_deletion");
|
||||
|
||||
const QString VSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements");
|
||||
const QString VSettings::SettingPathsStandardMeasurements = QStringLiteral("paths/standard_measurements");
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
|
||||
#include "dialogtool.h"
|
||||
|
||||
namespace Ui {
|
||||
namespace Ui
|
||||
{
|
||||
class DialogCurveIntersectAxis;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
|
||||
#include "dialogtool.h"
|
||||
|
||||
namespace Ui {
|
||||
namespace Ui
|
||||
{
|
||||
class DialogLineIntersectAxis;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,10 +71,10 @@ Q_LOGGING_CATEGORY(vMainWindow, "v.mainwindow")
|
|||
* @param parent parent widget.
|
||||
*/
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
:QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), currentTool(Tool::Arrow), lastUsedTool(Tool::Arrow),
|
||||
currentScene(nullptr), sceneDraw(nullptr), sceneDetails(nullptr), mouseCoordinate(nullptr), helpLabel(nullptr),
|
||||
isInitialized(false), dialogTable(nullptr), dialogTool(nullptr), dialogHistory(nullptr),
|
||||
comboBoxDraws(nullptr), curFile(QString()), mode(Draw::Calculation), currentDrawIndex(0),
|
||||
:QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), currentTool(Tool::Arrow),
|
||||
lastUsedTool(Tool::Arrow), currentScene(nullptr), sceneDraw(nullptr), sceneDetails(nullptr),
|
||||
mouseCoordinate(nullptr), helpLabel(nullptr), isInitialized(false), dialogTable(nullptr), dialogTool(nullptr),
|
||||
dialogHistory(nullptr), comboBoxDraws(nullptr), curFile(QString()), mode(Draw::Calculation), currentDrawIndex(0),
|
||||
currentToolBoxIndex(0), drawMode(true), recentFileActs(),
|
||||
separatorAct(nullptr), autoSaveTimer(nullptr), guiEnabled(true), gradationHeights(nullptr),
|
||||
gradationSizes(nullptr), toolOptions(nullptr), lock(nullptr)
|
||||
|
@ -2201,7 +2201,9 @@ void MainWindow::CreateMenus()
|
|||
void MainWindow::LastUsedTool()
|
||||
{
|
||||
if (currentTool == lastUsedTool)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch ( lastUsedTool )
|
||||
{
|
||||
|
|
|
@ -39,8 +39,9 @@ class VToolLinePoint : public VToolPoint
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const QString &lineColor, const QString &formula,
|
||||
const quint32 &basePointId, const qreal &angle, QGraphicsItem * parent = nullptr);
|
||||
VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine, const
|
||||
QString &lineColor, const QString &formula, const quint32 &basePointId, const qreal &angle,
|
||||
QGraphicsItem * parent = nullptr);
|
||||
virtual ~VToolLinePoint();
|
||||
virtual int type() const {return Type;}
|
||||
enum { Type = UserType + static_cast<int>(Tool::LinePoint)};
|
||||
|
|
|
@ -173,10 +173,10 @@ VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphics
|
|||
* @return the created tool
|
||||
*/
|
||||
VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formula, const quint32 &p1Line,
|
||||
const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine, const QString &lineColor,
|
||||
const QString &pointName, const qreal &mx, const qreal &my,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document &parse, const Source &typeCreation)
|
||||
const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine,
|
||||
const QString &lineColor, const QString &pointName, const qreal &mx,
|
||||
const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data, const Document &parse, const Source &typeCreation)
|
||||
{
|
||||
const QSharedPointer<VPointF> firstPoint = data->GeometricObject<VPointF>(p1Line);
|
||||
const QSharedPointer<VPointF> secondPoint = data->GeometricObject<VPointF>(p2Line);
|
||||
|
|
|
@ -52,9 +52,13 @@ QString compilerString()
|
|||
return QLatin1String("GCC " ) + QLatin1String(__VERSION__);
|
||||
#elif defined(Q_CC_MSVC)
|
||||
if (_MSC_VER >= 1800) // 1800: MSVC 2013 (yearly release cycle)
|
||||
{
|
||||
return QLatin1String("MSVC ") + QString::number(2008 + ((_MSC_VER / 100) - 13));
|
||||
}
|
||||
if (_MSC_VER >= 1500) // 1500: MSVC 2008, 1600: MSVC 2010, ... (2-year release cycle)
|
||||
{
|
||||
return QLatin1String("MSVC ") + QString::number(2008 + 2 * ((_MSC_VER / 100) - 15));
|
||||
}
|
||||
#endif
|
||||
return QLatin1String("<unknown compiler>");
|
||||
}
|
||||
|
|
|
@ -160,5 +160,3 @@ int VObjPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -37,7 +37,8 @@
|
|||
|
||||
static const char kDoNotAskAgainKey[] = "DoNotAskAgain";
|
||||
|
||||
namespace Utils {
|
||||
namespace Utils
|
||||
{
|
||||
|
||||
class CheckableMessageBoxPrivate
|
||||
{
|
||||
|
@ -131,7 +132,9 @@ QAbstractButton *CheckableMessageBox::clickedButton() const
|
|||
QDialogButtonBox::StandardButton CheckableMessageBox::clickedStandardButton() const
|
||||
{
|
||||
if (d->clickedButton)
|
||||
{
|
||||
return d->buttonBox->standardButton(d->clickedButton);
|
||||
}
|
||||
return QDialogButtonBox::NoButton;
|
||||
}
|
||||
|
||||
|
@ -148,7 +151,9 @@ void CheckableMessageBox::setText(const QString &t)
|
|||
QPixmap CheckableMessageBox::iconPixmap() const
|
||||
{
|
||||
if (const QPixmap *p = d->pixmapLabel->pixmap())
|
||||
{
|
||||
return QPixmap(*p);
|
||||
}
|
||||
return QPixmap();
|
||||
}
|
||||
|
||||
|
@ -212,14 +217,19 @@ QDialogButtonBox::StandardButton CheckableMessageBox::defaultButton() const
|
|||
{
|
||||
foreach (QAbstractButton *b, d->buttonBox->buttons())
|
||||
if (QPushButton *pb = qobject_cast<QPushButton *>(b))
|
||||
{
|
||||
if (pb->isDefault())
|
||||
{
|
||||
return d->buttonBox->standardButton(pb);
|
||||
}
|
||||
}
|
||||
return QDialogButtonBox::NoButton;
|
||||
}
|
||||
|
||||
void CheckableMessageBox::setDefaultButton(QDialogButtonBox::StandardButton s)
|
||||
{
|
||||
if (QPushButton *b = d->buttonBox->button(s)) {
|
||||
if (QPushButton *b = d->buttonBox->button(s))
|
||||
{
|
||||
b->setDefault(true);
|
||||
b->setFocus();
|
||||
}
|
||||
|
@ -277,13 +287,16 @@ QMessageBox::StandardButton CheckableMessageBox::dialogButtonBoxToMessageBoxButt
|
|||
bool askAgain(QSettings *settings, const QString &settingsSubKey)
|
||||
{
|
||||
//QTC_CHECK(settings);
|
||||
if (settings) {
|
||||
if (settings)
|
||||
{
|
||||
settings->beginGroup(QLatin1String(kDoNotAskAgainKey));
|
||||
bool shouldNotAsk = settings->value(settingsSubKey, false).toBool();
|
||||
settings->endGroup();
|
||||
if (shouldNotAsk)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -310,7 +323,9 @@ void initDoNotAskAgainMessageBox(CheckableMessageBox &messageBox, const QString
|
|||
void doNotAskAgain(QSettings *settings, const QString &settingsSubKey)
|
||||
{
|
||||
if (!settings)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
settings->beginGroup(QLatin1String(kDoNotAskAgainKey));
|
||||
settings->setValue(settingsSubKey, true);
|
||||
|
@ -336,13 +351,17 @@ CheckableMessageBox::doNotAskAgainQuestion(QWidget *parent, const QString &title
|
|||
|
||||
{
|
||||
if (!askAgain(settings, settingsSubKey))
|
||||
{
|
||||
return acceptButton;
|
||||
}
|
||||
|
||||
CheckableMessageBox messageBox(parent);
|
||||
initDoNotAskAgainMessageBox(messageBox, title, text, buttons, defaultButton, Question);
|
||||
messageBox.exec();
|
||||
if (messageBox.isChecked() && (messageBox.clickedStandardButton() == acceptButton))
|
||||
{
|
||||
doNotAskAgain(settings, settingsSubKey);
|
||||
}
|
||||
|
||||
return messageBox.clickedStandardButton();
|
||||
}
|
||||
|
@ -364,13 +383,17 @@ CheckableMessageBox::doNotShowAgainInformation(QWidget *parent, const QString &t
|
|||
|
||||
{
|
||||
if (!askAgain(settings, settingsSubKey))
|
||||
{
|
||||
return defaultButton;
|
||||
}
|
||||
|
||||
CheckableMessageBox messageBox(parent);
|
||||
initDoNotAskAgainMessageBox(messageBox, title, text, buttons, defaultButton, Information);
|
||||
messageBox.exec();
|
||||
if (messageBox.isChecked())
|
||||
{
|
||||
doNotAskAgain(settings, settingsSubKey);
|
||||
}
|
||||
|
||||
return messageBox.clickedStandardButton();
|
||||
}
|
||||
|
@ -396,8 +419,10 @@ bool CheckableMessageBox::hasSuppressedQuestions(QSettings *settings)
|
|||
//Q_ASSERT(settings, return false);
|
||||
bool hasSuppressed = false;
|
||||
settings->beginGroup(QLatin1String(kDoNotAskAgainKey));
|
||||
foreach (const QString &subKey, settings->childKeys()) {
|
||||
if (settings->value(subKey, false).toBool()) {
|
||||
foreach (const QString &subKey, settings->childKeys())
|
||||
{
|
||||
if (settings->value(subKey, false).toBool())
|
||||
{
|
||||
hasSuppressed = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,8 @@ QT_BEGIN_NAMESPACE
|
|||
class QSettings;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
namespace Utils
|
||||
{
|
||||
|
||||
class CheckableMessageBoxPrivate;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user