Skip to content
Permalink
Browse files
Add QgisApp::messageTimeout() to iface sip file
- [API] Remove recently added, and unnecessary, mMessageTimeout and setMessageTimeout() from QgisApp
  • Loading branch information
dakcarto committed Jan 14, 2013
1 parent e435762 commit b288b3a6f56ea7ed62d62ca7f9493ccceb4d0714
Showing with 24 additions and 11 deletions.
  1. +4 −0 python/gui/qgisinterface.sip
  2. +6 −1 src/app/qgisapp.cpp
  3. +1 −9 src/app/qgisapp.h
  4. +5 −0 src/app/qgisappinterface.cpp
  5. +4 −0 src/app/qgisappinterface.h
  6. +0 −1 src/app/qgsoptions.cpp
  7. +4 −0 src/gui/qgisinterface.h
@@ -398,6 +398,10 @@ class QgisInterface : QObject
* @note added in 1.9 */
virtual QList<QgsMapLayer *> editableLayers( bool modified = false ) const = 0;

/** Get timeout for timed messages: default of 5 seconds
* @note added in 1.9 */
virtual int messageTimeout() = 0;

signals:
/** Emited whenever current (selected) layer changes.
* The pointer to layer can be null if no layer is selected
@@ -488,7 +488,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
mInfoBar = new QgsMessageBar( centralWidget );
mInfoBar->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed );
centralLayout->addWidget( mInfoBar, 0, 0, 1, 1 );
mMessageTimeout = settings.value( "/qgis/messageTimeout", 5 ).toInt();

//set the focus to the map canvas
mMapCanvas->setFocus();
@@ -1218,6 +1217,12 @@ void QgisApp::setAppStyleSheet()
}
}

int QgisApp::messageTimeout()
{
QSettings settings;
return settings.value( "/qgis/messageTimeout", 5 ).toInt();
}

void QgisApp::createMenus()
{
/*
@@ -400,7 +400,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow

/** Get timeout for timed messages: default of 5 seconds
* @note added in 1.9 */
int messageTimeout() { return mMessageTimeout; }
int messageTimeout();

#ifdef Q_OS_WIN
//! ugly hack
@@ -543,11 +543,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
//! layer selection changed
void legendLayerSelectionChanged( void );

/** Set timeout for timed messages
* @param t timeout in seconds
* @note added in 1.9 */
void setMessageTimeout( int t ) { mMessageTimeout = t; }

//! Watch for QFileOpenEvent.
virtual bool event( QEvent * event );

@@ -1342,9 +1337,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
QgsMessageBar *mInfoBar;
QWidget *mMacrosWarn;

//! timeout for timed messages
int mMessageTimeout;

#ifdef HAVE_TOUCH
bool gestureEvent( QGestureEvent *event );
void tapAndHoldTriggered( QTapAndHoldGesture *gesture );
@@ -485,3 +485,8 @@ QList<QgsMapLayer *> QgisAppInterface::editableLayers( bool modified ) const
{
return qgis->editableLayers( modified );
}

int QgisAppInterface::messageTimeout()
{
return qgis->messageTimeout();
}
@@ -353,6 +353,10 @@ class QgisAppInterface : public QgisInterface
* @note added in 1.9 */
virtual QList<QgsMapLayer *> editableLayers( bool modified = false ) const;

/** Get timeout for timed messages: default of 5 seconds
* @note added in 1.9 */
virtual int messageTimeout();

signals:
void currentThemeChanged( QString );

@@ -1081,7 +1081,6 @@ void QgsOptions::saveOptions()
QgisApp::instance()->setAppStyleSheet();

settings.setValue( "/qgis/messageTimeout", mMessageTimeoutSpnBx->value() );
QgisApp::instance()->setMessageTimeout( mMessageTimeoutSpnBx->value() );

// rasters settings
settings.setValue( "/Raster/defaultRedBand", spnRed->value() );
@@ -446,6 +446,10 @@ class GUI_EXPORT QgisInterface : public QObject
* @note added in 1.9 */
virtual QList<QgsMapLayer *> editableLayers( bool modified = false ) const = 0;

/** Get timeout for timed messages: default of 5 seconds
* @note added in 1.9 */
virtual int messageTimeout() = 0;

signals:
/** Emited whenever current (selected) layer changes.
* The pointer to layer can be null if no layer is selected

0 comments on commit b288b3a

Please sign in to comment.