本文整理汇总了C++中AccountHandler::isOnline方法的典型用法代码示例。如果您正苦于以下问题:C++ AccountHandler::isOnline方法的具体用法?C++ AccountHandler::isOnline怎么用?C++ AccountHandler::isOnline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccountHandler
的用法示例。
在下文中一共展示了AccountHandler::isOnline方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _constructModel
GtkListStore* AP_UnixDialog_CollaborationAccounts::_constructModel()
{
GtkTreeIter iter;
GtkListStore* model = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
for (UT_uint32 i = 0; i < pManager->getAccounts().size(); i++)
{
AccountHandler* pHandler = pManager->getAccounts()[i];
if (pHandler)
{
UT_DEBUGMSG(("Got account: %s of type %s\n",
pHandler->getDescription().utf8_str(),
pHandler->getDisplayType().utf8_str()
));
gtk_list_store_append (model, &iter);
gtk_list_store_set (model, &iter,
ONLINE_COLUMN, pHandler->isOnline(),
DESC_COLUMN, pHandler->getDescription().utf8_str(),
TYPE_COLUMN, pHandler->getDisplayType().utf8_str(),
HANDLER_COLUMN, pHandler,
-1);
}
}
return model;
}
示例2: _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);
}
}
示例3: 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;
}
示例4:
void AP_Win32Dialog_CollaborationAccounts::_populateWindowData()
{
AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
UT_return_if_fail(pManager);
m_bPopulating = true;
// clear out the old contents, if any
ListView_DeleteAllItems(m_hAccountList);
for (UT_uint32 i = 0; i < pManager->getAccounts().size(); i++)
{
AccountHandler* pAccount = pManager->getAccounts()[i];
UT_continue_if_fail(pAccount);
UT_Win32LocaleString sAccountText = AP_Win32App::s_fromUTF8ToWinLocale(pAccount->getDescription().utf8_str());
UT_Win32LocaleString sAccountTypeText = AP_Win32App::s_fromUTF8ToWinLocale(pAccount->getDisplayType().utf8_str());
// insert a new account record
LVITEMW lviAccount;
lviAccount.mask = LVIF_STATE | LVIF_IMAGE | LVIF_PARAM;
lviAccount.state = 1;
lviAccount.iItem = i;
lviAccount.iSubItem = 0;
lviAccount.lParam = (LPARAM)pAccount;
SendMessageW(m_hAccountList, LVM_INSERTITEMW, 0, (LPARAM) &lviAccount);
ListView_SetCheckState(m_hAccountList, i, pAccount->isOnline());
lviAccount.iSubItem=1;
lviAccount.pszText= const_cast<LPWSTR>(sAccountText.c_str());
SendMessageW(m_hAccountList, LVM_SETITEMTEXTW, i, (LPARAM) &lviAccount);
lviAccount.iSubItem=2;
lviAccount.pszText= const_cast<LPWSTR>(sAccountTypeText.c_str());
SendMessageW(m_hAccountList, LVM_SETITEMTEXTW, i, (LPARAM) &lviAccount);
}
_updateSelection();
m_bPopulating = false;
}