本文整理汇总了C++中AccountHandler::canManuallyStartSession方法的典型用法代码示例。如果您正苦于以下问题:C++ AccountHandler::canManuallyStartSession方法的具体用法?C++ AccountHandler::canManuallyStartSession怎么用?C++ AccountHandler::canManuallyStartSession使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccountHandler
的用法示例。
在下文中一共展示了AccountHandler::canManuallyStartSession方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _populateWindowData
void AP_UnixDialog_CollaborationShare::_populateWindowData()
{
AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
UT_return_if_fail(pManager);
// populate the account combobox
GtkListStore* store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
GtkTreeIter iter;
AccountHandler* pShareeableAcount = _getShareableAccountHandler();
if (pShareeableAcount)
{
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pShareeableAcount->getDescription().utf8_str(),
1, pShareeableAcount,
-1);
gtk_widget_set_sensitive(m_wAccount, false);
}
else
{
for (std::vector<AccountHandler*>::const_iterator cit = pManager->getAccounts().begin(); cit != pManager->getAccounts().end(); cit++)
{
AccountHandler* pAccount = *cit;
UT_continue_if_fail(pAccount);
if (!pAccount->isOnline() || !pAccount->canManuallyStartSession())
continue;
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pAccount->getDescription().utf8_str(),
1, pAccount,
-1);
}
gtk_widget_set_sensitive(m_wAccount, true);
}
m_pAccountModel = GTK_TREE_MODEL (store);
gtk_combo_box_set_model(GTK_COMBO_BOX(m_wAccount), m_pAccountModel);
// if we have at least one account handler, then make sure the first one is selected
if (pManager->getRegisteredAccountHandlers().size() > 0)
{
gtk_combo_box_set_active(GTK_COMBO_BOX(m_wAccount), 0);
}
else
{
// nope, we don't have any account handler :'-(
gtk_combo_box_set_active(GTK_COMBO_BOX(m_wAccount), -1);
}
}
示例2: s_any_accounts_online
/*!
* returns true if at least one account is online
*/
static bool s_any_accounts_online(bool bIncludeNonManualShareAccounts = true)
{
AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
UT_return_val_if_fail(pManager, false);
const std::vector<AccountHandler *>& vecAccounts = pManager->getAccounts();
for (UT_uint32 i = 0; i < vecAccounts.size(); i++)
{
AccountHandler* pHandler = vecAccounts[i];
if (pHandler && pHandler->isOnline())
{
if (bIncludeNonManualShareAccounts)
return true;
if (pHandler->canManuallyStartSession())
return true;
}
}
return false;
}