Skip to content

Commit

Permalink
new temporal map settings dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Samweli authored and nyalldawson committed Mar 12, 2020
1 parent d446c0a commit 3e06d0a
Show file tree
Hide file tree
Showing 16 changed files with 605 additions and 5 deletions.
1 change: 1 addition & 0 deletions images/images.qrc
Expand Up @@ -829,6 +829,7 @@
<file>themes/default/temporal_navigation/next.svg</file>
<file>themes/default/temporal_navigation/stop.svg</file>
<file>themes/default/temporal_navigation/previous.svg</file>
<file>themes/default/temporal_navigation/vcr_settings.svg</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Expand Down
79 changes: 79 additions & 0 deletions images/themes/default/temporal_navigation/vcr_settings.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion python/core/auto_generated/qgstemporalcontroller.sip.in
Expand Up @@ -13,7 +13,8 @@
class QgsTemporalController : QObject
{
%Docstring

A controller base class for temporal objects, contains a signal for notifying
updates of the objects temporal range.

.. versionadded:: 3.14
%End
Expand All @@ -31,7 +32,12 @@ Constructor for QgsTemporalController.
virtual ~QgsTemporalController();

signals:

void updateTemporalRange( const QgsDateTimeRange &range );
%Docstring
Signals that a temporal ``range`` has changed and need to be updated to
the related objects.
%End

};

Expand Down
46 changes: 46 additions & 0 deletions python/gui/auto_generated/qgstemporalmapsettingsdialog.sip.in
@@ -0,0 +1,46 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgstemporalmapsettingsdialog.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsTemporalMapSettingsDialog : QDialog
{
%Docstring
The QgsTemporalMapSettingsDialog class

.. versionadded:: 3.14
%End

%TypeHeaderCode
#include "qgstemporalmapsettingsdialog.h"
%End
public:

QgsTemporalMapSettingsDialog( QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags() );
%Docstring
Constructor for QgsTemporalMapSettingsDialog
%End

~QgsTemporalMapSettingsDialog();

double frameRateValue();
%Docstring
Returns the value of frame rate from widget.
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgstemporalmapsettingsdialog.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
52 changes: 52 additions & 0 deletions python/gui/auto_generated/qgstemporalmapsettingswidget.sip.in
@@ -0,0 +1,52 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgstemporalmapsettingswidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/






class QgsTemporalMapSettingsWidget : QWidget
{
%Docstring
The QgsTemporalMapSettingsWidget class

.. versionadded:: 3.14
%End

%TypeHeaderCode
#include "qgstemporalmapsettingswidget.h"
%End
public:

QgsTemporalMapSettingsWidget( QWidget *parent = 0 );
%Docstring
Constructor for QgsTemporalMapSettingsWidget
%End

~QgsTemporalMapSettingsWidget();

double frameRateValue();
%Docstring
Returns the value of frame rate from widget input
%End

void setFrameRateValue( double value );
%Docstring
Sets the value of frame rate from the vcr widget.
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgstemporalmapsettingswidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2 changes: 2 additions & 0 deletions python/gui/gui_auto.sip
Expand Up @@ -196,6 +196,8 @@
%Include auto_generated/qgstablewidgetitem.sip
%Include auto_generated/qgstabwidget.sip
%Include auto_generated/qgstaskmanagerwidget.sip
%Include auto_generated/qgstemporalmapsettingsdialog.sip
%Include auto_generated/qgstemporalmapsettingswidget.sip
%Include auto_generated/qgstemporalvcrdockwidget.sip
%Include auto_generated/qgstextformatwidget.sip
%Include auto_generated/qgstextpreview.sip
Expand Down
4 changes: 4 additions & 0 deletions src/gui/CMakeLists.txt
Expand Up @@ -504,6 +504,8 @@ SET(QGIS_GUI_SRCS
qgstabwidget.cpp
qgstablewidgetitem.cpp
qgstaskmanagerwidget.cpp
qgstemporalmapsettingsdialog.cpp
qgstemporalmapsettingswidget.cpp
qgstemporalvcrdockwidget.cpp
qgstextformatwidget.cpp
qgstextpreview.cpp
Expand Down Expand Up @@ -725,6 +727,8 @@ SET(QGIS_GUI_HDRS
qgstablewidgetitem.h
qgstabwidget.h
qgstaskmanagerwidget.h
qgstemporalmapsettingsdialog.h
qgstemporalmapsettingswidget.h
qgstemporalvcrdockwidget.h
qgstextformatwidget.h
qgstextpreview.h
Expand Down
56 changes: 56 additions & 0 deletions src/gui/qgstemporalmapsettingsdialog.cpp
@@ -0,0 +1,56 @@
/***************************************************************************
qgstemporalmapsettingsdialog.cpp
---------------
begin : March 2020
copyright : (C) 2020 by Samweli Mwakisambwe
email : samweli at kartoza dot 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. *
* *
***************************************************************************/

#include "qgstemporalmapsettingsdialog.h"
#include "qgsgui.h"
#include "qgstemporalmapsettingswidget.h"

QgsTemporalMapSettingsDialog::QgsTemporalMapSettingsDialog( QWidget *parent, Qt::WindowFlags flags )
: QDialog( parent, flags )
{
setupUi( this );

connect( this, &QDialog::accepted, this, &QgsTemporalMapSettingsDialog::apply );
connect( this, &QDialog::rejected, this, &QgsTemporalMapSettingsDialog::onCancel );

QVBoxLayout *layout = new QVBoxLayout();
mTemporalMapSettingsWidget = new QgsTemporalMapSettingsWidget( this );
layout->addWidget( mTemporalMapSettingsWidget );
setLayout( layout );
setWindowTitle( tr( "Temporal Map Settings" ) );

mTemporalMapSettingsWidget->setFrameRateValue( 1 );

hide();
}

QgsTemporalMapSettingsDialog::~QgsTemporalMapSettingsDialog()
{
}

void QgsTemporalMapSettingsDialog::apply()
{
}

void QgsTemporalMapSettingsDialog::onCancel()
{

}
double QgsTemporalMapSettingsDialog::frameRateValue()
{
return mTemporalMapSettingsWidget->frameRateValue();
}
63 changes: 63 additions & 0 deletions src/gui/qgstemporalmapsettingsdialog.h
@@ -0,0 +1,63 @@
/***************************************************************************
qgstemporalmapsettingsdialog.h
---------------
begin : March 2020
copyright : (C) 2020 by Samweli Mwakisambwe
email : samweli at kartoza dot 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 QGSTEMPORALMAPSETTINGSDIALOG_H
#define QGSTEMPORALMAPSETTINGSDIALOG_H

#include "ui_qgstemporalmapsettingsdialogbase.h"
#include "qgis_gui.h"

class QgsTemporalMapSettingsWidget;

/**
* \ingroup gui
* The QgsTemporalMapSettingsDialog class
*
* \since QGIS 3.14
*/
class GUI_EXPORT QgsTemporalMapSettingsDialog : public QDialog, private Ui::QgsTemporalMapSettingsDialogBase
{
Q_OBJECT
public:

/**
* Constructor for QgsTemporalMapSettingsDialog
*
*/
QgsTemporalMapSettingsDialog( QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );

~QgsTemporalMapSettingsDialog() override;

/**
* Returns the value of frame rate from widget.
*/
double frameRateValue();

private slots:

//! \brief Applies the settings made in the dialog.
void apply();
//! \brief Called when cancel button is pressed
void onCancel();

private:

//! Widget for handling temporal map settings
QgsTemporalMapSettingsWidget *mTemporalMapSettingsWidget = nullptr;
};

#endif // QGSTEMPORALMAPSETTINGSDIALOG_H
39 changes: 39 additions & 0 deletions src/gui/qgstemporalmapsettingswidget.cpp
@@ -0,0 +1,39 @@
/***************************************************************************
qgstemporalmapsettingswidget.cpp
---------------
begin : March 2020
copyright : (C) 2020 by Samweli Mwakisambwe
email : samweli at kartoza dot 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. *
* *
***************************************************************************/

#include "qgstemporalmapsettingswidget.h"
#include "qgsgui.h"

QgsTemporalMapSettingsWidget::QgsTemporalMapSettingsWidget( QWidget *parent )
: QWidget( parent )
{
setupUi( this );
}

QgsTemporalMapSettingsWidget::~QgsTemporalMapSettingsWidget()
{
}

double QgsTemporalMapSettingsWidget::frameRateValue()
{
return mFrameSpinBox->value();
}

void QgsTemporalMapSettingsWidget::setFrameRateValue( double value )
{
mFrameSpinBox->setValue( value );
}

0 comments on commit 3e06d0a

Please sign in to comment.