Merge pull request #756 from RetroPooh/guistuff

minor gui stuff
This commit is contained in:
csoler 2017-03-25 20:27:18 +01:00 committed by GitHub
commit dbcf2d2149
6 changed files with 34 additions and 2 deletions

View File

@ -378,8 +378,12 @@ static void updateItem(QTreeWidget *treeWidget, QTreeWidgetItem *item, ChatLobby
+QObject::tr("Id:")+" "+QString::number(id,16) ;
if(lobby_flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED)
{
tooltipstr += QObject::tr("\nSecurity: no anonymous IDs") ;
QColor foreground = QColor(0, 128, 0); // green
for (int column = 0; column < COLUMN_COUNT; ++column)
item->setTextColor(column, foreground);
}
item->setToolTip(0,tooltipstr) ;
}
@ -653,7 +657,9 @@ void ChatLobbyWidget::updateDisplay()
updateItem(ui.lobbyTreeWidget, item, lobby.lobby_id, lobby.lobby_name,lobby.lobby_topic, lobby.gxs_ids.size(), true, autoSubscribe,lobby_flags);
}
publicSubLobbyItem->setHidden(publicSubLobbyItem->childCount()==0);
publicSubLobbyItem->setText(COLUMN_NAME, tr("Public Subscribed chat rooms")+ QString(" (") + QString::number(publicSubLobbyItem->childCount())+QString(")"));
privateSubLobbyItem->setHidden(privateSubLobbyItem->childCount()==0);
publicLobbyItem->setText(COLUMN_NAME, tr("Public chat rooms")+ " (" + QString::number(publicLobbyItem->childCount())+QString(")"));
}
void ChatLobbyWidget::createChatLobby()

View File

@ -407,6 +407,13 @@ void SearchDialog::download()
for(std::list<RsPeerId>::const_iterator it(srcIds.begin()); it!=srcIds.end(); ++it) {
std::cout << *it << "-" << std::endl;
}//for(std::list<RsPeerId>::const_iterator
//QColor foreground = QColor(0, 128, 0); // green
QColor foreground = textColorDownloading();
QBrush brush(foreground);
for (int i = 0; i < item->columnCount(); ++i)
{
item->setForeground(i, brush);
}
}//if(!rsFiles -> FileRequest(
}//if (item->text(SR_HASH_COL).isEmpty())
}//for (int i = 0
@ -1189,6 +1196,11 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
found = true ;
if (!item->data(SR_DATA_COL, SR_ROLE_LOCAL).toBool()) {
FileInfo fi;
if (rsFiles->FileDetails(file.hash, RS_FILE_HINTS_DOWNLOAD, fi))
break;
QColor foreground;
int sources = friendSource + anonymousSource ;
@ -1281,6 +1293,12 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
setForeground = true;
}
}
if (rsFiles->FileDetails(file.hash, RS_FILE_HINTS_DOWNLOAD, fi))
{
//foreground = QColor(0, 128, 0); // green
foreground = textColorDownloading();
setForeground = true;
}
if (setForeground) {
QBrush brush(foreground);

View File

@ -38,6 +38,7 @@ class SearchDialog : public MainPage
Q_OBJECT
Q_PROPERTY(QColor textColorLocal READ textColorLocal WRITE setTextColorLocal)
Q_PROPERTY(QColor textColorDownloading READ textColorDownloading WRITE setTextColorDownloading)
Q_PROPERTY(QColor textColorNoSources READ textColorNoSources WRITE setTextColorNoSources)
Q_PROPERTY(QColor textColorLowSources READ textColorLowSources WRITE setTextColorLowSources)
Q_PROPERTY(QColor textColorHighSources READ textColorHighSources WRITE setTextColorHighSources)
@ -51,11 +52,13 @@ public:
void searchKeywords(const QString& keywords);
QColor textColorLocal() const { return mTextColorLocal; }
QColor textColorDownloading() const { return mTextColorDownloading; }
QColor textColorNoSources() const { return mTextColorNoSources; }
QColor textColorLowSources() const { return mTextColorLowSources; }
QColor textColorHighSources() const { return mTextColorHighSources; }
void setTextColorLocal(QColor color) { mTextColorLocal = color; }
void setTextColorDownloading(QColor color) { mTextColorDownloading = color; }
void setTextColorNoSources(QColor color) { mTextColorNoSources = color; }
void setTextColorLowSources(QColor color) { mTextColorLowSources = color; }
void setTextColorHighSources(QColor color) { mTextColorHighSources = color; }
@ -154,6 +157,7 @@ private:
/* Color definitions (for standard see qss.default) */
QColor mTextColorLocal;
QColor mTextColorDownloading;
QColor mTextColorNoSources;
QColor mTextColorLowSources;
QColor mTextColorHighSources;

View File

@ -841,8 +841,11 @@ void GxsGroupFrameDialog::insertGroupsData(const std::list<RsGroupMetaData> &gro
/* now we can add them in as a tree! */
ui->groupTreeWidget->fillGroupItems(mYourGroups, adminList);
ui->groupTreeWidget->fillGroupItems(mSubscribedGroups, subList);
mSubscribedGroups->setText(2, QString::number(mSubscribedGroups->childCount())); // 1 COLUMN_UNREAD 2 COLUMN_POPULARITY
ui->groupTreeWidget->fillGroupItems(mPopularGroups, popList);
mPopularGroups->setText(2, QString::number(mPopularGroups->childCount()));
ui->groupTreeWidget->fillGroupItems(mOtherGroups, otherList);
mOtherGroups->setText(2, QString::number(mOtherGroups->childCount()));
mInFill = false;

View File

@ -174,6 +174,7 @@ FriendList
SearchDialog
{
qproperty-textColorLocal: red;
qproperty-textColorDownloading: green;
qproperty-textColorNoSources: rgb(0, 0, 19);
qproperty-textColorLowSources: rgb(0, 0, 38);
qproperty-textColorHighSources: rgb(0, 0, 228);

View File

@ -153,7 +153,7 @@ void TurtleRouterDialog::updateTunnelRequests( const std::vector<std::vector<std
font.setItalic(true);
item->setFont(0,font);
}
if(strtol(tunnels_info[i][5].c_str(), NULL, 0)>1000) // fast
if(strtof(tunnels_info[i][5].c_str(), NULL)>1000) // fast
{
font.setBold(true);
item->setFont(0,font);