Example #1
0
void CFrmUserList::slotUpdateMenu()
{
    m_Menu.setTitle(tr("Operator roster(&O)"));
    m_Menu.setEnabled(true);
    EnableAllActioins(false);
    if(this->isHidden())
        return;

    //如果是组上,显示增加好友  
    EnableAction(ui->actionAddRoster_A);

    //判断是在组上还是在好友上  
    CRoster* p = GetCurrentRoster();
    if(p)
    {
        //增加订阅  
        if(QXmppRosterIq::Item::None == p->GetSubScriptionType()
             || QXmppRosterIq::Item::From == p->GetSubScriptionType())
            EnableAction(ui->actionAgreeAddRoster);

        //如果是好友上,显示删除好友  
        EnableAction(ui->actionRemoveRoster_R);

        //查看好友信息  
        EnableAction(ui->actionInformation_I);
        //TODO: 移动到组  

    }
    else
    {
        //TODO:新建组  
    }
    return;
}
Example #2
0
int CFrmUserList::EnableAllActioins(bool bEnable)
{
    EnableAction(ui->actionAddRoster_A, bEnable);
    EnableAction(ui->actionAgreeAddRoster, bEnable);
    EnableAction(ui->actionRemoveRoster_R, bEnable);
    EnableAction(ui->actionInformation_I, bEnable);
    return 0;
}
Example #3
0
/////////////////////////////////////////////////////////////////////////////
//
//    OPERATION: zwTZERRORD_LoadPopup
//
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT /*DIALOG */  OPERATION
zwTZERRORD_LoadPopup( zVIEW vSubtask )
{
   zVIEW vTZERROR;
   zBOOL bEnable = TRUE;

   if ( GetViewByName( &vTZERROR, "TZERROR", vSubtask, zLEVEL_TASK ) < 0 )
      return( -1 );

   if ( CompareAttributeToInteger( vTZERROR, "ErrorList", "MetaType",
                                   zSOURCE_ERD_META ) != 0 )
   {
      bEnable = FALSE;
   }

   EnableAction( vSubtask, "SelectEntity", bEnable );

   CreateTrackingPopupMenu( vSubtask, "ErrorListPopup", -1, -1, FALSE, FALSE );

   return( 0 );
} // zwTZERRORD_LoadPopup
Example #4
0
void CFrmUserList::slotUpdateMenu()
{
    m_Menu.setTitle(tr("Operator roster(&O)"));
    m_Menu.setEnabled(true);
    EnableAllActioins(false);
    if(this->isHidden())
        return;

    //如果是组上,显示增加好友  
    EnableAction(ui->actionAddRoster_A);

    //判断是在组上还是在好友上  
    QString bareJid = GetCurrentRoster();
    if(bareJid.isEmpty())
    {
        //TODO:新建组  

        //判断子节点是否为空  
        QModelIndex index = m_UserList.currentIndex();
        if(!m_pModel->hasChildren(index))
            EnableAction(ui->actionRemove_Group);
    }
    else
    {
        QSharedPointer<CUser> user = GLOBAL_USER->GetUserInfoRoster(bareJid);
        if(user.isNull())
        {
            LOG_MODEL_ERROR("FrmUserList", "Don't roster:%s", bareJid.toStdString().c_str());
            return;
        }
        
        QSharedPointer<CUserInfo> info = user->GetInfo();
        if(info.isNull())
        {
            LOG_MODEL_ERROR("FrmUserList", "Don't roster:%s", bareJid.toStdString().c_str());
            return;
        }

        //增加订阅  
        if(CUserInfo::Both != info->GetSubScriptionType())
            EnableAction(ui->actionAgreeAddRoster);
        
        //显示重命名菜单  
        EnableAction(ui->actionRename);
        //如果是好友上,显示删除好友  
        EnableAction(ui->actionRemoveRoster_R);

        //查看好友信息  
        EnableAction(ui->actionInformation_I);
        //移动到组  
        EnableAction(ui->actionMove_roster);
        EnableAction(ui->actionSendMessage);
        EnableAction(ui->actionSendFile);
        EnableAction(ui->actionVideo);
        EnableAction(ui->actionAudio);
        if(CGlobal::Instance()->GetIsMonitor())
        {
            ui->actionAllowMonitor->setChecked(info->GetIsMonitor());
            EnableAction(ui->actionAllowMonitor);
        }
         //TODO:3新增菜单  
    }
    return;
}
Example #5
0
int CFrmUserList::EnableAllActioins(bool bEnable)
{
    EnableAction(ui->actionAddRoster_A, bEnable);
    EnableAction(ui->actionAgreeAddRoster, bEnable);
    EnableAction(ui->actionRemoveRoster_R, bEnable);
    EnableAction(ui->actionInformation_I, bEnable);
    EnableAction(ui->actionRemove_Group, bEnable);
    EnableAction(ui->actionRename, bEnable);
    EnableAction(ui->actionSendMessage, bEnable);
    EnableAction(ui->actionSendFile, bEnable);
    EnableAction(ui->actionVideo, bEnable);
    EnableAction(ui->actionAudio, bEnable);
    EnableAction(ui->actionAllowMonitor, bEnable);
    EnableAction(ui->actionMove_roster, bEnable);
    //TODO:2.新增菜单  
    return 0;
}