Skip to content
Permalink
Browse files

Remove messageitem id

  • Loading branch information
NathanW2 committed Aug 15, 2013
1 parent 05a41e3 commit 65dfdf1fa4f877be12de008fe590d56fc21ebaea
@@ -45,12 +45,9 @@ class QgsMessageBar: QFrame
static QgsMessageBarItem* createMessage( QWidget *widget, QWidget *parent = 0 ) /Factory/;

//! convenience method for pushing a non-widget-based message to the bar
QString pushMessage( const QString &text, MessageLevel level = INFO, int duration = 0 );
void pushMessage( const QString &text, MessageLevel level = INFO, int duration = 0 );
//! convenience method for pushing a non-widget-based message with title to the bar
QString pushMessage( const QString &title, const QString &text, MessageLevel level = INFO, int duration = 0 );

//! return the item for given uuid if the item still exists, 0 otherwise
QgsMessageBarItem* itemAtId( QString uuid );
void pushMessage( const QString &title, const QString &text, MessageLevel level = INFO, int duration = 0 );

signals:
//! emitted when a message widget is added to the bar
@@ -32,9 +32,6 @@ class QgsMessageBarItem: QWidget

//! returns the duration in second of the message
int duration();

//! get the uuid of this message
QString id();

//! returns the level
QgsMessageBar::MessageLevel level();
@@ -268,11 +268,10 @@ QgsMessageBarItem* QgsMessageBar::pushWidget( QWidget *widget , QgsMessageBar::M
return item;
}

QString QgsMessageBar::pushMessage( const QString &title, const QString &text, QgsMessageBar::MessageLevel level, int duration )
void QgsMessageBar::pushMessage( const QString &title, const QString &text, QgsMessageBar::MessageLevel level, int duration )
{
QgsMessageBarItem *item = new QgsMessageBarItem( title, text, level, duration );
pushItem( item );
return item->id();
}

QgsMessageBarItem* QgsMessageBar::createMessage( const QString &text, QWidget *parent )
@@ -291,17 +290,6 @@ QgsMessageBarItem* QgsMessageBar::createMessage( QWidget *widget, QWidget *paren
return new QgsMessageBarItem( widget, INFO, 0, parent );
}

QgsMessageBarItem* QgsMessageBar::itemAtId( QString uuid )
{
if ( mCurrentItem->id() == uuid )
return mCurrentItem;

foreach ( QgsMessageBarItem *item, mItems )
if ( item->id() == uuid )
return item;
return 0;
}

void QgsMessageBar::updateCountdown()
{
if ( !mCountdownTimer->isActive() )
@@ -84,12 +84,9 @@ class GUI_EXPORT QgsMessageBar: public QFrame
static QgsMessageBarItem* createMessage( QWidget *widget, QWidget *parent = 0 );

//! convenience method for pushing a message to the bar
QString pushMessage( const QString &text, MessageLevel level = INFO, int duration = 0 ) { return pushMessage( QString::null, text, level, duration ); }
void pushMessage( const QString &text, MessageLevel level = INFO, int duration = 0 ) { return pushMessage( QString::null, text, level, duration ); }
//! convenience method for pushing a message with title to the bar
QString pushMessage( const QString &title, const QString &text, MessageLevel level = INFO, int duration = 0 );

//! return the item for given uuid if the item still exists, 0 otherwise
QgsMessageBarItem* itemAtId( QString uuid );
void pushMessage( const QString &title, const QString &text, MessageLevel level = INFO, int duration = 0 );

signals:
//! emitted when a message widget is added to the bar
@@ -22,11 +22,9 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QTextEdit>
#include <QUuid>

QgsMessageBarItem::QgsMessageBarItem( const QString &text, QgsMessageBar::MessageLevel level, int duration, QWidget *parent ) :
QWidget( parent )
, mUuid( QUuid::createUuid().toString() )
, mTitle( "" )
, mText( text )
, mLevel( level )
@@ -40,7 +38,6 @@ QgsMessageBarItem::QgsMessageBarItem( const QString &text, QgsMessageBar::Messag

QgsMessageBarItem::QgsMessageBarItem(const QString &title, const QString &text, QgsMessageBar::MessageLevel level, int duration , QWidget *parent ) :
QWidget( parent )
, mUuid( QUuid::createUuid().toString() )
, mTitle( title )
, mText( text )
, mLevel( level )
@@ -54,7 +51,6 @@ QgsMessageBarItem::QgsMessageBarItem(const QString &title, const QString &text,

QgsMessageBarItem::QgsMessageBarItem( const QString &title, const QString &text, QWidget *widget, QgsMessageBar::MessageLevel level, int duration, QWidget *parent ) :
QWidget( parent )
, mUuid( QUuid::createUuid().toString() )
, mTitle( title )
, mText( text )
, mLevel( level )
@@ -68,7 +64,6 @@ QgsMessageBarItem::QgsMessageBarItem( const QString &title, const QString &text,

QgsMessageBarItem::QgsMessageBarItem( QWidget *widget, QgsMessageBar::MessageLevel level, int duration, QWidget *parent ) :
QWidget( parent )
, mUuid( QUuid::createUuid().toString() )
, mTitle( "" )
, mText( "" )
, mLevel( level )
@@ -59,9 +59,6 @@ class GUI_EXPORT QgsMessageBarItem : public QWidget
//! returns the duration in second of the message
int duration() const { return mDuration; }

//! get the uuid of this message
QString id() { return mUuid; }

//! returns the level
QgsMessageBar::MessageLevel level() { return mLevel; }

@@ -76,7 +73,6 @@ class GUI_EXPORT QgsMessageBarItem : public QWidget
private:
void writeContent();

QString mUuid;
QString mTitle;
QString mText;
QgsMessageBar::MessageLevel mLevel;

0 comments on commit 65dfdf1

Please sign in to comment.
You can’t perform that action at this time.