void CGUIDialogAccessPoints::OnInitWindow()
{
  m_wasItemSelected = false;

  CGUIDialog::OnInitWindow();

  CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_ACCESS_POINTS);
  OnMessage(msgReset);

  CStdString ifaceName(m_interfaceName);
  CNetworkInterface* iface = g_application.getNetwork().GetInterfaceByName(ifaceName);
  m_aps = iface->GetAccessPoints();

  for (int i = 0; i < (int) m_aps.size(); i++)
  {
      CFileItem *item = new CFileItem(m_aps[i].getEssId());

      int q = m_aps[i].getQuality();
      if (q <= 20) item->SetThumbnailImage("ap-signal1.png");
      else if (q <= 40) item->SetThumbnailImage("ap-signal2.png");
      else if (q <= 60) item->SetThumbnailImage("ap-signal3.png");
      else if (q <= 80) item->SetThumbnailImage("ap-signal4.png");
      else if (q <= 100) item->SetThumbnailImage("ap-signal5.png");

      if (m_aps[i].getEncryptionMode() != ENC_NONE)
         item->SetIconImage("ap-lock.png");

      CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_ACCESS_POINTS, 0, 0, item);
      OnMessage(msg);
  }

  CFileItem *item = new CFileItem(g_localizeStrings.Get(1047));
  CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_ACCESS_POINTS, 0, 0, item);
  OnMessage(msg);
}
示例#2
0
void CGUIDialogAccessPoints::UpdateConnectionList()
{
  m_connectionsFileList->Clear();

  CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), ACCESS_POINT_LIST);
  OnMessage(msgReset);

  int connectedItem = 0;
  ConnectionList connections = g_application.getNetworkManager().GetConnections();

  std::string connection_name;
  for (size_t i = 0; i < connections.size(); i++)
  {
    connection_name = connections[i]->GetName();
    CFileItemPtr item(new CFileItem(connection_name));

    if (m_use_ipconfig)
    {
      if (connection_name.find(m_ipname) != std::string::npos)
        connectedItem = i;
    }
    else
    {
      if (connections[i]->GetState() == NETWORK_CONNECTION_STATE_CONNECTED)
        connectedItem = i;
    }
    if (connections[i]->GetType() == NETWORK_CONNECTION_TYPE_WIFI)
    {
      int signal, strength = connections[i]->GetStrength();
      if (strength == 0 || strength < 20)
        signal = 1;
      else if (strength == 20 || strength < 40)
        signal = 2;
      else if (strength == 40 || strength < 60)
        signal = 3;
      else if (strength == 60 || strength < 80)
        signal = 4;
      else
        signal = 5;

        if (strength <= 20) item->SetArt("thumb", "ap-signal1.png");                                                                                                                      
        else if (strength <= 40) item->SetArt("thumb", "ap-signal2.png");                                                                                                                 
        else if (strength <= 60) item->SetArt("thumb", "ap-signal3.png");                                                                                                                 
        else if (strength <= 80) item->SetArt("thumb", "ap-signal4.png");                                                                                                                 
        else if (strength <= 100) item->SetArt("thumb", "ap-signal5.png");

      item->SetProperty("signal",     signal);
      item->SetProperty("encryption", EncryptionToString(connections[i]->GetEncryption()));
    }

    item->SetProperty("type",  ConnectionTypeToString(connections[i]->GetType()));
    item->SetProperty("state", ConnectionStateToString(connections[i]->GetState()));
 
    m_connectionsFileList->Add(item);
  }

  CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), ACCESS_POINT_LIST, connectedItem, 0, m_connectionsFileList);
  OnMessage(msg);
}
void CGUIDialogPictureInfo::OnDeinitWindow(int nextWindowID)
{
  CGUIDialog::OnDeinitWindow(nextWindowID);
  CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_PICTURE_INFO);
  OnMessage(msgReset);
  m_pictureInfo->Clear();
  m_currentPicture.Empty();
}
示例#4
0
void CGUIDialogTextViewer::OnDeinitWindow(int nextWindowID)
{
  CGUIDialog::OnDeinitWindow(nextWindowID);

  // reset text area
  CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_TEXTAREA);
  OnMessage(msgReset);

  // reset heading
  SET_CONTROL_LABEL(CONTROL_HEADING, "");
}
void CGUIDialogBoxeeOTAfavouriteShows::OnInitWindow()
{
  CGUIDialog::OnInitWindow();

  if(m_favoriteShowsSuggestions.IsEmpty())
  {
    if(!GetFavoriteShowsFromServer())
    {
      return;
    }
  }

  CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), FAVOURITE_SUGGESTIONS_CONTROL_LIST);
  OnMessage(msgReset);

  CGUIMessage msgBind(GUI_MSG_LABEL_BIND, GetID(), FAVOURITE_SUGGESTIONS_CONTROL_LIST, 0, 0, &m_favoriteShowsSuggestions);
  OnMessage(msgBind);
}
示例#6
0
void CGUIDialogPictureInfo::UpdatePictureInfo()
{
  // add stuff from the current slide to the list
  CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_PICTURE_INFO);
  OnMessage(msgReset);
  m_pictureInfo->Clear();
  for (int info = SLIDE_INFO_START; info <= SLIDE_INFO_END; ++info)
  {
    CStdString picInfo = g_infoManager.GetLabel(info);
    if (!picInfo.IsEmpty())
    {
      CFileItemPtr item(new CFileItem(g_localizeStrings.Get(SLIDE_STRING_BASE + info)));
      item->SetLabel2(picInfo);
      m_pictureInfo->Add(item);
      CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_PICTURE_INFO, 0, 0, item);
      OnMessage(msg);
    }
  }
}
示例#7
0
void CGUIWindowFullScreen::FillInTVGroups()
{
  CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_GROUP_CHOOSER);
  g_windowManager.SendMessage(msgReset);

  const CPVRChannelGroups *groups = CPVRManager::GetChannelGroups()->Get(CPVRManager::GetClients()->IsPlayingRadio());

  int iGroup        = 0;
  int iCurrentGroup = 0;
  const CPVRChannelGroup *currentGroup = CPVRManager::Get()->GetPlayingGroup(false);
  for (int i = 0; i < (int) groups->size(); ++i)
  {
    if (*groups->at(i) == *currentGroup)
      iCurrentGroup = iGroup;

    CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_GROUP_CHOOSER, iGroup++);
    msg.SetLabel(groups->at(i)->GroupName());
    g_windowManager.SendMessage(msg);
  }
  CGUIMessage msgSel(GUI_MSG_ITEM_SELECT, GetID(), CONTROL_GROUP_CHOOSER, iCurrentGroup);
  g_windowManager.SendMessage(msgSel);
}
示例#8
0
void CGUIDialogAccessPoints::OnInitWindow()
{
  m_wasItemSelected = false;

  CGUIDialog::OnInitWindow();

  CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_ACCESS_POINTS);
  OnMessage(msgReset);

  m_accessPoints->Clear();

  std::string ifaceName(m_interfaceName);
  CNetworkInterface* iface = CServiceBroker::GetNetwork().GetInterfaceByName(ifaceName);
  m_aps = iface->GetAccessPoints();

  for (int i = 0; i < (int) m_aps.size(); i++)
  {
      CFileItemPtr item(new CFileItem(m_aps[i].getEssId()));

      int q = m_aps[i].getQuality();
      if (q <= 20) item->SetArt("thumb", "ap-signal1.png");
      else if (q <= 40) item->SetArt("thumb", "ap-signal2.png");
      else if (q <= 60) item->SetArt("thumb", "ap-signal3.png");
      else if (q <= 80) item->SetArt("thumb", "ap-signal4.png");
      else if (q <= 100) item->SetArt("thumb", "ap-signal5.png");

      if (m_aps[i].getEncryptionMode() != ENC_NONE)
         item->SetIconImage("ap-lock.png");

      m_accessPoints->Add(item);
  }

  CFileItemPtr item(new CFileItem(g_localizeStrings.Get(1047)));
  m_accessPoints->Add(item);

  CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_ACCESS_POINTS, 0, 0, m_accessPoints);
  OnMessage(msg);
}
void CGUIDialogPictureInfo::UpdatePictureInfo()
{
  // add stuff from the current slide to the list
  CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_PICTURE_INFO);
  OnMessage(msgReset);
  m_pictureInfo->Clear();
  for (int info = SLIDE_INFO_START; info <= SLIDE_INFO_END; ++info)
  {
    // we don't need want to add both SLIDE_EXIF_DATE_TIME and SLIDE_EXIF_DATE
    // so we skip one without time
    if (info == SLIDE_EXIF_DATE)
      continue;

    CStdString picInfo = g_infoManager.GetLabel(info);
    if (!picInfo.IsEmpty())
    {
      CFileItemPtr item(new CFileItem(g_localizeStrings.Get(SLIDE_STRING_BASE + info)));
      item->SetLabel2(picInfo);
      m_pictureInfo->Add(item);
    }
  }
  CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_PICTURE_INFO, 0, 0, m_pictureInfo);
  OnMessage(msg);
}
示例#10
0
void CGUIDialogPictureInfo::UpdatePictureInfo()
{
  // add stuff from the current slide to the list
  CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_PICTURE_INFO);
  OnMessage(msgReset);
  m_pictureInfo->Clear();
  for (int info = SLIDESHOW_LABELS_START; info <= SLIDESHOW_LABELS_END; ++info)
  {
    // we only want to add SLIDESHOW_EXIF_DATE_TIME
    // so we skip the other date formats
    if (info == SLIDESHOW_EXIF_DATE || info == SLIDESHOW_EXIF_LONG_DATE || info == SLIDESHOW_EXIF_LONG_DATE_TIME )
      continue;

    std::string picInfo = CServiceBroker::GetGUI()->GetInfoManager().GetLabel(info);
    if (!picInfo.empty())
    {
      CFileItemPtr item(new CFileItem(g_localizeStrings.Get(SLIDESHOW_STRING_BASE + info)));
      item->SetLabel2(picInfo);
      m_pictureInfo->Add(item);
    }
  }
  CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_PICTURE_INFO, 0, 0, m_pictureInfo);
  OnMessage(msg);
}
void CGUIDialogSmartPlaylistEditor::UpdateButtons()
{
  CONTROL_ENABLE(CONTROL_OK); // always enabled since we can have no rules -> match everything (as we do with default partymode playlists)
  
  // if there's no rule available, add a dummy one the user can edit
  if (m_playlist.m_ruleCombination.m_rules.size() <= 0)
    m_playlist.m_ruleCombination.AddRule(CSmartPlaylistRule());

  // name
  if (m_mode == "partyvideo" || m_mode == "partymusic")
  {
    SET_CONTROL_LABEL2(CONTROL_NAME, g_localizeStrings.Get(16035));
    CONTROL_DISABLE(CONTROL_NAME);
  }
  else
    SET_CONTROL_LABEL2(CONTROL_NAME, m_playlist.m_playlistName);
  
  UpdateRuleControlButtons();

  CONTROL_ENABLE_ON_CONDITION(CONTROL_MATCH, m_playlist.m_ruleCombination.m_rules.size() > 1);

  int currentItem = GetSelectedItem();
  CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_RULE_LIST);
  OnMessage(msgReset);
  m_ruleLabels->Clear();
  for (unsigned int i = 0; i < m_playlist.m_ruleCombination.m_rules.size(); i++)
  {
    CFileItemPtr item(new CFileItem("", false));
    if (m_playlist.m_ruleCombination.m_rules[i]->m_field == FieldNone)
      item->SetLabel(g_localizeStrings.Get(21423));
    else
      item->SetLabel(std::static_pointer_cast<CSmartPlaylistRule>(m_playlist.m_ruleCombination.m_rules[i])->GetLocalizedRule());
    m_ruleLabels->Add(item);
  }
  CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_RULE_LIST, 0, 0, m_ruleLabels);
  OnMessage(msg);
  SendMessage(GUI_MSG_ITEM_SELECT, GetID(), CONTROL_RULE_LIST, currentItem);

  if (m_playlist.m_orderDirection != SortOrderDescending)
  {
    CONTROL_SELECT(CONTROL_ORDER_DIRECTION);
  }
  else
  {
    CONTROL_DESELECT(CONTROL_ORDER_DIRECTION);
  }

  // sort out the order fields
  std::vector< std::pair<std::string, int> > labels;
  std::vector<SortBy> orders = CSmartPlaylistRule::GetOrders(m_playlist.GetType());
  for (unsigned int i = 0; i < orders.size(); i++)
    labels.push_back(make_pair(g_localizeStrings.Get(SortUtils::GetSortLabel(orders[i])), orders[i]));
  SET_CONTROL_LABELS(CONTROL_ORDER_FIELD, m_playlist.m_orderField, &labels);

  // setup groups
  labels.clear();
  std::vector<Field> groups = CSmartPlaylistRule::GetGroups(m_playlist.GetType());
  Field currentGroup = CSmartPlaylistRule::TranslateGroup(m_playlist.GetGroup().c_str());
  for (unsigned int i = 0; i < groups.size(); i++)
    labels.push_back(make_pair(CSmartPlaylistRule::GetLocalizedGroup(groups[i]), groups[i]));
  SET_CONTROL_LABELS(CONTROL_GROUP_BY, currentGroup, &labels);

  if (m_playlist.IsGroupMixed())
    CONTROL_SELECT(CONTROL_GROUP_MIXED);
  else
    CONTROL_DESELECT(CONTROL_GROUP_MIXED);

  // disable the group controls if there's no group
  // or only one group which can't be mixed
  if (groups.empty() ||
     (groups.size() == 1 && !CSmartPlaylistRule::CanGroupMix(groups[0])))
  {
    CONTROL_DISABLE(CONTROL_GROUP_BY);
    CONTROL_DISABLE(CONTROL_GROUP_MIXED);
  }
  else
  {
    CONTROL_ENABLE(CONTROL_GROUP_BY);
    CONTROL_ENABLE_ON_CONDITION(CONTROL_GROUP_MIXED, CSmartPlaylistRule::CanGroupMix(currentGroup));
  }
}