mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
Show Connecting... state for jabber and in delegate
This commit is contained in:
@@ -226,8 +226,15 @@ JabberPlugin::connectPlugin( bool startup )
|
|||||||
void
|
void
|
||||||
JabberPlugin::disconnectPlugin()
|
JabberPlugin::disconnectPlugin()
|
||||||
{
|
{
|
||||||
if(!m_client->isConnected())
|
if (!m_client->isConnected())
|
||||||
|
{
|
||||||
|
if ( m_state != Disconnected ) // might be Connecting
|
||||||
|
{
|
||||||
|
m_state = Disconnected;
|
||||||
|
emit stateChanged( m_state );
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach(const Jreen::JID &peer, m_peers.keys())
|
foreach(const Jreen::JID &peer, m_peers.keys())
|
||||||
{
|
{
|
||||||
@@ -366,6 +373,9 @@ QString JabberPlugin::errorMessage(Jreen::Client::DisconnectReason reason)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_state == Disconnected;
|
||||||
|
emit stateChanged( m_state );
|
||||||
|
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -172,9 +172,13 @@ SipConfigDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option
|
|||||||
|
|
||||||
QPixmap p;
|
QPixmap p;
|
||||||
QString statusText;
|
QString statusText;
|
||||||
if( index.data( SipModel::ConnectionStateRole ).toInt() == SipPlugin::Connected ) {
|
SipPlugin::ConnectionState state = static_cast< SipPlugin::ConnectionState >( index.data( SipModel::ConnectionStateRole ).toInt() );
|
||||||
|
if( state == SipPlugin::Connected ) {
|
||||||
p = QPixmap( RESPATH "images/sipplugin-online.png" );
|
p = QPixmap( RESPATH "images/sipplugin-online.png" );
|
||||||
statusText = tr( "Online" );
|
statusText = tr( "Online" );
|
||||||
|
} else if( state == SipPlugin::Connecting ) {
|
||||||
|
p = QPixmap( RESPATH "images/sipplugin-offline.png" );
|
||||||
|
statusText = tr( "Connecting..." );
|
||||||
} else {
|
} else {
|
||||||
p = QPixmap( RESPATH "images/sipplugin-offline.png" );
|
p = QPixmap( RESPATH "images/sipplugin-offline.png" );
|
||||||
statusText = tr( "Offline" );
|
statusText = tr( "Offline" );
|
||||||
|
Reference in New Issue
Block a user