From 209355b9a5d39817588bb57d7b714c43d6e5b72a Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 15 Aug 2020 22:17:52 +0200 Subject: [PATCH] converted all calls to QIcon("somefile.png") into FilesDefs::getIconFromQtResourcePath("somefile.png") to save memory duplicated by Qt --- retroshare-gui/src/gui/ChatLobbyWidget.cpp | 35 ++++----- retroshare-gui/src/gui/Identity/IdDialog.cpp | 28 ++++---- .../src/gui/Posted/PostedDialog.cpp | 2 +- .../src/gui/chat/ChatLobbyDialog.cpp | 10 +-- .../src/gui/chat/ChatLobbyUserNotify.cpp | 7 +- retroshare-gui/src/gui/chat/ChatTabWidget.cpp | 9 +-- .../src/gui/chat/ChatUserNotify.cpp | 5 +- retroshare-gui/src/gui/chat/ChatWidget.cpp | 4 +- .../src/gui/chat/PopupChatDialog.cpp | 5 +- .../src/gui/chat/PopupChatWindow.cpp | 11 +-- .../src/gui/chat/PopupDistantChatDialog.cpp | 9 +-- retroshare-gui/src/gui/common/Emoticons.cpp | 7 +- retroshare-gui/src/gui/common/FriendList.cpp | 40 +++++------ .../src/gui/common/FriendSelectionWidget.cpp | 11 +-- .../src/gui/common/GroupFlagsWidget.cpp | 19 +++-- .../src/gui/common/GroupFlagsWidget.h | 2 +- .../src/gui/common/GroupTreeWidget.cpp | 5 +- .../src/gui/common/LineEditClear.cpp | 8 +-- .../src/gui/common/MimeTextEdit.cpp | 5 +- .../src/gui/common/NewFriendList.cpp | 35 ++++----- .../src/gui/common/PopularityDefs.cpp | 13 ++-- .../src/gui/common/RsCollectionDialog.cpp | 3 +- .../src/gui/common/SubscribeToolButton.cpp | 7 +- .../src/gui/connect/ConnectFriendWizard.cpp | 5 +- .../src/gui/connect/PGPKeyDialog.cpp | 5 +- retroshare-gui/src/gui/elastic/elnode.cpp | 7 +- .../src/gui/feeds/GxsChannelGroupItem.cpp | 5 +- .../src/gui/feeds/GxsForumGroupItem.cpp | 5 +- .../src/gui/feeds/GxsForumMsgItem.cpp | 5 +- retroshare-gui/src/gui/feeds/MsgItem.cpp | 5 +- .../src/gui/feeds/NewsFeedUserNotify.cpp | 3 +- retroshare-gui/src/gui/feeds/PeerItem.cpp | 5 +- .../src/gui/feeds/PostedGroupItem.cpp | 5 +- .../src/gui/feeds/SecurityIpItem.cpp | 5 +- retroshare-gui/src/gui/feeds/SecurityItem.cpp | 5 +- .../src/gui/gxs/GxsCommentTreeWidget.cpp | 8 +-- .../src/gui/gxs/GxsGroupFrameDialog.cpp | 72 +++++++++---------- retroshare-gui/src/gui/gxs/GxsIdChooser.cpp | 5 +- retroshare-gui/src/gui/gxs/GxsIdDetails.cpp | 33 ++++----- .../src/gui/gxs/GxsIdTreeWidgetItem.cpp | 2 +- .../gui/gxschannels/CreateGxsChannelMsg.cpp | 4 +- .../src/gui/gxschannels/GxsChannelDialog.cpp | 12 ++-- .../gui/gxschannels/GxsChannelPostsWidget.cpp | 4 +- .../gui/gxsforums/GxsForumThreadWidget.cpp | 2 +- .../src/gui/gxsforums/GxsForumsDialog.cpp | 4 +- .../src/gui/msgs/MessageComposer.cpp | 17 ++--- .../src/gui/msgs/MessageUserNotify.cpp | 5 +- retroshare-gui/src/gui/msgs/MessageWidget.cpp | 8 +-- retroshare-gui/src/gui/msgs/MessageWindow.cpp | 7 +- .../src/gui/msgs/MessagesDialog.cpp | 30 ++++---- retroshare-gui/src/gui/notifyqt.cpp | 3 +- .../src/gui/profile/ProfileManager.cpp | 3 +- .../src/gui/settings/AppearancePage.cpp | 3 +- .../src/gui/settings/FileAssociationsPage.cpp | 7 +- .../src/gui/settings/ServerPage.cpp | 6 +- .../src/gui/settings/rsettingswin.h | 3 +- .../gui/statistics/GlobalRouterStatistics.cpp | 2 +- .../src/gui/statistics/StatisticsWindow.cpp | 17 ++--- .../src/gui/statusbar/SoundStatus.cpp | 3 +- .../src/gui/statusbar/SysTrayStatus.cpp | 3 +- .../src/gui/unfinished/ApplicationWindow.cpp | 8 +-- retroshare-gui/src/main.cpp | 7 +- retroshare-gui/src/rshare.cpp | 3 +- 63 files changed, 330 insertions(+), 291 deletions(-) diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp index bd802bae4..475495674 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp +++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp @@ -34,6 +34,7 @@ #include "gui/settings/rsharesettings.h" #include "util/HandleRichText.h" #include "util/QtVersion.h" +#include "gui/common/FilesDefs.h" #include "retroshare/rsmsgs.h" #include "retroshare/rspeers.h" @@ -281,7 +282,7 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint) QMenu contextMnu(this); if (item && item->type() == TYPE_FOLDER) { - QAction *action = contextMnu.addAction(QIcon(IMAGE_CREATE), tr("Create chat room"), this, SLOT(createChatLobby())); + QAction *action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_CREATE), tr("Create chat room"), this, SLOT(createChatLobby())); action->setData(item->data(COLUMN_DATA, ROLE_PRIVACYLEVEL).toInt()); } @@ -291,7 +292,7 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint) rsIdentity->getOwnIds(own_identities) ; if (item->data(COLUMN_DATA, ROLE_SUBSCRIBED).toBool()) - contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Leave this room"), this, SLOT(unsubscribeItem())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_UNSUBSCRIBE), tr("Leave this room"), this, SLOT(unsubscribeItem())); else { QTreeWidgetItem *item = ui.lobbyTreeWidget->currentItem(); @@ -306,18 +307,18 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint) if(own_identities.empty()) { if(removed) - contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Create a non anonymous identity and enter this room"), this, SLOT(createIdentityAndSubscribe())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_SUBSCRIBE), tr("Create a non anonymous identity and enter this room"), this, SLOT(createIdentityAndSubscribe())); else - contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Create an identity and enter this chat room"), this, SLOT(createIdentityAndSubscribe())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_SUBSCRIBE), tr("Create an identity and enter this chat room"), this, SLOT(createIdentityAndSubscribe())); } else if(own_identities.size() == 1) { - QAction *action = contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Enter this chat room"), this, SLOT(subscribeChatLobbyAs())); + QAction *action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_SUBSCRIBE), tr("Enter this chat room"), this, SLOT(subscribeChatLobbyAs())); action->setData(QString::fromStdString((own_identities.front()).toStdString())) ; } else { - QMenu *mnu = contextMnu.addMenu(QIcon(IMAGE_SUBSCRIBE),tr("Enter this chat room as...")) ; + QMenu *mnu = contextMnu.addMenu(FilesDefs::getIconFromQtResourcePath(IMAGE_SUBSCRIBE),tr("Enter this chat room as...")) ; for(std::list::const_iterator it=own_identities.begin();it!=own_identities.end();++it) { @@ -344,7 +345,7 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint) contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Add Auto Subscribe"), this, SLOT(autoSubscribeItem())); #endif - contextMnu.addAction(QIcon(IMAGE_COPYRSLINK), tr("Copy RetroShare Link"), this, SLOT(copyItemLink())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COPYRSLINK), tr("Copy RetroShare Link"), this, SLOT(copyItemLink())); } contextMnu.addSeparator();//------------------------------------------------------------------- @@ -435,7 +436,7 @@ void ChatLobbyWidget::addChatPage(ChatLobbyDialog *d) ChatLobbyInfo linfo ; if(rsMsgs->getChatLobbyInfo(id,linfo)) - _lobby_infos[id].default_icon = (linfo.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? QIcon(IMAGE_PUBLIC):QIcon(IMAGE_PRIVATE) ; + _lobby_infos[id].default_icon = (linfo.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? FilesDefs::getIconFromQtResourcePath(IMAGE_PUBLIC):FilesDefs::getIconFromQtResourcePath(IMAGE_PRIVATE) ; else std::cerr << "(EE) cannot find info for room " << std::hex << id << std::dec << std::endl; } @@ -615,7 +616,7 @@ void ChatLobbyWidget::updateDisplay() if (item == NULL) { item = new RSTreeWidgetItem(compareRole, TYPE_LOBBY); - icon = (lobby.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? QIcon(IMAGE_PUBLIC) : QIcon(IMAGE_PRIVATE); + icon = (lobby.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? FilesDefs::getIconFromQtResourcePath(IMAGE_PUBLIC) : FilesDefs::getIconFromQtResourcePath(IMAGE_PRIVATE); lobby_item->addChild(item); } @@ -623,7 +624,7 @@ void ChatLobbyWidget::updateDisplay() { if (item->data(COLUMN_DATA, ROLE_SUBSCRIBED).toBool() != subscribed) { // Replace icon - icon = (lobby.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? QIcon(IMAGE_PUBLIC) : QIcon(IMAGE_PRIVATE); + icon = (lobby.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? FilesDefs::getIconFromQtResourcePath(IMAGE_PUBLIC) : FilesDefs::getIconFromQtResourcePath(IMAGE_PRIVATE); } } if (!icon.isNull()) { @@ -683,12 +684,12 @@ void ChatLobbyWidget::updateDisplay() if (item == NULL) { item = new RSTreeWidgetItem(compareRole, TYPE_LOBBY); - icon = (lobby.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? QIcon(IMAGE_PUBLIC) : QIcon(IMAGE_PRIVATE); + icon = (lobby.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? FilesDefs::getIconFromQtResourcePath(IMAGE_PUBLIC) : FilesDefs::getIconFromQtResourcePath(IMAGE_PRIVATE); itemParent->addChild(item); } else { if (!item->data(COLUMN_DATA, ROLE_SUBSCRIBED).toBool()) { // Replace icon - icon = (lobby.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? QIcon(IMAGE_PUBLIC) : QIcon(IMAGE_PRIVATE); + icon = (lobby.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? FilesDefs::getIconFromQtResourcePath(IMAGE_PUBLIC) : FilesDefs::getIconFromQtResourcePath(IMAGE_PRIVATE); } } if (!icon.isNull()) { @@ -996,7 +997,7 @@ void ChatLobbyWidget::updateTypingStatus(ChatLobbyId id) if(item != NULL) { - item->setIcon(COLUMN_NAME,QIcon(IMAGE_TYPING)) ; + item->setIcon(COLUMN_NAME,FilesDefs::getIconFromQtResourcePath(IMAGE_TYPING)) ; _lobby_infos[id].last_typing_event = time(NULL) ; QTimer::singleShot(5000,this,SLOT(resetLobbyTreeIcons())) ; @@ -1008,7 +1009,7 @@ void ChatLobbyWidget::updatePeerLeaving(ChatLobbyId id) if(item != NULL) { - item->setIcon(COLUMN_NAME,QIcon(IMAGE_PEER_LEAVING)) ; + item->setIcon(COLUMN_NAME,FilesDefs::getIconFromQtResourcePath(IMAGE_PEER_LEAVING)) ; _lobby_infos[id].last_typing_event = time(NULL) ; QTimer::singleShot(5000,this,SLOT(resetLobbyTreeIcons())) ; @@ -1020,7 +1021,7 @@ void ChatLobbyWidget::updatePeerEntering(ChatLobbyId id) if(item != NULL) { - item->setIcon(COLUMN_NAME,QIcon(IMAGE_PEER_ENTERING)) ; + item->setIcon(COLUMN_NAME,FilesDefs::getIconFromQtResourcePath(IMAGE_PEER_ENTERING)) ; _lobby_infos[id].last_typing_event = time(NULL) ; QTimer::singleShot(5000,this,SLOT(resetLobbyTreeIcons())) ; @@ -1105,7 +1106,7 @@ void ChatLobbyWidget::updateCurrentLobby() if(_lobby_infos.find(id) != _lobby_infos.end()) { int iPrivacyLevel= item->parent()->data(COLUMN_DATA, ROLE_PRIVACYLEVEL).toInt(); - QIcon icon = (iPrivacyLevel==CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC) ? QIcon(IMAGE_PUBLIC) : QIcon(IMAGE_PRIVATE); + QIcon icon = (iPrivacyLevel==CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC) ? FilesDefs::getIconFromQtResourcePath(IMAGE_PUBLIC) : FilesDefs::getIconFromQtResourcePath(IMAGE_PRIVATE); _lobby_infos[id].default_icon = icon ; item->setIcon(COLUMN_NAME, icon) ; } @@ -1129,7 +1130,7 @@ void ChatLobbyWidget::updateMessageChanged(bool incoming, ChatLobbyId id, QDateT if(bIsCurrentItem) return ; - _lobby_infos[id].default_icon = QIcon(IMAGE_MESSAGE) ; + _lobby_infos[id].default_icon = FilesDefs::getIconFromQtResourcePath(IMAGE_MESSAGE) ; QTreeWidgetItem *item = getTreeWidgetItem(id) ; diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index d87f1d6e7..f66f9d6af 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -321,10 +321,10 @@ IdDialog::IdDialog(QWidget *parent) : MainPage(parent), ui(new Ui::IdDialog) connect(idTWHAction, SIGNAL(toggled(bool)), this, SLOT(filterToggled(bool))); idTWHMenu->addAction(idTWHAction); - QAction *CreateIDAction = new QAction(QIcon(":/icons/png/person.png"),tr("Create new Identity"), this); + QAction *CreateIDAction = new QAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/person.png"),tr("Create new Identity"), this); connect(CreateIDAction, SIGNAL(triggered()), this, SLOT(addIdentity())); - QAction *CreateCircleAction = new QAction(QIcon(":/icons/png/circles.png"),tr("Create new circle"), this); + QAction *CreateCircleAction = new QAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/circles.png"),tr("Create new circle"), this); connect(CreateCircleAction, SIGNAL(triggered()), this, SLOT(createExternalCircle())); QMenu *menu = new QMenu(); @@ -1017,11 +1017,11 @@ void IdDialog::CircleListCustomPopupMenu( QPoint ) #endif if(group_flags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN) { - contextMnu.addAction(QIcon(IMAGE_EDIT), tr("Edit Circle"), this, SLOT(showEditExistingCircle())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EDIT), tr("Edit Circle"), this, SLOT(showEditExistingCircle())); am_I_circle_admin = true ; } else - contextMnu.addAction(QIcon(IMAGE_INFO), tr("See details"), this, SLOT(showEditExistingCircle())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_INFO), tr("See details"), this, SLOT(showEditExistingCircle())); #ifdef CIRCLE_MEMBERSHIP_CATEGORIES } #endif @@ -1109,9 +1109,9 @@ void IdDialog::CircleListCustomPopupMenu( QPoint ) QAction *action ; if(is_circle) - action = new QAction(QIcon(image_names[i]), menu_titles[i] + " " + id_name,this) ; + action = new QAction(FilesDefs::getIconFromQtResourcePath(image_names[i]), menu_titles[i] + " " + id_name,this) ; else - action = new QAction(QIcon(image_names[i]), menu_titles[i],this) ; + action = new QAction(FilesDefs::getIconFromQtResourcePath(image_names[i]), menu_titles[i],this) ; if(i <2) QObject::connect(action,SIGNAL(triggered()), this, SLOT(acceptCircleSubscription())); @@ -1134,7 +1134,7 @@ void IdDialog::CircleListCustomPopupMenu( QPoint ) else id_name = tr("for identity ")+QString::fromStdString(ids[i][j].toStdString()) ; - QAction *action = new QAction(QIcon(image_names[i]), id_name,this) ; + QAction *action = new QAction(FilesDefs::getIconFromQtResourcePath(image_names[i]), id_name,this) ; if(i <2) QObject::connect(action,SIGNAL(triggered()), this, SLOT(acceptCircleSubscription())); @@ -2195,7 +2195,7 @@ void IdDialog::IdListCustomPopupMenu( QPoint ) { if(own_identities.size() <= 1) { - QAction *action = contextMenu->addAction(QIcon(":/icons/png/chats.png"), tr("Chat with this person"), this, SLOT(chatIdentity())); + QAction *action = contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/chats.png"), tr("Chat with this person"), this, SLOT(chatIdentity())); if(own_identities.empty()) action->setEnabled(false) ; @@ -2204,7 +2204,7 @@ void IdDialog::IdListCustomPopupMenu( QPoint ) } else { - QMenu *mnu = contextMenu->addMenu(QIcon(":/icons/png/chats.png"),tr("Chat with this person as...")) ; + QMenu *mnu = contextMenu->addMenu(FilesDefs::getIconFromQtResourcePath(":/icons/png/chats.png"),tr("Chat with this person as...")) ; for(std::list::const_iterator it=own_identities.begin();it!=own_identities.end();++it) { @@ -2222,7 +2222,7 @@ void IdDialog::IdListCustomPopupMenu( QPoint ) } } // always allow to send messages - contextMenu->addAction(QIcon(":/icons/mail/write-mail.png"), tr("Send message"), this, SLOT(sendMsg())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/mail/write-mail.png"), tr("Send message"), this, SLOT(sendMsg())); contextMenu->addSeparator(); @@ -2233,18 +2233,18 @@ void IdDialog::IdListCustomPopupMenu( QPoint ) contextMenu->addAction(QIcon(""),tr("Copy identity to clipboard"),this,SLOT(copyRetroshareLink())) ; if(n_is_not_a_contact == 0) - contextMenu->addAction(QIcon(":/images/cancel.png"), tr("Remove from Contacts"), this, SLOT(removefromContacts())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/images/cancel.png"), tr("Remove from Contacts"), this, SLOT(removefromContacts())); contextMenu->addSeparator(); if(n_positive_reputations == 0) // only unban when all items are banned - contextMenu->addAction(QIcon(":/icons/png/thumbs-up.png"), tr("Set positive opinion"), this, SLOT(positivePerson())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-up.png"), tr("Set positive opinion"), this, SLOT(positivePerson())); if(n_neutral_reputations == 0) // only unban when all items are banned - contextMenu->addAction(QIcon(":/icons/png/thumbs-neutral.png"), tr("Set neutral opinion"), this, SLOT(neutralPerson())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-neutral.png"), tr("Set neutral opinion"), this, SLOT(neutralPerson())); if(n_negative_reputations == 0) - contextMenu->addAction(QIcon(":/icons/png/thumbs-down.png"), tr("Set negative opinion"), this, SLOT(negativePerson())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-down.png"), tr("Set negative opinion"), this, SLOT(negativePerson())); } if(one_item_owned_by_you && n_selected_items==1) diff --git a/retroshare-gui/src/gui/Posted/PostedDialog.cpp b/retroshare-gui/src/gui/Posted/PostedDialog.cpp index 6c2772276..fa5826151 100644 --- a/retroshare-gui/src/gui/Posted/PostedDialog.cpp +++ b/retroshare-gui/src/gui/Posted/PostedDialog.cpp @@ -255,7 +255,7 @@ void PostedDialog::groupInfoToGroupItemInfo(const RsGxsGenericGroupData *groupDa groupItemInfo.icon = image; } else - groupItemInfo.icon = QIcon(":icons/png/postedlinks.png"); + groupItemInfo.icon = FilesDefs::getIconFromQtResourcePath(":icons/png/postedlinks.png"); groupItemInfo.description = QString::fromUtf8(postedGroupData->mDescription.c_str()); } diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index b45c448fe..bfd2ad379 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -92,11 +92,11 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi QHeaderView_setSectionResizeModeColumn(header, COLUMN_NAME, QHeaderView::Stretch); muteAct = new QAction(QIcon(), tr("Mute participant"), this); - voteNegativeAct = new QAction(QIcon(":/icons/png/thumbs-down.png"), tr("Ban this person (Sets negative opinion)"), this); - voteNeutralAct = new QAction(QIcon(":/icons/png/thumbs-neutral.png"), tr("Give neutral opinion"), this); - votePositiveAct = new QAction(QIcon(":/icons/png/thumbs-up.png"), tr("Give positive opinion"), this); - distantChatAct = new QAction(QIcon(":/icons/png/chats.png"), tr("Start private chat"), this); - sendMessageAct = new QAction(QIcon(":/icons/mail/write-mail.png"), tr("Send Message"), this); + voteNegativeAct = new QAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-down.png"), tr("Ban this person (Sets negative opinion)"), this); + voteNeutralAct = new QAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-neutral.png"), tr("Give neutral opinion"), this); + votePositiveAct = new QAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-up.png"), tr("Give positive opinion"), this); + distantChatAct = new QAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/chats.png"), tr("Start private chat"), this); + sendMessageAct = new QAction(FilesDefs::getIconFromQtResourcePath(":/icons/mail/write-mail.png"), tr("Send Message"), this); showInPeopleAct = new QAction(QIcon(), tr("Show author in people tab"), this); QActionGroup *sortgrp = new QActionGroup(this); diff --git a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp index 81cb47846..64798a011 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp @@ -23,6 +23,7 @@ #include #include +#include "gui/common/FilesDefs.h" #include "ChatLobbyUserNotify.h" #include "gui/ChatLobbyWidget.h" @@ -104,12 +105,12 @@ void ChatLobbyUserNotify::setTextCaseSensitive(bool value) QIcon ChatLobbyUserNotify::getIcon() { - return QIcon(":/icons/png/chat-lobbies.png"); + return FilesDefs::getIconFromQtResourcePath(":/icons/png/chat-lobbies.png"); } QIcon ChatLobbyUserNotify::getMainIcon(bool hasNew) { - return hasNew ? QIcon(":/icons/png/chat-lobbies-notify.png") : QIcon(":/icons/png/chat-lobbies.png"); + return hasNew ? FilesDefs::getIconFromQtResourcePath(":/icons/png/chat-lobbies-notify.png") : FilesDefs::getIconFromQtResourcePath(":/icons/png/chat-lobbies.png"); } unsigned int ChatLobbyUserNotify::getNewCount() @@ -164,7 +165,7 @@ void ChatLobbyUserNotify::iconClicked() ChatLobbyInfo clInfo; if (rsMsgs->getChatLobbyInfo(clId,clInfo)) strLobbyName=QString::fromUtf8(clInfo.lobby_name.c_str()) ; - icoLobby=(clInfo.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? QIcon(":/images/chat_red24.png") : QIcon(":/images/chat_x24.png"); + icoLobby=(clInfo.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? FilesDefs::getIconFromQtResourcePath(":/images/chat_red24.png") : FilesDefs::getIconFromQtResourcePath(":/images/chat_x24.png"); bFound=true; break; } diff --git a/retroshare-gui/src/gui/chat/ChatTabWidget.cpp b/retroshare-gui/src/gui/chat/ChatTabWidget.cpp index ad15fb905..03357a3e4 100644 --- a/retroshare-gui/src/gui/chat/ChatTabWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatTabWidget.cpp @@ -22,6 +22,7 @@ #include +#include "gui/common/FilesDefs.h" #include "ChatTabWidget.h" #include "ui_ChatTabWidget.h" #include "ChatDialog.h" @@ -102,9 +103,9 @@ void ChatTabWidget::tabInfoChanged(ChatDialog *dialog) if (tab >= 0) { if (dialog->isTyping()) { setBlinking(tab, false); - setTabIcon(tab, QIcon(IMAGE_TYPING)); + setTabIcon(tab, FilesDefs::getIconFromQtResourcePath(IMAGE_TYPING)); } else if (dialog->hasNewMessages()) { - setTabIcon(tab, QIcon(IMAGE_CHAT)); + setTabIcon(tab, FilesDefs::getIconFromQtResourcePath(IMAGE_CHAT)); if (dialog->notifyBlink()) { setBlinking(tab, true); } else { @@ -148,9 +149,9 @@ void ChatTabWidget::getInfo(bool &isTyping, bool &hasNewMessage, QIcon *icon) if (icon) { if (isTyping) { - *icon = QIcon(IMAGE_TYPING); + *icon = FilesDefs::getIconFromQtResourcePath(IMAGE_TYPING); } else if (hasNewMessage) { - *icon = QIcon(IMAGE_CHAT); + *icon = FilesDefs::getIconFromQtResourcePath(IMAGE_CHAT); } else { cd = dynamic_cast(currentWidget()); if (cd && cd->hasPeerStatus()) { diff --git a/retroshare-gui/src/gui/chat/ChatUserNotify.cpp b/retroshare-gui/src/gui/chat/ChatUserNotify.cpp index ecb563938..2e9fb2d1a 100644 --- a/retroshare-gui/src/gui/chat/ChatUserNotify.cpp +++ b/retroshare-gui/src/gui/chat/ChatUserNotify.cpp @@ -20,6 +20,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include "ChatUserNotify.h" #include "gui/notifyqt.h" #include "gui/MainWindow.h" @@ -75,12 +76,12 @@ bool ChatUserNotify::hasSetting(QString *name, QString *group) QIcon ChatUserNotify::getIcon() { - return QIcon(":/images/chat.png"); + return FilesDefs::getIconFromQtResourcePath(":/images/chat.png"); } QIcon ChatUserNotify::getMainIcon(bool hasNew) { - return hasNew ? QIcon(":/icons/png/network-notify.png") : QIcon(":/icons/png/network.png"); + return hasNew ? FilesDefs::getIconFromQtResourcePath(":/icons/png/network-notify.png") : FilesDefs::getIconFromQtResourcePath(":/icons/png/network.png"); } unsigned int ChatUserNotify::getNewCount() diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 6c36a392b..5506dedfb 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -245,7 +245,7 @@ ChatWidget::ChatWidget(QWidget *parent) //#ifdef ENABLE_DISTANT_CHAT_AND_MSGS // contextMnu->addSeparator(); -// QAction *action = new QAction(QIcon(":/images/pasterslink.png"), tr("Paste/Create private chat or Message link..."), this); +// QAction *action = new QAction(FilesDefs::getIconFromQtResourcePath(":/images/pasterslink.png"), tr("Paste/Create private chat or Message link..."), this); // connect(action, SIGNAL(triggered()), this, SLOT(pasteCreateMsgLink())); // ui->chatTextEdit->addContextMenuAction(action); //#endif @@ -1067,7 +1067,7 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const RsGxsId gx rsIdentity->getIdDetails(gxsId, details); bool isUnsigned = !(details.mFlags & RS_IDENTITY_FLAGS_PGP_LINKED); if(isUnsigned && ui->textBrowser->getShowImages()) { - QIcon icon = QIcon(":/icons/anonymous_blue_128.png"); + QIcon icon = FilesDefs::getIconFromQtResourcePath(":/icons/anonymous_blue_128.png"); int height = ui->textBrowser->fontMetrics().height()*0.8; QImage image(icon.pixmap(height,height).toImage()); QByteArray byteArray; diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index 1591669f4..9cb422a8f 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -23,6 +23,7 @@ #include "PopupChatDialog.h" #include "PopupChatWindow.h" +#include "gui/common/FilesDefs.h" #include "gui/settings/rsharesettings.h" #include "gui/settings/RsharePeerSettings.h" #include "gui/notifyqt.h" @@ -149,10 +150,10 @@ void PopupChatDialog::showAvatarFrame(bool show) if (show) { ui.avatarFrameButton->setToolTip(tr("Hide Avatar")); - ui.avatarFrameButton->setIcon(QIcon(":images/hide_toolbox_frame.png")); + ui.avatarFrameButton->setIcon(FilesDefs::getIconFromQtResourcePath(":images/hide_toolbox_frame.png")); } else { ui.avatarFrameButton->setToolTip(tr("Show Avatar")); - ui.avatarFrameButton->setIcon(QIcon(":images/show_toolbox_frame.png")); + ui.avatarFrameButton->setIcon(FilesDefs::getIconFromQtResourcePath(":images/show_toolbox_frame.png")); } PeerSettings->setShowAvatarFrame(mChatId, show); diff --git a/retroshare-gui/src/gui/chat/PopupChatWindow.cpp b/retroshare-gui/src/gui/chat/PopupChatWindow.cpp index 6d6502c5f..6c1f9128d 100644 --- a/retroshare-gui/src/gui/chat/PopupChatWindow.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatWindow.cpp @@ -24,6 +24,7 @@ #include #include +#include "gui/common/FilesDefs.h" #include "PopupChatWindow.h" #include "ChatDialog.h" #include "gui/settings/rsharesettings.h" @@ -113,14 +114,14 @@ PopupChatWindow::PopupChatWindow(bool tabbed, QWidget *parent, Qt::WindowFlags f void PopupChatWindow::showContextMenu(QPoint) { QMenu contextMnu(this); - contextMnu.addAction(QIcon(":/images/highlight.png"),tr("Choose window color..."),this,SLOT(setStyle())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/highlight.png"),tr("Choose window color..."),this,SLOT(setStyle())); if (Settings->getChatFlags() & RS_CHAT_TABBED_WINDOW) { if(tabbedWindow) - contextMnu.addAction(QIcon(":/images/tab-dock.png"),tr("Dock window"),this,SLOT(docTab())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/tab-dock.png"),tr("Dock window"),this,SLOT(docTab())); - contextMnu.addAction(QIcon(":/images/tab-undock.png"),tr("Dock window"),this,SLOT(undockTab())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/tab-undock.png"),tr("Dock window"),this,SLOT(undockTab())); } contextMnu.exec(QCursor::pos()); } @@ -295,9 +296,9 @@ void PopupChatWindow::calculateTitle(ChatDialog *dialog) QIcon icon; if (isTyping) { mBlinkIcon = QIcon(); - icon = QIcon(IMAGE_TYPING); + icon = FilesDefs::getIconFromQtResourcePath(IMAGE_TYPING); } else if (hasNewMessages) { - icon = QIcon(IMAGE_CHAT); + icon = FilesDefs::getIconFromQtResourcePath(IMAGE_CHAT); if (Settings->getChatFlags() & RS_CHAT_BLINK) { mBlinkIcon = icon; } else { diff --git a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp index b93c2d438..ff02ebae2 100644 --- a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.cpp @@ -26,6 +26,7 @@ #include +#include "gui/common/FilesDefs.h" #include #include #include @@ -112,7 +113,7 @@ void PopupDistantChatDialog::updateDisplay() { case RS_DISTANT_CHAT_STATUS_UNKNOWN: - _status_label->setIcon(QIcon(IMAGE_GRY_LED)); + _status_label->setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_GRY_LED)); msg = tr("Remote status unknown."); _status_label->setToolTip(msg); getChatWidget()->updateStatusString("%1", msg, true); @@ -123,7 +124,7 @@ void PopupDistantChatDialog::updateDisplay() break ; case RS_DISTANT_CHAT_STATUS_REMOTELY_CLOSED: std::cerr << "Chat remotely closed. " << std::endl; - _status_label->setIcon(QIcon(IMAGE_RED_LED)); + _status_label->setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_RED_LED)); _status_label->setToolTip( QObject::tr("Distant peer has closed the chat") ); getChatWidget()->updateStatusString("%1", tr( "Your partner closed the conversation." ), true ); @@ -134,7 +135,7 @@ void PopupDistantChatDialog::updateDisplay() case RS_DISTANT_CHAT_STATUS_TUNNEL_DN: - _status_label->setIcon(QIcon(IMAGE_YEL_LED)); + _status_label->setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_YEL_LED)); msg = QObject::tr( "Tunnel is pending"); if(tinfo.pending_items > 0) @@ -147,7 +148,7 @@ void PopupDistantChatDialog::updateDisplay() break; case RS_DISTANT_CHAT_STATUS_CAN_TALK: - _status_label->setIcon(QIcon(IMAGE_GRN_LED)); + _status_label->setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_GRN_LED)); msg = QObject::tr( "End-to-end encrypted conversation established"); _status_label->setToolTip(msg); getChatWidget()->unblockSending(); diff --git a/retroshare-gui/src/gui/common/Emoticons.cpp b/retroshare-gui/src/gui/common/Emoticons.cpp index 347d88b6e..47a1d67bf 100644 --- a/retroshare-gui/src/gui/common/Emoticons.cpp +++ b/retroshare-gui/src/gui/common/Emoticons.cpp @@ -37,6 +37,7 @@ #include "Emoticons.h" #include "util/HandleRichText.h" #include "retroshare/rsinit.h" +#include "gui/common/FilesDefs.h" #define ICONNAME "groupicon.png" @@ -210,7 +211,7 @@ void Emoticons::showSmileyWidget(QWidget *parent, QWidget *button, const char *s smTab->setStyleSheet("QTabBar::tab { height: 44px; width: 44px; }"); if (groupName.right(4).toLower() == ".png") - smTab->addTab( tabGrpWidget, QIcon(groupName), ""); + smTab->addTab( tabGrpWidget, FilesDefs::getIconFromQtResourcePath(groupName), ""); else smTab->addTab( tabGrpWidget, groupName); } else { @@ -371,9 +372,9 @@ void Emoticons::showStickerWidget(QWidget *parent, QWidget *button, const char * int index; if (groupDir.exists(ICONNAME)) //use groupicon.png if exists, else the first png as a group icon - index = smTab->addTab( tabGrpWidget, QIcon(groupDir.absoluteFilePath(ICONNAME)), ""); + index = smTab->addTab( tabGrpWidget, FilesDefs::getIconFromQtResourcePath(groupDir.absoluteFilePath(ICONNAME)), ""); else - index = smTab->addTab( tabGrpWidget, QIcon(groupDir.entryInfoList(QDir::Files)[0].canonicalFilePath()), ""); + index = smTab->addTab( tabGrpWidget, FilesDefs::getIconFromQtResourcePath(groupDir.entryInfoList(QDir::Files)[0].canonicalFilePath()), ""); smTab->setTabToolTip(index, groupName); } else { tabGrpWidget = smWidget; diff --git a/retroshare-gui/src/gui/common/FriendList.cpp b/retroshare-gui/src/gui/common/FriendList.cpp index 967d8df5d..257a0349a 100644 --- a/retroshare-gui/src/gui/common/FriendList.cpp +++ b/retroshare-gui/src/gui/common/FriendList.cpp @@ -352,25 +352,25 @@ void FriendList::peerTreeWidgetCustomPopupMenu() { bool standard = c->data(COLUMN_DATA, ROLE_STANDARD).toBool(); #ifdef RS_DIRECT_CHAT - contextMenu->addAction(QIcon(IMAGE_MSG), tr("Send message to whole group"), this, SLOT(msgfriend())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MSG), tr("Send message to whole group"), this, SLOT(msgfriend())); contextMenu->addSeparator(); #endif // RS_DIRECT_CHAT - contextMenu->addAction(QIcon(IMAGE_EDIT), tr("Edit Group"), this, SLOT(editGroup())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EDIT), tr("Edit Group"), this, SLOT(editGroup())); - QAction *action = contextMenu->addAction(QIcon(IMAGE_REMOVE), tr("Remove Group"), this, SLOT(removeGroup())); + QAction *action = contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_REMOVE), tr("Remove Group"), this, SLOT(removeGroup())); action->setDisabled(standard); } break; case TYPE_GPG: { #ifdef RS_DIRECT_CHAT - contextMenu->addAction(QIcon(IMAGE_CHAT), tr("Chat"), this, SLOT(chatfriendproxy())); - contextMenu->addAction(QIcon(IMAGE_MSG), tr("Send message"), this, SLOT(msgfriend())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_CHAT), tr("Chat"), this, SLOT(chatfriendproxy())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MSG), tr("Send message"), this, SLOT(msgfriend())); contextMenu->addSeparator(); #endif // RS_DIRECT_CHAT - contextMenu->addAction(QIcon(IMAGE_FRIENDINFO), tr("Profile details"), this, SLOT(configurefriend())); - contextMenu->addAction(QIcon(IMAGE_DENYFRIEND), tr("Deny connections"), this, SLOT(removefriend())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_FRIENDINFO), tr("Profile details"), this, SLOT(configurefriend())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_DENYFRIEND), tr("Deny connections"), this, SLOT(removefriend())); if(mShowGroups) { @@ -412,8 +412,8 @@ void FriendList::peerTreeWidgetCustomPopupMenu() } } - QMenu *groupsMenu = contextMenu->addMenu(QIcon(IMAGE_GROUP16), tr("Groups")); - groupsMenu->addAction(QIcon(IMAGE_EXPAND), tr("Create new group"), this, SLOT(createNewGroup())); + QMenu *groupsMenu = contextMenu->addMenu(FilesDefs::getIconFromQtResourcePath(IMAGE_GROUP16), tr("Groups")); + groupsMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EXPAND), tr("Create new group"), this, SLOT(createNewGroup())); if (addToGroupMenu || moveToGroupMenu || foundGroup) { if (addToGroupMenu) { @@ -445,24 +445,24 @@ void FriendList::peerTreeWidgetCustomPopupMenu() case TYPE_SSL: { #ifdef RS_DIRECT_CHAT - contextMenu->addAction(QIcon(IMAGE_CHAT), tr("Chat"), this, SLOT(chatfriendproxy())); - contextMenu->addAction(QIcon(IMAGE_MSG), tr("Send message to this node"), this, SLOT(msgfriend())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_CHAT), tr("Chat"), this, SLOT(chatfriendproxy())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MSG), tr("Send message to this node"), this, SLOT(msgfriend())); contextMenu->addSeparator(); #endif // RS_DIRECT_CHAT - contextMenu->addAction(QIcon(IMAGE_FRIENDINFO), tr("Node details"), this, SLOT(configurefriend())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_FRIENDINFO), tr("Node details"), this, SLOT(configurefriend())); if (type == TYPE_GPG || type == TYPE_SSL) { - contextMenu->addAction(QIcon(IMAGE_EXPORTFRIEND), tr("Recommend this node to..."), this, SLOT(recommendfriend())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EXPORTFRIEND), tr("Recommend this node to..."), this, SLOT(recommendfriend())); } if(!rsPeers->isHiddenNode(rsPeers->getOwnId()) || rsPeers->isHiddenNode( RsPeerId(getRsId(c)) )) - contextMenu->addAction(QIcon(IMAGE_CONNECT), tr("Attempt to connect"), this, SLOT(connectfriend())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_CONNECT), tr("Attempt to connect"), this, SLOT(connectfriend())); - contextMenu->addAction(QIcon(IMAGE_COPYLINK), tr("Copy certificate link"), this, SLOT(copyFullCertificate())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COPYLINK), tr("Copy certificate link"), this, SLOT(copyFullCertificate())); //this is a SSL key - contextMenu->addAction(QIcon(IMAGE_REMOVEFRIEND), tr("Remove Friend Node"), this, SLOT(removefriend())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_REMOVEFRIEND), tr("Remove Friend Node"), this, SLOT(removefriend())); } } @@ -471,12 +471,12 @@ void FriendList::peerTreeWidgetCustomPopupMenu() contextMenu->addSeparator(); - QAction *action = contextMenu->addAction(QIcon(IMAGE_PASTELINK), tr("Paste certificate link"), this, SLOT(pastePerson())); + QAction *action = contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_PASTELINK), tr("Paste certificate link"), this, SLOT(pastePerson())); if (RSLinkClipboard::empty(RetroShareLink::TYPE_CERTIFICATE)) action->setDisabled(true); - contextMenu->addAction(QIcon(IMAGE_EXPAND), tr("Expand all"), ui->peerTreeWidget, SLOT(expandAll())); - contextMenu->addAction(QIcon(IMAGE_COLLAPSE), tr("Collapse all"), ui->peerTreeWidget, SLOT(collapseAll())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EXPAND), tr("Expand all"), ui->peerTreeWidget, SLOT(expandAll())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COLLAPSE), tr("Collapse all"), ui->peerTreeWidget, SLOT(collapseAll())); contextMenu = ui->peerTreeWidget->createStandardContextMenu(contextMenu); @@ -716,7 +716,7 @@ void FriendList::insertPeers() groupItem->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless); groupItem->setTextAlignment(COLUMN_NAME, Qt::AlignLeft | Qt::AlignVCenter); - groupItem->setIcon(COLUMN_NAME, QIcon(IMAGE_GROUP24)); + groupItem->setIcon(COLUMN_NAME, FilesDefs::getIconFromQtResourcePath(IMAGE_GROUP24)); groupItem->setData(COLUMN_NAME, Qt::ForegroundRole, textColorGroup()); /* used to find back the item */ diff --git a/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp b/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp index 4043fe424..d253691bf 100644 --- a/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp +++ b/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include #include #include "FriendSelectionWidget.h" @@ -219,7 +220,7 @@ static void initSslItem(QTreeWidgetItem *item, const RsPeerDetails &detail, cons item->setData(COLUMN_NAME, Qt::ForegroundRole, textColorOnline); } - item->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(state))); + item->setIcon(COLUMN_NAME, FilesDefs::getIconFromQtResourcePath(StatusDefs::imageUser(state))); item->setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(detail.id.toStdString())); item->setData(COLUMN_NAME, ROLE_SORT_GROUP, 1); @@ -381,7 +382,7 @@ void FriendSelectionWidget::secured_fillList() groupItem->setFlags(Qt::ItemIsUserCheckable | groupItem->flags()); groupItem->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless); groupItem->setTextAlignment(COLUMN_NAME, Qt::AlignLeft | Qt::AlignVCenter); - groupItem->setIcon(COLUMN_NAME, QIcon(IMAGE_GROUP16)); + groupItem->setIcon(COLUMN_NAME, FilesDefs::getIconFromQtResourcePath(IMAGE_GROUP16)); groupItem->setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(groupInfo->id.toStdString())); @@ -454,7 +455,7 @@ void FriendSelectionWidget::secured_fillList() } gpgItem->setFlags(Qt::ItemIsUserCheckable | gpgItem->flags()); - gpgItem->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(state))); + gpgItem->setIcon(COLUMN_NAME, FilesDefs::getIconFromQtResourcePath(StatusDefs::imageUser(state))); gpgItem->setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(detail.gpg_id.toStdString())); gpgItem->setData(COLUMN_NAME, ROLE_SORT_GROUP, 1); @@ -773,7 +774,7 @@ void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status) item->setData(COLUMN_NAME, Qt::ForegroundRole, QVariant()); } - item->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(gpgStatus))); + item->setIcon(COLUMN_NAME, FilesDefs::getIconFromQtResourcePath(StatusDefs::imageUser(gpgStatus))); item->setData(COLUMN_NAME, ROLE_SORT_STATE, gpgStatus); @@ -790,7 +791,7 @@ void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status) item->setData(COLUMN_NAME, Qt::ForegroundRole, QVariant()); } - item->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(status))); + item->setIcon(COLUMN_NAME, FilesDefs::getIconFromQtResourcePath(StatusDefs::imageUser(status))); item->setData(COLUMN_NAME, ROLE_SORT_STATE, status); diff --git a/retroshare-gui/src/gui/common/GroupFlagsWidget.cpp b/retroshare-gui/src/gui/common/GroupFlagsWidget.cpp index d4142f886..9b40df3d0 100644 --- a/retroshare-gui/src/gui/common/GroupFlagsWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupFlagsWidget.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include #include #include "GroupFlagsWidget.h" @@ -54,12 +55,12 @@ GroupFlagsWidget::GroupFlagsWidget(QWidget *parent,FileStorageFlags flags) setMaximumSize(128 * QFontMetricsF(font()).height()/14.0,32 * QFontMetricsF(font()).height()/14.0) ; setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); - _icons[2*INDEX_BROWSABLE+0] = new QIcon(FLAGS_BROWSABLE_OFF) ; - _icons[2*INDEX_BROWSABLE+1] = new QIcon(FLAGS_BROWSABLE_ON) ; - _icons[2*INDEX_ANON_SEARCH+0] = new QIcon(FLAGS_ANONYMOUS_SEARCH_OFF) ; - _icons[2*INDEX_ANON_SEARCH+1] = new QIcon(FLAGS_ANONYMOUS_SEARCH_ON) ; - _icons[2*INDEX_ANON_DL+0] = new QIcon(FLAGS_ANONYMOUS_DL_OFF) ; - _icons[2*INDEX_ANON_DL+1] = new QIcon(FLAGS_ANONYMOUS_DL_ON) ; + _icons[2*INDEX_BROWSABLE+0] = FilesDefs::getIconFromQtResourcePath(FLAGS_BROWSABLE_OFF) ; + _icons[2*INDEX_BROWSABLE+1] = FilesDefs::getIconFromQtResourcePath(FLAGS_BROWSABLE_ON) ; + _icons[2*INDEX_ANON_SEARCH+0] = FilesDefs::getIconFromQtResourcePath(FLAGS_ANONYMOUS_SEARCH_OFF) ; + _icons[2*INDEX_ANON_SEARCH+1] = FilesDefs::getIconFromQtResourcePath(FLAGS_ANONYMOUS_SEARCH_ON) ; + _icons[2*INDEX_ANON_DL+0] = FilesDefs::getIconFromQtResourcePath(FLAGS_ANONYMOUS_DL_OFF) ; + _icons[2*INDEX_ANON_DL+1] = FilesDefs::getIconFromQtResourcePath(FLAGS_ANONYMOUS_DL_ON) ; setLayout(_layout) ; @@ -136,7 +137,7 @@ void GroupFlagsWidget::update_button_state(bool b,int button_id) tip_on = ""; tip_off = ""; } - _buttons[button_id]->setIcon(*_icons[2*button_id+(int)b]) ; + _buttons[button_id]->setIcon(_icons[2*button_id+(int)b]) ; _buttons[button_id]->setToolTip(b?tip_on:tip_off) ; } @@ -183,10 +184,6 @@ void GroupFlagsWidget::update_BR_button(bool b) { update_button_state(b,INDEX_BR GroupFlagsWidget::~GroupFlagsWidget() { for(int i=0;i<3;++i) - { delete _buttons[i] ; - delete _icons[2*i+0] ; - delete _icons[2*i+1] ; - } } diff --git a/retroshare-gui/src/gui/common/GroupFlagsWidget.h b/retroshare-gui/src/gui/common/GroupFlagsWidget.h index 4703d124d..d4ef95295 100644 --- a/retroshare-gui/src/gui/common/GroupFlagsWidget.h +++ b/retroshare-gui/src/gui/common/GroupFlagsWidget.h @@ -55,7 +55,7 @@ class GroupFlagsWidget: public QWidget QPushButton *_buttons[4] ; QLayout *_layout ; - QIcon *_icons[6] ; + QIcon _icons[6] ; FileStorageFlags _flags[4] ; static QString _tooltips_on[4] ; diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index db9b487b4..aa9b76023 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -21,6 +21,7 @@ #include "GroupTreeWidget.h" #include "ui_GroupTreeWidget.h" +#include "gui/common/FilesDefs.h" #include "retroshare/rsgxsflags.h" #include "PopularityDefs.h" @@ -250,11 +251,11 @@ void GroupTreeWidget::initDisplayMenu(QToolButton *toolButton) displayMenu = new QMenu(); QActionGroup *actionGroupAsc = new QActionGroup(displayMenu); - actionSortDescending = displayMenu->addAction(QIcon(":/images/sort_decrease.png"), tr("Sort Descending Order"), this, SLOT(sort())); + actionSortDescending = displayMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/images/sort_decrease.png"), tr("Sort Descending Order"), this, SLOT(sort())); actionSortDescending->setCheckable(true); actionSortDescending->setActionGroup(actionGroupAsc); - actionSortAscending = displayMenu->addAction(QIcon(":/images/sort_incr.png"), tr("Sort Ascending Order"), this, SLOT(sort())); + actionSortAscending = displayMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/images/sort_incr.png"), tr("Sort Ascending Order"), this, SLOT(sort())); actionSortAscending->setCheckable(true); actionSortAscending->setActionGroup(actionGroupAsc); diff --git a/retroshare-gui/src/gui/common/LineEditClear.cpp b/retroshare-gui/src/gui/common/LineEditClear.cpp index 05bdca90b..b439aaa07 100644 --- a/retroshare-gui/src/gui/common/LineEditClear.cpp +++ b/retroshare-gui/src/gui/common/LineEditClear.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include "LineEditClear.h" #include @@ -124,9 +125,8 @@ void LineEditClear::showFilterIcon() mFilterButton = new QToolButton(this); mFilterButton->setFixedSize(16, 16); - QPixmap filterPixmap(IMAGE_FILTER); - mFilterButton->setIcon(QIcon(filterPixmap)); - mFilterButton->setIconSize(filterPixmap.size()); + mFilterButton->setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_FILTER)); + //mFilterButton->setIconSize(filterPixmap.size()); mFilterButton->setCursor(Qt::ArrowCursor); mFilterButton->setStyleSheet("QToolButton { border: none; padding: 0px; }" "QToolButton[popupMode=\"2\"] { padding-right: 10px; }" @@ -224,7 +224,7 @@ void LineEditClear::activateAction(QAction *action) QIcon icon = action->icon(); if (icon.isNull()) { - icon = QIcon(IMAGE_FILTER); + icon = FilesDefs::getIconFromQtResourcePath(IMAGE_FILTER); } mFilterButton->setIcon(icon); diff --git a/retroshare-gui/src/gui/common/MimeTextEdit.cpp b/retroshare-gui/src/gui/common/MimeTextEdit.cpp index cac02dc3e..b24a65879 100644 --- a/retroshare-gui/src/gui/common/MimeTextEdit.cpp +++ b/retroshare-gui/src/gui/common/MimeTextEdit.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include #include #include @@ -250,8 +251,8 @@ void MimeTextEdit::contextMenuEvent(QContextMenuEvent *e) QAction *spoilerAction = contextMenu->addAction(tr("Spoiler"), this, SLOT(spoiler())); spoilerAction->setToolTip(tr("Select text to hide, then push this button")); contextMenu->addSeparator(); - QAction *pasteLinkAction = contextMenu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink())); - contextMenu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste my certificate link"), this, SLOT(pasteOwnCertificateLink())); + QAction *pasteLinkAction = contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink())); + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/images/pasterslink.png"), tr("Paste my certificate link"), this, SLOT(pasteOwnCertificateLink())); if (RSLinkClipboard::empty()) { pasteLinkAction->setDisabled(true); diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index 9d9908642..2dd216383 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -32,6 +32,7 @@ #include "GroupDefs.h" #include "gui/chat/ChatDialog.h" #include "gui/common/AvatarDefs.h" +#include "gui/common/FilesDefs.h" #include "gui/connect/ConfCertDialog.h" #include "gui/connect/PGPKeyDialog.h" @@ -577,20 +578,20 @@ void NewFriendList::peerTreeWidgetCustomPopupMenu() bool standard = group_info.flag & RS_GROUP_FLAG_STANDARD; #ifdef RS_DIRECT_CHAT - contextMenu.addAction(QIcon(IMAGE_MSG), tr("Send message to whole group"), this, SLOT(msgGroup())); + contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MSG), tr("Send message to whole group"), this, SLOT(msgGroup())); contextMenu.addSeparator(); #endif // RS_DIRECT_CHAT - contextMenu.addAction(QIcon(IMAGE_EDIT), tr("Edit Group"), this, SLOT(editGroup())); + contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EDIT), tr("Edit Group"), this, SLOT(editGroup())); - QAction *action = contextMenu.addAction(QIcon(IMAGE_REMOVE), tr("Remove Group"), this, SLOT(removeGroup())); + QAction *action = contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_REMOVE), tr("Remove Group"), this, SLOT(removeGroup())); action->setDisabled(standard); } break; case RsFriendListModel::ENTRY_TYPE_PROFILE: { - contextMenu.addAction(QIcon(IMAGE_FRIENDINFO), tr("Profile details"), this, SLOT(configureProfile())); - contextMenu.addAction(QIcon(IMAGE_DENYFRIEND), tr("Deny connections"), this, SLOT(removeProfile())); + contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_FRIENDINFO), tr("Profile details"), this, SLOT(configureProfile())); + contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_DENYFRIEND), tr("Deny connections"), this, SLOT(removeProfile())); RsFriendListModel::RsProfileDetails details; mModel->getProfileData(index,details); @@ -636,8 +637,8 @@ void NewFriendList::peerTreeWidgetCustomPopupMenu() } } - QMenu *groupsMenu = contextMenu.addMenu(QIcon(IMAGE_GROUP16), tr("Groups")); - groupsMenu->addAction(QIcon(IMAGE_EXPAND), tr("Create new group"), this, SLOT(createNewGroup())); + QMenu *groupsMenu = contextMenu.addMenu(FilesDefs::getIconFromQtResourcePath(IMAGE_GROUP16), tr("Groups")); + groupsMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EXPAND), tr("Create new group"), this, SLOT(createNewGroup())); if (addToGroupMenu || moveToGroupMenu || foundGroup) { if (addToGroupMenu) { @@ -674,26 +675,26 @@ void NewFriendList::peerTreeWidgetCustomPopupMenu() case RsFriendListModel::ENTRY_TYPE_NODE: { #ifdef RS_DIRECT_CHAT - contextMenu.addAction(QIcon(IMAGE_CHAT), tr("Chat"), this, SLOT(chatNode())); - contextMenu.addAction(QIcon(IMAGE_MSG), tr("Send message to this node"), this, SLOT(msgNode())); + contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_CHAT), tr("Chat"), this, SLOT(chatNode())); + contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MSG), tr("Send message to this node"), this, SLOT(msgNode())); contextMenu.addSeparator(); #endif // RS_DIRECT_CHAT - contextMenu.addAction(QIcon(IMAGE_FRIENDINFO), tr("Node details"), this, SLOT(configureNode())); + contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_FRIENDINFO), tr("Node details"), this, SLOT(configureNode())); if (type == RsFriendListModel::ENTRY_TYPE_PROFILE || type == RsFriendListModel::ENTRY_TYPE_NODE) - contextMenu.addAction(QIcon(IMAGE_EXPORTFRIEND), tr("Recommend this node to..."), this, SLOT(recommendNode())); + contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EXPORTFRIEND), tr("Recommend this node to..."), this, SLOT(recommendNode())); RsFriendListModel::RsNodeDetails details; mModel->getNodeData(index,details); if(!rsPeers->isHiddenNode(rsPeers->getOwnId()) || rsPeers->isHiddenNode( details.id )) - contextMenu.addAction(QIcon(IMAGE_CONNECT), tr("Attempt to connect"), this, SLOT(connectNode())); + contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_CONNECT), tr("Attempt to connect"), this, SLOT(connectNode())); - contextMenu.addAction(QIcon(IMAGE_COPYLINK), tr("Copy certificate link"), this, SLOT(copyFullCertificate())); + contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COPYLINK), tr("Copy certificate link"), this, SLOT(copyFullCertificate())); //this is a SSL key - contextMenu.addAction(QIcon(IMAGE_REMOVEFRIEND), tr("Remove Friend Node"), this, SLOT(removeNode())); + contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_REMOVEFRIEND), tr("Remove Friend Node"), this, SLOT(removeNode())); } } @@ -702,12 +703,12 @@ void NewFriendList::peerTreeWidgetCustomPopupMenu() contextMenu.addSeparator(); - QAction *action = contextMenu.addAction(QIcon(IMAGE_PASTELINK), tr("Paste certificate link"), this, SLOT(pastePerson())); + QAction *action = contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_PASTELINK), tr("Paste certificate link"), this, SLOT(pastePerson())); if (RSLinkClipboard::empty(RetroShareLink::TYPE_CERTIFICATE)) action->setDisabled(true); - contextMenu.addAction(QIcon(IMAGE_EXPAND), tr("Expand all"), ui->peerTreeWidget, SLOT(expandAll())); - contextMenu.addAction(QIcon(IMAGE_COLLAPSE), tr("Collapse all"), ui->peerTreeWidget, SLOT(collapseAll())); + contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EXPAND), tr("Expand all"), ui->peerTreeWidget, SLOT(expandAll())); + contextMenu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COLLAPSE), tr("Collapse all"), ui->peerTreeWidget, SLOT(collapseAll())); contextMenu.addSeparator(); diff --git a/retroshare-gui/src/gui/common/PopularityDefs.cpp b/retroshare-gui/src/gui/common/PopularityDefs.cpp index 096cdc1cf..d027c4248 100644 --- a/retroshare-gui/src/gui/common/PopularityDefs.cpp +++ b/retroshare-gui/src/gui/common/PopularityDefs.cpp @@ -20,22 +20,23 @@ #include +#include "FilesDefs.h" #include "PopularityDefs.h" QIcon PopularityDefs::icon(int popularity) { if (popularity <= 1) - return QIcon(":/images/hot_0.png"); + return FilesDefs::getIconFromQtResourcePath(":/images/hot_0.png"); else if (popularity <= 2) /* 1-1 */ - return QIcon(":/images/hot_1.png"); + return FilesDefs::getIconFromQtResourcePath(":/images/hot_1.png"); else if (popularity <= 5) /* 2-2 */ - return QIcon(":/images/hot_2.png"); + return FilesDefs::getIconFromQtResourcePath(":/images/hot_2.png"); else if (popularity <= 10) /* 3-5 */ - return QIcon(":/images/hot_3.png"); + return FilesDefs::getIconFromQtResourcePath(":/images/hot_3.png"); else if (popularity <= 20) /* 6-10 */ - return QIcon(":/images/hot_4.png"); + return FilesDefs::getIconFromQtResourcePath(":/images/hot_4.png"); else /* >10 */ - return QIcon(":/images/hot_5.png"); + return FilesDefs::getIconFromQtResourcePath(":/images/hot_5.png"); } QString PopularityDefs::tooltip(int popularity) diff --git a/retroshare-gui/src/gui/common/RsCollectionDialog.cpp b/retroshare-gui/src/gui/common/RsCollectionDialog.cpp index b9a84b7a1..89976f6e8 100644 --- a/retroshare-gui/src/gui/common/RsCollectionDialog.cpp +++ b/retroshare-gui/src/gui/common/RsCollectionDialog.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include "RsCollectionDialog.h" #include "RsCollection.h" @@ -254,7 +255,7 @@ void RsCollectionDialog::openDestinationDirectoryMenu() contextMnu.addAction(QString::fromUtf8((*it).filename.c_str()), this, SLOT(setDestinationDirectory()))->setData(QString::fromUtf8( (*it).filename.c_str() ) ) ; } - contextMnu.addAction( QIcon(IMAGE_SEARCH),tr("Specify..."),this,SLOT(chooseDestinationDirectory())); + contextMnu.addAction( FilesDefs::getIconFromQtResourcePath(IMAGE_SEARCH),tr("Specify..."),this,SLOT(chooseDestinationDirectory())); contextMnu.exec(QCursor::pos()) ; } diff --git a/retroshare-gui/src/gui/common/SubscribeToolButton.cpp b/retroshare-gui/src/gui/common/SubscribeToolButton.cpp index 4bb0147e6..4015e641c 100644 --- a/retroshare-gui/src/gui/common/SubscribeToolButton.cpp +++ b/retroshare-gui/src/gui/common/SubscribeToolButton.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include #include "SubscribeToolButton.h" @@ -64,14 +65,14 @@ void SubscribeToolButton::updateUi() #else setPopupMode(QToolButton::InstantPopup); #endif - //setIcon(QIcon(":/images/accepted16.png")); + //setIcon(FilesDefs::getIconFromQtResourcePath(":/images/accepted16.png")); setText(tr("Subscribed")); if(mMenu != NULL) // that's because setMenu does not give away memory ownership delete mMenu ; mMenu = new QMenu; - mMenu->addAction(QIcon(":/images/cancel.png"), tr("Unsubscribe"), this, SLOT(unsubscribePrivate())); + mMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/images/cancel.png"), tr("Unsubscribe"), this, SLOT(unsubscribePrivate())); if (!mSubscribedActions.empty()) { mMenu->addSeparator(); @@ -86,7 +87,7 @@ void SubscribeToolButton::updateUi() } else { setPopupMode(QToolButton::DelayedPopup); setMenu(NULL); - //setIcon(QIcon(":/images/RSS_004_32.png")); + //setIcon(FilesDefs::getIconFromQtResourcePath(":/images/RSS_004_32.png")); setText(tr("Subscribe")); #ifndef USE_MENUBUTTONPOPUP diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index 4ad6315b9..c225d3eac 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -33,6 +33,7 @@ #include #endif +#include "gui/common/FilesDefs.h" #include "gui/settings/rsharesettings.h" #include "util/misc.h" #include "ConnectFriendWizard.h" @@ -145,11 +146,11 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) : switch (rsFiles->filePermDirectDL()) { case RS_FILE_PERM_DIRECT_DL_YES: - ui->_direct_transfer_CB_2->setIcon(QIcon(":/icons/warning_yellow_128.png")); + ui->_direct_transfer_CB_2->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/warning_yellow_128.png")); ui->_direct_transfer_CB_2->setToolTip(ui->_direct_transfer_CB_2->toolTip().append(tr("\nWarning: In your File-Transfer option, you select allow direct download to Yes."))); break ; case RS_FILE_PERM_DIRECT_DL_NO: - ui->_direct_transfer_CB_2->setIcon(QIcon(":/icons/warning_yellow_128.png")); + ui->_direct_transfer_CB_2->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/warning_yellow_128.png")); ui->_direct_transfer_CB_2->setToolTip(ui->_direct_transfer_CB_2->toolTip().append(tr("\nWarning: In your File-Transfer option, you select allow direct download to No."))); break ; diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp index d27e779fd..5dde6822c 100644 --- a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include "PGPKeyDialog.h" #include @@ -156,11 +157,11 @@ void PGPKeyDialog::load() switch (rsFiles->filePermDirectDL()) { case RS_FILE_PERM_DIRECT_DL_YES: - ui._direct_transfer_CB->setIcon(QIcon(":/icons/warning_yellow_128.png")); + ui._direct_transfer_CB->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/warning_yellow_128.png")); ui._direct_transfer_CB->setToolTip(ui._direct_transfer_CB->toolTip().append(tr("\nWarning: In your File-Transfer option, you select allow direct download to Yes."))); break ; case RS_FILE_PERM_DIRECT_DL_NO: - ui._direct_transfer_CB->setIcon(QIcon(":/icons/warning_yellow_128.png")); + ui._direct_transfer_CB->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/warning_yellow_128.png")); ui._direct_transfer_CB->setToolTip(ui._direct_transfer_CB->toolTip().append(tr("\nWarning: In your File-Transfer option, you select allow direct download to No."))); break ; diff --git a/retroshare-gui/src/gui/elastic/elnode.cpp b/retroshare-gui/src/gui/elastic/elnode.cpp index 0fef49cba..86bb4e31e 100644 --- a/retroshare-gui/src/gui/elastic/elnode.cpp +++ b/retroshare-gui/src/gui/elastic/elnode.cpp @@ -20,6 +20,7 @@ // This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-node-cpp.html +#include "gui/common/FilesDefs.h" #include #include @@ -366,11 +367,11 @@ void Node::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) QMenu contextMnu ; if(_type == GraphWidget::ELASTIC_NODE_TYPE_FRIEND) - contextMnu.addAction(QIcon(IMAGE_DENIED), QObject::tr( "Deny friend" ), this, SLOT(denyFriend()) ); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_DENIED), QObject::tr( "Deny friend" ), this, SLOT(denyFriend()) ); else if(_type != GraphWidget::ELASTIC_NODE_TYPE_OWN) - contextMnu.addAction(QIcon(IMAGE_MAKEFRIEND), QObject::tr( "Make friend" ), this, SLOT(makeFriend()) ); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MAKEFRIEND), QObject::tr( "Make friend" ), this, SLOT(makeFriend()) ); - contextMnu.addAction(QIcon(IMAGE_MAKEFRIEND), QObject::tr( "Peer details" ), this, SLOT(peerDetails()) ); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MAKEFRIEND), QObject::tr( "Peer details" ), this, SLOT(peerDetails()) ); contextMnu.exec(event->screenPos()); } diff --git a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp index e1c9a028f..8f53b5fe4 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp @@ -24,6 +24,7 @@ #include "FeedHolder.h" #include "util/qtthreadsutils.h" +#include "gui/common/FilesDefs.h" #include "gui/NewsFeed.h" #include "gui/RetroShareLink.h" @@ -187,13 +188,13 @@ void GxsChannelGroupItem::doExpand(bool open) if (open) { ui->expandFrame->show(); - ui->expandButton->setIcon(QIcon(QString(":/icons/png/up-arrow.png"))); + ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png"))); ui->expandButton->setToolTip(tr("Hide")); } else { ui->expandFrame->hide(); - ui->expandButton->setIcon(QIcon(QString(":/icons/png/down-arrow.png"))); + ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/down-arrow.png"))); ui->expandButton->setToolTip(tr("Expand")); } diff --git a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp index 4a559e001..5df1a8906 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp @@ -22,6 +22,7 @@ #include "ui_GxsForumGroupItem.h" #include "gui/NewsFeed.h" +#include "gui/common/FilesDefs.h" #include "FeedHolder.h" #include "gui/RetroShareLink.h" #include "util/qtthreadsutils.h" @@ -251,13 +252,13 @@ void GxsForumGroupItem::doExpand(bool open) if (open) { ui->expandFrame->show(); - ui->expandButton->setIcon(QIcon(QString(":/icons/png/up-arrow.png"))); + ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png"))); ui->expandButton->setToolTip(tr("Hide")); } else { ui->expandFrame->hide(); - ui->expandButton->setIcon(QIcon(QString(":/icons/png/down-arrow.png"))); + ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/down-arrow.png"))); ui->expandButton->setToolTip(tr("Expand")); } diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp index f6afc8cdd..4d4bdd661 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp @@ -28,6 +28,7 @@ #include "FeedHolder.h" #include "gui/RetroShareLink.h" +#include "gui/common/FilesDefs.h" #include "gui/gxs/GxsIdDetails.h" #include "util/HandleRichText.h" #include "util/qtthreadsutils.h" @@ -421,7 +422,7 @@ void GxsForumMsgItem::doExpand(bool open) if (open) { ui->expandFrame->show(); - ui->expandButton->setIcon(QIcon(QString(":/icons/png/up-arrow.png"))); + ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png"))); ui->expandButton->setToolTip(tr("Hide")); if (!mParentMessage.mMeta.mMsgId.isNull()) { @@ -434,7 +435,7 @@ void GxsForumMsgItem::doExpand(bool open) { ui->expandFrame->hide(); ui->parentFrame->hide(); - ui->expandButton->setIcon(QIcon(QString(":/icons/png/down-arrow.png"))); + ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/down-arrow.png"))); ui->expandButton->setToolTip(tr("Expand")); } diff --git a/retroshare-gui/src/gui/feeds/MsgItem.cpp b/retroshare-gui/src/gui/feeds/MsgItem.cpp index 181774a00..a25e97873 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/MsgItem.cpp @@ -29,6 +29,7 @@ #include "util/HandleRichText.h" #include "util/DateTime.h" #include "gui/common/AvatarDefs.h" +#include "gui/common/FilesDefs.h" #include "gui/notifyqt.h" #include @@ -231,7 +232,7 @@ void MsgItem::doExpand(bool open) if (open) { expandFrame->show(); - expandButton->setIcon(QIcon(QString(":/icons/png/up-arrow.png"))); + expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png"))); expandButton->setToolTip(tr("Hide")); mCloseOnRead = false; @@ -241,7 +242,7 @@ void MsgItem::doExpand(bool open) else { expandFrame->hide(); - expandButton->setIcon(QIcon(QString(":/icons/png/down-arrow.png"))); + expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/down-arrow.png"))); expandButton->setToolTip(tr("Expand")); } diff --git a/retroshare-gui/src/gui/feeds/NewsFeedUserNotify.cpp b/retroshare-gui/src/gui/feeds/NewsFeedUserNotify.cpp index e71c166f2..65a377edf 100644 --- a/retroshare-gui/src/gui/feeds/NewsFeedUserNotify.cpp +++ b/retroshare-gui/src/gui/feeds/NewsFeedUserNotify.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include "NewsFeedUserNotify.h" #include "gui/NewsFeed.h" @@ -37,7 +38,7 @@ void NewsFeedUserNotify::newsFeedChanged(int count) QIcon NewsFeedUserNotify::getMainIcon(bool hasNew) { - return hasNew ? QIcon(":/icons/png/newsfeed-notify.png") : QIcon(":/icons/png/newsfeed.png"); + return hasNew ? FilesDefs::getIconFromQtResourcePath(":/icons/png/newsfeed-notify.png") : FilesDefs::getIconFromQtResourcePath(":/icons/png/newsfeed.png"); } unsigned int NewsFeedUserNotify::getNewCount() diff --git a/retroshare-gui/src/gui/feeds/PeerItem.cpp b/retroshare-gui/src/gui/feeds/PeerItem.cpp index 2a6f0b19d..a03572f61 100644 --- a/retroshare-gui/src/gui/feeds/PeerItem.cpp +++ b/retroshare-gui/src/gui/feeds/PeerItem.cpp @@ -26,6 +26,7 @@ #include "retroshare-gui/RsAutoUpdatePage.h" #include "gui/msgs/MessageComposer.h" #include "gui/common/StatusDefs.h" +#include "gui/common/FilesDefs.h" #include "gui/common/AvatarDefs.h" #include "util/DateTime.h" @@ -243,13 +244,13 @@ void PeerItem::doExpand(bool open) if (open) { expandFrame->show(); - expandButton->setIcon(QIcon(QString(":/icons/png/up-arrow.png"))); + expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png"))); expandButton->setToolTip(tr("Hide")); } else { expandFrame->hide(); - expandButton->setIcon(QIcon(QString(":/icons/png/down-arrow.png"))); + expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/down-arrow.png"))); expandButton->setToolTip(tr("Expand")); } diff --git a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp index 6b39566aa..90d766bc2 100644 --- a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp @@ -25,6 +25,7 @@ #include "util/qtthreadsutils.h" #include "gui/RetroShareLink.h" #include "gui/gxs/GxsIdDetails.h" +#include "gui/common/FilesDefs.h" /**** * #define DEBUG_ITEM 1 @@ -204,13 +205,13 @@ void PostedGroupItem::doExpand(bool open) if (open) { ui->expandFrame->show(); - ui->expandButton->setIcon(QIcon(QString(":/icons/png/up-arrow.png"))); + ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png"))); ui->expandButton->setToolTip(tr("Hide")); } else { ui->expandFrame->hide(); - ui->expandButton->setIcon(QIcon(QString(":/icons/png/down-arrow.png"))); + ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/down-arrow.png"))); ui->expandButton->setToolTip(tr("Expand")); } diff --git a/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp b/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp index 590bd0588..6e543108d 100644 --- a/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp +++ b/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp @@ -29,6 +29,7 @@ #include "util/DateTime.h" #include "gui/common/PeerDefs.h" #include "gui/common/RsBanListDefs.h" +#include "gui/common/FilesDefs.h" #include #include @@ -199,13 +200,13 @@ void SecurityIpItem::doExpand(bool open) if (open) { ui->expandFrame->show(); - ui->expandButton->setIcon(QIcon(":/icons/png/up-arrow.png")); + ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/up-arrow.png")); ui->expandButton->setToolTip(tr("Hide")); } else { ui->expandFrame->hide(); - ui->expandButton->setIcon(QIcon(":/icons/png/down-arrow.png")); + ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/png/down-arrow.png")); ui->expandButton->setToolTip(tr("Expand")); } diff --git a/retroshare-gui/src/gui/feeds/SecurityItem.cpp b/retroshare-gui/src/gui/feeds/SecurityItem.cpp index aedfd4e6c..b2bbc2cf3 100644 --- a/retroshare-gui/src/gui/feeds/SecurityItem.cpp +++ b/retroshare-gui/src/gui/feeds/SecurityItem.cpp @@ -29,6 +29,7 @@ #include "gui/common/StatusDefs.h" #include "gui/connect/ConfCertDialog.h" #include "gui/connect/PGPKeyDialog.h" +#include "gui/common/FilesDefs.h" #include "gui/connect/ConnectFriendWizard.h" #include "gui/common/AvatarDefs.h" #include "util/DateTime.h" @@ -295,13 +296,13 @@ void SecurityItem::doExpand(bool open) if (open) { expandFrame->show(); - expandButton->setIcon(QIcon(QString(":/icons/png/up-arrow.png"))); + expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png"))); expandButton->setToolTip(tr("Hide")); } else { expandFrame->hide(); - expandButton->setIcon(QIcon(QString(":/icons/png/down-arrow.png"))); + expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/down-arrow.png"))); expandButton->setToolTip(tr("Expand")); } diff --git a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp index a1f824e9a..dfdd9bd04 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp @@ -211,14 +211,14 @@ void GxsCommentTreeWidget::customPopUpMenu(const QPoint& /*point*/) contextMnu.addSeparator(); QMenu *rep_menu = contextMnu.addMenu(tr("Reputation")); - action = rep_menu->addAction(QIcon(IMAGE_MESSAGE), tr("Show Reputation"), this, SLOT(showReputation())); + action = rep_menu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MESSAGE), tr("Show Reputation"), this, SLOT(showReputation())); contextMnu.addSeparator(); - action = rep_menu->addAction(QIcon(IMAGE_MESSAGE), tr("Interesting User"), this, SLOT(markInteresting())); + action = rep_menu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MESSAGE), tr("Interesting User"), this, SLOT(markInteresting())); contextMnu.addSeparator(); - action = rep_menu->addAction(QIcon(IMAGE_MESSAGE), tr("Mark Spammy"), this, SLOT(markSpammer())); - action = rep_menu->addAction(QIcon(IMAGE_MESSAGE), tr("Ban User"), this, SLOT(banUser())); + action = rep_menu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MESSAGE), tr("Mark Spammy"), this, SLOT(markSpammer())); + action = rep_menu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MESSAGE), tr("Ban User"), this, SLOT(banUser())); */ } diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index b7f3fcf20..1021a3937 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -151,16 +151,16 @@ void GxsGroupFrameDialog::initUi() /* Initialize group tree */ QToolButton *newGroupButton = new QToolButton(this); - newGroupButton->setIcon(QIcon(icon(ICON_NEW))); + newGroupButton->setIcon(FilesDefs::getIconFromQtResourcePath(icon(ICON_NEW))); newGroupButton->setToolTip(text(TEXT_NEW)); connect(newGroupButton, SIGNAL(clicked()), this, SLOT(newGroup())); ui->groupTreeWidget->addToolButton(newGroupButton); /* Create group tree */ - mYourGroups = ui->groupTreeWidget->addCategoryItem(text(TEXT_YOUR_GROUP), QIcon(icon(ICON_YOUR_GROUP)), true); - mSubscribedGroups = ui->groupTreeWidget->addCategoryItem(text(TEXT_SUBSCRIBED_GROUP), QIcon(icon(ICON_SUBSCRIBED_GROUP)), true); - mPopularGroups = ui->groupTreeWidget->addCategoryItem(text(TEXT_POPULAR_GROUP), QIcon(icon(ICON_POPULAR_GROUP)), false); - mOtherGroups = ui->groupTreeWidget->addCategoryItem(text(TEXT_OTHER_GROUP), QIcon(icon(ICON_OTHER_GROUP)), false); + mYourGroups = ui->groupTreeWidget->addCategoryItem(text(TEXT_YOUR_GROUP), FilesDefs::getIconFromQtResourcePath(icon(ICON_YOUR_GROUP)), true); + mSubscribedGroups = ui->groupTreeWidget->addCategoryItem(text(TEXT_SUBSCRIBED_GROUP), FilesDefs::getIconFromQtResourcePath(icon(ICON_SUBSCRIBED_GROUP)), true); + mPopularGroups = ui->groupTreeWidget->addCategoryItem(text(TEXT_POPULAR_GROUP), FilesDefs::getIconFromQtResourcePath(icon(ICON_POPULAR_GROUP)), false); + mOtherGroups = ui->groupTreeWidget->addCategoryItem(text(TEXT_OTHER_GROUP), FilesDefs::getIconFromQtResourcePath(icon(ICON_OTHER_GROUP)), false); if (text(TEXT_TODO).isEmpty()) { ui->todoPushButton->hide(); @@ -410,8 +410,8 @@ void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) { QMenu contextMnu(this); - contextMnu.addAction(QIcon(IMAGE_DELETE), tr("Remove this search"), this, SLOT(removeCurrentSearch()))->setData(search_request_id); - contextMnu.addAction(QIcon(IMAGE_DELETE), tr("Remove all searches"), this, SLOT(removeAllSearches())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_DELETE), tr("Remove this search"), this, SLOT(removeCurrentSearch()))->setData(search_request_id); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_DELETE), tr("Remove all searches"), this, SLOT(removeAllSearches())); contextMnu.exec(QCursor::pos()); return ; } @@ -424,7 +424,7 @@ void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) { QMenu contextMnu(this); - contextMnu.addAction(QIcon(IMAGE_RETRIEVE), tr("Request data"), this, SLOT(distantRequestGroupData()))->setData(group_id_s); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_RETRIEVE), tr("Request data"), this, SLOT(distantRequestGroupData()))->setData(group_id_s); contextMnu.exec(QCursor::pos()); return ; } @@ -442,27 +442,27 @@ void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) QMenu contextMnu(this); QAction *action; - action = contextMnu.addAction(QIcon(IMAGE_TABNEW), tr("Open in new tab"), this, SLOT(openInNewTab())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_TABNEW), tr("Open in new tab"), this, SLOT(openInNewTab())); if(mGroupId.isNull()) // dont enable the open in tab if a tab is already here action->setEnabled(false); if (isSubscribed) { - action = contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Unsubscribe"), this, SLOT(unsubscribeGroup())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_UNSUBSCRIBE), tr("Unsubscribe"), this, SLOT(unsubscribeGroup())); action->setEnabled (!mGroupId.isNull() && IS_GROUP_SUBSCRIBED(subscribeFlags)); } else { - action = contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Subscribe"), this, SLOT(subscribeGroup())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_SUBSCRIBE), tr("Subscribe"), this, SLOT(subscribeGroup())); action->setDisabled (mGroupId.isNull() || IS_GROUP_SUBSCRIBED(subscribeFlags)); } contextMnu.addSeparator(); - contextMnu.addAction(QIcon(icon(ICON_NEW)), text(TEXT_NEW), this, SLOT(newGroup())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(icon(ICON_NEW)), text(TEXT_NEW), this, SLOT(newGroup())); - action = contextMnu.addAction(QIcon(IMAGE_INFO), tr("Show Details"), this, SLOT(showGroupDetails())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_INFO), tr("Show Details"), this, SLOT(showGroupDetails())); action->setEnabled (!mGroupId.isNull()); - action = contextMnu.addAction(QIcon(IMAGE_EDIT), tr("Edit Details"), this, SLOT(editGroupDetails())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EDIT), tr("Edit Details"), this, SLOT(editGroupDetails())); action->setEnabled (!mGroupId.isNull() && isAdmin); uint32_t current_store_time = checkDelay(mInterface->getStoragePeriod(mGroupId))/86400 ; @@ -472,39 +472,39 @@ void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) QAction *actnn = NULL; QMenu *ctxMenu2 = contextMnu.addMenu(tr("Synchronise posts of last...")) ; - actnn = ctxMenu2->addAction(tr(" 5 days" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 5)) ; if(current_sync_time == 5) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 2 weeks" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 15)) ; if(current_sync_time == 15) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 1 month" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 30)) ; if(current_sync_time == 30) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 3 months" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 90)) ; if(current_sync_time == 90) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 6 months" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(180)) ; if(current_sync_time ==180) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 1 year " ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(365)) ; if(current_sync_time ==365) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" Indefinitly"),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 0)) ; if(current_sync_time == 0) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 5 days" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 5)) ; if(current_sync_time == 5) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 2 weeks" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 15)) ; if(current_sync_time == 15) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 1 month" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 30)) ; if(current_sync_time == 30) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 3 months" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 90)) ; if(current_sync_time == 90) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 6 months" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(180)) ; if(current_sync_time ==180) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 1 year " ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(365)) ; if(current_sync_time ==365) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" Indefinitly"),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 0)) ; if(current_sync_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} ctxMenu2 = contextMnu.addMenu(tr("Store posts for at most...")) ; - actnn = ctxMenu2->addAction(tr(" 5 days" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 5)) ; if(current_store_time == 5) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 2 weeks" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 15)) ; if(current_store_time == 15) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 1 month" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 30)) ; if(current_store_time == 30) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 3 months" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 90)) ; if(current_store_time == 90) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 6 months" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant(180)) ; if(current_store_time ==180) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 1 year " ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant(365)) ; if(current_store_time ==365) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" Indefinitly"),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 0)) ; if(current_store_time == 0) { actnn->setEnabled(false);actnn->setIcon(QIcon(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 5 days" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 5)) ; if(current_store_time == 5) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 2 weeks" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 15)) ; if(current_store_time == 15) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 1 month" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 30)) ; if(current_store_time == 30) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 3 months" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 90)) ; if(current_store_time == 90) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 6 months" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant(180)) ; if(current_store_time ==180) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 1 year " ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant(365)) ; if(current_store_time ==365) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" Indefinitly"),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 0)) ; if(current_store_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} if (shareKeyType()) { - action = contextMnu.addAction(QIcon(IMAGE_SHARE), tr("Share publish permissions..."), this, SLOT(sharePublishKey())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_SHARE), tr("Share publish permissions..."), this, SLOT(sharePublishKey())); action->setEnabled(!mGroupId.isNull() && isPublisher); } if (getLinkType() != RetroShareLink::TYPE_UNKNOWN) { - action = contextMnu.addAction(QIcon(IMAGE_COPYLINK), tr("Copy RetroShare Link"), this, SLOT(copyGroupLink())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COPYLINK), tr("Copy RetroShare Link"), this, SLOT(copyGroupLink())); action->setEnabled(!mGroupId.isNull()); } contextMnu.addSeparator(); - action = contextMnu.addAction(QIcon(":/images/message-mail-read.png"), tr("Mark all as read"), this, SLOT(markMsgAsRead())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/message-mail-read.png"), tr("Mark all as read"), this, SLOT(markMsgAsRead())); action->setEnabled (!mGroupId.isNull() && isSubscribed); - action = contextMnu.addAction(QIcon(":/images/message-mail.png"), tr("Mark all as unread"), this, SLOT(markMsgAsUnread())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/message-mail.png"), tr("Mark all as unread"), this, SLOT(markMsgAsUnread())); action->setEnabled (!mGroupId.isNull() && isSubscribed); /* Add special actions */ @@ -739,7 +739,7 @@ void GxsGroupFrameDialog::loadComment(const RsGxsGroupId &grpId, const QVectorcommentLoad(grpId, msgv,most_recent_msgId); int index = ui->messageTabWidget->addTab(commentDialog, comments); - ui->messageTabWidget->setTabIcon(index, QIcon(IMAGE_COMMENT)); + ui->messageTabWidget->setTabIcon(index, FilesDefs::getIconFromQtResourcePath(IMAGE_COMMENT)); } ui->messageTabWidget->setCurrentWidget(commentDialog); @@ -956,12 +956,12 @@ void GxsGroupFrameDialog::groupInfoToGroupItemInfo(const RsGxsGenericGroupData * #if TOGXS if (groupInfo.mGroupFlags & RS_DISTRIB_AUTHEN_REQ) { groupItemInfo.name += " (" + tr("AUTHD") + ")"; - groupItemInfo.icon = QIcon(IMAGE_GROUPAUTHD); + groupItemInfo.icon = FilesDefs::getIconFromQtResourcePath(IMAGE_GROUPAUTHD); } else #endif { - groupItemInfo.icon = QIcon(icon(ICON_DEFAULT)); + groupItemInfo.icon = FilesDefs::getIconFromQtResourcePath(icon(ICON_DEFAULT)); } } @@ -1209,7 +1209,7 @@ void GxsGroupFrameDialog::searchNetwork(const QString& search_string) if(request_id == 0) return ; - mSearchGroupsItems[request_id] = ui->groupTreeWidget->addSearchItem(tr("Search for")+ " \"" + search_string + "\"",(uint32_t)request_id,QIcon(icon(ICON_SEARCH))); + mSearchGroupsItems[request_id] = ui->groupTreeWidget->addSearchItem(tr("Search for")+ " \"" + search_string + "\"",(uint32_t)request_id,FilesDefs::getIconFromQtResourcePath(icon(ICON_SEARCH))); } void GxsGroupFrameDialog::distantRequestGroupData() diff --git a/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp b/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp index 2db5d8534..6235c025f 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp @@ -22,6 +22,7 @@ #include "GxsIdDetails.h" #include "RsGxsUpdateBroadcastBase.h" #include "gui/Identity/IdEditDialog.h" +#include "gui/common/FilesDefs.h" #include "util/misc.h" #include @@ -162,7 +163,7 @@ static void loadPrivateIdsCallback(GxsIdDetailsType type, const RsIdentityDetail break; case GXS_ID_DETAILS_TYPE_BANNED: - icons.push_back(QIcon(BANNED_ICON)) ; + icons.push_back(FilesDefs::getIconFromQtResourcePath(BANNED_ICON)) ; break; } @@ -285,7 +286,7 @@ void GxsIdChooser::loadPrivateIds() QString str = tr("Create new Identity"); QString id = ""; - addItem(QIcon(":/icons/png/add-identity.png"), str, id); + addItem(FilesDefs::getIconFromQtResourcePath(":/icons/png/add-identity.png"), str, id); setItemData(count() - 1, QString("%1_%2").arg(TYPE_CREATE_ID).arg(str), ROLE_SORT); setItemData(count() - 1, TYPE_CREATE_ID, ROLE_TYPE); diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp index 701a9153d..a7d050dd5 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp @@ -21,6 +21,7 @@ #include "GxsIdDetails.h" #include "gui/common/AvatarDialog.h" +#include "gui/common/FilesDefs.h" #include "retroshare-gui/RsAutoUpdatePage.h" #include @@ -375,10 +376,10 @@ static bool findTagIcon(int tag_class, int /*tag_type*/, QIcon &icon) { default: case 0: - icon = QIcon(IMAGE_DEV_AMBASSADOR); + icon = FilesDefs::getIconFromQtResourcePath(IMAGE_DEV_AMBASSADOR); break; case 1: - icon = QIcon(IMAGE_DEV_CONTRIBUTOR); + icon = FilesDefs::getIconFromQtResourcePath(IMAGE_DEV_CONTRIBUTOR); break; } return true; @@ -974,7 +975,7 @@ QString GxsIdDetails::getNameForType(GxsIdDetailsType type, const RsIdentityDeta QIcon GxsIdDetails::getLoadingIcon(const RsGxsId &/*id*/) { - return QIcon(IMAGE_LOADING); + return FilesDefs::getIconFromQtResourcePath(IMAGE_LOADING); } bool GxsIdDetails::MakeIdDesc(const RsGxsId &id, bool doIcons, QString &str, QList &icons, QString& comment,uint32_t icon_types) @@ -1005,9 +1006,9 @@ bool GxsIdDetails::MakeIdDesc(const RsGxsId &id, bool doIcons, QString &str, QLi // Cyril: I disabled these three which I believe to have been put for testing purposes. // -// icons.push_back(QIcon(IMAGE_ANON)); -// icons.push_back(QIcon(IMAGE_ANON)); -// icons.push_back(QIcon(IMAGE_ANON)); +// icons.push_back(FilesDefs::getIconFromQtResourcePath(IMAGE_ANON)); +// icons.push_back(FilesDefs::getIconFromQtResourcePath(IMAGE_ANON)); +// icons.push_back(FilesDefs::getIconFromQtResourcePath(IMAGE_ANON)); // std::cerr << "GxsIdTreeWidget::MakeIdDesc() ID Ok. Comment: " << comment.toStdString() ; // std::cerr << std::endl; @@ -1083,20 +1084,20 @@ QIcon GxsIdDetails::getReputationIcon( RsReputationLevel icon_index, uint32_t min_reputation ) { if( static_cast(icon_index) >= min_reputation ) - return QIcon(REPUTATION_VOID); + return FilesDefs::getIconFromQtResourcePath(REPUTATION_VOID); switch(icon_index) { case RsReputationLevel::LOCALLY_NEGATIVE: - return QIcon(REPUTATION_LOCALLY_NEGATIVE_ICON); + return FilesDefs::getIconFromQtResourcePath(REPUTATION_LOCALLY_NEGATIVE_ICON); case RsReputationLevel::LOCALLY_POSITIVE: - return QIcon(REPUTATION_LOCALLY_POSITIVE_ICON); + return FilesDefs::getIconFromQtResourcePath(REPUTATION_LOCALLY_POSITIVE_ICON); case RsReputationLevel::REMOTELY_POSITIVE: - return QIcon(REPUTATION_REMOTELY_POSITIVE_ICON); + return FilesDefs::getIconFromQtResourcePath(REPUTATION_REMOTELY_POSITIVE_ICON); case RsReputationLevel::REMOTELY_NEGATIVE: - return QIcon(REPUTATION_REMOTELY_NEGATIVE_ICON); + return FilesDefs::getIconFromQtResourcePath(REPUTATION_REMOTELY_NEGATIVE_ICON); case RsReputationLevel::NEUTRAL: - return QIcon(REPUTATION_NEUTRAL_ICON); + return FilesDefs::getIconFromQtResourcePath(REPUTATION_NEUTRAL_ICON); default: std::cerr << "Asked for unidentified icon index " << static_cast(icon_index) << std::endl; @@ -1112,7 +1113,7 @@ void GxsIdDetails::getIcons(const RsIdentityDetails &details, QList &icon RsReputationLevel::LOCALLY_NEGATIVE ) { icons.clear() ; - icons.push_back(QIcon(IMAGE_BANNED)) ; + icons.push_back(FilesDefs::getIconFromQtResourcePath(IMAGE_BANNED)) ; return ; } @@ -1141,12 +1142,12 @@ void GxsIdDetails::getIcons(const RsIdentityDetails &details, QList &icon if (details.mFlags & RS_IDENTITY_FLAGS_PGP_LINKED) { if (details.mFlags & RS_IDENTITY_FLAGS_PGP_KNOWN) - baseIcon = QIcon(IMAGE_PGPKNOWN); + baseIcon = FilesDefs::getIconFromQtResourcePath(IMAGE_PGPKNOWN); else - baseIcon = QIcon(IMAGE_PGPUNKNOWN); + baseIcon = FilesDefs::getIconFromQtResourcePath(IMAGE_PGPUNKNOWN); } else - baseIcon = QIcon(IMAGE_ANON); + baseIcon = FilesDefs::getIconFromQtResourcePath(IMAGE_ANON); icons.push_back(baseIcon); } diff --git a/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp b/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp index 413aef616..aa9201e95 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp @@ -67,7 +67,7 @@ static void fillGxsIdRSTreeWidgetItemCallback(GxsIdDetailsType type, const RsIde break; case GXS_ID_DETAILS_TYPE_BANNED: - icons.push_back(QIcon("BANNED_IMAGE")) ; + icons.push_back(FilesDefs::getIconFromQtResourcePath("BANNED_IMAGE")) ; break ; } diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp index ef1a6271e..177289f09 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp @@ -122,9 +122,9 @@ void CreateGxsChannelMsg::contextMenu(QPoint /*point*/) QAction *action ; if(n_file > 1) - action = contextMnu.addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Links"), this, SLOT(pasteLink())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/pasterslink.png"), tr("Paste RetroShare Links"), this, SLOT(pasteLink())); else - action = contextMnu.addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink())); action->setDisabled(n_file < 1) ; contextMnu.exec(QCursor::pos()); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp index 5e1c40fe4..a70fdf395 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp @@ -251,8 +251,8 @@ void GxsChannelDialog::groupTreeCustomActions(RsGxsGroupId grpId, int subscribeF if (isSubscribed) { - QAction *action = autoDownload ? (new QAction(QIcon(":/images/redled.png"), tr("Disable Auto-Download"), this)) - : (new QAction(QIcon(":/images/start.png"),tr("Enable Auto-Download"), this)); + QAction *action = autoDownload ? (new QAction(FilesDefs::getIconFromQtResourcePath(":/images/redled.png"), tr("Disable Auto-Download"), this)) + : (new QAction(FilesDefs::getIconFromQtResourcePath(":/images/start.png"),tr("Enable Auto-Download"), this)); connect(action, SIGNAL(triggered()), this, SLOT(toggleAutoDownload())); actions.append(action); @@ -263,7 +263,7 @@ void GxsChannelDialog::groupTreeCustomActions(RsGxsGroupId grpId, int subscribeF QMenu *mnu = new QMenu(tr("Set download directory")) ; if(dl_directory.empty()) - mnu->addAction(QIcon(":/images/start.png"),tr("[Default directory]"), this, SLOT(setDefaultDirectory())) ; + mnu->addAction(FilesDefs::getIconFromQtResourcePath(":/images/start.png"),tr("[Default directory]"), this, SLOT(setDefaultDirectory())) ; else mnu->addAction(tr("[Default directory]"), this, SLOT(setDefaultDirectory())) ; @@ -277,7 +277,7 @@ void GxsChannelDialog::groupTreeCustomActions(RsGxsGroupId grpId, int subscribeF if(dl_directory == it->filename) { - action = new QAction(QIcon(":/images/start.png"),QString::fromUtf8(it->filename.c_str()),NULL) ; + action = new QAction(FilesDefs::getIconFromQtResourcePath(":/images/start.png"),QString::fromUtf8(it->filename.c_str()),NULL) ; found = true ; } else @@ -291,7 +291,7 @@ void GxsChannelDialog::groupTreeCustomActions(RsGxsGroupId grpId, int subscribeF if(!found && !dl_directory.empty()) { - QAction *action = new QAction(QIcon(":/images/start.png"),QString::fromUtf8(dl_directory.c_str()),NULL) ; + QAction *action = new QAction(FilesDefs::getIconFromQtResourcePath(":/images/start.png"),QString::fromUtf8(dl_directory.c_str()),NULL) ; connect(action,SIGNAL(triggered()),this,SLOT(setDownloadDirectory())) ; action->setData(QString::fromUtf8(dl_directory.c_str())) ; @@ -391,7 +391,7 @@ void GxsChannelDialog::groupInfoToGroupItemInfo(const RsGxsGenericGroupData *gro groupItemInfo.icon = image; } else - groupItemInfo.icon = QIcon(":icons/png/channel.png"); + groupItemInfo.icon = FilesDefs::getIconFromQtResourcePath(":icons/png/channel.png"); groupItemInfo.description = QString::fromUtf8(channelGroupData->mDescription.c_str()); } diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp index bbbb26a42..a393b1d38 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp @@ -220,11 +220,11 @@ void GxsChannelPostsWidget::groupNameChanged(const QString &name) QIcon GxsChannelPostsWidget::groupIcon() { if (mStateHelper->isLoading(mTokenTypeGroupData) || mStateHelper->isLoading(mTokenTypeAllPosts)) { - return QIcon(":/images/kalarm.png"); + return FilesDefs::getIconFromQtResourcePath(":/images/kalarm.png"); } // if (mNewCount) { -// return QIcon(":/images/message-state-new.png"); +// return FilesDefs::getIconFromQtResourcePath(":/images/message-state-new.png"); // } return QIcon(); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index fd9c591ca..04777fa8c 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -775,7 +775,7 @@ void GxsForumThreadWidget::togglethreadview_internal() ui->expandButton->setToolTip(tr("Hide")); // } else { // ui->postText->setVisible(false); -// ui->expandButton->setIcon(QIcon(QString(":/images/edit_add24.png"))); +// ui->expandButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/images/edit_add24.png"))); // ui->expandButton->setToolTip(tr("Expand")); // } } diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp index b0dcc0402..7ce84ea5c 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp @@ -228,8 +228,8 @@ void GxsForumsDialog::groupInfoToGroupItemInfo(const RsGxsGenericGroupData *grou groupItemInfo.description = QString::fromUtf8(forumGroupData->mDescription.c_str()); if(IS_GROUP_ADMIN(groupData->mMeta.mSubscribeFlags)) - groupItemInfo.icon = QIcon(":icons/png/forums.png"); + groupItemInfo.icon = FilesDefs::getIconFromQtResourcePath(":icons/png/forums.png"); else if ((IS_GROUP_PGP_AUTHED(groupData->mMeta.mSignFlags)) || (IS_GROUP_MESSAGE_TRACKING(groupData->mMeta.mSignFlags)) ) - groupItemInfo.icon = QIcon(":icons/png/forums-signed.png"); + groupItemInfo.icon = FilesDefs::getIconFromQtResourcePath(":icons/png/forums-signed.png"); } diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.cpp b/retroshare-gui/src/gui/msgs/MessageComposer.cpp index 92f4de457..db3083686 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.cpp +++ b/retroshare-gui/src/gui/msgs/MessageComposer.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include #include #include @@ -696,7 +697,7 @@ void MessageComposer::contextMenuFileList(QPoint) { QMenu contextMnu(this); - QAction *action = contextMnu.addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteRecommended())); + QAction *action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteRecommended())); action->setDisabled(RSLinkClipboard::empty(RetroShareLink::TYPE_FILE)); contextMnu.exec(QCursor::pos()); @@ -805,7 +806,7 @@ void MessageComposer::peerStatusChanged(const QString& peer_id, int status) { QTableWidgetItem *item = ui.recipientWidget->item(row, COLUMN_RECIPIENT_ICON); if (item) - item->setIcon(QIcon(StatusDefs::imageUser(status))); + item->setIcon(FilesDefs::getIconFromQtResourcePath(StatusDefs::imageUser(status))); } } } @@ -1606,7 +1607,7 @@ void MessageComposer::setRecipientToRow(int row, enumType type, destinationType switch(dest_type) { case PEER_TYPE_GROUP: { - icon = QIcon(IMAGE_GROUP16); + icon = FilesDefs::getIconFromQtResourcePath(IMAGE_GROUP16); RsGroupInfo groupInfo; if (rsPeers->getGroupInfo(RsNodeGroupId(id), groupInfo)) { @@ -1652,7 +1653,7 @@ void MessageComposer::setRecipientToRow(int row, enumType type, destinationType // No check of return value. Non existing status info is handled as offline. rsStatus->getStatus(RsPeerId(id), peerStatusInfo); - icon = QIcon(StatusDefs::imageUser(peerStatusInfo.status)); + icon = FilesDefs::getIconFromQtResourcePath(StatusDefs::imageUser(peerStatusInfo.status)); } break ; default: @@ -1928,7 +1929,7 @@ void MessageComposer::setupFileActions() connect(a, SIGNAL(triggered()), this, SLOT(filePrint())); menu->addAction(a); - /*a = new QAction(QIcon(":/images/textedit/fileprint.png"), tr("Print Preview..."), this); + /*a = new QAction(FilesDefs::getIconFromQtResourcePath(":/images/textedit/fileprint.png"), tr("Print Preview..."), this); connect(a, SIGNAL(triggered()), this, SLOT(filePrintPreview())); menu->addAction(a);*/ @@ -2021,7 +2022,7 @@ void MessageComposer::setupContactActions() connect(mActionAddBCC, SIGNAL(triggered(bool)), this, SLOT(addBcc())); mActionAddRecommend = new QAction(tr("Add as Recommend"), this); connect(mActionAddRecommend, SIGNAL(triggered(bool)), this, SLOT(addRecommend())); - mActionContactDetails = new QAction(QIcon(IMAGE_FRIENDINFO), tr("Details"), this); + mActionContactDetails = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_FRIENDINFO), tr("Details"), this); connect(mActionContactDetails, SIGNAL(triggered(bool)), this, SLOT(contactDetails())); ui.friendSelectionWidget->addContextMenuAction(mActionAddTo); @@ -2435,9 +2436,9 @@ void MessageComposer::on_contactsdockWidget_visibilityChanged(bool visible) void MessageComposer::updatecontactsviewicons() { if(!ui.contactsdockWidget->isVisible()){ - ui.actionContactsView->setIcon(QIcon(":/icons/mail/contacts.png")); + ui.actionContactsView->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/mail/contacts.png")); }else{ - ui.actionContactsView->setIcon(QIcon(":/icons/mail/contacts.png")); + ui.actionContactsView->setIcon(FilesDefs::getIconFromQtResourcePath(":/icons/mail/contacts.png")); } } diff --git a/retroshare-gui/src/gui/msgs/MessageUserNotify.cpp b/retroshare-gui/src/gui/msgs/MessageUserNotify.cpp index fa586f1c8..4144867c6 100644 --- a/retroshare-gui/src/gui/msgs/MessageUserNotify.cpp +++ b/retroshare-gui/src/gui/msgs/MessageUserNotify.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include "MessageUserNotify.h" #include "gui/notifyqt.h" #include "gui/MainWindow.h" @@ -40,12 +41,12 @@ bool MessageUserNotify::hasSetting(QString *name, QString *group) QIcon MessageUserNotify::getIcon() { - return QIcon(":/icons/png/messages.png"); + return FilesDefs::getIconFromQtResourcePath(":/icons/png/messages.png"); } QIcon MessageUserNotify::getMainIcon(bool hasNew) { - return hasNew ? QIcon(":/icons/png/messages-notify.png") : QIcon(":/icons/png/messages.png"); + return hasNew ? FilesDefs::getIconFromQtResourcePath(":/icons/png/messages-notify.png") : FilesDefs::getIconFromQtResourcePath(":/icons/png/messages.png"); } unsigned int MessageUserNotify::getNewCount() diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index 086986230..d3f3af131 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -315,8 +315,8 @@ void MessageWidget::msgfilelistWidgetCostumPopupMenu( QPoint /*point*/ ) { QMenu contextMnu(this); - contextMnu.addAction(QIcon(IMAGE_DOWNLOAD), tr("Download"), this, SLOT(getcurrentrecommended())); - contextMnu.addAction(QIcon(IMAGE_DOWNLOADALL), tr("Download all"), this, SLOT(getallrecommended())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_DOWNLOAD), tr("Download"), this, SLOT(getcurrentrecommended())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_DOWNLOADALL), tr("Download all"), this, SLOT(getallrecommended())); contextMnu.exec(QCursor::pos()); } @@ -328,10 +328,10 @@ void MessageWidget::togglefileview(bool noUpdate/*=false*/) */ if (ui.expandFilesButton->isChecked()) { - ui.expandFilesButton->setIcon(QIcon(QString(":/icons/png/down-arrow.png"))); + ui.expandFilesButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/down-arrow.png"))); ui.expandFilesButton->setToolTip(tr("Hide the attachment pane")); } else { - ui.expandFilesButton->setIcon(QIcon(QString(":/icons/png/up-arrow.png"))); + ui.expandFilesButton->setIcon(FilesDefs::getIconFromQtResourcePath(QString(":/icons/png/up-arrow.png"))); ui.expandFilesButton->setToolTip(tr("Show the attachment pane")); } if (!noUpdate) diff --git a/retroshare-gui/src/gui/msgs/MessageWindow.cpp b/retroshare-gui/src/gui/msgs/MessageWindow.cpp index 17355143f..ad1067367 100644 --- a/retroshare-gui/src/gui/msgs/MessageWindow.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWindow.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include "MessageWindow.h" #include "MessageWidget.h" #include "MessageComposer.h" @@ -180,12 +181,12 @@ void MessageWindow::setupFileActions() menuBar()->addMenu(menu); actionSaveAs = menu->addAction(tr("Save &As File")); - actionPrint = menu->addAction(QIcon(":/images/textedit/fileprint.png"), tr("&Print...")); + actionPrint = menu->addAction(FilesDefs::getIconFromQtResourcePath(":/images/textedit/fileprint.png"), tr("&Print...")); actionPrint->setShortcut(QKeySequence::Print); - actionPrintPreview = menu->addAction(QIcon(":/images/textedit/fileprint.png"), tr("Print Preview...")); + actionPrintPreview = menu->addAction(FilesDefs::getIconFromQtResourcePath(":/images/textedit/fileprint.png"), tr("Print Preview...")); -// a = new QAction(QIcon(":/images/textedit/exportpdf.png"), tr("&Export PDF..."), this); +// a = new QAction(FilesDefs::getIconFromQtResourcePath(":/images/textedit/exportpdf.png"), tr("&Export PDF..."), this); // a->setShortcut(Qt::CTRL + Qt::Key_D); // connect(a, SIGNAL(triggered()), this, SLOT(filePrintPdf())); // menu->addAction(a); diff --git a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp index 40b61739a..acb19d900 100644 --- a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp @@ -422,7 +422,7 @@ void MessagesDialog::fillQuickView() // add static items item = new QListWidgetItem(tr("Starred"), ui.quickViewWidget); - item->setIcon(QIcon(IMAGE_STAR_ON)); + item->setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_STAR_ON)); item->setData(ROLE_QUICKVIEW_TYPE, QUICKVIEW_TYPE_STATIC); item->setData(ROLE_QUICKVIEW_ID, QUICKVIEW_STATIC_ID_STARRED); item->setData(ROLE_QUICKVIEW_TEXT, item->text()); // for updateMessageSummaryList @@ -432,7 +432,7 @@ void MessagesDialog::fillQuickView() } item = new QListWidgetItem(tr("System"), ui.quickViewWidget); - item->setIcon(QIcon(IMAGE_NOTFICATION)); + item->setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_NOTFICATION)); item->setData(ROLE_QUICKVIEW_TYPE, QUICKVIEW_TYPE_STATIC); item->setData(ROLE_QUICKVIEW_ID, QUICKVIEW_STATIC_ID_SYSTEM); item->setData(ROLE_QUICKVIEW_TEXT, item->text()); // for updateMessageSummaryList @@ -442,7 +442,7 @@ void MessagesDialog::fillQuickView() } item = new QListWidgetItem(tr("Spam"), ui.quickViewWidget); - item->setIcon(QIcon(IMAGE_SPAM_ON)); + item->setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_SPAM_ON)); item->setData(ROLE_QUICKVIEW_TYPE, QUICKVIEW_TYPE_STATIC); item->setData(ROLE_QUICKVIEW_ID, QUICKVIEW_STATIC_ID_SPAM); item->setData(ROLE_QUICKVIEW_TEXT, item->text()); // for updateMessageSummaryList @@ -452,7 +452,7 @@ void MessagesDialog::fillQuickView() } item = new QListWidgetItem(tr("Attachment"), ui.quickViewWidget); - item->setIcon(QIcon(IMAGE_ATTACHMENT)); + item->setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_ATTACHMENT)); item->setData(ROLE_QUICKVIEW_TYPE, QUICKVIEW_TYPE_STATIC); item->setData(ROLE_QUICKVIEW_ID, QUICKVIEW_STATIC_ID_ATTACHMENT); item->setData(ROLE_QUICKVIEW_TEXT, item->text()); // for updateMessageSummaryList @@ -584,13 +584,13 @@ void MessagesDialog::messageTreeWidgetCustomPopupMenu(QPoint /*point*/) QMenu contextMnu( this ); - QAction *action = contextMnu.addAction(QIcon(":/images/view_split_top_bottom.png"), tr("Open in a new window"), this, SLOT(openAsWindow())); + QAction *action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/view_split_top_bottom.png"), tr("Open in a new window"), this, SLOT(openAsWindow())); if (nCount != 1) { action->setDisabled(true); } - action = contextMnu.addAction(QIcon(":/images/tab-dock.png"), tr("Open in a new tab"), this, SLOT(openAsTab())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/tab-dock.png"), tr("Open in a new tab"), this, SLOT(openAsTab())); if (nCount != 1) { action->setDisabled(true); } @@ -608,12 +608,12 @@ void MessagesDialog::messageTreeWidgetCustomPopupMenu(QPoint /*point*/) contextMnu.addSeparator(); - action = contextMnu.addAction(QIcon(":/images/message-mail-read.png"), tr("Mark as read"), this, SLOT(markAsRead())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/message-mail-read.png"), tr("Mark as read"), this, SLOT(markAsRead())); if (itemsUnread.isEmpty()) { action->setDisabled(true); } - action = contextMnu.addAction(QIcon(":/images/message-mail.png"), tr("Mark as unread"), this, SLOT(markAsUnread())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/message-mail.png"), tr("Mark as unread"), this, SLOT(markAsUnread())); if (itemsRead.isEmpty()) { action->setDisabled(true); @@ -647,7 +647,7 @@ void MessagesDialog::messageTreeWidgetCustomPopupMenu(QPoint /*point*/) action->setDisabled(true); } - action = contextMnu.addAction(QIcon(IMAGE_MESSAGEREMOVE), (nCount > 1) ? tr("Remove Messages") : tr("Remove Message"), this, SLOT(removemessage())); + action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MESSAGEREMOVE), (nCount > 1) ? tr("Remove Messages") : tr("Remove Message"), this, SLOT(removemessage())); if (nCount == 0) { action->setDisabled(true); } @@ -674,11 +674,11 @@ void MessagesDialog::messageTreeWidgetCustomPopupMenu(QPoint /*point*/) { std::cerr << "Src ID = " << msgInfo.rsgxsid_srcId << std::endl; - contextMnu.addAction(QIcon(IMAGE_AUTHOR_INFO),tr("Show author in People"),this,SLOT(showAuthorInPeopleTab())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_AUTHOR_INFO),tr("Show author in People"),this,SLOT(showAuthorInPeopleTab())); contextMnu.addSeparator(); } - contextMnu.addAction(QIcon(IMAGE_MESSAGE), tr("New Message"), this, SLOT(newmessage())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MESSAGE), tr("New Message"), this, SLOT(newmessage())); contextMnu.exec(QCursor::pos()); } @@ -767,7 +767,7 @@ void MessagesDialog::openAsTab() return; } - ui.tabWidget->addTab(msgWidget,QIcon(IMAGE_MAIL), msgWidget->subject(true)); + ui.tabWidget->addTab(msgWidget,FilesDefs::getIconFromQtResourcePath(IMAGE_MAIL), msgWidget->subject(true)); ui.tabWidget->setCurrentWidget(msgWidget); connect(msgWidget, SIGNAL(messageRemoved()), this, SLOT(messageRemoved())); @@ -1284,7 +1284,7 @@ void MessagesDialog::updateMessageSummaryList() QFont qf = item->font(); qf.setBold(true); item->setFont(qf); - item->setIcon(QIcon(":/images/folder-inbox-new.png")); + item->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/folder-inbox-new.png")); item->setData(Qt::ForegroundRole, mTextColorInbox); } else @@ -1294,7 +1294,7 @@ void MessagesDialog::updateMessageSummaryList() QFont qf = item->font(); qf.setBold(false); item->setFont(qf); - item->setIcon(QIcon(":/images/folder-inbox.png")); + item->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/folder-inbox.png")); item->setData(Qt::ForegroundRole, QVariant()); } @@ -1553,6 +1553,6 @@ void MessagesDialog::updateInterface() else { ui.tabWidget->setTabText(0, tr("No Box selected.")); - ui.tabWidget->setTabIcon(0, QIcon(":/icons/warning_yellow_128.png")); + ui.tabWidget->setTabIcon(0, FilesDefs::getIconFromQtResourcePath(":/icons/warning_yellow_128.png")); } } diff --git a/retroshare-gui/src/gui/notifyqt.cpp b/retroshare-gui/src/gui/notifyqt.cpp index e2e933a32..3a181df2c 100644 --- a/retroshare-gui/src/gui/notifyqt.cpp +++ b/retroshare-gui/src/gui/notifyqt.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include #include @@ -276,7 +277,7 @@ bool NotifyQt::askForPluginConfirmation(const std::string& plugin_file_name, con text += "" ; dialog.setText(text) ; - dialog.setWindowIcon(QIcon(":/icons/logo_128.png")); + dialog.setWindowIcon(FilesDefs::getIconFromQtResourcePath(":/icons/logo_128.png")); dialog.setStandardButtons(QMessageBox::Yes | QMessageBox::No) ; int ret = dialog.exec(); diff --git a/retroshare-gui/src/gui/profile/ProfileManager.cpp b/retroshare-gui/src/gui/profile/ProfileManager.cpp index 0a8a80df6..7041f7201 100644 --- a/retroshare-gui/src/gui/profile/ProfileManager.cpp +++ b/retroshare-gui/src/gui/profile/ProfileManager.cpp @@ -19,6 +19,7 @@ *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include #include #include @@ -67,7 +68,7 @@ void ProfileManager::identityTreeWidgetCostumPopupMenu(QPoint) QMenu contextMnu(this); - QAction *action = contextMnu.addAction(QIcon(IMAGE_EXPORT), tr("Export Identity"), this, SLOT(exportIdentity())); + QAction *action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EXPORT), tr("Export Identity"), this, SLOT(exportIdentity())); action->setEnabled(item != NULL); contextMnu.exec(QCursor::pos()); diff --git a/retroshare-gui/src/gui/settings/AppearancePage.cpp b/retroshare-gui/src/gui/settings/AppearancePage.cpp index 0c3c2c924..02ad43143 100755 --- a/retroshare-gui/src/gui/settings/AppearancePage.cpp +++ b/retroshare-gui/src/gui/settings/AppearancePage.cpp @@ -42,6 +42,7 @@ #include "gui/statusbar/SoundStatus.h" #include "gui/statusbar/ToasterDisable.h" #include "gui/statusbar/SysTrayStatus.h" +#include "gui/common/FilesDefs.h" /** Constructor */ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags) @@ -69,7 +70,7 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags) /* Populate combo boxes */ foreach (QString code, LanguageSupport::languageCodes()) { - ui.cmboLanguage->addItem(QIcon(":/images/flags/" + code + ".png"), LanguageSupport::languageName(code), code); + ui.cmboLanguage->addItem(FilesDefs::getIconFromQtResourcePath(":/images/flags/" + code + ".png"), LanguageSupport::languageName(code), code); } foreach (QString style, QStyleFactory::keys()) { ui.cmboStyle->addItem(style, style.toLower()); diff --git a/retroshare-gui/src/gui/settings/FileAssociationsPage.cpp b/retroshare-gui/src/gui/settings/FileAssociationsPage.cpp index e6e5f67e3..fe7e36a7b 100755 --- a/retroshare-gui/src/gui/settings/FileAssociationsPage.cpp +++ b/retroshare-gui/src/gui/settings/FileAssociationsPage.cpp @@ -19,6 +19,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include "FileAssociationsPage.h" #include "AddFileAssociationDialog.h" //#include "rshare.h" // for Rshare::dataDirectory() method @@ -60,19 +61,19 @@ FileAssociationsPage::FileAssociationsPage(QWidget * parent, Qt::WindowFlags fla QVBoxLayout* pageLay = new QVBoxLayout(this); toolBar = new QToolBar("actions", this); - newAction = new QAction(QIcon(":/icons/png/add.png"), tr("&New"), this); + newAction = new QAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/add.png"), tr("&New"), this); //newAction->setShortcut(tr("Ctrl+N")); newAction->setStatusTip(tr("Add new Association")); connect(newAction, SIGNAL(triggered()), this, SLOT(addnew())); toolBar->addAction(newAction); - editAction = new QAction(QIcon(":/images/kcmsystem24.png"), + editAction = new QAction(FilesDefs::getIconFromQtResourcePath(":/images/kcmsystem24.png"), tr("&Edit"), this); editAction->setStatusTip(tr("Edit this Association")); connect(editAction, SIGNAL(triggered()), this, SLOT(edit())); toolBar->addAction(editAction); - removeAction = new QAction(QIcon(":/images/edit_remove24.png"), + removeAction = new QAction(FilesDefs::getIconFromQtResourcePath(":/images/edit_remove24.png"), tr("&Remove"), this); removeAction->setStatusTip(tr("Remove this Association")); connect(removeAction, SIGNAL(triggered()), this, SLOT(remove())); diff --git a/retroshare-gui/src/gui/settings/ServerPage.cpp b/retroshare-gui/src/gui/settings/ServerPage.cpp index 37291be0f..64392aa08 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.cpp +++ b/retroshare-gui/src/gui/settings/ServerPage.cpp @@ -1352,7 +1352,7 @@ void ServerPage::updateInProxyIndicator() return ; //ui.iconlabel_tor_incoming->setPixmap(QPixmap(ICON_STATUS_UNKNOWN)) ; - //ui.testIncomingTor_PB->setIcon(QIcon(":/loader/circleball-16.gif")) ; + //ui.testIncomingTor_PB->setIcon(FilesDefs::getIconFromQtResourcePath(":/loader/circleball-16.gif")) ; QMovie *movie = new QMovie(":/images/loader/circleball-16.gif"); ui.iconlabel_service_incoming->setMovie(movie); movie->start(); @@ -1846,11 +1846,11 @@ void ServerPage::updateInProxyIndicatorResult(bool success) ui.iconlabel_service_incoming->setPixmap(QPixmap(ICON_STATUS_OK)) ; ui.iconlabel_service_incoming->setToolTip(tr("You are reachable through the hidden service.")) ; - //ui.testIncomingTor_PB->setIcon(QIcon(ICON_STATUS_OK)) ; + //ui.testIncomingTor_PB->setIcon(FilesDefs::getIconFromQtResourcePath(ICON_STATUS_OK)) ; } else { std::cerr <<"Failed!" << std::endl; - //ui.testIncomingTor_PB->setIcon(QIcon(ICON_STATUS_UNKNOWN)) ; + //ui.testIncomingTor_PB->setIcon(FilesDefs::getIconFromQtResourcePath(ICON_STATUS_UNKNOWN)) ; ui.iconlabel_service_incoming->setPixmap(QPixmap(ICON_STATUS_UNKNOWN)) ; ui.iconlabel_service_incoming->setToolTip(tr("The proxy is not enabled or broken.\nAre all services up and running fine??\nAlso check your ports!")) ; } diff --git a/retroshare-gui/src/gui/settings/rsettingswin.h b/retroshare-gui/src/gui/settings/rsettingswin.h index 7a9864fff..9b584162e 100755 --- a/retroshare-gui/src/gui/settings/rsettingswin.h +++ b/retroshare-gui/src/gui/settings/rsettingswin.h @@ -21,6 +21,7 @@ #ifndef RSETTINGSWIN_HPP_ #define RSETTINGSWIN_HPP_ +#include "gui/common/FilesDefs.h" #include #include #include "ui_settingsw.h" @@ -44,7 +45,7 @@ public: void postModDirectories(bool update_local); - virtual QIcon iconPixmap() const { return QIcon(IMAGE_PREFERENCES) ; } //MainPage + virtual QIcon iconPixmap() const { return FilesDefs::getIconFromQtResourcePath(IMAGE_PREFERENCES) ; } //MainPage virtual QString pageName() const { return tr("Preferences") ; } //MainPage protected: diff --git a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp index 0a992353b..1fc583b18 100644 --- a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp @@ -126,7 +126,7 @@ void GlobalRouterStatistics::CustomPopupMenu( QPoint ) QTreeWidgetItem *item = treeWidget->currentItem(); if (item) { - contextMnu.addAction(QIcon(":/images/info16.png"), tr("Details"), this, SLOT(personDetails())); + contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(":/images/info16.png"), tr("Details"), this, SLOT(personDetails())); } diff --git a/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp index 50c947822..3d3868135 100644 --- a/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp +++ b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp @@ -34,6 +34,7 @@ #include #include +#include "gui/common/FilesDefs.h" #include #include @@ -140,22 +141,22 @@ void StatisticsWindow::initStackedPage() QAction *action; ui->stackPages->add(bwdlg = new BwCtrlWindow(ui->stackPages), - action = createPageAction(QIcon(IMAGE_BWGRAPH), tr("Bandwidth"), grp)); + action = createPageAction(FilesDefs::getIconFromQtResourcePath(IMAGE_BWGRAPH), tr("Bandwidth"), grp)); ui->stackPages->add(trsdlg = new TurtleRouterStatistics(ui->stackPages), - action = createPageAction(QIcon(IMAGE_TURTLE), tr("Turtle Router"), grp)); + action = createPageAction(FilesDefs::getIconFromQtResourcePath(IMAGE_TURTLE), tr("Turtle Router"), grp)); ui->stackPages->add(gxsiddlg = new GxsIdStatistics(ui->stackPages), - action = createPageAction(QIcon(IMAGE_IDENTITIES), tr("Identities"), grp)); + action = createPageAction(FilesDefs::getIconFromQtResourcePath(IMAGE_IDENTITIES), tr("Identities"), grp)); ui->stackPages->add(grsdlg = new GlobalRouterStatistics(ui->stackPages), - action = createPageAction(QIcon(IMAGE_GLOBALROUTER), tr("Global Router"), grp)); + action = createPageAction(FilesDefs::getIconFromQtResourcePath(IMAGE_GLOBALROUTER), tr("Global Router"), grp)); ui->stackPages->add(gxsdlg = new GxsTransportStatistics(ui->stackPages), - action = createPageAction(QIcon(IMAGE_GXSTRANSPORT), tr("Gxs Transport"), grp)); + action = createPageAction(FilesDefs::getIconFromQtResourcePath(IMAGE_GXSTRANSPORT), tr("Gxs Transport"), grp)); ui->stackPages->add(rttdlg = new RttStatistics(ui->stackPages), - action = createPageAction(QIcon(IMAGE_RTT), tr("RTT Statistics"), grp)); + action = createPageAction(FilesDefs::getIconFromQtResourcePath(IMAGE_RTT), tr("RTT Statistics"), grp)); bool showdht = true; RsPeerDetails detail; @@ -167,7 +168,7 @@ void StatisticsWindow::initStackedPage() if(showdht) { ui->stackPages->add(dhtw = new DhtWindow(ui->stackPages), - action = createPageAction(QIcon(IMAGE_DHT), tr("DHT"), grp)); + action = createPageAction(FilesDefs::getIconFromQtResourcePath(IMAGE_DHT), tr("DHT"), grp)); } /*std::cerr << "Looking for interfaces in existing plugins:" << std::endl; @@ -180,7 +181,7 @@ void StatisticsWindow::initStackedPage() if(rsPlugins->plugin(i)->qt_icon() != NULL) icon = *rsPlugins->plugin(i)->qt_icon() ; else - icon = QIcon(":images/extension_48.png") ; + icon = FilesDefs::getIconFromQtResourcePath(":images/extension_48.png") ; std::cerr << " Addign widget page for plugin " << rsPlugins->plugin(i)->getPluginName() << std::endl; MainPage *pluginPage = rsPlugins->plugin(i)->qt_page(); diff --git a/retroshare-gui/src/gui/statusbar/SoundStatus.cpp b/retroshare-gui/src/gui/statusbar/SoundStatus.cpp index 531133008..374a61b12 100644 --- a/retroshare-gui/src/gui/statusbar/SoundStatus.cpp +++ b/retroshare-gui/src/gui/statusbar/SoundStatus.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include #include @@ -54,6 +55,6 @@ SoundStatus::SoundStatus(QWidget *parent) void SoundStatus::mute(bool isMute) { - imageButton->setIcon(QIcon(isMute ? IMAGE_MUTE_ON : IMAGE_MUTE_OFF)); + imageButton->setIcon(FilesDefs::getIconFromQtResourcePath(isMute ? IMAGE_MUTE_ON : IMAGE_MUTE_OFF)); imageButton->setToolTip(isMute ? tr("Sound is off, click to turn it on") : tr("Sound is on, click to turn it off")); } diff --git a/retroshare-gui/src/gui/statusbar/SysTrayStatus.cpp b/retroshare-gui/src/gui/statusbar/SysTrayStatus.cpp index b465e83e3..1f52163ec 100644 --- a/retroshare-gui/src/gui/statusbar/SysTrayStatus.cpp +++ b/retroshare-gui/src/gui/statusbar/SysTrayStatus.cpp @@ -18,6 +18,7 @@ * * *******************************************************************************/ +#include "gui/common/FilesDefs.h" #include #include #include @@ -36,7 +37,7 @@ SysTrayStatus::SysTrayStatus(QWidget *parent) : hbox->setSpacing(0); imageButton = new QPushButton(this); - imageButton->setIcon(QIcon(IMAGE_NOONLINE)); + imageButton->setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_NOONLINE)); imageButton->setFlat(true); imageButton->setCheckable(false); imageButton->setFocusPolicy(Qt::ClickFocus); diff --git a/retroshare-gui/src/gui/unfinished/ApplicationWindow.cpp b/retroshare-gui/src/gui/unfinished/ApplicationWindow.cpp index 9db4326a4..923d1ba88 100644 --- a/retroshare-gui/src/gui/unfinished/ApplicationWindow.cpp +++ b/retroshare-gui/src/gui/unfinished/ApplicationWindow.cpp @@ -74,7 +74,7 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WindowFlags flags) //StatisticDialog *statisticDialog = NULL; //ui.stackPages->add(statisticDialog = new StatisticDialog(ui.stackPages), - // createPageAction(QIcon(IMAGE_STATISTIC), tr("Statistics"), grp)); + // createPageAction(FilesDefs::getIconFromQtResourcePath(IMAGE_STATISTIC), tr("Statistics"), grp)); //GamesDialog *gamesDialog = NULL; //ui.stackPages->add(gamesDialog = new GamesDialog(ui.stackPages), @@ -91,7 +91,7 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WindowFlags flags) #ifdef RS_USE_CIRCLES CirclesDialog *circlesDialog = NULL; ui.stackPages->add(circlesDialog = new CirclesDialog(ui.stackPages), - action = createPageAction(QIcon(IMAGE_CIRCLES ), tr("Circles"), grp)); + action = createPageAction(FilesDefs::getIconFromQtResourcePath(IMAGE_CIRCLES ), tr("Circles"), grp)); mNotify.push_back(QPair(circlesDialog, action)); #endif #endif @@ -105,13 +105,13 @@ ApplicationWindow::ApplicationWindow(QWidget* parent, Qt::WindowFlags flags) /*PostedDialog *postedDialog = NULL; ui.stackPages->add(postedDialog = new PostedDialog(ui.stackPages), - action = createPageAction(QIcon(IMAGE_POSTED), tr("Posted Links"), grp)); + action = createPageAction(FilesDefs::getIconFromQtResourcePath(IMAGE_POSTED), tr("Posted Links"), grp)); postedDialog->setup(); mNotify.push_back(QPair(postedDialog, action)); WikiDialog *wikiDialog = NULL; ui.stackPages->add(wikiDialog = new WikiDialog(ui.stackPages), - action = createPageAction(QIcon(IMAGE_WIKI), tr("Wiki Pages"), grp)); + action = createPageAction(FilesDefs::getIconFromQtResourcePath(IMAGE_WIKI), tr("Wiki Pages"), grp)); mNotify.push_back(QPair(wikiDialog, action));*/ // THESE HAVE TO BE CONVERTED TO VEG FORMAT diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index 490878e57..4c427d289 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -30,6 +30,7 @@ CrashStackTrace gCrashStackTrace; #include #include +#include "gui/common/FilesDefs.h" #include "gui/FriendsDialog.h" #include "gui/GenCertDialog.h" #include "gui/MainWindow.h" @@ -136,7 +137,7 @@ static void displayWarningAboutDSAKeys() msgBox.setInformativeText(QObject::tr("DSA keys are not yet supported by this version of RetroShare. All these nodes will be unusable. We're very sorry for that.")); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setDefaultButton(QMessageBox::Ok); - msgBox.setWindowIcon(QIcon(":/icons/logo_128.png")); + msgBox.setWindowIcon(FilesDefs::getIconFromQtResourcePath(":/icons/logo_128.png")); msgBox.exec(); } @@ -270,7 +271,7 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO); msgBox.setInformativeText(QObject::tr("Choose between:
  • Ok to copy the existing keyring from gnupg (safest bet), or
  • Close without saving to start fresh with an empty keyring (you will be asked to create a new PGP key to work with RetroShare, or import a previously saved pgp keypair).
  • Cancel to quit and forge a keyring by yourself (needs some PGP skills)
")); msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Discard | QMessageBox::Cancel); msgBox.setDefaultButton(QMessageBox::Ok); - msgBox.setWindowIcon(QIcon(":/icons/logo_128.png")); + msgBox.setWindowIcon(FilesDefs::getIconFromQtResourcePath(":/icons/logo_128.png")); int ret = msgBox.exec(); @@ -299,7 +300,7 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO); displayWarningAboutDSAKeys(); QMessageBox mb(QMessageBox::Critical, QObject::tr("RetroShare"), "", QMessageBox::Ok); - mb.setWindowIcon(QIcon(":/icons/logo_128.png")); + mb.setWindowIcon(FilesDefs::getIconFromQtResourcePath(":/icons/logo_128.png")); switch (initResult) { diff --git a/retroshare-gui/src/rshare.cpp b/retroshare-gui/src/rshare.cpp index 3898a899a..cbed6698a 100644 --- a/retroshare-gui/src/rshare.cpp +++ b/retroshare-gui/src/rshare.cpp @@ -42,6 +42,7 @@ #include #include +#include "gui/common/FilesDefs.h" #include #include #include @@ -258,7 +259,7 @@ Rshare::Rshare(QStringList args, int &argc, char **argv, const QString &dir) #ifndef __APPLE__ /* set default window icon */ - setWindowIcon(QIcon(":/icons/logo_128.png")); + setWindowIcon(FilesDefs::getIconFromQtResourcePath(":/icons/logo_128.png")); #endif