QTfrontend/chatwidget.cpp
changeset 3123 b0a02930a1dc
parent 3058 2ebc20485344
child 3236 4ab3917d7d44
equal deleted inserted replaced
3122:e005359efc59 3123:b0a02930a1dc
    82         this, SLOT(chatNickSelected(int)));
    82         this, SLOT(chatNickSelected(int)));
    83 
    83 
    84     mainLayout.addWidget(chatNicks, 0, 1);
    84     mainLayout.addWidget(chatNicks, 0, 1);
    85 
    85 
    86     acInfo = new QAction(QAction::tr("Info"), chatNicks);
    86     acInfo = new QAction(QAction::tr("Info"), chatNicks);
       
    87     acInfo->setIcon(QIcon(":/res/info.png"));
    87     connect(acInfo, SIGNAL(triggered(bool)), this, SLOT(onInfo()));
    88     connect(acInfo, SIGNAL(triggered(bool)), this, SLOT(onInfo()));
    88     acKick = new QAction(QAction::tr("Kick"), chatNicks);
    89     acKick = new QAction(QAction::tr("Kick"), chatNicks);
       
    90     acKick->setIcon(QIcon(":/res/kick.png"));
    89     connect(acKick, SIGNAL(triggered(bool)), this, SLOT(onKick()));
    91     connect(acKick, SIGNAL(triggered(bool)), this, SLOT(onKick()));
    90     acBan = new QAction(QAction::tr("Ban"), chatNicks);
    92     acBan = new QAction(QAction::tr("Ban"), chatNicks);
       
    93     acBan->setIcon(QIcon(":/res/ban.png"));
    91     connect(acBan, SIGNAL(triggered(bool)), this, SLOT(onBan()));
    94     connect(acBan, SIGNAL(triggered(bool)), this, SLOT(onBan()));
    92     acFollow = new QAction(QAction::tr("Follow"), chatNicks);
    95     acFollow = new QAction(QAction::tr("Follow"), chatNicks);
       
    96     acFollow->setIcon(QIcon(":/res/follow.png"));
    93     connect(acFollow, SIGNAL(triggered(bool)), this, SLOT(onFollow()));
    97     connect(acFollow, SIGNAL(triggered(bool)), this, SLOT(onFollow()));
    94     acIgnore = new QAction(QAction::tr("Ignore"), chatNicks);
    98     acIgnore = new QAction(QAction::tr("Ignore"), chatNicks);
       
    99     acIgnore->setIcon(QIcon(":/res/ignore.png"));
    95     connect(acIgnore, SIGNAL(triggered(bool)), this, SLOT(onIgnore()));
   100     connect(acIgnore, SIGNAL(triggered(bool)), this, SLOT(onIgnore()));
    96     acFriend = new QAction(QAction::tr("Add friend"), chatNicks);
   101     acFriend = new QAction(QAction::tr("Add friend"), chatNicks);
       
   102     acFriend->setIcon(QIcon(":/res/addfriend.png"));
    97     connect(acFriend, SIGNAL(triggered(bool)), this, SLOT(onFriend()));
   103     connect(acFriend, SIGNAL(triggered(bool)), this, SLOT(onFriend()));
    98 
   104 
    99     chatNicks->insertAction(0, acInfo);
   105     chatNicks->insertAction(0, acInfo);
   100     chatNicks->insertAction(0, acFollow);
   106     chatNicks->insertAction(0, acFollow);
   101     chatNicks->insertAction(0, acIgnore);
   107     chatNicks->insertAction(0, acIgnore);
   339     if (!item)
   345     if (!item)
   340         return;
   346         return;
   341 
   347 
   342     // update context menu labels according to possible action
   348     // update context menu labels according to possible action
   343     if(ignoreList.contains(item->text(), Qt::CaseInsensitive))
   349     if(ignoreList.contains(item->text(), Qt::CaseInsensitive))
       
   350     {
   344         acIgnore->setText(QAction::tr("Unignore"));
   351         acIgnore->setText(QAction::tr("Unignore"));
       
   352         acIgnore->setIcon(QIcon(":/res/unignore.png"));
       
   353     }
   345     else
   354     else
       
   355     {
   346         acIgnore->setText(QAction::tr("Ignore"));
   356         acIgnore->setText(QAction::tr("Ignore"));
       
   357         acIgnore->setIcon(QIcon(":/res/ignore.png"));
       
   358     }
   347 
   359 
   348     if(friendsList.contains(item->text(), Qt::CaseInsensitive))
   360     if(friendsList.contains(item->text(), Qt::CaseInsensitive))
       
   361     {
   349         acFriend->setText(QAction::tr("Remove friend"));
   362         acFriend->setText(QAction::tr("Remove friend"));
       
   363         acFriend->setIcon(QIcon(":/res/remfriend.png"));
       
   364     }
   350     else
   365     else
       
   366     {
   351         acFriend->setText(QAction::tr("Add friend"));
   367         acFriend->setText(QAction::tr("Add friend"));
       
   368         acFriend->setIcon(QIcon(":/res/addfriend.png"));
       
   369     }
   352 }
   370 }
   353 
   371 
   354 void HWChatWidget::setShowReady(bool s)
   372 void HWChatWidget::setShowReady(bool s)
   355 {
   373 {
   356     showReady = s;
   374     showReady = s;