mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Added to identify for Channel Files if its a media file(s) or not, to change the Play Button text from "Play" to "Open"
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5781 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4009ff47cb
commit
07d8db4505
@ -21,6 +21,7 @@
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QTimer>
|
||||
#include <QFileInfo>
|
||||
|
||||
#include "rshare.h"
|
||||
#include "ChanMsgItem.h"
|
||||
@ -209,7 +210,12 @@ void ChanMsgItem::updateItemStatic()
|
||||
/* add file */
|
||||
SubFileItem *fi = new SubFileItem(it->hash, it->fname, it->path, it->size,
|
||||
SFI_STATE_REMOTE | SFI_TYPE_CHANNEL, "");
|
||||
mFileItems.push_back(fi);
|
||||
mFileItems.push_back(fi);
|
||||
|
||||
/* check if the file is a media file */
|
||||
if (!misc::isPreviewable(QFileInfo(QString::fromUtf8(it->fname.c_str())).suffix()))
|
||||
fi->mediatype();
|
||||
|
||||
|
||||
QLayout *layout = expandFrame->layout();
|
||||
layout->addWidget(fi);
|
||||
|
@ -686,3 +686,9 @@ bool SubFileItem::isPlayable(bool &startable)
|
||||
return visible;
|
||||
}
|
||||
|
||||
void SubFileItem::mediatype()
|
||||
{
|
||||
/* check if the file is not a media file and change text */
|
||||
playButton->setText(tr("Open"));
|
||||
playButton->setToolTip(tr("Open File"));
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ public:
|
||||
public slots:
|
||||
void download();
|
||||
void play();
|
||||
void mediatype();
|
||||
|
||||
private slots:
|
||||
void toggle();
|
||||
|
Loading…
Reference in New Issue
Block a user