*************** *** 790,796 **** IconAction *actBrowse, *actBack, *actForward, *actRefresh, *actStop; // custom actions, that will be added to toolbar and context menu - IconAction *actRegister, *actSearch, *actJoin, *actVCard, *actAdd; typedef QPtrList HistoryList; HistoryList backHistory, forwardHistory; --- 790,796 ---- IconAction *actBrowse, *actBack, *actForward, *actRefresh, *actStop; // custom actions, that will be added to toolbar and context menu + IconAction *actRegister, *actSearch, *actJoin, *actAdHoc, *actVCard, *actAdd; typedef QPtrList HistoryList; HistoryList backHistory, forwardHistory; *************** *** 898,903 **** actJoin = new IconAction (tr("Join"), "psi/groupChat", tr("&Join"), 0, dlg); connect (actJoin, SIGNAL(activated()), sm, SLOT(map())); sm->setMapping(actJoin, Features::FID_Groupchat); actVCard = new IconAction (tr("vCard"), "psi/vCard", tr("&vCard"), 0, dlg); connect (actVCard, SIGNAL(activated()), sm, SLOT(map())); sm->setMapping(actVCard, Features::FID_VCard); --- 898,906 ---- actJoin = new IconAction (tr("Join"), "psi/groupChat", tr("&Join"), 0, dlg); connect (actJoin, SIGNAL(activated()), sm, SLOT(map())); sm->setMapping(actJoin, Features::FID_Groupchat); + actAdHoc = new IconAction (tr("Execute command"), "psi/edit", tr("&Execute command"), 0, dlg); + connect (actAdHoc, SIGNAL(activated()), sm, SLOT(map())); + sm->setMapping(actAdHoc, Features::FID_AdHoc); actVCard = new IconAction (tr("vCard"), "psi/vCard", tr("&vCard"), 0, dlg); connect (actVCard, SIGNAL(activated()), sm, SLOT(map())); sm->setMapping(actVCard, Features::FID_VCard); *************** *** 922,927 **** actRegister->addTo(toolBar); actSearch->addTo(toolBar); actJoin->addTo(toolBar); toolBar->addSeparator(); actAdd->addTo(toolBar); --- 925,931 ---- actRegister->addTo(toolBar); actSearch->addTo(toolBar); actJoin->addTo(toolBar); + actAdHoc->addTo(toolBar); toolBar->addSeparator(); actAdd->addTo(toolBar); *************** *** 1136,1141 **** actRegister->setEnabled( f.canRegister() ); actSearch->setEnabled( f.canSearch() ); actJoin->setEnabled( f.canGroupchat() ); actAdd->setEnabled( itemSelected ); actVCard->setEnabled( f.haveVCard() ); } --- 1140,1146 ---- actRegister->setEnabled( f.canRegister() ); actSearch->setEnabled( f.canSearch() ); actJoin->setEnabled( f.canGroupchat() ); + actAdHoc->setEnabled( f.canAdHoc() ); actAdd->setEnabled( itemSelected ); actVCard->setEnabled( f.haveVCard() ); } *************** *** 1163,1186 **** const DiscoItem d = it->item(); const Features &f = d.features(); - // set the prior state of item - // FIXME: causes minor flickering - if ( f.canGroupchat() || f.canRegister() || f.canSearch() ) { - if ( !it->isOpen() ) { - if ( it->isExpandable() || it->childCount() ) - it->setOpen( true ); - } - else { - it->setOpen( false ); - } - } - long id = 0; // trigger default action if ( f.canGroupchat() ) { id = Features::FID_Groupchat; } else { // FIXME: check the category and type for JUD! DiscoItem::Identity ident = d.identities().first(); --- 1168,1182 ---- const DiscoItem d = it->item(); const Features &f = d.features(); long id = 0; // trigger default action if ( f.canGroupchat() ) { id = Features::FID_Groupchat; } + else if (f.canAdHoc() ) { + id = Features::FID_AdHoc; + } else { // FIXME: check the category and type for JUD! DiscoItem::Identity ident = d.identities().first(); *************** *** 1195,1202 **** } } - if ( id > 0 ) emit dlg->featureActivated( Features::feature(id), d.jid(), d.node() ); } bool DiscoDlg::Private::eventFilter (QObject *object, QEvent *event) --- 1191,1210 ---- } } + if ( id > 0 ) { + + // set the prior state of item + // FIXME: causes minor flickering + if ( !it->isOpen() ) { + if ( it->isExpandable() || it->childCount() ) + it->setOpen( true ); + } + else { + it->setOpen( false ); + } + emit dlg->featureActivated( Features::feature(id), d.jid(), d.node() ); + } } bool DiscoDlg::Private::eventFilter (QObject *object, QEvent *event) *************** *** 1254,1259 **** actRegister->addTo(&p); actSearch->addTo(&p); actJoin->addTo(&p); p.insertSeparator(); actAdd->addTo(&p); --- 1262,1268 ---- actRegister->addTo(&p); actSearch->addTo(&p); actJoin->addTo(&p); + actAdHoc->addTo(&p); p.insertSeparator(); actAdd->addTo(&p);