mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-24 09:49:42 +01:00
Restored go online/go offline functionality in AccountsWidget.
This is a stopgap measure until we refactor the Accounts stuff for easy state management in resolvers and such. It is still better than the old go online/go offline entry, but it ties the connected/disconnected state of all non-SIP accounts to the state of the SIP accounts, without changing the non-SIP accounts' enabled/disabled setting. This means that as long as at least one SIP account is enabled, all other non-SIP accounts will try to connect and Tomahawk will be reported as "online" in the UI. Otherwise, when hitting "Disconnect All" or disabling the last online SIP account, all non-SIP accounts will be disconnected as well.
This commit is contained in:
parent
022b11e7cb
commit
015a76f831
@ -19,6 +19,7 @@
|
||||
#include "AccountListWidget.h"
|
||||
|
||||
#include "accounts/AccountModel.h"
|
||||
#include "accounts/AccountManager.h"
|
||||
#include "AccountWidget.h"
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
|
||||
@ -214,7 +215,14 @@ AccountListWidget::updateToggleOnlineStateButton()
|
||||
}
|
||||
end:;
|
||||
|
||||
m_toggleOnlineButtonState = newState;
|
||||
if ( newState != m_toggleOnlineButtonState )
|
||||
{
|
||||
m_toggleOnlineButtonState = newState;
|
||||
if ( newState )
|
||||
Tomahawk::Accounts::AccountManager::instance()->connectAll();
|
||||
else
|
||||
Tomahawk::Accounts::AccountManager::instance()->disconnectAll();
|
||||
}
|
||||
|
||||
m_toggleOnlineButton->setText( m_toggleOnlineButtonState ? tr( "Disconnect &All" )
|
||||
: tr( "Connect &All" ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user