Commit 1093d618 authored by Pierre-Luc Beaudoin's avatar Pierre-Luc Beaudoin

Account's Trying state in UI

parent 31a51a63
......@@ -115,15 +115,24 @@ const gchar * account_state_name(account_state_t s)
switch(s)
{
case ACCOUNT_STATE_REGISTERED:
state = "Registered";
break;
state = "Registered";
break;
case ACCOUNT_STATE_UNREGISTERED:
state = "Not Registered";
break;
state = "Not Registered";
break;
case ACCOUNT_STATE_TRYING:
state = "Trying...";
break;
default:
state = "Invalid";
break;
state = "Invalid";
break;
}
return state;
}
void
account_list_clear ( )
{
g_queue_free (accountQueue);
accountQueue = g_queue_new ();
}
......@@ -49,7 +49,8 @@ typedef enum
{
ACCOUNT_STATE_INVALID = 0,
ACCOUNT_STATE_REGISTERED,
ACCOUNT_STATE_UNREGISTERED
ACCOUNT_STATE_UNREGISTERED,
ACCOUNT_STATE_TRYING
} account_state_t;
/** @struct account_t
......@@ -99,4 +100,6 @@ account_t * account_list_get_nth ( guint n );
* @param s The state
* @return The full text description of the state */
const gchar * account_state_name(account_state_t s);
void account_list_clear ( );
#endif
......@@ -89,6 +89,8 @@ sflphone_ringing(call_t * c )
void
sflphone_fill_account_list()
{
account_list_clear ( );
gchar ** array = (gchar **)dbus_account_list();
gchar ** accountID;
for (accountID = array; *accountID; accountID++)
......@@ -115,6 +117,10 @@ sflphone_fill_account_list()
{
a->state = ACCOUNT_STATE_UNREGISTERED;
}
else if(strcmp(status, "TRYING") == 0)
{
a->state = ACCOUNT_STATE_TRYING;
}
else
{
a->state = ACCOUNT_STATE_INVALID;
......
......@@ -100,4 +100,5 @@ void sflphone_keypad ( guint keyval, gchar * key);
*/
void sflphone_place_call ( call_t * c );
void sflphone_fill_account_list();
#endif
......@@ -141,6 +141,7 @@ accounts_changed_cb (DBusGProxy *proxy,
void * foo )
{
g_print ("Accounts changed\n");
sflphone_fill_account_list();
// TODO reload list
}
......
......@@ -68,7 +68,6 @@ ConfigurationManager::getAccountList( )
{
_debug("ConfigurationManager::getAccountList received\n");
return Manager::instance().getAccountList();
}
......
......@@ -1584,9 +1584,9 @@ ManagerImpl::getAccountDetails(const AccountID& accountID)
std::pair<std::string, std::string>(
"Status",
(state == VoIPLink::Registered ? "REGISTERED":
(state == VoIPLink::Unregistered ? "UNREGISTERED":
(state == VoIPLink::Trying ? "TRYING":
(state == VoIPLink::Error ? "ERROR": "UNKNOWN"))))
(state == VoIPLink::Unregistered ? "UNREGISTERED":
(state == VoIPLink::Trying ? "TRYING":
(state == VoIPLink::Error ? "ERROR": "UNKNOWN"))))
)
);
a.insert(
......@@ -1721,15 +1721,6 @@ void
ManagerImpl::removeAccount(const AccountID& accountID)
{
_config.removeSection(accountID);
//TODO
/*AccountMap::iterator iter = _accountMap.begin();
while ( iter != _accountMap.end() ) {
_debug("Account %s == %s ", iter->first, accountID);
if ( iter->first == accountID ) {
_accountMap.erase(iter);
}
iter++;
}*/
saveConfig();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment