replaced a bunch of explicit icons, mostly in abstract items models, by cached ones

This commit is contained in:
csoler 2020-04-19 17:41:13 +02:00
parent c84016c3b0
commit 02e939ac8f
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
6 changed files with 92 additions and 90 deletions

View file

@ -919,10 +919,10 @@ TransfersDialog::TransfersDialog(QWidget *parent)
QObject::connect(ui.downloadList->selectionModel(),SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)),this,SLOT(showFileDetails())) ; QObject::connect(ui.downloadList->selectionModel(),SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)),this,SLOT(showFileDetails())) ;
ui.tabWidget->insertTab(2,searchDialog = new SearchDialog(), QIcon(IMAGE_SEARCH), tr("Search")) ; ui.tabWidget->insertTab(2,searchDialog = new SearchDialog(), FilesDefs::getIconFromQtResourcePath(IMAGE_SEARCH), tr("Search")) ;
ui.tabWidget->insertTab(3,remoteSharedFiles = new RemoteSharedFilesDialog(), QIcon(IMAGE_FRIENDSFILES), tr("Friends files")) ; ui.tabWidget->insertTab(3,remoteSharedFiles = new RemoteSharedFilesDialog(), FilesDefs::getIconFromQtResourcePath(IMAGE_FRIENDSFILES), tr("Friends files")) ;
ui.tabWidget->addTab(localSharedFiles = new LocalSharedFilesDialog(), QIcon(IMAGE_MYFILES), tr("My files")) ; ui.tabWidget->addTab(localSharedFiles = new LocalSharedFilesDialog(), FilesDefs::getIconFromQtResourcePath(IMAGE_MYFILES), tr("My files")) ;
for(int i=0;i<rsPlugins->nbPlugins();++i) for(int i=0;i<rsPlugins->nbPlugins();++i)
if(rsPlugins->plugin(i) != NULL && rsPlugins->plugin(i)->qt_transfers_tab() != NULL) if(rsPlugins->plugin(i) != NULL && rsPlugins->plugin(i)->qt_transfers_tab() != NULL)
@ -933,79 +933,79 @@ TransfersDialog::TransfersDialog(QWidget *parent)
/** Setup the actions for the context menu */ /** Setup the actions for the context menu */
// Actions. Only need to be defined once. // Actions. Only need to be defined once.
pauseAct = new QAction(QIcon(IMAGE_PAUSE), tr("Pause"), this); pauseAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_PAUSE), tr("Pause"), this);
connect(pauseAct, SIGNAL(triggered()), this, SLOT(pauseFileTransfer())); connect(pauseAct, SIGNAL(triggered()), this, SLOT(pauseFileTransfer()));
resumeAct = new QAction(QIcon(IMAGE_RESUME), tr("Resume"), this); resumeAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_RESUME), tr("Resume"), this);
connect(resumeAct, SIGNAL(triggered()), this, SLOT(resumeFileTransfer())); connect(resumeAct, SIGNAL(triggered()), this, SLOT(resumeFileTransfer()));
forceCheckAct = new QAction(QIcon(IMAGE_CANCEL), tr( "Force Check" ), this ); forceCheckAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_CANCEL), tr( "Force Check" ), this );
connect( forceCheckAct , SIGNAL( triggered() ), this, SLOT( forceCheck() ) ); connect( forceCheckAct , SIGNAL( triggered() ), this, SLOT( forceCheck() ) );
cancelAct = new QAction(QIcon(IMAGE_CANCEL), tr( "Cancel" ), this ); cancelAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_CANCEL), tr( "Cancel" ), this );
connect( cancelAct , SIGNAL( triggered() ), this, SLOT( cancel() ) ); connect( cancelAct , SIGNAL( triggered() ), this, SLOT( cancel() ) );
openFolderAct = new QAction(QIcon(IMAGE_OPENFOLDER), tr("Open Folder"), this); openFolderAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_OPENFOLDER), tr("Open Folder"), this);
connect(openFolderAct, SIGNAL(triggered()), this, SLOT(dlOpenFolder())); connect(openFolderAct, SIGNAL(triggered()), this, SLOT(dlOpenFolder()));
openFileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Open File"), this); openFileAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_OPENFILE), tr("Open File"), this);
connect(openFileAct, SIGNAL(triggered()), this, SLOT(dlOpenFile())); connect(openFileAct, SIGNAL(triggered()), this, SLOT(dlOpenFile()));
previewFileAct = new QAction(QIcon(IMAGE_PREVIEW), tr("Preview File"), this); previewFileAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_PREVIEW), tr("Preview File"), this);
connect(previewFileAct, SIGNAL(triggered()), this, SLOT(dlPreviewFile())); connect(previewFileAct, SIGNAL(triggered()), this, SLOT(dlPreviewFile()));
detailsFileAct = new QAction(QIcon(IMAGE_INFO), tr("Details..."), this); detailsFileAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_INFO), tr("Details..."), this);
connect(detailsFileAct, SIGNAL(triggered()), this, SLOT(showDetailsDialog())); connect(detailsFileAct, SIGNAL(triggered()), this, SLOT(showDetailsDialog()));
clearCompletedAct = new QAction(QIcon(IMAGE_CLEARCOMPLETED), tr( "Clear Completed" ), this ); clearCompletedAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_CLEARCOMPLETED), tr( "Clear Completed" ), this );
connect( clearCompletedAct , SIGNAL( triggered() ), this, SLOT( clearcompleted() ) ); connect( clearCompletedAct , SIGNAL( triggered() ), this, SLOT( clearcompleted() ) );
copyLinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy RetroShare Link" ), this ); copyLinkAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COPYLINK), tr( "Copy RetroShare Link" ), this );
connect( copyLinkAct , SIGNAL( triggered() ), this, SLOT( dlCopyLink() ) ); connect( copyLinkAct , SIGNAL( triggered() ), this, SLOT( dlCopyLink() ) );
pasteLinkAct = new QAction(QIcon(IMAGE_PASTELINK), tr( "Paste RetroShare Link" ), this ); pasteLinkAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_PASTELINK), tr( "Paste RetroShare Link" ), this );
connect( pasteLinkAct , SIGNAL( triggered() ), this, SLOT( pasteLink() ) ); connect( pasteLinkAct , SIGNAL( triggered() ), this, SLOT( pasteLink() ) );
queueDownAct = new QAction(QIcon(":/images/go-down.png"), tr("Down"), this); queueDownAct = new QAction(FilesDefs::getIconFromQtResourcePath(":/images/go-down.png"), tr("Down"), this);
connect(queueDownAct, SIGNAL(triggered()), this, SLOT(priorityQueueDown())); connect(queueDownAct, SIGNAL(triggered()), this, SLOT(priorityQueueDown()));
queueUpAct = new QAction(QIcon(":/images/go-up.png"), tr("Up"), this); queueUpAct = new QAction(FilesDefs::getIconFromQtResourcePath(":/images/go-up.png"), tr("Up"), this);
connect(queueUpAct, SIGNAL(triggered()), this, SLOT(priorityQueueUp())); connect(queueUpAct, SIGNAL(triggered()), this, SLOT(priorityQueueUp()));
queueTopAct = new QAction(QIcon(":/images/go-top.png"), tr("Top"), this); queueTopAct = new QAction(FilesDefs::getIconFromQtResourcePath(":/images/go-top.png"), tr("Top"), this);
connect(queueTopAct, SIGNAL(triggered()), this, SLOT(priorityQueueTop())); connect(queueTopAct, SIGNAL(triggered()), this, SLOT(priorityQueueTop()));
queueBottomAct = new QAction(QIcon(":/images/go-bottom.png"), tr("Bottom"), this); queueBottomAct = new QAction(FilesDefs::getIconFromQtResourcePath(":/images/go-bottom.png"), tr("Bottom"), this);
connect(queueBottomAct, SIGNAL(triggered()), this, SLOT(priorityQueueBottom())); connect(queueBottomAct, SIGNAL(triggered()), this, SLOT(priorityQueueBottom()));
chunkStreamingAct = new QAction(QIcon(IMAGE_STREAMING), tr("Streaming"), this); chunkStreamingAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_STREAMING), tr("Streaming"), this);
connect(chunkStreamingAct, SIGNAL(triggered()), this, SLOT(chunkStreaming())); connect(chunkStreamingAct, SIGNAL(triggered()), this, SLOT(chunkStreaming()));
prioritySlowAct = new QAction(QIcon(IMAGE_PRIORITYLOW), tr("Slower"), this); prioritySlowAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_PRIORITYLOW), tr("Slower"), this);
connect(prioritySlowAct, SIGNAL(triggered()), this, SLOT(speedSlow())); connect(prioritySlowAct, SIGNAL(triggered()), this, SLOT(speedSlow()));
priorityMediumAct = new QAction(QIcon(IMAGE_PRIORITYNORMAL), tr("Average"), this); priorityMediumAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_PRIORITYNORMAL), tr("Average"), this);
connect(priorityMediumAct, SIGNAL(triggered()), this, SLOT(speedAverage())); connect(priorityMediumAct, SIGNAL(triggered()), this, SLOT(speedAverage()));
priorityFastAct = new QAction(QIcon(IMAGE_PRIORITYHIGH), tr("Faster"), this); priorityFastAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_PRIORITYHIGH), tr("Faster"), this);
connect(priorityFastAct, SIGNAL(triggered()), this, SLOT(speedFast())); connect(priorityFastAct, SIGNAL(triggered()), this, SLOT(speedFast()));
chunkRandomAct = new QAction(QIcon(IMAGE_PRIORITYAUTO), tr("Random"), this); chunkRandomAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_PRIORITYAUTO), tr("Random"), this);
connect(chunkRandomAct, SIGNAL(triggered()), this, SLOT(chunkRandom())); connect(chunkRandomAct, SIGNAL(triggered()), this, SLOT(chunkRandom()));
chunkProgressiveAct = new QAction(QIcon(IMAGE_PRIORITYAUTO), tr("Progressive"), this); chunkProgressiveAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_PRIORITYAUTO), tr("Progressive"), this);
connect(chunkProgressiveAct, SIGNAL(triggered()), this, SLOT(chunkProgressive())); connect(chunkProgressiveAct, SIGNAL(triggered()), this, SLOT(chunkProgressive()));
playAct = new QAction(QIcon(IMAGE_PLAY), tr( "Play" ), this ); playAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_PLAY), tr( "Play" ), this );
connect( playAct , SIGNAL( triggered() ), this, SLOT( dlOpenFile() ) ); connect( playAct , SIGNAL( triggered() ), this, SLOT( dlOpenFile() ) );
renameFileAct = new QAction(QIcon(IMAGE_RENAMEFILE), tr("Rename file..."), this); renameFileAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_RENAMEFILE), tr("Rename file..."), this);
connect(renameFileAct, SIGNAL(triggered()), this, SLOT(renameFile())); connect(renameFileAct, SIGNAL(triggered()), this, SLOT(renameFile()));
specifyDestinationDirectoryAct = new QAction(QIcon(IMAGE_SEARCH),tr("Specify..."),this) ; specifyDestinationDirectoryAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_SEARCH),tr("Specify..."),this) ;
connect(specifyDestinationDirectoryAct,SIGNAL(triggered()),this,SLOT(chooseDestinationDirectory())); connect(specifyDestinationDirectoryAct,SIGNAL(triggered()),this,SLOT(chooseDestinationDirectory()));
expandAllDLAct= new QAction(QIcon(IMAGE_EXPAND),tr("Expand all"),this); expandAllDLAct= new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EXPAND),tr("Expand all"),this);
connect(expandAllDLAct,SIGNAL(triggered()),this,SLOT(expandAllDL())); connect(expandAllDLAct,SIGNAL(triggered()),this,SLOT(expandAllDL()));
collapseAllDLAct= new QAction(QIcon(IMAGE_COLLAPSE),tr("Collapse all"),this); collapseAllDLAct= new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COLLAPSE),tr("Collapse all"),this);
connect(collapseAllDLAct,SIGNAL(triggered()),this,SLOT(collapseAllDL())); connect(collapseAllDLAct,SIGNAL(triggered()),this,SLOT(collapseAllDL()));
expandAllULAct= new QAction(QIcon(IMAGE_EXPAND),tr("Expand all"),this); expandAllULAct= new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EXPAND),tr("Expand all"),this);
connect(expandAllULAct,SIGNAL(triggered()),this,SLOT(expandAllUL())); connect(expandAllULAct,SIGNAL(triggered()),this,SLOT(expandAllUL()));
collapseAllULAct= new QAction(QIcon(IMAGE_COLLAPSE),tr("Collapse all"),this); collapseAllULAct= new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COLLAPSE),tr("Collapse all"),this);
connect(collapseAllULAct,SIGNAL(triggered()),this,SLOT(collapseAllUL())); connect(collapseAllULAct,SIGNAL(triggered()),this,SLOT(collapseAllUL()));
collCreateAct= new QAction(QIcon(IMAGE_COLLCREATE), tr("Create Collection..."), this); collCreateAct= new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COLLCREATE), tr("Create Collection..."), this);
connect(collCreateAct,SIGNAL(triggered()),this,SLOT(collCreate())); connect(collCreateAct,SIGNAL(triggered()),this,SLOT(collCreate()));
collModifAct= new QAction(QIcon(IMAGE_COLLMODIF), tr("Modify Collection..."), this); collModifAct= new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COLLMODIF), tr("Modify Collection..."), this);
connect(collModifAct,SIGNAL(triggered()),this,SLOT(collModif())); connect(collModifAct,SIGNAL(triggered()),this,SLOT(collModif()));
collViewAct= new QAction(QIcon(IMAGE_COLLVIEW), tr("View Collection..."), this); collViewAct= new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COLLVIEW), tr("View Collection..."), this);
connect(collViewAct,SIGNAL(triggered()),this,SLOT(collView())); connect(collViewAct,SIGNAL(triggered()),this,SLOT(collView()));
collOpenAct = new QAction(QIcon(IMAGE_COLLOPEN), tr( "Download from collection file..." ), this ); collOpenAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COLLOPEN), tr( "Download from collection file..." ), this );
connect(collOpenAct, SIGNAL(triggered()), this, SLOT(collOpen())); connect(collOpenAct, SIGNAL(triggered()), this, SLOT(collOpen()));
connect(NotifyQt::getInstance(), SIGNAL(downloadComplete(QString)), this, SLOT(collAutoOpen(QString))); connect(NotifyQt::getInstance(), SIGNAL(downloadComplete(QString)), this, SLOT(collAutoOpen(QString)));
@ -1068,9 +1068,9 @@ TransfersDialog::TransfersDialog(QWidget *parent)
connect(showULHashAct,SIGNAL(triggered(bool)),this,SLOT(setShowULHashColumn(bool))) ; connect(showULHashAct,SIGNAL(triggered(bool)),this,SLOT(setShowULHashColumn(bool))) ;
/** Setup the actions for the upload context menu */ /** Setup the actions for the upload context menu */
ulOpenFolderAct = new QAction(QIcon(IMAGE_OPENFOLDER), tr("Open Folder"), this); ulOpenFolderAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_OPENFOLDER), tr("Open Folder"), this);
connect(ulOpenFolderAct, SIGNAL(triggered()), this, SLOT(ulOpenFolder())); connect(ulOpenFolderAct, SIGNAL(triggered()), this, SLOT(ulOpenFolder()));
ulCopyLinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy RetroShare Link" ), this ); ulCopyLinkAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COPYLINK), tr( "Copy RetroShare Link" ), this );
connect( ulCopyLinkAct , SIGNAL( triggered() ), this, SLOT( ulCopyLink() ) ); connect( ulCopyLinkAct , SIGNAL( triggered() ), this, SLOT( ulCopyLink() ) );
// load settings // load settings
@ -1231,26 +1231,26 @@ void TransfersDialog::downloadListCustomPopupMenu( QPoint /*point*/ )
FileInfo info; FileInfo info;
QMenu priorityQueueMenu(tr("Move in Queue..."), this); QMenu priorityQueueMenu(tr("Move in Queue..."), this);
priorityQueueMenu.setIcon(QIcon(IMAGE_PRIORITY)); priorityQueueMenu.setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_PRIORITY));
priorityQueueMenu.addAction(queueTopAct); priorityQueueMenu.addAction(queueTopAct);
priorityQueueMenu.addAction(queueUpAct); priorityQueueMenu.addAction(queueUpAct);
priorityQueueMenu.addAction(queueDownAct); priorityQueueMenu.addAction(queueDownAct);
priorityQueueMenu.addAction(queueBottomAct); priorityQueueMenu.addAction(queueBottomAct);
QMenu prioritySpeedMenu(tr("Priority (Speed)..."), this); QMenu prioritySpeedMenu(tr("Priority (Speed)..."), this);
prioritySpeedMenu.setIcon(QIcon(IMAGE_PRIORITY)); prioritySpeedMenu.setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_PRIORITY));
prioritySpeedMenu.addAction(prioritySlowAct); prioritySpeedMenu.addAction(prioritySlowAct);
prioritySpeedMenu.addAction(priorityMediumAct); prioritySpeedMenu.addAction(priorityMediumAct);
prioritySpeedMenu.addAction(priorityFastAct); prioritySpeedMenu.addAction(priorityFastAct);
QMenu chunkMenu(tr("Chunk strategy"), this); QMenu chunkMenu(tr("Chunk strategy"), this);
chunkMenu.setIcon(QIcon(IMAGE_PRIORITY)); chunkMenu.setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_PRIORITY));
chunkMenu.addAction(chunkStreamingAct); chunkMenu.addAction(chunkStreamingAct);
chunkMenu.addAction(chunkProgressiveAct); chunkMenu.addAction(chunkProgressiveAct);
chunkMenu.addAction(chunkRandomAct); chunkMenu.addAction(chunkRandomAct);
QMenu collectionMenu(tr("Collection"), this); QMenu collectionMenu(tr("Collection"), this);
collectionMenu.setIcon(QIcon(IMAGE_LIBRARY)); collectionMenu.setIcon(FilesDefs::getIconFromQtResourcePath(IMAGE_LIBRARY));
collectionMenu.addAction(collCreateAct); collectionMenu.addAction(collCreateAct);
collectionMenu.addAction(collModifAct); collectionMenu.addAction(collModifAct);
collectionMenu.addAction(collViewAct); collectionMenu.addAction(collViewAct);
@ -1331,7 +1331,7 @@ void TransfersDialog::downloadListCustomPopupMenu( QPoint /*point*/ )
contextMnu.addAction( renameFileAct) ; contextMnu.addAction( renameFileAct) ;
} }
QMenu *directoryMenu = contextMnu.addMenu(QIcon(IMAGE_OPENFOLDER), tr("Set destination directory")) ; QMenu *directoryMenu = contextMnu.addMenu(FilesDefs::getIconFromQtResourcePath(IMAGE_OPENFOLDER), tr("Set destination directory")) ;
directoryMenu->addAction(specifyDestinationDirectoryAct) ; directoryMenu->addAction(specifyDestinationDirectoryAct) ;
// Now get the list of existing directories. // Now get the list of existing directories.

View file

@ -100,11 +100,9 @@ static bool isNewerThanEpoque(uint32_t ts)
void RetroshareDirModel::treeStyle() void RetroshareDirModel::treeStyle()
{ {
categoryIcon.addPixmap(QPixmap(":/icons/folder.png"), categoryIcon.addPixmap(FilesDefs::getPixmapFromQtResourcePath(":/icons/folder.png"), QIcon::Normal, QIcon::Off);
QIcon::Normal, QIcon::Off); categoryIcon.addPixmap(FilesDefs::getPixmapFromQtResourcePath(":/icons/folderopen.png"), QIcon::Normal, QIcon::On);
categoryIcon.addPixmap(QPixmap(":/icons/folderopen.png"), peerIcon = FilesDefs::getIconFromQtResourcePath(":/images/user/identity16.png");
QIcon::Normal, QIcon::On);
peerIcon = QIcon(":/images/user/identity16.png");
} }
void TreeStyle_RDM::update() void TreeStyle_RDM::update()
{ {
@ -349,19 +347,19 @@ const QIcon& RetroshareDirModel::getFlagsIcon(FileStorageFlags flags)
QList<QIcon> icons ; QList<QIcon> icons ;
if(flags & DIR_FLAGS_ANONYMOUS_SEARCH) if(flags & DIR_FLAGS_ANONYMOUS_SEARCH)
icons.push_back(QIcon(":icons/search_red_128.png")) ; icons.push_back(FilesDefs::getIconFromQtResourcePath(":icons/search_red_128.png")) ;
else else
icons.push_back(QIcon(":icons/void_128.png")) ; icons.push_back(FilesDefs::getIconFromQtResourcePath(":icons/void_128.png")) ;
if(flags & DIR_FLAGS_ANONYMOUS_DOWNLOAD) if(flags & DIR_FLAGS_ANONYMOUS_DOWNLOAD)
icons.push_back(QIcon(":icons/anonymous_blue_128.png")) ; icons.push_back(FilesDefs::getIconFromQtResourcePath(":icons/anonymous_blue_128.png")) ;
else else
icons.push_back(QIcon(":icons/void_128.png")) ; icons.push_back(FilesDefs::getIconFromQtResourcePath(":icons/void_128.png")) ;
if(flags & DIR_FLAGS_BROWSABLE) if(flags & DIR_FLAGS_BROWSABLE)
icons.push_back(QIcon(":icons/browsable_green_128.png")) ; icons.push_back(FilesDefs::getIconFromQtResourcePath(":icons/browsable_green_128.png")) ;
else else
icons.push_back(QIcon(":icons/void_128.png")) ; icons.push_back(FilesDefs::getIconFromQtResourcePath(":icons/void_128.png")) ;
QPixmap pix ; QPixmap pix ;
GxsIdDetails::GenerateCombinedPixmap(pix, icons, 128); GxsIdDetails::GenerateCombinedPixmap(pix, icons, 128);
@ -399,13 +397,13 @@ QVariant RetroshareDirModel::decorationRole(const DirDetails& details,int coln)
time_t now = time(NULL) ; time_t now = time(NULL) ;
if(ageIndicator != IND_ALWAYS && now > details.max_mtime + ageIndicator) if(ageIndicator != IND_ALWAYS && now > details.max_mtime + ageIndicator)
return QIcon(":/images/folder_grey.png"); return FilesDefs::getIconFromQtResourcePath(":/images/folder_grey.png");
else if (ageIndicator == IND_LAST_DAY ) else if (ageIndicator == IND_LAST_DAY )
return QIcon(":/images/folder_green.png"); return FilesDefs::getIconFromQtResourcePath(":/images/folder_green.png");
else if (ageIndicator == IND_LAST_WEEK ) else if (ageIndicator == IND_LAST_WEEK )
return QIcon(":/images/folder_yellow.png"); return FilesDefs::getIconFromQtResourcePath(":/images/folder_yellow.png");
else if (ageIndicator == IND_LAST_MONTH ) else if (ageIndicator == IND_LAST_MONTH )
return QIcon(":/images/folder_red.png"); return FilesDefs::getIconFromQtResourcePath(":/images/folder_red.png");
else else
return (QIcon(peerIcon)); return (QIcon(peerIcon));
} }
@ -414,13 +412,13 @@ QVariant RetroshareDirModel::decorationRole(const DirDetails& details,int coln)
time_t now = time(NULL) ; time_t now = time(NULL) ;
if(ageIndicator != IND_ALWAYS && now > details.max_mtime + ageIndicator) if(ageIndicator != IND_ALWAYS && now > details.max_mtime + ageIndicator)
return QIcon(":/images/folder_grey.png"); return FilesDefs::getIconFromQtResourcePath(":/images/folder_grey.png");
else if (ageIndicator == IND_LAST_DAY ) else if (ageIndicator == IND_LAST_DAY )
return QIcon(":/images/folder_green.png"); return FilesDefs::getIconFromQtResourcePath(":/images/folder_green.png");
else if (ageIndicator == IND_LAST_WEEK ) else if (ageIndicator == IND_LAST_WEEK )
return QIcon(":/images/folder_yellow.png"); return FilesDefs::getIconFromQtResourcePath(":/images/folder_yellow.png");
else if (ageIndicator == IND_LAST_MONTH ) else if (ageIndicator == IND_LAST_MONTH )
return QIcon(":/images/folder_red.png"); return FilesDefs::getIconFromQtResourcePath(":/images/folder_red.png");
else else
return QIcon(categoryIcon); return QIcon(categoryIcon);
} }
@ -428,7 +426,7 @@ QVariant RetroshareDirModel::decorationRole(const DirDetails& details,int coln)
{ {
// extensions predefined // extensions predefined
if(details.hash.isNull()) if(details.hash.isNull())
return QIcon(":/images/reset.png") ; // file is being hashed return FilesDefs::getIconFromQtResourcePath(":/images/reset.png") ; // file is being hashed
else else
return FilesDefs::getIconFromFileType(QString::fromUtf8(details.name.c_str())); return FilesDefs::getIconFromFileType(QString::fromUtf8(details.name.c_str()));
} }

View file

@ -27,6 +27,7 @@
#include <QIcon> #include <QIcon>
#include "gui/common/StatusDefs.h" #include "gui/common/StatusDefs.h"
#include "gui/common/FilesDefs.h"
#include "gui/common/AvatarDefs.h" #include "gui/common/AvatarDefs.h"
#include "util/HandleRichText.h" #include "util/HandleRichText.h"
#include "util/DateTime.h" #include "util/DateTime.h"
@ -815,13 +816,13 @@ QVariant RsFriendListModel::decorationRole(const EntryIndex& entry,int col) cons
switch(entry.type) switch(entry.type)
{ {
case ENTRY_TYPE_GROUP: return QVariant(QIcon(IMAGE_GROUP24)); case ENTRY_TYPE_GROUP: return QVariant(FilesDefs::getIconFromQtResourcePath(IMAGE_GROUP24));
case ENTRY_TYPE_PROFILE: case ENTRY_TYPE_PROFILE:
{ {
if(!isProfileExpanded(entry)) if(!isProfileExpanded(entry))
{ {
QPixmap sslAvatar(AVATAR_DEFAULT_IMAGE); QPixmap sslAvatar = FilesDefs::getPixmapFromQtResourcePath(AVATAR_DEFAULT_IMAGE);
const HierarchicalProfileInformation *hn = getProfileInfo(entry); const HierarchicalProfileInformation *hn = getProfileInfo(entry);

View file

@ -28,6 +28,7 @@
#include <QTextDocument> #include <QTextDocument>
#include "gui/common/RSElidedItemDelegate.h" #include "gui/common/RSElidedItemDelegate.h"
#include "gui/common/FilesDefs.h"
#include "gui/gxs/GxsCommentTreeWidget.h" #include "gui/gxs/GxsCommentTreeWidget.h"
#include "gui/gxs/GxsCreateCommentDialog.h" #include "gui/gxs/GxsCreateCommentDialog.h"
#include "gui/gxs/GxsIdTreeWidgetItem.h" #include "gui/gxs/GxsIdTreeWidgetItem.h"
@ -186,18 +187,18 @@ void GxsCommentTreeWidget::setCurrentCommentMsgId(QTreeWidgetItem *current, QTre
void GxsCommentTreeWidget::customPopUpMenu(const QPoint& /*point*/) void GxsCommentTreeWidget::customPopUpMenu(const QPoint& /*point*/)
{ {
QMenu contextMnu( this ); QMenu contextMnu( this );
QAction* action = contextMnu.addAction(QIcon(IMAGE_MESSAGE), tr("Reply to Comment"), this, SLOT(replyToComment())); QAction* action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MESSAGE), tr("Reply to Comment"), this, SLOT(replyToComment()));
action->setDisabled(mCurrentCommentMsgId.isNull()); action->setDisabled(mCurrentCommentMsgId.isNull());
action = contextMnu.addAction(QIcon(IMAGE_MESSAGE), tr("Submit Comment"), this, SLOT(makeComment())); action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_MESSAGE), tr("Submit Comment"), this, SLOT(makeComment()));
action->setDisabled(mMsgVersions.empty()); action->setDisabled(mMsgVersions.empty());
action = contextMnu.addAction(QIcon(IMAGE_COPY), tr("Copy Comment"), this, SLOT(copyComment())); action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COPY), tr("Copy Comment"), this, SLOT(copyComment()));
action->setDisabled(mCurrentCommentMsgId.isNull()); action->setDisabled(mCurrentCommentMsgId.isNull());
contextMnu.addSeparator(); contextMnu.addSeparator();
action = contextMnu.addAction(QIcon(IMAGE_VOTEUP), tr("Vote Up"), this, SLOT(voteUp())); action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_VOTEUP), tr("Vote Up"), this, SLOT(voteUp()));
action->setDisabled(mVoterId.isNull()); action->setDisabled(mVoterId.isNull());
action = contextMnu.addAction(QIcon(IMAGE_VOTEDOWN), tr("Vote Down"), this, SLOT(voteDown())); action = contextMnu.addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_VOTEDOWN), tr("Vote Down"), this, SLOT(voteDown()));
action->setDisabled(mVoterId.isNull()); action->setDisabled(mVoterId.isNull());

View file

@ -23,6 +23,7 @@
#include <QModelIndex> #include <QModelIndex>
#include <QIcon> #include <QIcon>
#include "gui/common/FilesDefs.h"
#include "util/qtthreadsutils.h" #include "util/qtthreadsutils.h"
#include "util/HandleRichText.h" #include "util/HandleRichText.h"
#include "util/DateTime.h" #include "util/DateTime.h"
@ -359,8 +360,8 @@ QVariant RsGxsForumModel::headerData(int section, Qt::Orientation /*orientation*
if(role == Qt::DecorationRole) if(role == Qt::DecorationRole)
switch(section) switch(section)
{ {
case COLUMN_THREAD_DISTRIBUTION: return QIcon(":/icons/flag-green.png"); case COLUMN_THREAD_DISTRIBUTION: return FilesDefs::getIconFromQtResourcePath(":/icons/flag-green.png");
case COLUMN_THREAD_READ: return QIcon(":/images/message-state-read.png"); case COLUMN_THREAD_READ: return FilesDefs::getIconFromQtResourcePath(":/images/message-state-read.png");
default: default:
return QVariant(); return QVariant();
} }

View file

@ -27,6 +27,7 @@
#include <QIcon> #include <QIcon>
#include "gui/common/TagDefs.h" #include "gui/common/TagDefs.h"
#include "gui/common/FilesDefs.h"
#include "util/HandleRichText.h" #include "util/HandleRichText.h"
#include "util/DateTime.h" #include "util/DateTime.h"
#include "gui/gxs/GxsIdDetails.h" #include "gui/gxs/GxsIdDetails.h"
@ -171,9 +172,9 @@ QVariant RsMessageModel::headerData(int section, Qt::Orientation orientation, in
if(role == Qt::DecorationRole) if(role == Qt::DecorationRole)
switch(section) switch(section)
{ {
case COLUMN_THREAD_STAR: return QIcon(IMAGE_STAR_ON); case COLUMN_THREAD_STAR: return FilesDefs::getIconFromQtResourcePath(IMAGE_STAR_ON);
case COLUMN_THREAD_READ: return QIcon(":/images/message-state-header.png"); case COLUMN_THREAD_READ: return FilesDefs::getIconFromQtResourcePath(":/images/message-state-header.png");
case COLUMN_THREAD_ATTACHMENT: return QIcon(":/icons/png/attachements.png"); case COLUMN_THREAD_ATTACHMENT: return FilesDefs::getIconFromQtResourcePath(":/icons/png/attachements.png");
default: default:
return QVariant(); return QVariant();
} }
@ -511,39 +512,39 @@ QVariant RsMessageModel::decorationRole(const Rs::Msgs::MsgInfoSummary& fmpe,int
{ {
if(col == COLUMN_THREAD_READ) if(col == COLUMN_THREAD_READ)
if(fmpe.msgflags & (RS_MSG_NEW | RS_MSG_UNREAD_BY_USER)) if(fmpe.msgflags & (RS_MSG_NEW | RS_MSG_UNREAD_BY_USER))
return QIcon(":/images/message-state-unread.png"); return FilesDefs::getIconFromQtResourcePath(":/images/message-state-unread.png");
else else
return QIcon(":/images/message-state-read.png"); return FilesDefs::getIconFromQtResourcePath(":/images/message-state-read.png");
if(col == COLUMN_THREAD_SUBJECT) if(col == COLUMN_THREAD_SUBJECT)
{ {
if(fmpe.msgflags & RS_MSG_NEW ) return QIcon(":/images/message-state-new.png"); if(fmpe.msgflags & RS_MSG_NEW ) return FilesDefs::getIconFromQtResourcePath(":/images/message-state-new.png");
if(fmpe.msgflags & RS_MSG_USER_REQUEST) return QIcon(":/images/user/user_request16.png"); if(fmpe.msgflags & RS_MSG_USER_REQUEST) return FilesDefs::getIconFromQtResourcePath(":/images/user/user_request16.png");
if(fmpe.msgflags & RS_MSG_FRIEND_RECOMMENDATION) return QIcon(":/images/user/friend_suggestion16.png"); if(fmpe.msgflags & RS_MSG_FRIEND_RECOMMENDATION) return FilesDefs::getIconFromQtResourcePath(":/images/user/friend_suggestion16.png");
if(fmpe.msgflags & RS_MSG_PUBLISH_KEY) return QIcon(":/images/share-icon-16.png"); if(fmpe.msgflags & RS_MSG_PUBLISH_KEY) return FilesDefs::getIconFromQtResourcePath(":/images/share-icon-16.png");
if(fmpe.msgflags & RS_MSG_UNREAD_BY_USER) if(fmpe.msgflags & RS_MSG_UNREAD_BY_USER)
{ {
if((fmpe.msgflags & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == RS_MSG_REPLIED) return QIcon(":/images/message-mail-replied.png"); if((fmpe.msgflags & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == RS_MSG_REPLIED) return FilesDefs::getIconFromQtResourcePath(":/images/message-mail-replied.png");
if((fmpe.msgflags & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == RS_MSG_FORWARDED) return QIcon(":/images/message-mail-forwarded.png"); if((fmpe.msgflags & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == RS_MSG_FORWARDED) return FilesDefs::getIconFromQtResourcePath(":/images/message-mail-forwarded.png");
if((fmpe.msgflags & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == (RS_MSG_REPLIED | RS_MSG_FORWARDED)) return QIcon(":/images/message-mail-replied-forw.png"); if((fmpe.msgflags & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == (RS_MSG_REPLIED | RS_MSG_FORWARDED)) return FilesDefs::getIconFromQtResourcePath(":/images/message-mail-replied-forw.png");
return QIcon(":/images/message-mail.png"); return FilesDefs::getIconFromQtResourcePath(":/images/message-mail.png");
} }
if((fmpe.msgflags & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == RS_MSG_REPLIED) return QIcon(":/images/message-mail-replied-read.png"); if((fmpe.msgflags & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == RS_MSG_REPLIED) return FilesDefs::getIconFromQtResourcePath(":/images/message-mail-replied-read.png");
if((fmpe.msgflags & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == RS_MSG_FORWARDED) return QIcon(":/images/message-mail-forwarded-read.png"); if((fmpe.msgflags & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == RS_MSG_FORWARDED) return FilesDefs::getIconFromQtResourcePath(":/images/message-mail-forwarded-read.png");
if((fmpe.msgflags & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == (RS_MSG_REPLIED | RS_MSG_FORWARDED)) return QIcon(":/images/message-mail-replied-forw-read.png"); if((fmpe.msgflags & (RS_MSG_REPLIED | RS_MSG_FORWARDED)) == (RS_MSG_REPLIED | RS_MSG_FORWARDED)) return FilesDefs::getIconFromQtResourcePath(":/images/message-mail-replied-forw-read.png");
return QIcon(":/images/message-mail-read.png"); return FilesDefs::getIconFromQtResourcePath(":/images/message-mail-read.png");
} }
if(col == COLUMN_THREAD_STAR) if(col == COLUMN_THREAD_STAR)
return QIcon((fmpe.msgflags & RS_MSG_STAR) ? (IMAGE_STAR_ON ): (IMAGE_STAR_OFF)); return FilesDefs::getIconFromQtResourcePath((fmpe.msgflags & RS_MSG_STAR) ? (IMAGE_STAR_ON ): (IMAGE_STAR_OFF));
bool isNew = fmpe.msgflags & (RS_MSG_NEW | RS_MSG_UNREAD_BY_USER); bool isNew = fmpe.msgflags & (RS_MSG_NEW | RS_MSG_UNREAD_BY_USER);
if(col == COLUMN_THREAD_READ) if(col == COLUMN_THREAD_READ)
return QIcon(isNew ? ":/images/message-state-unread.png": ":/images/message-state-read.png"); return FilesDefs::getIconFromQtResourcePath(isNew ? ":/images/message-state-unread.png": ":/images/message-state-read.png");
return QVariant(); return QVariant();
} }