Logo Search packages:      
Sourcecode: qtsmbstatus version File versions  Download package

void ClientSocket::slotPopupMenu ( Q3ListViewItem *  Item,
const QPoint &  point,
int   
) [private, slot]

popup menu

Definition at line 394 of file clientsocket.cpp.

References InfoMachine(), InfoServer(), InfoService(), InfoUser(), machine::machine_name, permitDisconnectUser, permitSendMsg, slotDisconnectUser(), slotSendMessage(), slotSendMessageAllUsers(), and user::username.

Referenced by ClientSocket().

{
      int id;
      currentPopupMenuItem = Item;
      // if deconnected, no popup menu
      if (!ssl_connected) return;
      if( Item )
      {
            // create popup menu
            menu->clear();

            if (Item==item_server) // if a server item
            {
                  menu->insertItem( tr( "Properties"),this,SLOT(InfoServer() ) );
                  id=menu->insertItem( tr( "Send out message to all users"),this,SLOT(slotSendMessageAllUsers() ) );
                  menu->setItemEnabled(id,permitSendMsg);
                  menu->popup( point );
                  return;
            }
            if (Item->parent()==item_server) // if a machine item
            {
                  machine * myItem=dynamic_cast<machine *>(Item);
                  if (!myItem) return;
                  menu->insertItem( tr( "Properties"),this,SLOT(InfoMachine() ) );
                  id=menu->insertItem( tr( "Send out message to")+ " " + myItem->machine_name,this,SLOT(slotSendMessage() ) );
                  menu->setItemEnabled(id,permitSendMsg); // if client can send popup messages
                  menu->popup( point );
                  return;
            }
            if (Item->parent()->parent()==item_server) // if an user item
            {
                  user * myItem=dynamic_cast<user *>(Item);
                  if (!myItem) return;
                  menu->insertItem( tr( "Properties"),this,SLOT(InfoUser() ) );
                  id=menu->insertItem( tr( "Disconnect user")+ " " + myItem->username,this,SLOT(slotDisconnectUser() ) );
                  menu->setItemEnabled(id,permitDisconnectUser); //  if client can disconnect an user
                  menu->popup( point );
                  return;
            }
            // it's a locked file or share
            menu->insertItem( tr( "Properties"),this,SLOT(InfoService() ) );
            menu->popup( point );
      }
}


Generated by  Doxygen 1.6.0   Back to index