void mgrui::append2_skin_ui(ZListBox *target, QList<struct skinObj> objList)
{
	struct skinObj *obj = objList.first();
	ZSettingItem *pItem = NULL;
	QPixmap pm;
	while(obj != NULL)
	{	
		pItem = new ZSettingItem(target);//, QString("%I%M") );
		pItem->appendSubItem(1, obj->skinName, SETTINGITEM_REGION_A );
		if(obj->isInPH == true)
			pItem->appendSubItem(1, obj->skinAuthor+ctr(",Phone,")+obj->skinDir,false, SETTINGITEM_REGION_B );
		else
			pItem->appendSubItem(1, obj->skinAuthor+ctr(",MMCA2,")+obj->skinDir, false, SETTINGITEM_REGION_B );
	
		if( QFile::exists( obj->skinWall ) )
			pm = QPixmap( obj->skinWall );
		else
			pm = QPixmap( QString("%1/img/skin.png").arg(appdir) );
			
		QImage img = pm.convertToImage();
		img = img.smoothScale(48, 48);
		pm.convertFromImage(img);
		pItem->setPixmap(0, pm);	
		
		target->insertItem(pItem);
		
		obj = objList.next();
	}
}
Example #2
0
void UISearchPage::menu_Download()
{
        QList<QListViewItem> list = m_view->selectedItems();
        QListViewItem * item;
        QString path;

        for ( item = list.first(); item != 0; item = list.next() )
        {
                path = item->text( UIPageView::Col_Path );

                if ( path.isEmpty() )
                        return ;

                IOMessage * io = new IOMessage( 0 );
                io->setMessageType( IONapsterCodes::DownloadRequest );
                io->insert( "nick",     item->text( UIPageView::Col_Nick ) );
                io->insert( "path",     item->text( UIPageView::Col_Path ) );
                io->insert( "name",     item->text( UIPageView::Col_Name ) );
                io->insert( "speed",    item->text( UIPageView::Col_Link ) );
                io->insert( "bitrate",  item->text( UIPageView::Col_Bitr ) );
                io->insert( "host",     item->text( UIPageView::Col_Host ) );
                io->insert( "time",     item->text( UIPageView::Col_Time ) );
                io->insert( "size",     item->text( UIPageView::Col_Size ) );
                io->insert( "freq",     item->text( UIPageView::Col_Freq ) );
                emit sendIO( io );

                delete io;
        }
}
Example #3
0
void UserTabBar::layoutTabs()
{
    QTabBar::layoutTabs();
#if QT_VERSION < 300
    QList<QTab> *tList = tabList();
    for (QTab *t = tList->first(); t; t = tList->next()){
        t->r.setHeight(height());
    }
#endif
}
Example #4
0
bool UserTabBar::isBold(UserWnd *wnd)
{
    QList<QTab> *tList = tabList();
    for (QTab *t = tList->first(); t; t = tList->next()){
        UserTab *tab = static_cast<UserTab*>(t);
        if (tab->wnd() == wnd)
            return tab->isBold();
    }
    return false;
}
Example #5
0
void UserTabBar::raiseTab(unsigned id)
{
    QList<QTab> *tList = tabList();
    for (QTab *t = tList->first(); t; t = tList->next()){
        UserTab *tab = static_cast<UserTab*>(t);
        if (tab->wnd()->id() == id){
            setCurrentTab(tab);
            return;
        }
    }
}
Example #6
0
UserWnd *UserTabBar::wnd(unsigned id)
{
    layoutTabs();
    QList<QTab> *tList = tabList();
    for (QTab *t = tList->first(); t; t = tList->next()){
        UserTab *tab = static_cast<UserTab*>(t);
        if (tab->wnd()->id() == id)
            return tab->wnd();
    }
    return NULL;
}
Example #7
0
void UserTabBar::setBold(unsigned id, bool bBold)
{
    QList<QTab> *tList = tabList();
    for (QTab *t = tList->first(); t; t = tList->next()){
        UserTab *tab = static_cast<UserTab*>(t);
        if (tab->wnd()->id() == id){
            if (tab->setBold(bBold))
                repaint();
            break;
        }
    }
}
Example #8
0
void UserTabBar::changeTab(unsigned id)
{
    layoutTabs();
    QList<QTab> *tList = tabList();
    for (QTab *t = tList->first(); t; t = tList->next()){
        UserTab *tab = static_cast<UserTab*>(t);
        if (tab->wnd()->id() == id){
            tab->setText(tab->wnd()->getName());
            break;
        }
    }
}
Example #9
0
void UserTabBar::removeTab(unsigned id)
{
    layoutTabs();
    QList<QTab> *tList = tabList();
    for (QTab *t = tList->first(); t; t = tList->next()){
        UserTab *tab = static_cast<UserTab*>(t);
        if (tab == NULL)
            continue;
        if (tab->wnd()->id() == id){
            QTabBar::removeTab(tab);
            break;
        }
    }
}
Example #10
0
void TagFileParser::addIncludes()
{
  TagFileInfo *tfi = m_tagFileFiles.first();
  while (tfi)
  {
    //printf("tag file tagName=%s path=%s name=%s\n",m_tagName.data(),tfi->path.data(),tfi->name.data());
    FileName *fn = Doxygen::inputNameDict->find(tfi->name);
    if (fn)
    {
      //printf("found\n");
      FileNameIterator fni(*fn);
      FileDef *fd;
      for (;(fd=fni.current());++fni)
      {
        //printf("input file path=%s name=%s\n",fd->getPath().data(),fd->name().data());
        if (fd->getPath()==QCString(m_tagName+":"+tfi->path))
        {
          //printf("found\n");
          QListIterator<TagIncludeInfo> mii(tfi->includes);
          TagIncludeInfo *ii;
          for (;(ii=mii.current());++mii)
          {
            //printf("ii->name=`%s'\n",ii->name.data());
            FileName *ifn = Doxygen::inputNameDict->find(ii->name);
            ASSERT(ifn!=0);
            if (ifn)
            {
              FileNameIterator ifni(*ifn);
              FileDef *ifd;
              for (;(ifd=ifni.current());++ifni)
              {
                //printf("ifd->getOutputFileBase()=%s ii->id=%s\n",
                //        ifd->getOutputFileBase().data(),ii->id.data());
                if (ifd->getOutputFileBase()==QCString(ii->id))
                {
                  fd->addIncludeDependency(ifd,ii->text,ii->isLocal,ii->isImported,FALSE);
                }
              }
            }
          }
        }
      } 
    }
    tfi = m_tagFileFiles.next();
  }
}
Example #11
0
/*! Injects the info gathered by the XML parser into the Entry tree.
 *  This tree contains the information extracted from the input in a 
 *  "unrelated" form.
 */
void TagFileParser::buildLists(Entry *root)
{
  // build class list
  TagClassInfo *tci = m_tagFileClasses.first();
  while (tci)
  {
    Entry *ce = new Entry;
    ce->section = Entry::CLASS_SEC;
    switch (tci->kind)
    {
      case TagClassInfo::Class:     break;
      case TagClassInfo::Struct:    ce->spec = Entry::Struct;    break;
      case TagClassInfo::Union:     ce->spec = Entry::Union;     break;
      case TagClassInfo::Interface: ce->spec = Entry::Interface; break;
      case TagClassInfo::Exception: ce->spec = Entry::Exception; break;
      case TagClassInfo::Protocol:  ce->spec = Entry::Protocol;  break;
      case TagClassInfo::Category:  ce->spec = Entry::Category;  break;
    }
    ce->name     = tci->name;
    if (tci->kind==TagClassInfo::Protocol) 
    {
      ce->name+="-p";
    }
    addDocAnchors(ce,tci->docAnchors);
    TagInfo *ti  = new TagInfo;
    ti->tagName  = m_tagName;
    ti->fileName = tci->filename;
    ce->tagInfo = ti;
    ce->lang = tci->isObjC ? SrcLangExt_ObjC : SrcLangExt_Unknown;
    // transfer base class list
    if (tci->bases)
    {
      delete ce->extends;
      ce->extends = tci->bases; tci->bases = 0;
    }
    if (tci->templateArguments)
    {
      if (ce->tArgLists==0) 
      {
        ce->tArgLists = new QList<ArgumentList>;
        ce->tArgLists->setAutoDelete(TRUE);
      }
      ArgumentList *al = new ArgumentList;
      ce->tArgLists->append(al);
      
      QListIterator<QCString> sli(*tci->templateArguments);
      QCString *argName;
      for (;(argName=sli.current());++sli)
      {
        Argument *a = new Argument;
        a->type = "class";
        a->name = *argName;
        al->append(a);
      }
    }

    buildMemberList(ce,tci->members);
    root->addSubEntry(ce);
    tci = m_tagFileClasses.next();
  }

  // build file list
  TagFileInfo *tfi = m_tagFileFiles.first();
  while (tfi)
  {
    Entry *fe = new Entry;
    fe->section = guessSection(tfi->name);
    fe->name     = tfi->name;
    addDocAnchors(fe,tfi->docAnchors);
    TagInfo *ti  = new TagInfo;
    ti->tagName  = m_tagName;
    ti->fileName = tfi->filename;
    fe->tagInfo  = ti;
    
    QCString fullName = m_tagName+":"+tfi->path+stripPath(tfi->name);
    fe->fileName = fullName;
    //printf("new FileDef() filename=%s\n",tfi->filename.data());
    FileDef *fd = new FileDef(m_tagName+":"+tfi->path,
                              tfi->name,m_tagName,
                              tfi->filename
                             );
    FileName *mn;
    if ((mn=Doxygen::inputNameDict->find(tfi->name)))
    {
      mn->append(fd);
    }
    else
    {
      mn = new FileName(fullName,tfi->name);
      mn->append(fd);
      Doxygen::inputNameList->inSort(mn);
      Doxygen::inputNameDict->insert(tfi->name,mn);
    }
    buildMemberList(fe,tfi->members);
    root->addSubEntry(fe);
    tfi = m_tagFileFiles.next();
  }

  // build namespace list
  TagNamespaceInfo *tni = m_tagFileNamespaces.first();
  while (tni)
  {
    Entry *ne    = new Entry;
    ne->section  = Entry::NAMESPACE_SEC;
    ne->name     = tni->name;
    addDocAnchors(ne,tni->docAnchors);
    TagInfo *ti  = new TagInfo;
    ti->tagName  = m_tagName;
    ti->fileName = tni->filename;
    ne->tagInfo  = ti;

    buildMemberList(ne,tni->members);
    root->addSubEntry(ne);
    tni = m_tagFileNamespaces.next();
  }

  // build package list
  TagPackageInfo *tpgi = m_tagFilePackages.first();
  while (tpgi)
  {
    Entry *pe    = new Entry;
    pe->section  = Entry::PACKAGE_SEC;
    pe->name     = tpgi->name;
    addDocAnchors(pe,tpgi->docAnchors);
    TagInfo *ti  = new TagInfo;
    ti->tagName  = m_tagName;
    ti->fileName = tpgi->filename;
    pe->tagInfo  = ti;

    buildMemberList(pe,tpgi->members);
    root->addSubEntry(pe);
    tpgi = m_tagFilePackages.next();
  }

  // build group list, but only if config file says to include it
  //if (Config_getBool("EXTERNAL_GROUPS")) 
  //{
    TagGroupInfo *tgi = m_tagFileGroups.first();
    while (tgi)
    {
      Entry *ge    = new Entry;
      ge->section  = Entry::GROUPDOC_SEC;
      ge->name     = tgi->name;
      ge->type     = tgi->title;
      addDocAnchors(ge,tgi->docAnchors);
      TagInfo *ti  = new TagInfo;
      ti->tagName  = m_tagName;
      ti->fileName = tgi->filename;
      ge->tagInfo  = ti;
      
      buildMemberList(ge,tgi->members);
      root->addSubEntry(ge);
      tgi = m_tagFileGroups.next();
    }
  //}

  // build page list
  TagPageInfo *tpi = m_tagFilePages.first();
  while (tpi)
  {
    Entry *pe    = new Entry;
    pe->section  = Entry::PAGEDOC_SEC;
    pe->name     = tpi->name;
    pe->args     = tpi->title;
    addDocAnchors(pe,tpi->docAnchors);
    TagInfo *ti  = new TagInfo;
    ti->tagName  = m_tagName;
    ti->fileName = tpi->filename;
    pe->tagInfo  = ti;

    root->addSubEntry(pe);
    tpi = m_tagFilePages.next();
  }
}
Example #12
0
void BrowserView::update(const QList<BrowserView *> & lv)
{
    Q3Dict<Use> all_nodes(DICT_SIZE);
    Q3PtrListIterator<BrowserView> itv(lv);

    all_nodes.setAutoDelete(TRUE);

    // look at the revision in each view

    for (; itv.current(); ++itv) {
        Q3DictIterator<BrowserNode> itd(itv.current()->nodes);

        for (; itd.current(); ++itd) {
            BrowserNode * bn = itd.current();
            int rev = bn->get_rev();
            Use * use = all_nodes.find(itd.currentKey());

            if (use == 0)
                all_nodes.insert(itd.currentKey(), new Use(rev));
            else {
                if (rev < use->rev_min)
                    use->rev_min = rev;

                if (rev > use->rev_max)
                    use->rev_max = rev;

                use->count += 1;
            }
        }
    }

    // first solve step
    // only the package existing in all the view are solved

    int nviews = lv.count();
    QStringList deleted_or_new;

    Q3DictIterator<Use> itu(all_nodes);

    for (; itu.current(); ++itu) {
        QString who = itu.currentKey();
        Use * use = itu.current();

        if (use->count == nviews) {
            // exist in all views : solve the state
            if (use->rev_min == use->rev_max) {
                // up to date in all views
                for (itv.toFirst(); itv.current(); ++itv)
                    itv.current()->nodes.find(who)->set_state(UpToDate);
            }
            else {
                int max = use->rev_max;

                for (itv.toFirst(); itv.current(); ++itv) {
                    BrowserNode * pack = itv.current()->nodes.find(who);

                    pack->set_state((pack->get_rev() == max) ? Young : Old);
                }
            }
        }
        else {
            // deleted or new, mark it unknown for this step
            deleted_or_new.append(who);

            for (itv.toFirst(); itv.current(); ++itv) {
                BrowserNode * pack = itv.current()->nodes.find(who);

                if (pack != 0)
                    pack->set_state(Unknown);
            }
        }
    }

    all_nodes.clear();

    // solve packages marked unknown
    // a package is deleted if its parent is never 'Young'

    QStringList::Iterator it;

    for (it = deleted_or_new.begin(); it != deleted_or_new.end(); ++it) {
        QString who = *it;
        QList<BrowserNode *> images;
        bool young = FALSE;

        // set the state in each view without looking at the others
        for (itv.toFirst(); itv.current(); ++itv) {
            BrowserNode * pack = itv.current()->nodes.find(who);

            if (pack != 0) {
                images.append(pack);

                if (pack->solve())
                    young = TRUE;
            }
        }

        // set the final state if young, else all already marked deleted
        if (young) {
            BrowserNode * pack;

            for (pack = images.first(); pack != 0; pack = images.next())
                pack->set_state(Young);
        }
    }

    // force update on views
    for (itv.toFirst(); itv.current(); ++itv)
        itv.current()->update_it();
}