コード例 #1
0
ファイル: webfeedentry.cpp プロジェクト: prestocore/browser
OP_STATUS WebFeedEntry::GetEntryIdURL(OpString& res)
{
	RETURN_IF_ERROR(GetFeed()->GetFeedIdURL(res));
	RETURN_IF_ERROR(res.AppendFormat(UNI_L("-%08x"), GetId()));

	return OpStatus::OK;
}
コード例 #2
0
void CFeedIcoItemListCtrl::UpdateMenuState(CTitleMenu	& menuRSS)
{
	if( !CGlobalVariable::IsRunning() )
	{
		return;
	}

	//设置菜单状态
	int iSelectedItems = GetSelectedCount();
	if(iSelectedItems && iSelectedItems == 1)
	{
		int nIndex = GetCurrSelectIndex();
		if ( nIndex >= 0 )
		{
			if ( CRssFeed* pFeed = GetFeed(nIndex) )
			{
				//删除不用的menu项
				menuRSS.DeleteMenu(MP_OPEN,MF_STRING);
				menuRSS.DeleteMenu(MP_RESUME,MF_STRING);

				//下载所有||暂停
				if (pFeed->ExistDownloadingItem())
				{
					menuRSS.EnableMenuItem(MP_PAUSE, MF_ENABLED);
				}

				if (pFeed->ExistUnloadItem())
				{
					menuRSS.EnableMenuItem(MP_DOWNLOAD_ALL, MF_ENABLED);
				}

				menuRSS.EnableMenuItem(MP_CANCEL, MF_ENABLED);
				menuRSS.EnableMenuItem(MP_REFRESH, MF_ENABLED);
				menuRSS.EnableMenuItem(MP_OPTIONS, MF_ENABLED);
				menuRSS.EnableMenuItem(MP_OPENFOLDER, MF_ENABLED);
			}
		}
	}
	else//空白处右键
	{
		menuRSS.DeleteMenu(MP_OPEN,MF_STRING);
		menuRSS.DeleteMenu(MP_OPENFOLDER,MF_STRING);
		menuRSS.DeleteMenu(MP_DOWNLOAD_ALL,MF_STRING);
		menuRSS.DeleteMenu(MP_RESUME,MF_STRING);
		menuRSS.DeleteMenu(MP_PAUSE,MF_STRING);
		menuRSS.DeleteMenu(MP_CANCEL,MF_STRING);
		menuRSS.DeleteMenu(MP_OPTIONS,MF_STRING);
		//menuRSS.DeleteMenu(MF_SEPARATOR,MF_STRING);

		if ( this->GetItemCount() > 0 )
		{
			menuRSS.EnableMenuItem(MP_REFRESH, MF_ENABLED);
		}
		else
		{
			menuRSS.DeleteMenu(MP_REFRESH,MF_STRING);
		}
	}
}
コード例 #3
0
// 更新toolbar按钮状态
void CFeedIcoItemListCtrl::UpdateToolBarState(CToolBarCtrl & toolbar)
{
	if( !CGlobalVariable::IsRunning() )
	{
		return;
	}

	toolbar.EnableButton(MP_PAUSE, FALSE);
	toolbar.EnableButton(MP_RESUME, FALSE);
	toolbar.EnableButton(MP_STOP, FALSE);
	toolbar.EnableButton(MP_OPENFOLDER, FALSE);
	toolbar.EnableButton(MP_CANCEL, FALSE);

	int iSelectedItems = GetSelectedCount();
	if(iSelectedItems && iSelectedItems == 1)
	{
		int nIndex = GetCurrSelectIndex();
		if ( nIndex >= 0 )
		{
			if ( CRssFeed* pFeed = GetFeed(nIndex) )
			{
				toolbar.EnableButton(MP_OPENFOLDER, TRUE);

				//下载所有||暂停
				if (pFeed->ExistDownloadingItem())
				{
					toolbar.EnableButton(MP_PAUSE, TRUE);
				}

				if (pFeed->ExistCanResumeItem())
				{
					toolbar.EnableButton(MP_RESUME, TRUE);
				}

				toolbar.EnableButton(MP_CANCEL, TRUE);
			}
		}
	}
}