Ejemplo n.º 1
0
void GMSourceView::init() {
  loadSettings("window");
  clear();
  listsources();


  FXString key = getApp()->reg().readStringEntry("window","source-list-current","");
  if (!key.empty()){
    FXTreeItem * item = sourcelist->getFirstItem();
    while(item){
      GMSource * src = static_cast<GMSource*>(item->getData());
      if (src->settingKey()==key) {
        sourcelist->setCurrentItem(item);
        break;
        }
      item=item->getBelow();
      }
    }

  if (sourcelist->getCurrentItem()==nullptr && sourcelist->getFirstItem())
    sourcelist->setCurrentItem(sourcelist->getFirstItem());

  source=static_cast<GMSource*>(sourcelist->getItemData(sourcelist->getCurrentItem()));
  GMPlayerManager::instance()->getTrackView()->init(source);
  }
Ejemplo n.º 2
0
void GMSourceView::updateSource(GMSource * src){
  FXTreeItem * item = sourcelist->getFirstItem();
  while(item) {
    if (item->getData()==src) {
      item->setText(tr(src->getName().text()));
      break;
      }
    item=item->getBelow();
    }
  resort();
  }