Skip to content

Commit

Permalink
Update indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 24, 2017
1 parent 6ec96d6 commit 32834e9
Show file tree
Hide file tree
Showing 10 changed files with 233 additions and 193 deletions.
4 changes: 2 additions & 2 deletions python/core/layout/qgslayoutitemhtml.sip
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ class QgsLayoutItemHtml: QgsLayoutMultiFrame
%Docstring
Recalculates the frame sizes for the current viewport dimensions
%End
void refreshExpressionContext();

void refreshDataDefinedProperty( const QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
virtual void refreshDataDefinedProperty( const QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );


protected:

Expand Down
14 changes: 14 additions & 0 deletions python/core/layout/qgslayoutmultiframe.sip
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ class QgsLayoutMultiFrame: QgsLayoutObject, QgsLayoutUndoObjectInterface

public slots:

virtual void refresh();

%Docstring
Refreshes the multiframe, causing a recalculation of any property overrides.
%End

void update();
%Docstring
Forces a redraw of all child frames.
Expand All @@ -290,6 +296,14 @@ class QgsLayoutMultiFrame: QgsLayoutObject, QgsLayoutUndoObjectInterface
.. seealso:: recalculateFrameSizes
%End

virtual void refreshDataDefinedProperty( const QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
%Docstring
Refreshes a data defined ``property`` for the multi frame by reevaluating the property's value
and redrawing the item with this new value. If ``property`` is set to
QgsLayoutObject.AllProperties then all data defined properties for the item will be
refreshed.
%End

signals:

void changed();
Expand Down
1 change: 1 addition & 0 deletions src/app/qgscrashhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class APP_EXPORT QgsCrashHandler
{

public:

/**
* This class doesn't need to be created by anyone as is only used to handle
* crashes in the application.
Expand Down
5 changes: 3 additions & 2 deletions src/core/layout/qgslayoutitemhtml.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,8 @@ class CORE_EXPORT QgsLayoutItemHtml: public QgsLayoutMultiFrame

//! Recalculates the frame sizes for the current viewport dimensions
void recalculateFrameSizes() override;
void refreshExpressionContext();

void refreshDataDefinedProperty( const QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
void refreshDataDefinedProperty( const QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties ) override;

protected:

Expand Down Expand Up @@ -273,6 +272,8 @@ class CORE_EXPORT QgsLayoutItemHtml: public QgsLayoutMultiFrame

//! Calculates the max width of frames in the html multiframe
double maxFrameWidth() const;

void refreshExpressionContext();
};

#endif // QGSLAYOUTITEMHTML_H
11 changes: 11 additions & 0 deletions src/core/layout/qgslayoutmultiframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ void QgsLayoutMultiFrame::recalculateFrameRects()
}
}

void QgsLayoutMultiFrame::refreshDataDefinedProperty( const QgsLayoutObject::DataDefinedProperty )
{

}

QgsLayoutFrame *QgsLayoutMultiFrame::createNewFrame( QgsLayoutFrame *currentFrame, QPointF pos, QSizeF size )
{
if ( !currentFrame )
Expand Down Expand Up @@ -289,6 +294,12 @@ void QgsLayoutMultiFrame::cancelCommand()
mLayout->undoStack()->cancelCommand();
}

void QgsLayoutMultiFrame::refresh()
{
QgsLayoutObject::refresh();
refreshDataDefinedProperty();
}

void QgsLayoutMultiFrame::handleFrameRemoval()
{
if ( mBlockUpdates )
Expand Down
13 changes: 13 additions & 0 deletions src/core/layout/qgslayoutmultiframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ class CORE_EXPORT QgsLayoutMultiFrame: public QgsLayoutObject, public QgsLayoutU

public slots:

/**
* Refreshes the multiframe, causing a recalculation of any property overrides.
*/
void refresh() override;

/**
* Forces a redraw of all child frames.
*/
Expand All @@ -302,6 +307,14 @@ class CORE_EXPORT QgsLayoutMultiFrame: public QgsLayoutObject, public QgsLayoutU
*/
void recalculateFrameRects();

/**
* Refreshes a data defined \a property for the multi frame by reevaluating the property's value
* and redrawing the item with this new value. If \a property is set to
* QgsLayoutObject::AllProperties then all data defined properties for the item will be
* refreshed.
*/
virtual void refreshDataDefinedProperty( const QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );

signals:

/**
Expand Down
64 changes: 32 additions & 32 deletions src/crashhandler/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
INCLUDE_DIRECTORIES(SYSTEM
${CMAKE_CURRENT_BINARY_DIR}
)

QT5_WRAP_UI(CRASH_UIS_H qgscrashdialog.ui)
QT5_WRAP_CPP(CRASH_HDR_MOC qgscrashdialog.h)

SET(IMAGE_RCCS ../../images/images.qrc)
QT5_ADD_RESOURCES(IMAGE_RCC_SRCS ${IMAGE_RCCS})

# -wd4091 Avoid 'typedef' ignored on left of '' when no variable is declared warning in DbgHelp.h
SET_SOURCE_FILES_PROPERTIES(qgsstacktrace.cpp PROPERTIES COMPILE_FLAGS -wd4091)

ADD_EXECUTABLE(qgiscrashhandler WIN32
main.cpp
${CRASH_UIS_H}
${CRASH_HDR_MOC}
${IMAGE_RCC_SRCS}
qgscrashdialog.cpp
qgsstacktrace.cpp
qgscrashreport.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../app/qgis_win32.rc
)

TARGET_LINK_LIBRARIES(qgiscrashhandler
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
DbgHelp
)

INSTALL(CODE "MESSAGE(\"Installing crashhandler ...\")")
INSTALL(TARGETS qgiscrashhandler RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR})
INCLUDE_DIRECTORIES(SYSTEM
${CMAKE_CURRENT_BINARY_DIR}
)

QT5_WRAP_UI(CRASH_UIS_H qgscrashdialog.ui)
QT5_WRAP_CPP(CRASH_HDR_MOC qgscrashdialog.h)

SET(IMAGE_RCCS ../../images/images.qrc)
QT5_ADD_RESOURCES(IMAGE_RCC_SRCS ${IMAGE_RCCS})

# -wd4091 Avoid 'typedef' ignored on left of '' when no variable is declared warning in DbgHelp.h
SET_SOURCE_FILES_PROPERTIES(qgsstacktrace.cpp PROPERTIES COMPILE_FLAGS -wd4091)

ADD_EXECUTABLE(qgiscrashhandler WIN32
main.cpp
${CRASH_UIS_H}
${CRASH_HDR_MOC}
${IMAGE_RCC_SRCS}
qgscrashdialog.cpp
qgsstacktrace.cpp
qgscrashreport.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../app/qgis_win32.rc
)

TARGET_LINK_LIBRARIES(qgiscrashhandler
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
DbgHelp
)

INSTALL(CODE "MESSAGE(\"Installing crashhandler ...\")")
INSTALL(TARGETS qgiscrashhandler RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR})
110 changes: 55 additions & 55 deletions src/crashhandler/qgscrashdialog.h
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
/***************************************************************************
qgscrashdialog.h - QgsCrashDialog
---------------------
begin : 11.4.2017
copyright : (C) 2017 by Nathan Woodrow
email : woodrow.nathan@gmail.com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSCRASHDIALOG_H
#define QGSCRASHDIALOG_H

#include <QDialog>
#include <QFormLayout>
#include <QPlainTextEdit>
#include <QPushButton>

#include "ui_qgscrashdialog.h"

/**
* A dialog to show a nicer crash dialog to the user.
*/
class QgsCrashDialog : public QDialog, private Ui::QgsCrashDialog
{
Q_OBJECT
public:

/**
* A dialog to show a nicer crash dialog to the user.
*/
QgsCrashDialog( QWidget *parent = nullptr );

void setBugReport( const QString &reportData );
void setReloadArgs( const QString &reloadArgs );

static QString htmlToMarkdown( const QString &html );

private slots:
void showReportWidget();
void createBugReport();
void reloadQGIS();

private:
QString mReportData;
QString mReloadArgs;
};

#endif // QGSCRASHDIALOG_H
/***************************************************************************
qgscrashdialog.h - QgsCrashDialog
---------------------
begin : 11.4.2017
copyright : (C) 2017 by Nathan Woodrow
email : woodrow.nathan@gmail.com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSCRASHDIALOG_H
#define QGSCRASHDIALOG_H

#include <QDialog>
#include <QFormLayout>
#include <QPlainTextEdit>
#include <QPushButton>

#include "ui_qgscrashdialog.h"

/**
* A dialog to show a nicer crash dialog to the user.
*/
class QgsCrashDialog : public QDialog, private Ui::QgsCrashDialog
{
Q_OBJECT
public:

/**
* A dialog to show a nicer crash dialog to the user.
*/
QgsCrashDialog( QWidget *parent = nullptr );

void setBugReport( const QString &reportData );
void setReloadArgs( const QString &reloadArgs );

static QString htmlToMarkdown( const QString &html );

private slots:
void showReportWidget();
void createBugReport();
void reloadQGIS();

private:
QString mReportData;
QString mReloadArgs;
};

#endif // QGSCRASHDIALOG_H
Loading

0 comments on commit 32834e9

Please sign in to comment.