merged with upstream/master
|
@ -187,15 +187,32 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
}
|
||||
painter->drawText(option.rect, Qt::AlignCenter, newopt.text);
|
||||
break;
|
||||
case COLUMN_SOURCES:
|
||||
{
|
||||
double dblValue = index.data().toDouble();
|
||||
case COLUMN_SOURCES:
|
||||
{
|
||||
double dblValue = index.data().toDouble();
|
||||
|
||||
temp = dblValue!=0 ? QString("%1 (%2)").arg((int)dblValue).arg((int)((fmod(dblValue,1)*1000)+0.5)) : "";
|
||||
painter->drawText(option.rect, Qt::AlignCenter, temp);
|
||||
}
|
||||
break;
|
||||
case COLUMN_DOWNLOADTIME:
|
||||
temp = dblValue!=0 ? QString("%1 (%2)").arg((int)dblValue).arg((int)((fmod(dblValue,1)*1000)+0.5)) : "";
|
||||
painter->drawText(option.rect, Qt::AlignCenter, temp);
|
||||
}
|
||||
break;
|
||||
case COLUMN_PRIORITY:
|
||||
{
|
||||
double dblValue = index.data().toDouble();
|
||||
if (dblValue == PRIORITY_NULL)
|
||||
temp = "";
|
||||
else if (dblValue == PRIORITY_FASTER)
|
||||
temp = tr("Faster");
|
||||
else if (dblValue == PRIORITY_AVERAGE)
|
||||
temp = tr("Average");
|
||||
else if (dblValue == PRIORITY_SLOWER)
|
||||
temp = tr("Slower");
|
||||
else
|
||||
temp = QString::number((uint32_t)dblValue);
|
||||
|
||||
painter->drawText(option.rect, Qt::AlignCenter, temp);
|
||||
}
|
||||
break;
|
||||
case COLUMN_DOWNLOADTIME:
|
||||
downloadtime = index.data().toLongLong();
|
||||
minutes = downloadtime / 60;
|
||||
seconds = downloadtime % 60;
|
||||
|
|
|
@ -42,6 +42,11 @@
|
|||
#define COLUMN_PATH 12
|
||||
#define COLUMN_COUNT 13
|
||||
|
||||
#define PRIORITY_NULL 0.0
|
||||
#define PRIORITY_FASTER 0.1
|
||||
#define PRIORITY_AVERAGE 0.2
|
||||
#define PRIORITY_SLOWER 0.3
|
||||
|
||||
|
||||
#define MAX_CHAR_TMP 128
|
||||
|
||||
|
|
|
@ -1166,6 +1166,7 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
|
|||
// 1 - look in result window whether the file already exists.
|
||||
//
|
||||
bool found = false ;
|
||||
bool altname = false ;
|
||||
int sources;
|
||||
int friendSource = 0;
|
||||
int anonymousSource = 0;
|
||||
|
@ -1193,7 +1194,11 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
|
|||
(*it)->setText(SR_SOURCES_COL,modifiedResult);
|
||||
(*it)->setData(SR_SOURCES_COL, ROLE_SORT, fltRes);
|
||||
QTreeWidgetItem *item = (*it);
|
||||
|
||||
found = true ;
|
||||
|
||||
if(QString::compare((*it)->text(SR_NAME_COL), QString::fromUtf8(file.name.c_str()), Qt::CaseSensitive)!=0)
|
||||
altname = true;
|
||||
|
||||
if (!item->data(SR_DATA_COL, SR_ROLE_LOCAL).toBool()) {
|
||||
|
||||
|
@ -1233,9 +1238,20 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
|
|||
item->setForeground(i, brush);
|
||||
}
|
||||
}
|
||||
break ;
|
||||
}
|
||||
|
||||
if(altname)
|
||||
{
|
||||
QTreeWidgetItem *item = new RSTreeWidgetItem(compareResultRole);
|
||||
item->setText(SR_NAME_COL, QString::fromUtf8(file.name.c_str()));
|
||||
item->setText(SR_HASH_COL, QString::fromStdString(file.hash.toStdString()));
|
||||
setIconAndType(item, QString::fromUtf8(file.name.c_str()));
|
||||
item->setText(SR_SIZE_COL, QString::number(file.size));
|
||||
setIconAndType(item, QString::fromUtf8(file.name.c_str()));
|
||||
(*it)->addChild(item);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!found)
|
||||
{
|
||||
++nb_results[searchId] ;
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "gui/msgs/MessageComposer.h"
|
||||
#include "gui/settings/AddFileAssociationDialog.h"
|
||||
#include "gui/gxschannels/GxsChannelDialog.h"
|
||||
#include "gui/gxsforums/GxsForumsDialog.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "util/QtVersion.h"
|
||||
#include "util/RsAction.h"
|
||||
|
@ -64,6 +65,7 @@
|
|||
#define IMAGE_OPENFILE ":/images/fileopen.png"
|
||||
#define IMAGE_LIBRARY ":/images/library.png"
|
||||
#define IMAGE_CHANNEL ":/images/channels32.png"
|
||||
#define IMAGE_FORUMS ":/icons/png/forums.png"
|
||||
#define IMAGE_COLLCREATE ":/images/library_add.png"
|
||||
#define IMAGE_COLLMODIF ":/images/library_edit.png"
|
||||
#define IMAGE_COLLVIEW ":/images/library_view.png"
|
||||
|
@ -963,6 +965,15 @@ void SharedFilesDialog::postModDirectories(bool local)
|
|||
QCoreApplication::flush();
|
||||
}
|
||||
|
||||
class ChannelCompare
|
||||
{
|
||||
public:
|
||||
bool operator()(const std::pair<std::string,RsGxsGroupId>& id1,const std::pair<std::string,RsGxsGroupId>& id2) const
|
||||
{
|
||||
return id1.first < id2.first ;
|
||||
}
|
||||
};
|
||||
|
||||
void LocalSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
|
||||
{
|
||||
if (!rsPeers) return; /* not ready yet! */
|
||||
|
@ -1017,26 +1028,55 @@ void LocalSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
|
|||
}
|
||||
|
||||
GxsChannelDialog *channelDialog = dynamic_cast<GxsChannelDialog*>(MainWindow::getPage(MainWindow::Channels));
|
||||
QMenu shareChannelMenu(tr("Share on channel...")) ; // added here because the shareChannelMenu QMenu object is deleted afterwards
|
||||
|
||||
if(channelDialog != NULL)
|
||||
{
|
||||
QMenu shareChannelMenu(tr("Share on channel...")) ;
|
||||
shareChannelMenu.setIcon(QIcon(IMAGE_CHANNEL));
|
||||
|
||||
std::list<RsGroupMetaData> grp_metas ;
|
||||
channelDialog->getGroupList(grp_metas) ;
|
||||
|
||||
std::vector<std::pair<std::string,RsGxsGroupId> > grplist ; // I dont use a std::map because two or more channels may have the same name.
|
||||
|
||||
for(auto it(grp_metas.begin());it!=grp_metas.end();++it)
|
||||
if(IS_GROUP_PUBLISHER((*it).mSubscribeFlags))
|
||||
shareChannelMenu.addAction(QString::fromUtf8((*it).mGroupName.c_str()), this, SLOT(shareOnChannel()))->setData(QString::fromStdString((*it).mGroupId.toStdString())) ;
|
||||
if(IS_GROUP_PUBLISHER((*it).mSubscribeFlags) && IS_GROUP_SUBSCRIBED((*it).mSubscribeFlags))
|
||||
grplist.push_back(std::make_pair((*it).mGroupName, (*it).mGroupId));
|
||||
|
||||
std::sort(grplist.begin(),grplist.end(),ChannelCompare()) ;
|
||||
|
||||
for(auto it(grplist.begin());it!=grplist.end();++it)
|
||||
shareChannelMenu.addAction(QString::fromUtf8((*it).first.c_str()), this, SLOT(shareOnChannel()))->setData(QString::fromStdString((*it).second.toStdString())) ;
|
||||
|
||||
contextMnu.addMenu(&shareChannelMenu) ;
|
||||
contextMnu.exec(QCursor::pos()) ; // added here because the shareChannelMenu QMenu object is deleted afterwards
|
||||
}
|
||||
else
|
||||
contextMnu.exec(QCursor::pos()) ;
|
||||
}
|
||||
|
||||
GxsForumsDialog *forumsDialog = dynamic_cast<GxsForumsDialog*>(MainWindow::getPage(MainWindow::Forums));
|
||||
QMenu shareForumMenu(tr("Share on forum...")) ; // added here because the shareChannelMenu QMenu object is deleted afterwards
|
||||
|
||||
if(forumsDialog != NULL)
|
||||
{
|
||||
shareForumMenu.setIcon(QIcon(IMAGE_FORUMS));
|
||||
|
||||
std::list<RsGroupMetaData> grp_metas ;
|
||||
forumsDialog->getGroupList(grp_metas) ;
|
||||
|
||||
std::vector<std::pair<std::string,RsGxsGroupId> > grplist ; // I dont use a std::map because two or more channels may have the same name.
|
||||
|
||||
for(auto it(grp_metas.begin());it!=grp_metas.end();++it)
|
||||
if(IS_GROUP_SUBSCRIBED((*it).mSubscribeFlags))
|
||||
grplist.push_back(std::make_pair((*it).mGroupName, (*it).mGroupId));
|
||||
|
||||
std::sort(grplist.begin(),grplist.end(),ChannelCompare()) ;
|
||||
|
||||
for(auto it(grplist.begin());it!=grplist.end();++it)
|
||||
shareForumMenu.addAction(QString::fromUtf8((*it).first.c_str()), this, SLOT(shareInForum()))->setData(QString::fromStdString((*it).second.toStdString())) ;
|
||||
|
||||
contextMnu.addMenu(&shareForumMenu) ;
|
||||
}
|
||||
|
||||
contextMnu.exec(QCursor::pos()) ;
|
||||
}
|
||||
void LocalSharedFilesDialog::shareOnChannel()
|
||||
{
|
||||
RsGxsGroupId groupId(qobject_cast<QAction*>(sender())->data().toString().toStdString());
|
||||
|
@ -1055,6 +1095,24 @@ void LocalSharedFilesDialog::shareOnChannel()
|
|||
|
||||
channelDialog->shareOnChannel(groupId,file_links_list) ;
|
||||
}
|
||||
void LocalSharedFilesDialog::shareInForum()
|
||||
{
|
||||
RsGxsGroupId groupId(qobject_cast<QAction*>(sender())->data().toString().toStdString());
|
||||
|
||||
GxsForumsDialog *forumsDialog = dynamic_cast<GxsForumsDialog*>(MainWindow::getPage(MainWindow::Forums));
|
||||
|
||||
if(forumsDialog == NULL)
|
||||
return ;
|
||||
|
||||
std::list<DirDetails> files_info ;
|
||||
|
||||
QList<RetroShareLink> file_links_list ;
|
||||
bool has_unhashed_files ;
|
||||
|
||||
copyLinks(getSelected(),false,file_links_list,has_unhashed_files) ;
|
||||
|
||||
forumsDialog->shareInMessage(groupId,file_links_list) ;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
||||
|
|
|
@ -160,6 +160,7 @@ class LocalSharedFilesDialog : public SharedFilesDialog
|
|||
void tryToAddNewAssotiation();
|
||||
void forceCheck();
|
||||
void shareOnChannel();
|
||||
void shareInForum();
|
||||
|
||||
QAction* fileAssotiationAction(const QString fileName);
|
||||
|
||||
|
|
|
@ -159,32 +159,6 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class PriorityItem : public SortByNameItem
|
||||
{
|
||||
public:
|
||||
PriorityItem(QHeaderView *header) : SortByNameItem(header) {}
|
||||
|
||||
virtual bool operator<(const QStandardItem &other) const
|
||||
{
|
||||
const int role = model() ? model()->sortRole() : Qt::DisplayRole;
|
||||
|
||||
QString l = data(role).value<QString>();
|
||||
QString r = other.data(role).value<QString>();
|
||||
|
||||
bool bl,br ;
|
||||
int nl = l.toInt(&bl) ;
|
||||
int nr = r.toInt(&br) ;
|
||||
|
||||
if(bl && br)
|
||||
return nl < nr ;
|
||||
|
||||
if(bl ^ br)
|
||||
return br ;
|
||||
|
||||
return SortByNameItem::operator<(other);
|
||||
}
|
||||
};
|
||||
|
||||
/** Constructor */
|
||||
TransfersDialog::TransfersDialog(QWidget *parent)
|
||||
: RsAutoUpdatePage(1000,parent)
|
||||
|
@ -911,16 +885,18 @@ int TransfersDialog::addDLItem(int row, const FileInfo &fileInfo)
|
|||
default: status = tr("Unknown"); break;
|
||||
}
|
||||
|
||||
QString priority;
|
||||
double priority = PRIORITY_NULL;
|
||||
|
||||
if (fileInfo.downloadStatus == FT_STATE_QUEUED) {
|
||||
priority = QString::number(fileInfo.queue_position);
|
||||
priority = fileInfo.queue_position;
|
||||
} else if (fileInfo.downloadStatus == FT_STATE_COMPLETE) {
|
||||
priority = 0;
|
||||
} else {
|
||||
switch (fileInfo.priority) {
|
||||
case SPEED_LOW: priority = tr("Slower");break;
|
||||
case SPEED_NORMAL: priority = tr("Average");break;
|
||||
case SPEED_HIGH: priority = tr("Faster");break;
|
||||
default: priority = tr("Average");break;
|
||||
case SPEED_LOW: priority = PRIORITY_SLOWER; break;
|
||||
case SPEED_NORMAL: priority = PRIORITY_AVERAGE; break;
|
||||
case SPEED_HIGH: priority = PRIORITY_FASTER; break;
|
||||
default: priority = PRIORITY_AVERAGE; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -982,7 +958,6 @@ int TransfersDialog::addDLItem(int row, const FileInfo &fileInfo)
|
|||
|
||||
// change progress column to own class for sorting
|
||||
DLListModel->setItem(row, COLUMN_PROGRESS, new ProgressItem(NULL));
|
||||
DLListModel->setItem(row, COLUMN_PRIORITY, new PriorityItem(NULL));
|
||||
|
||||
DLListModel->setData(DLListModel->index(row, COLUMN_SIZE), QVariant((qlonglong) fileInfo.size));
|
||||
DLListModel->setData(DLListModel->index(row, COLUMN_ID), fileHash, Qt::DisplayRole);
|
||||
|
@ -1107,7 +1082,7 @@ int TransfersDialog::addPeerToDLItem(QStandardItem *dlItem, const RsPeerId& peer
|
|||
iProgress->setData(QVariant::fromValue(peerInfo), Qt::UserRole);
|
||||
iSource->setData(QVariant(QString()), Qt::DisplayRole);
|
||||
|
||||
iPriority->setData(QVariant(QString()), Qt::DisplayRole); // blank field for priority
|
||||
iPriority->setData(QVariant((double)PRIORITY_NULL), Qt::DisplayRole); // blank field for priority
|
||||
iRemaining->setData(QVariant(QString()), Qt::DisplayRole);
|
||||
iDownloadTime->setData(QVariant(QString()), Qt::DisplayRole);
|
||||
iID->setData(QVariant() , Qt::DisplayRole);
|
||||
|
|
|
@ -144,6 +144,7 @@ QList<int> sizes;
|
|||
RsAutoUpdatePage::lockAllEvents();
|
||||
ui.friendList->setColumnVisible(FriendList::COLUMN_LAST_CONTACT, false);
|
||||
ui.friendList->setColumnVisible(FriendList::COLUMN_IP, false);
|
||||
ui.friendList->setColumnVisible(FriendList::COLUMN_ID, false);
|
||||
ui.friendList->setShowGroups(true);
|
||||
processSettings(true);
|
||||
RsAutoUpdatePage::unlockAllEvents();
|
||||
|
|
|
@ -1489,7 +1489,7 @@ void MainWindow::processLastArgs()
|
|||
opModeStatus->setCurrentIndex(RS_OPMODE_GAMING - 1);
|
||||
} else if (opmode == "minimal") {
|
||||
opModeStatus->setCurrentIndex(RS_OPMODE_MINIMAL - 1);
|
||||
} else {
|
||||
} else if (opmode != "") {
|
||||
opModeStatus->setCurrentIndex(RS_OPMODE_FULL - 1);
|
||||
}
|
||||
opModeStatus->setOpMode();
|
||||
|
|
|
@ -32,9 +32,6 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
#define COLOR_NORMAL QColor(248, 248, 248)
|
||||
#define COLOR_NEW QColor(220, 236, 253)
|
||||
|
||||
/** Constructor */
|
||||
|
||||
PostedItem::PostedItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate) :
|
||||
|
@ -427,16 +424,9 @@ void PostedItem::setReadStatus(bool isNew, bool isUnread)
|
|||
|
||||
ui->newLabel->setVisible(isNew);
|
||||
|
||||
/* unpolish widget to clear the stylesheet's palette cache */
|
||||
ui->mainFrame->style()->unpolish(ui->mainFrame);
|
||||
|
||||
QPalette palette = ui->mainFrame->palette();
|
||||
palette.setColor(ui->mainFrame->backgroundRole(), isNew ? COLOR_NEW : COLOR_NORMAL); // QScrollArea
|
||||
palette.setColor(QPalette::Base, isNew ? COLOR_NEW : COLOR_NORMAL); // QTreeWidget
|
||||
ui->mainFrame->setPalette(palette);
|
||||
|
||||
ui->mainFrame->setProperty("new", isNew);
|
||||
Rshare::refreshStyleSheet(ui->mainFrame, false);
|
||||
ui->mainFrame->style()->unpolish(ui->mainFrame);
|
||||
ui->mainFrame->style()->polish( ui->mainFrame);
|
||||
}
|
||||
|
||||
void PostedItem::readToggled(bool checked)
|
||||
|
|
|
@ -1129,7 +1129,8 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
links.append(*linkIt);
|
||||
}
|
||||
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ASK) {
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ASK)
|
||||
{
|
||||
/* ask for some types of link */
|
||||
QStringList fileAdd;
|
||||
QStringList personAdd;
|
||||
|
@ -1153,12 +1154,9 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
case TYPE_CERTIFICATE:
|
||||
case TYPE_PUBLIC_MSG:
|
||||
case TYPE_PRIVATE_CHAT:
|
||||
// no need to ask
|
||||
break;
|
||||
|
||||
case TYPE_FILE:
|
||||
case TYPE_EXTRAFILE:
|
||||
fileAdd.append(link.name());
|
||||
// no need to ask
|
||||
break;
|
||||
|
||||
case TYPE_PERSON:
|
||||
|
@ -1166,30 +1164,6 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QString content;
|
||||
if (!fileAdd.isEmpty()) {
|
||||
processList(fileAdd, QObject::tr("Add file"), QObject::tr("Add files"), content);
|
||||
}
|
||||
|
||||
//if (personAdd.size()) {
|
||||
// processList(personAdd, QObject::tr("Add friend"), QObject::tr("Add friends"), content);
|
||||
//}
|
||||
|
||||
if (content.isEmpty() == false) {
|
||||
QString question = "<html><body>";
|
||||
if (links.size() == 1) {
|
||||
question += QObject::tr("Do you want to process the link ?");
|
||||
} else {
|
||||
question += QObject::tr("Do you want to process %1 links ?").arg(links.size());
|
||||
}
|
||||
question += "<br><br>" + content + "</body></html>";
|
||||
|
||||
QMessageBox mb(QObject::tr("Confirmation"), question, QMessageBox::Question, QMessageBox::Yes,QMessageBox::No, 0);
|
||||
if (mb.exec() == QMessageBox::No) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int countInvalid = 0;
|
||||
|
@ -1305,9 +1279,8 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
}
|
||||
break;
|
||||
|
||||
case TYPE_FILE:
|
||||
case TYPE_EXTRAFILE:
|
||||
{
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process FileRequest : fileName : " << link.name().toUtf8().constData() << ". fileHash : " << link.hash().toStdString() << ". fileSize : " << link.size() << std::endl;
|
||||
#endif
|
||||
|
@ -1388,9 +1361,18 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
} else {
|
||||
if (!bFileOpened) fileExist.append(link.name());
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TYPE_FILE:
|
||||
{
|
||||
RsCollection col ;
|
||||
col.merge_in(link.name(),link.size(),RsFileHash(link.hash().toStdString())) ;
|
||||
col.downloadFiles();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case TYPE_FILE_TREE:
|
||||
{
|
||||
FileTree *ft = FileTree::create(link.radix().toStdString()) ;
|
||||
|
|
|
@ -499,7 +499,7 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
|||
bTextselected=true;
|
||||
}
|
||||
}
|
||||
ui->searchButton->setChecked(!ui->searchButton->isChecked() | bTextselected);
|
||||
ui->searchButton->setChecked(!ui->searchButton->isChecked() || bTextselected);
|
||||
ui->leSearch->setVisible(bTextselected);//To discard re-selection of text
|
||||
on_searchButton_clicked(ui->searchButton->isChecked());
|
||||
return true; // eat event
|
||||
|
|
|
@ -32,10 +32,10 @@
|
|||
#include "RsAutoUpdatePage.h"
|
||||
#include "PopupDistantChatDialog.h"
|
||||
|
||||
#define IMAGE_RED_LED ":/icons/bullet_red_64.png"
|
||||
#define IMAGE_YEL_LED ":/icons/bullet_yellow_64.png"
|
||||
#define IMAGE_GRN_LED ":/icons/bullet_green_64.png"
|
||||
#define IMAGE_GRY_LED ":/icons/bullet_grey_64.png"
|
||||
#define IMAGE_RED_LED ":/icons/bullet_red_128.png"
|
||||
#define IMAGE_YEL_LED ":/icons/bullet_yellow_128.png"
|
||||
#define IMAGE_GRN_LED ":/icons/bullet_green_128.png"
|
||||
#define IMAGE_GRY_LED ":/icons/bullet_grey_128.png"
|
||||
|
||||
PopupDistantChatDialog::~PopupDistantChatDialog()
|
||||
{
|
||||
|
|
|
@ -74,7 +74,9 @@ class FlowLayoutItem : public QWidget
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FlowLayoutItem(QString name=QString(), QWidget *parent=0) : QWidget(parent), m_myName(name){
|
||||
FlowLayoutItem(QString name=QString(), QWidget *parent=0)
|
||||
: QWidget(parent), m_myName(name), m_isSelected(false), m_isCurrent(false)
|
||||
{
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
setAcceptDrops(true);
|
||||
}
|
||||
|
|
|
@ -45,12 +45,9 @@ class GroupItemInfo
|
|||
{
|
||||
public:
|
||||
GroupItemInfo()
|
||||
{
|
||||
popularity = 0;
|
||||
publishKey = false;
|
||||
subscribeFlags = 0;
|
||||
max_visible_posts =0;
|
||||
}
|
||||
: popularity(0), publishKey(false), adminKey(false)
|
||||
, subscribeFlags(0), max_visible_posts(0)
|
||||
{}
|
||||
|
||||
public:
|
||||
QString id;
|
||||
|
@ -65,6 +62,7 @@ public:
|
|||
quint32 max_visible_posts ;
|
||||
};
|
||||
|
||||
//cppcheck-suppress noConstructor
|
||||
class GroupTreeWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "RSTextEdit.h"
|
||||
#include "util/RsSyntaxHighlighter.h"
|
||||
|
||||
//cppcheck-suppress noConstructor
|
||||
class MimeTextEdit : public RSTextEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
class RSImageBlockWidget;
|
||||
|
||||
//cppcheck-suppress noConstructor
|
||||
class RSTextBrowser : public QTextBrowser
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
|
@ -11,67 +11,55 @@
|
|||
#include <iostream>
|
||||
|
||||
RSButtonOnText::RSButtonOnText(QWidget *parent)
|
||||
: QPushButton(parent)
|
||||
: QPushButton(parent), _textEdit(NULL), _textEditViewPort(NULL), _textCursor(NULL)
|
||||
, _lenght(-1), _mouseOver(false), _pressed(false)
|
||||
{
|
||||
_uuid = QUuid::createUuid().toString();
|
||||
_lenght = -1;
|
||||
_mouseOver = false;
|
||||
_pressed = false;
|
||||
}
|
||||
RSButtonOnText::RSButtonOnText(const QString &text, QWidget *parent)
|
||||
: QPushButton(parent)
|
||||
: QPushButton(parent), _textEdit(NULL), _textEditViewPort(NULL), _textCursor(NULL)
|
||||
, _lenght(-1), _mouseOver(false), _pressed(false)
|
||||
//: RSButtonOnText(parent)//delegating constructors only available with -std=c++11 or -std=gnu++11
|
||||
{
|
||||
_uuid = QUuid::createUuid().toString();
|
||||
_lenght = -1;
|
||||
_mouseOver = false;
|
||||
_pressed = false;
|
||||
setText(text);
|
||||
}
|
||||
|
||||
RSButtonOnText::RSButtonOnText(const QIcon& icon, const QString &text, QWidget *parent)
|
||||
: QPushButton(parent)
|
||||
: QPushButton(parent), _textEdit(NULL), _textEditViewPort(NULL), _textCursor(NULL)
|
||||
, _lenght(-1), _mouseOver(false), _pressed(false)
|
||||
//: RSButtonOnText(text, parent)//delegating constructors only available with -std=c++11 or -std=gnu++11
|
||||
{
|
||||
_uuid = QUuid::createUuid().toString();
|
||||
_lenght = -1;
|
||||
_mouseOver = false;
|
||||
_pressed = false;
|
||||
setIcon(icon);
|
||||
setText(text);
|
||||
}
|
||||
|
||||
RSButtonOnText::RSButtonOnText(QTextEdit *textEdit, QWidget *parent)
|
||||
: QPushButton(parent)
|
||||
, _lenght(-1), _mouseOver(false), _pressed(false)
|
||||
//: RSButtonOnText(parent)//delegating constructors only available with -std=c++11 or -std=gnu++11
|
||||
{
|
||||
_uuid = QUuid::createUuid().toString();
|
||||
_lenght = -1;
|
||||
_mouseOver = false;
|
||||
_pressed = false;
|
||||
appendToText(textEdit);
|
||||
appendToText(textEdit);
|
||||
}
|
||||
|
||||
RSButtonOnText::RSButtonOnText(const QString &text, QTextEdit *textEdit, QWidget *parent)
|
||||
: QPushButton(parent)
|
||||
, _lenght(-1), _mouseOver(false), _pressed(false)
|
||||
//: RSButtonOnText(parent)//delegating constructors only available with -std=c++11 or -std=gnu++11
|
||||
{
|
||||
_uuid = QUuid::createUuid().toString();
|
||||
_lenght = -1;
|
||||
_mouseOver = false;
|
||||
_pressed = false;
|
||||
setText(text);
|
||||
appendToText(textEdit);
|
||||
}
|
||||
|
||||
RSButtonOnText::RSButtonOnText(const QIcon& icon, const QString &text, QTextEdit *textEdit, QWidget *parent)
|
||||
: QPushButton(parent)
|
||||
, _lenght(-1), _mouseOver(false), _pressed(false)
|
||||
//: RSButtonOnText(parent)//delegating constructors only available with -std=c++11 or -std=gnu++11
|
||||
{
|
||||
_uuid = QUuid::createUuid().toString();
|
||||
_lenght = -1;
|
||||
_mouseOver = false;
|
||||
_pressed = false;
|
||||
setIcon(icon);
|
||||
setText(text);
|
||||
appendToText(textEdit);
|
||||
|
|
|
@ -35,10 +35,10 @@ private:
|
|||
bool isEventForThis(QObject *obj, QEvent *event, QPoint &point);
|
||||
|
||||
QString _uuid;
|
||||
int _lenght;//Because cursor end position move durring editing
|
||||
QTextEdit* _textEdit;
|
||||
QWidget* _textEditViewPort;
|
||||
QTextCursor* _textCursor;
|
||||
int _lenght;//Because cursor end position move durring editing
|
||||
bool _mouseOver;
|
||||
bool _pressed;
|
||||
|
||||
|
|
|
@ -146,16 +146,20 @@ RsCollectionDialog::RsCollectionDialog(const QString& collectionFileName
|
|||
ui.headerFrame->setHeaderText(tr("Collection Editor"));
|
||||
ui.downloadFolder_LE->hide();
|
||||
ui.downloadFolder_LB->hide();
|
||||
ui.destinationDir_TB->hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.headerFrame->setHeaderText(tr("Download files"));
|
||||
ui.downloadFolder_LE->show();
|
||||
ui.downloadFolder_LB->show();
|
||||
ui.label_filename->hide();
|
||||
ui._filename_TL->hide();
|
||||
|
||||
ui.downloadFolder_LE->setText(QString::fromUtf8(rsFiles->getDownloadDirectory().c_str())) ;
|
||||
|
||||
QObject::connect(ui.downloadFolder_LE,SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(openDestinationDirectoryMenu(QPoint)));
|
||||
QObject::connect(ui.downloadFolder_LE,SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(openDestinationDirectoryMenu()));
|
||||
QObject::connect(ui.destinationDir_TB,SIGNAL(pressed()), this, SLOT(openDestinationDirectoryMenu()));
|
||||
}
|
||||
|
||||
// 1 - add all elements to the list.
|
||||
|
@ -227,7 +231,7 @@ RsCollectionDialog::RsCollectionDialog(const QString& collectionFileName
|
|||
QMessageBox::warning(NULL,tr("Bad filenames have been cleaned"),tr("Some filenames or directory names contained forbidden characters.\nCharacters <b>\",|,/,\\,<,>,*,?</b> will be replaced by '_'.\n Concerned files are listed in red.")) ;
|
||||
}
|
||||
|
||||
void RsCollectionDialog::openDestinationDirectoryMenu(QPoint)
|
||||
void RsCollectionDialog::openDestinationDirectoryMenu()
|
||||
{
|
||||
QMenu contextMnu( this );
|
||||
|
||||
|
@ -398,30 +402,34 @@ void RsCollectionDialog::processSettings(bool bLoad)
|
|||
*/
|
||||
QTreeWidgetItem* RsCollectionDialog::getRootItem()
|
||||
{
|
||||
QTreeWidgetItem* root= ui._fileEntriesTW->topLevelItem(0);
|
||||
if (!root) {
|
||||
root= new QTreeWidgetItem;
|
||||
root->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate);
|
||||
root->setText(COLUMN_FILE, "/");
|
||||
root->setToolTip(COLUMN_FILE,tr("This is the root directory."));
|
||||
root->setText(COLUMN_FILEPATH, "/");
|
||||
root->setText(COLUMN_HASH, "");
|
||||
root->setData(COLUMN_HASH, ROLE_NAME, "");
|
||||
root->setData(COLUMN_HASH, ROLE_PATH, "");
|
||||
root->setData(COLUMN_HASH, ROLE_TYPE, DIR_TYPE_DIR);
|
||||
root->setText(COLUMN_SIZE, misc::friendlyUnit(0));
|
||||
root->setToolTip(COLUMN_SIZE, tr("Real Size: Waiting child..."));
|
||||
root->setData(COLUMN_SIZE, ROLE_SIZE, 0);
|
||||
root->setData(COLUMN_SIZE, ROLE_SELSIZE, 0);
|
||||
root->setText(COLUMN_FILEC, "0");
|
||||
root->setToolTip(COLUMN_FILEC, tr("Real File Count: Waiting child..."));
|
||||
root->setData(COLUMN_FILEC, ROLE_FILEC, 0);
|
||||
root->setData(COLUMN_FILEC, ROLE_SELFILEC, 0);
|
||||
ui._fileEntriesTW->addTopLevelItem(root);
|
||||
}
|
||||
root->setExpanded(true);
|
||||
return ui._fileEntriesTW->invisibleRootItem();
|
||||
|
||||
return root;
|
||||
// (csoler) I removed this code because it does the job of the invisibleRootItem() method.
|
||||
//
|
||||
// QTreeWidgetItem* root= ui._fileEntriesTW->topLevelItem(0);
|
||||
// if (!root) {
|
||||
// root= new QTreeWidgetItem;
|
||||
// root->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate);
|
||||
// root->setText(COLUMN_FILE, "/");
|
||||
// root->setToolTip(COLUMN_FILE,tr("This is the root directory."));
|
||||
// root->setText(COLUMN_FILEPATH, "/");
|
||||
// root->setText(COLUMN_HASH, "");
|
||||
// root->setData(COLUMN_HASH, ROLE_NAME, "");
|
||||
// root->setData(COLUMN_HASH, ROLE_PATH, "");
|
||||
// root->setData(COLUMN_HASH, ROLE_TYPE, DIR_TYPE_DIR);
|
||||
// root->setText(COLUMN_SIZE, misc::friendlyUnit(0));
|
||||
// root->setToolTip(COLUMN_SIZE, tr("Real Size: Waiting child..."));
|
||||
// root->setData(COLUMN_SIZE, ROLE_SIZE, 0);
|
||||
// root->setData(COLUMN_SIZE, ROLE_SELSIZE, 0);
|
||||
// root->setText(COLUMN_FILEC, "0");
|
||||
// root->setToolTip(COLUMN_FILEC, tr("Real File Count: Waiting child..."));
|
||||
// root->setData(COLUMN_FILEC, ROLE_FILEC, 0);
|
||||
// root->setData(COLUMN_FILEC, ROLE_SELFILEC, 0);
|
||||
// ui._fileEntriesTW->addTopLevelItem(root);
|
||||
// }
|
||||
// root->setExpanded(true);
|
||||
//
|
||||
// return root;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -512,6 +520,7 @@ bool RsCollectionDialog::addChild(QTreeWidgetItem* parent, const std::vector<Col
|
|||
item->setData(COLUMN_FILEC, ROLE_SELFILEC, 1);
|
||||
}
|
||||
item->setFont(COLUMN_FILE, font);
|
||||
item->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
|
||||
|
||||
if (colFileInfo.filename_has_wrong_characters)
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ private slots:
|
|||
void remove() ;
|
||||
void chooseDestinationDirectory();
|
||||
void setDestinationDirectory();
|
||||
void openDestinationDirectoryMenu(QPoint pt);
|
||||
void openDestinationDirectoryMenu();
|
||||
void processItem(QMap<QString, QString> &dirToAdd
|
||||
, int &index
|
||||
, ColFileInfo &parent
|
||||
|
|
|
@ -377,7 +377,7 @@
|
|||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
<property name="rootIsDecorated">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
|
@ -422,6 +422,17 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="destinationDir_TB">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/start.png</normaloff>:/images/start.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="downloadFolder_LE">
|
||||
<property name="contextMenuPolicy">
|
||||
|
|
|
@ -558,6 +558,7 @@
|
|||
<file>emojione/1F640.png</file>
|
||||
<file>emojione/1F641.png</file>
|
||||
<file>emojione/1F642.png</file>
|
||||
<file>emojione/1f644.png</file>
|
||||
<file>emojione/1F645.png</file>
|
||||
<file>emojione/1F646.png</file>
|
||||
<file>emojione/1F647.png</file>
|
||||
|
@ -654,6 +655,7 @@
|
|||
<file>emojione/2611.png</file>
|
||||
<file>emojione/2614.png</file>
|
||||
<file>emojione/2615.png</file>
|
||||
<file>emojione/2639.png</file>
|
||||
<file>emojione/2620.png</file>
|
||||
<file>emojione/2708.png</file>
|
||||
<file>emojione/2744.png</file>
|
||||
|
@ -668,6 +670,12 @@
|
|||
<file>emojione/1f914.png</file>
|
||||
<file>emojione/1f915.png</file>
|
||||
<file>emojione/1f916.png</file>
|
||||
<file>emojione/1f917.png</file>
|
||||
<file>emojione/1f922.png</file>
|
||||
<file>emojione/1f923.png</file>
|
||||
<file>emojione/1f924.png</file>
|
||||
<file>emojione/1f925.png</file>
|
||||
<file>emojione/1f927.png</file>
|
||||
<file>emojione/1f643.png</file>
|
||||
<file>emojione/emotes.acs</file>
|
||||
</qresource>
|
||||
|
|
Before Width: | Height: | Size: 950 B After Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 1,010 B After Width: | Height: | Size: 488 B |
Before Width: | Height: | Size: 892 B After Width: | Height: | Size: 477 B |
Before Width: | Height: | Size: 693 B After Width: | Height: | Size: 361 B |
Before Width: | Height: | Size: 879 B After Width: | Height: | Size: 487 B |
Before Width: | Height: | Size: 948 B After Width: | Height: | Size: 523 B |
Before Width: | Height: | Size: 814 B After Width: | Height: | Size: 419 B |
Before Width: | Height: | Size: 904 B After Width: | Height: | Size: 515 B |
Before Width: | Height: | Size: 956 B After Width: | Height: | Size: 568 B |
Before Width: | Height: | Size: 795 B After Width: | Height: | Size: 428 B |
Before Width: | Height: | Size: 930 B After Width: | Height: | Size: 493 B |
Before Width: | Height: | Size: 920 B After Width: | Height: | Size: 538 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 460 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 515 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 558 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 897 B |
Before Width: | Height: | Size: 840 B After Width: | Height: | Size: 444 B |
Before Width: | Height: | Size: 793 B After Width: | Height: | Size: 447 B |
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 418 B |
Before Width: | Height: | Size: 725 B After Width: | Height: | Size: 449 B |
Before Width: | Height: | Size: 931 B After Width: | Height: | Size: 548 B |
Before Width: | Height: | Size: 771 B After Width: | Height: | Size: 426 B |
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 562 B |
Before Width: | Height: | Size: 884 B After Width: | Height: | Size: 513 B |
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 829 B After Width: | Height: | Size: 592 B |
Before Width: | Height: | Size: 895 B After Width: | Height: | Size: 461 B |
Before Width: | Height: | Size: 914 B After Width: | Height: | Size: 543 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 545 B |
Before Width: | Height: | Size: 793 B After Width: | Height: | Size: 468 B |
Before Width: | Height: | Size: 1,013 B After Width: | Height: | Size: 587 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 982 B |
Before Width: | Height: | Size: 887 B After Width: | Height: | Size: 642 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 854 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 900 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 868 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 786 B |
Before Width: | Height: | Size: 833 B After Width: | Height: | Size: 605 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 975 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 843 B |
Before Width: | Height: | Size: 808 B After Width: | Height: | Size: 554 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 837 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 676 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 676 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 810 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 773 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 533 B |
Before Width: | Height: | Size: 842 B After Width: | Height: | Size: 625 B |
Before Width: | Height: | Size: 983 B After Width: | Height: | Size: 689 B |
Before Width: | Height: | Size: 795 B After Width: | Height: | Size: 577 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 655 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 904 B |
Before Width: | Height: | Size: 827 B After Width: | Height: | Size: 674 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 830 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 887 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 675 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 858 B After Width: | Height: | Size: 555 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 961 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 743 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 674 B |
Before Width: | Height: | Size: 998 B After Width: | Height: | Size: 757 B |
Before Width: | Height: | Size: 980 B After Width: | Height: | Size: 601 B |
Before Width: | Height: | Size: 933 B After Width: | Height: | Size: 524 B |
Before Width: | Height: | Size: 831 B After Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 982 B After Width: | Height: | Size: 745 B |
Before Width: | Height: | Size: 984 B After Width: | Height: | Size: 717 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 696 B |
Before Width: | Height: | Size: 851 B After Width: | Height: | Size: 654 B |
Before Width: | Height: | Size: 856 B After Width: | Height: | Size: 579 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 715 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 713 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 780 B |
Before Width: | Height: | Size: 964 B After Width: | Height: | Size: 645 B |