当前位置: 首页>>代码示例>>C++>>正文


C++ CGUIDialogProgress类代码示例

本文整理汇总了C++中CGUIDialogProgress的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogProgress类的具体用法?C++ CGUIDialogProgress怎么用?C++ CGUIDialogProgress使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CGUIDialogProgress类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ShowLegal

bool CGUIWindowSettings::ShowLegal()
{
  if (m_legalString.IsEmpty())
  {
    CGUIDialogProgress* progress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
    if (progress)
    {
      progress->StartModal();
      progress->Progress();
    }

    // verify the username is available
    CStdString strUrl = BOXEE::BXConfiguration::GetInstance().GetStringParam("Boxee.Legal","http://app.boxee.tv/api/getlegal?page=legal");
    BOXEE::BXCurl curl;

    m_legalString = curl.HttpGetString(strUrl, false);

    if (progress)
    {
      progress->Close();
    }

    if (m_legalString.IsEmpty())
    {
      CGUIDialogOK2::ShowAndGetInput(g_localizeStrings.Get(53701), g_localizeStrings.Get(53431));
      return true;
    }
  }

  CGUIDialogBoxeeMessageScroll::ShowAndGetInput(g_localizeStrings.Get(53441), m_legalString);
  return true;
}
开发者ID:Kr0nZ,项目名称:boxee,代码行数:32,代码来源:GUIWindowSettings.cpp

示例2: SaveList

void CGUIDialogPVRChannelManager::SaveList(void)
{
  if (!m_bContainsChanges)
   return;

  /* display the progress dialog */
  CGUIDialogProgress* pDlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
  pDlgProgress->SetHeading(190);
  pDlgProgress->SetLine(0, "");
  pDlgProgress->SetLine(1, 328);
  pDlgProgress->SetLine(2, "");
  pDlgProgress->StartModal();
  pDlgProgress->Progress();
  pDlgProgress->SetPercentage(0);

  /* persist all channels */
  unsigned int iNextChannelNumber(0);
  CPVRChannelGroupPtr group = g_PVRChannelGroups->GetGroupAll(m_bIsRadio);
  if (!group)
    return;
  for (int iListPtr = 0; iListPtr < m_channelItems->Size(); iListPtr++)
  {
    CFileItemPtr pItem = m_channelItems->Get(iListPtr);
    PersistChannel(pItem, group, &iNextChannelNumber);

    pDlgProgress->SetPercentage(iListPtr * 100 / m_channelItems->Size());
  }

  group->SortAndRenumber();
  group->Persist();
  m_bContainsChanges = false;
  SetItemsUnchanged();
  pDlgProgress->Close();
}
开发者ID:devilstrike,项目名称:boxeebox-xbmc,代码行数:34,代码来源:GUIDialogPVRChannelManager.cpp

示例3: url

bool CUPnPAvDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items)
{
  CURI url(strPath);

  m_cacheDirectory = DIR_CACHE_ALWAYS;

  if(url.GetProtocol() != "upnp")
  {
     CLog::Log(LOGERROR, "CUPnPAvDirectory::%s - invalid protocol [%s]", __func__, url.GetProtocol().c_str());
     return false;
  }

  CBrowserService* pBrowser = g_application.GetBrowserService();

  if( strPath == "upnp://" && pBrowser )
  {
    pBrowser->GetShare( CBrowserService::UPNP_SHARE, items );
    return true;
  }

  // If we have the items in the cache, return them
  if (g_directoryCache.GetDirectory(strPath, items))
  {
    return true;
  }

  if(strPath == "upnp://all")
  {
     bool bSuccess = ScanUPnPShares(items);
     if(!bSuccess)
     {
       IHalServices& client = CHalServicesFactory::GetInstance();
       client.DjmountRestart();

       CLog::Log(LOGWARNING, "CUPnPAvDirectory::%s - failed to scan UPnP shares, retrying...", __func__);

       CGUIDialogProgress* progress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
       if (progress)
       {
         CStdString strId;
         strId.Format("%d-upnp-scan-retry", CThread::GetCurrentThreadId());
         progress->StartModal(strId);
         progress->Progress();
       }

       // hopefully djmount will be able to find all shares
       Sleep(5000);

       bSuccess = ScanUPnPShares(items);

       progress->Close();
     }

     return bSuccess;
  }

  return ReadDir(url, items);
}
开发者ID:Kr0nZ,项目名称:boxee,代码行数:58,代码来源:UPnPAvDirectory.cpp

示例4:

 ~progress_info()
 {
   if (shown && g_application.IsCurrentThread())
   {
     // close progress dialog
     CGUIDialogProgress* dlg = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
     if (dlg)
       dlg->Close();
   }
 }
开发者ID:AndyPeterman,项目名称:mrmc,代码行数:10,代码来源:RarManager.cpp

示例5:

 ~progress_info()
 {
   if (shown)
   {
     // close progress dialog
     CGUIDialogProgress* dlg = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
     if (dlg)
       dlg->Close();
   }
 }
开发者ID:7orlum,项目名称:xbmc,代码行数:10,代码来源:RarManager.cpp

示例6: WaitForNetwork

bool CGUIMediaWindow::WaitForNetwork() const
{
  if (g_application.getNetwork().IsAvailable())
    return true;

  CGUIDialogProgress *progress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
  if (!progress)
    return true;

  CURL url(m_vecItems->GetPath());
  progress->SetHeading(1040); // Loading Directory
  progress->SetLine(1, url.GetWithoutUserDetails());
  progress->ShowProgressBar(false);
  progress->StartModal();
  while (!g_application.getNetwork().IsAvailable())
  {
    progress->Progress();
    if (progress->IsCanceled())
    {
      progress->Close();
      return false;
    }
  }
  progress->Close();
  return true;
}
开发者ID:SirTomselon,项目名称:xbmc,代码行数:26,代码来源:GUIMediaWindow.cpp

示例7: progress

 /*! \brief Progress callback from rar manager.
  \return true to continue processing, false to cancel.
  */
 bool progress(int progress, const char *text)
 {
   bool cont(true);
   if ((shown || showTime.IsTimePast()) && g_application.IsCurrentThread())
   {
     // grab the busy and show it
     CGUIDialogProgress* dlg = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
     if (dlg)
     {
       if (!shown)
       {
         dlg->SetHeading(CVariant{heading});
         dlg->Open();
       }
       if (progress >= 0)
       {
         dlg->ShowProgressBar(true);
         dlg->SetPercentage(progress);
       }
       if (text)
         dlg->SetLine(1, CVariant{text});
       cont = !dlg->IsCanceled();
       shown = true;
       // tell render loop to spin
       dlg->Progress();
     }
   }
   return cont;
 };
开发者ID:AndyPeterman,项目名称:mrmc,代码行数:32,代码来源:RarManager.cpp

示例8: dcguard

    void DialogProgress::update(int percent, const String& line1, 
                                const String& line2,
                                const String& line3)
    {
      DelayedCallGuard dcguard(languageHook);
      CGUIDialogProgress* pDialog = dlg;

      if (pDialog == NULL)
        throw WindowException("Dialog not created.");

      if (percent >= 0 && percent <= 100)
      {
        pDialog->SetPercentage(percent);
        pDialog->ShowProgressBar(true);
      }
      else
      {
        pDialog->ShowProgressBar(false);
      }

      if (!line1.empty())
        pDialog->SetLine(0, CVariant{line1});
      if (!line2.empty())
        pDialog->SetLine(1, CVariant{line2});
      if (!line3.empty())
        pDialog->SetLine(2, CVariant{line3});
    }
开发者ID:KeTao,项目名称:kodi-cmake,代码行数:27,代码来源:Dialog.cpp

示例9: OnInitWindow

void CGUIWindowPVRBase::OnInitWindow(void)
{
  if (!g_PVRManager.IsStarted() || !g_PVRClients->HasConnectedClients())
  {
    // wait until the PVR manager has been started
    CGUIDialogProgress* dialog = static_cast<CGUIDialogProgress*>(g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS));
    if (dialog)
    {
      dialog->SetHeading(CVariant{19235});
      dialog->SetText(CVariant{19045});
      dialog->ShowProgressBar(false);
      dialog->Open();

      // do not block the gfx context while waiting
      CSingleExit exit(g_graphicsContext);

      CEvent event(true);
      while(!event.WaitMSec(1))
      {
        if (g_PVRManager.IsStarted() && g_PVRClients->HasConnectedClients())
          event.Set();

        if (dialog->IsCanceled())
        {
          // return to previous window if canceled
          dialog->Close();
          g_windowManager.PreviousWindow();
          return;
        }

        g_windowManager.ProcessRenderLoop(false);
      }

      dialog->Close();
    }
  }

  {
    // set window group to playing group
    CPVRChannelGroupPtr group = g_PVRManager.GetPlayingGroup(m_bRadio);
    CSingleLock lock(m_critSection);
    if (m_group != group)
      m_viewControl.SetSelectedItem(0);
    m_group = group;
  }
  SetProperty("IsRadio", m_bRadio ? "true" : "");

  m_vecItems->SetPath(GetDirectoryPath());

  CGUIMediaWindow::OnInitWindow();

  // mark item as selected by channel path
  m_viewControl.SetSelectedItem(GetSelectedItemPath(m_bRadio));
}
开发者ID:MrMC,项目名称:mrmc,代码行数:54,代码来源:GUIWindowPVRBase.cpp

示例10: GetName

void CGUIWindowPVRSearch::UpdateData(bool bUpdateSelectedFile /* = true */)
{
  CLog::Log(LOGDEBUG, "CGUIWindowPVRSearch - %s - update window '%s'. set view to %d", __FUNCTION__, GetName(), m_iControlList);
  m_bUpdateRequired = false;

  /* lock the graphics context while updating */
  CSingleLock graphicsLock(g_graphicsContext);

  m_iSelected = m_parent->m_viewControl.GetSelectedItem();
  m_parent->m_viewControl.Clear();
  m_parent->m_vecItems->Clear();
  m_parent->m_viewControl.SetCurrentView(m_iControlList);

  if (m_bSearchConfirmed)
  {
    CGUIDialogProgress* dlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
    if (dlgProgress)
    {
      dlgProgress->SetHeading(194);
      dlgProgress->SetLine(0, m_searchfilter.m_strSearchTerm);
      dlgProgress->SetLine(1, "");
      dlgProgress->SetLine(2, "");
      dlgProgress->StartModal();
      dlgProgress->Progress();
    }

    // TODO get this from the selected channel group
    g_EpgContainer.GetEPGSearch(*m_parent->m_vecItems, m_searchfilter);
    if (dlgProgress)
      dlgProgress->Close();

    if (m_parent->m_vecItems->Size() == 0)
    {
      CGUIDialogOK::ShowAndGetInput(194, 284, 0, 0);
      m_bSearchConfirmed = false;
    }
  }

  if (m_parent->m_vecItems->Size() == 0)
  {
    CFileItemPtr item;
    item.reset(new CFileItem("pvr://guide/searchresults/empty.epg", false));
    item->SetLabel(g_localizeStrings.Get(19027));
    item->SetLabelPreformated(true);
    m_parent->m_vecItems->Add(item);
  }
  else
  {
    m_parent->m_vecItems->Sort(m_iSortMethod, m_iSortOrder, m_iSortAttributes);
  }

  m_parent->m_viewControl.SetItems(*m_parent->m_vecItems);

  if (bUpdateSelectedFile)
    m_parent->m_viewControl.SetSelectedItem(m_iSelected);

  m_parent->SetLabel(CONTROL_LABELHEADER, g_localizeStrings.Get(283));
  m_parent->SetLabel(CONTROL_LABELGROUP, "");
}
开发者ID:Anankin,项目名称:xbmc,代码行数:59,代码来源:GUIWindowPVRSearch.cpp

示例11: SaveList

void CGUIDialogPVRChannelManager::SaveList(void)
{
    if (!m_bContainsChanges)
        return;

    /* display the progress dialog */
    CGUIDialogProgress* pDlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
    pDlgProgress->SetHeading(CVariant{190});
    pDlgProgress->SetLine(0, CVariant{""});
    pDlgProgress->SetLine(1, CVariant{328});
    pDlgProgress->SetLine(2, CVariant{""});
    pDlgProgress->StartModal();
    pDlgProgress->Progress();
    pDlgProgress->SetPercentage(0);

    /* persist all channels */
    unsigned int iNextChannelNumber(0);
    CPVRChannelGroupPtr group = g_PVRChannelGroups->GetGroupAll(m_bIsRadio);
    if (!group)
        return;

    for (int iListPtr = 0; iListPtr < m_channelItems->Size(); iListPtr++)
    {
        CFileItemPtr pItem = m_channelItems->Get(iListPtr);

        if (!pItem->HasPVRChannelInfoTag())
            continue;

        if (pItem->GetProperty("SupportsSettings").asBoolean())
            RenameChannel(pItem);

        PersistChannel(pItem, group, &iNextChannelNumber);

        pDlgProgress->SetPercentage(iListPtr * 100 / m_channelItems->Size());
    }

    group->SortAndRenumber();
    group->Persist();
    m_bContainsChanges = false;
    SetItemsUnchanged();
    pDlgProgress->Close();
}
开发者ID:wm3ndez,项目名称:xbmc,代码行数:42,代码来源:GUIDialogPVRChannelManager.cpp

示例12: item

void CGUIWindowPVRSearch::OnPrepareFileItems(CFileItemList &items)
{
  items.Clear();

  CFileItemPtr item(new CFileItem("pvr://guide/searchresults/search/", true));
  item->SetLabel(g_localizeStrings.Get(19140));
  item->SetLabelPreformated(true);
  item->SetSpecialSort(SortSpecialOnTop);
  items.Add(item);

  if (m_bSearchConfirmed)
  {
    CGUIDialogProgress* dlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
    if (dlgProgress)
    {
      dlgProgress->SetHeading(194);
      dlgProgress->SetText(CVariant(m_searchfilter.m_strSearchTerm));
      dlgProgress->StartModal();
      dlgProgress->Progress();
    }

    // TODO should we limit the find similar search to the selected group?
    g_EpgContainer.GetEPGSearch(items, m_searchfilter);

    if (dlgProgress)
      dlgProgress->Close();

    if (items.IsEmpty())
    {
      CGUIDialogOK::ShowAndGetInput(194, 284, 0, 0);
      m_bSearchConfirmed = false;
    }
  }
}
开发者ID:JamesLinus,项目名称:xbmc,代码行数:34,代码来源:GUIWindowPVRSearch.cpp

示例13: GetUserConfiguration

bool CGUIWindowBoxeeWizardNetwork::SaveConfiguration()
{
   if (!NetworkConfigurationChanged())
      return true;
      
   bool result = false;
   CStdString currentEssId;
   CStdString currentKey;
   EncMode    currentEnc;
   CStdString currentInterfaceName;
   
   GetUserConfiguration(currentInterfaceName, currentEssId, currentKey, currentEnc);
   
   CGUIDialogProgress* pDlgProgress = (CGUIDialogProgress*)m_gWindowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
   pDlgProgress->SetHeading("");
   pDlgProgress->SetLine(0, "Applying network configuration...");
   pDlgProgress->SetLine(1, "");
   pDlgProgress->SetLine(2, "");
   pDlgProgress->StartModal();
   pDlgProgress->Progress();
        
   CStdString empty;
   NetworkAssignment assignment;
   CNetworkInterface* interface; 
   for (unsigned int i = 0; i < m_interfaces.size(); i++)
   {
      interface = m_interfaces[i];
      if (interface->GetName() == currentInterfaceName)
      {
         assignment = NETWORK_DHCP;
         interface->SetSettings(assignment, empty, empty, empty, currentEssId, currentKey, currentEnc);
      }
      else
      { 
         // if we have a different interfaces, we need to take them down
         assignment = NETWORK_DISABLED;
         EncMode enc = ENC_NONE;
         interface->SetSettings(assignment, empty, empty, empty, empty, empty, enc);
      }
   }
   
   pDlgProgress->Close();
     
   if (!interface->IsConnected())
      CGUIDialogOK::ShowAndGetInput(0, 50001, 50002, 0);
   else if (!g_application.IsConnectedToNet())
      CGUIDialogOK::ShowAndGetInput(0, 50003, 50004, 50002);
   else
      result = true;
          
   ResetCurrentNetworkState();
   
   return result;
}
开发者ID:Kr0nZ,项目名称:boxee,代码行数:54,代码来源:GUIWindowBoxeeWizardNetwork.cpp

示例14: CleanLibraryModal

void CMusicLibraryQueue::CleanLibraryModal()
{
  // We can't perform a modal library cleaning if other jobs are running
  if (IsRunning())
    return;

  CGUIDialogProgress* progress = nullptr;
  progress = g_windowManager.GetWindow<CGUIDialogProgress>(WINDOW_DIALOG_PROGRESS);
  if (progress)
  {
    progress->SetHeading(CVariant{ 700 });
    progress->SetPercentage(0);
    progress->Open();
    progress->ShowProgressBar(true);
  }

  m_modal = true;
  m_cleaning = true;
  CMusicLibraryCleaningJob cleaningJob(progress);
  cleaningJob.DoWork();
  m_cleaning = false;
  m_modal = false;
  Refresh();
}
开发者ID:Montellese,项目名称:xbmc,代码行数:24,代码来源:MusicLibraryQueue.cpp

示例15: OnSearch

/// \brief Search the current directory for a string got from the virtual keyboard
void CGUIDialogVideoInfo::OnSearch(CStdString& strSearch)
{
  CGUIDialogProgress *progress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
  if (progress)
  {
    progress->SetHeading(194);
    progress->SetLine(0, strSearch);
    progress->SetLine(1, "");
    progress->SetLine(2, "");
    progress->StartModal();
    progress->Progress();
  }
  CFileItemList items;
  DoSearch(strSearch, items);

  if (progress)
    progress->Close();

  if (items.Size())
  {
    CGUIDialogSelect* pDlgSelect = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
    pDlgSelect->Reset();
    pDlgSelect->SetHeading(283);

    for (int i = 0; i < (int)items.Size(); i++)
    {
      CFileItemPtr pItem = items[i];
      pDlgSelect->Add(pItem->GetLabel());
    }

    pDlgSelect->DoModal();

    int iItem = pDlgSelect->GetSelectedLabel();
    if (iItem < 0)
      return;

    CFileItem* pSelItem = new CFileItem(*items[iItem]);

    OnSearchItemFound(pSelItem);

    delete pSelItem;
  }
  else
  {
    CGUIDialogOK::ShowAndGetInput(194, 284, 0, 0);
  }
}
开发者ID:crckmc,项目名称:xbmc-boblight,代码行数:48,代码来源:GUIDialogVideoInfo.cpp


注:本文中的CGUIDialogProgress类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。