160 connect(acIgnore, SIGNAL(triggered(bool)), this, SLOT(onIgnore())); |
160 connect(acIgnore, SIGNAL(triggered(bool)), this, SLOT(onIgnore())); |
161 acFriend = new QAction(QAction::tr("Add friend"), chatNicks); |
161 acFriend = new QAction(QAction::tr("Add friend"), chatNicks); |
162 acFriend->setIcon(QIcon(":/res/addfriend.png")); |
162 acFriend->setIcon(QIcon(":/res/addfriend.png")); |
163 connect(acFriend, SIGNAL(triggered(bool)), this, SLOT(onFriend())); |
163 connect(acFriend, SIGNAL(triggered(bool)), this, SLOT(onFriend())); |
164 |
164 |
|
165 chatNicks->insertAction(0, acFriend); |
165 chatNicks->insertAction(0, acInfo); |
166 chatNicks->insertAction(0, acInfo); |
166 chatNicks->insertAction(0, acFollow); |
|
167 chatNicks->insertAction(0, acIgnore); |
167 chatNicks->insertAction(0, acIgnore); |
168 chatNicks->insertAction(0, acFriend); |
|
169 |
168 |
170 showReady = false; |
169 showReady = false; |
|
170 setShowFollow(true); |
|
171 } |
|
172 |
|
173 void HWChatWidget::setShowFollow(bool enabled) |
|
174 { |
|
175 if (enabled) { |
|
176 if (!(chatNicks->actions().contains(acFollow))) |
|
177 chatNicks->insertAction(acFriend, acFollow); |
|
178 } |
|
179 else { |
|
180 if (chatNicks->actions().contains(acFollow)) |
|
181 chatNicks->removeAction(acFollow); |
|
182 } |
171 } |
183 } |
172 |
184 |
173 void HWChatWidget::loadList(QStringList & list, const QString & file) |
185 void HWChatWidget::loadList(QStringList & list, const QString & file) |
174 { |
186 { |
175 list.clear(); |
187 list.clear(); |