| 357 | } |
| 358 | |
| 359 | void CustomizeToolbarDialog::showMenuAddButton() |
| 360 | { |
| 361 | addButtonMenu_->clear(); |
| 362 | |
| 363 | QListIterator<QAction *> iter(mainApp->mainWindow()->actions()); |
| 364 | while (iter.hasNext()) { |
| 365 | QAction *pAction = iter.next(); |
| 366 | if ((pAction->objectName() == "restoreNewsAct") || |
| 367 | pAction->objectName().contains("labelAction_")) continue; |
| 368 | |
| 369 | if (!pAction->icon().isNull()) { |
| 370 | QList<QTreeWidgetItem *> treeItems = shortcutTree_->findItems(pAction->objectName(), |
| 371 | Qt::MatchFixedString, |
| 372 | 1); |
| 373 | if (!treeItems.count()) { |
| 374 | QAction *action = addButtonMenu_->addAction(pAction->icon(), pAction->text()); |
| 375 | action->setObjectName(pAction->objectName()); |
| 376 | |
| 377 | if (pAction->objectName() == "autoLoadImagesToggle") { |
| 378 | action->setIcon(QIcon(":/images/imagesOn")); |
| 379 | action->setText(tr("Load images")); |
| 380 | } else if ((pAction->objectName() == "feedsFilter") || |
| 381 | (pAction->objectName() == "newsFilter")) { |
| 382 | action->setIcon(QIcon(":/images/filterOn")); |
| 383 | } else action->setIcon(pAction->icon()); |
| 384 | } |
| 385 | } |
| 386 | } |
| 387 | addButtonMenu_->addSeparator(); |
| 388 | QAction *action = addButtonMenu_->addAction(QIcon(":/images/images/noicon.png"), |
| 389 | tr("Separator")); |
| 390 | action->setObjectName("Separator"); |
| 391 | } |
| 392 | |
| 393 | void CustomizeToolbarDialog::addShortcut(QAction *action) |
| 394 | { |