mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
Merge pull request #2079 from csoler/v0.6-BugFixing_2
[WIP] save chosen ID in posted
This commit is contained in:
commit
bd624b666d
@ -188,7 +188,7 @@ IdDialog::IdDialog(QWidget *parent) : MainPage(parent), ui(new Ui::IdDialog)
|
||||
mMyCircleItem = NULL ;
|
||||
|
||||
/* Setup UI helper */
|
||||
mStateHelper = new UIStateHelper(this);
|
||||
mStateHelper = new UIStateHelper(this);
|
||||
// mStateHelper->addWidget(IDDIALOG_IDLIST, ui->idTreeWidget);
|
||||
mStateHelper->addLoadPlaceholder(IDDIALOG_IDLIST, ui->idTreeWidget, false);
|
||||
mStateHelper->addClear(IDDIALOG_IDLIST, ui->idTreeWidget);
|
||||
@ -235,7 +235,7 @@ IdDialog::IdDialog(QWidget *parent) : MainPage(parent), ui(new Ui::IdDialog)
|
||||
|
||||
//mStateHelper->addWidget(IDDIALOG_REPLIST, ui->treeWidget_RepList);
|
||||
//mStateHelper->addLoadPlaceholder(IDDIALOG_REPLIST, ui->treeWidget_RepList);
|
||||
//mStateHelper->addClear(IDDIALOG_REPLIST, ui->treeWidget_RepList);
|
||||
//mStateHelper->addClear(IDDIALOG_REPLIST, ui->treeWidget_RepList);
|
||||
|
||||
/* Connect signals */
|
||||
|
||||
@ -374,7 +374,7 @@ IdDialog::IdDialog(QWidget *parent) : MainPage(parent), ui(new Ui::IdDialog)
|
||||
QHeaderView_setSectionResizeModeColumn(idheader, RSID_COL_VOTES, QHeaderView::ResizeToContents);
|
||||
|
||||
mStateHelper->setActive(IDDIALOG_IDDETAILS, false);
|
||||
mStateHelper->setActive(IDDIALOG_REPLIST, false);
|
||||
mStateHelper->setActive(IDDIALOG_REPLIST, false);
|
||||
|
||||
QString hlp_str = tr(
|
||||
" <h1><img width=\"32\" src=\":/icons/help_64.png\"> Identities</h1> \
|
||||
@ -601,7 +601,7 @@ void IdDialog::loadCircles(const std::list<RsGroupMetaData>& groupInfo)
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
mStateHelper->setActive(CIRCLESDIALOG_GROUPMETA, true);
|
||||
mStateHelper->setActive(CIRCLESDIALOG_GROUPMETA, true);
|
||||
|
||||
std::vector<bool> expanded_top_level_items;
|
||||
std::set<RsGxsCircleId> expanded_circle_items;
|
||||
@ -1276,9 +1276,6 @@ void IdDialog::updateSelection()
|
||||
|
||||
void IdDialog::updateIdList()
|
||||
{
|
||||
//Disable by default, will be enable by insertIdDetails()
|
||||
ui->removeIdentity->setEnabled(false);
|
||||
ui->editIdentity->setEnabled(false);
|
||||
|
||||
//int accept = filter;
|
||||
|
||||
@ -1505,7 +1502,7 @@ void IdDialog::loadIdentities(const std::map<RsGxsGroupId,RsGxsIdGroup>& ids_set
|
||||
}
|
||||
int accept = filter;
|
||||
|
||||
mStateHelper->setActive(IDDIALOG_IDLIST, true);
|
||||
mStateHelper->setActive(IDDIALOG_IDLIST, true);
|
||||
|
||||
RsPgpId ownPgpId = rsPeers->getGPGOwnId();
|
||||
|
||||
@ -1596,15 +1593,15 @@ void IdDialog::updateIdentity()
|
||||
{
|
||||
if (mId.isNull())
|
||||
{
|
||||
mStateHelper->setActive(IDDIALOG_IDDETAILS, false);
|
||||
mStateHelper->setActive(IDDIALOG_IDDETAILS, false);
|
||||
mStateHelper->setLoading(IDDIALOG_IDDETAILS, false);
|
||||
mStateHelper->clear(IDDIALOG_IDDETAILS);
|
||||
mStateHelper->clear(IDDIALOG_IDDETAILS);
|
||||
clearPerson();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
mStateHelper->setLoading(IDDIALOG_IDDETAILS, true);
|
||||
mStateHelper->setLoading(IDDIALOG_IDDETAILS, true);
|
||||
|
||||
RsThread::async([this]()
|
||||
{
|
||||
@ -1642,11 +1639,11 @@ void IdDialog::updateIdentity()
|
||||
|
||||
void IdDialog::loadIdentity(RsGxsIdGroup data)
|
||||
{
|
||||
mStateHelper->setLoading(IDDIALOG_IDDETAILS, false);
|
||||
mStateHelper->setLoading(IDDIALOG_IDDETAILS, false);
|
||||
|
||||
/* get details from libretroshare */
|
||||
|
||||
mStateHelper->setActive(IDDIALOG_IDDETAILS, true);
|
||||
mStateHelper->setActive(IDDIALOG_IDDETAILS, true);
|
||||
|
||||
/* get GPG Details from rsPeers */
|
||||
RsPgpId ownPgpId = rsPeers->getGPGOwnId();
|
||||
@ -1749,20 +1746,20 @@ void IdDialog::loadIdentity(RsGxsIdGroup data)
|
||||
|
||||
if (isOwnId)
|
||||
{
|
||||
mStateHelper->setWidgetEnabled(ui->ownOpinion_CB, false);
|
||||
mStateHelper->setWidgetEnabled(ui->autoBanIdentities_CB, false);
|
||||
ui->editIdentity->setEnabled(true);
|
||||
ui->removeIdentity->setEnabled(true);
|
||||
mStateHelper->setWidgetEnabled(ui->ownOpinion_CB, false);
|
||||
mStateHelper->setWidgetEnabled(ui->autoBanIdentities_CB, false);
|
||||
// ui->editIdentity->setEnabled(true);
|
||||
// ui->removeIdentity->setEnabled(true);
|
||||
ui->chatIdentity->setEnabled(false);
|
||||
ui->inviteButton->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// No Reputation yet!
|
||||
mStateHelper->setWidgetEnabled(ui->ownOpinion_CB, true);
|
||||
mStateHelper->setWidgetEnabled(ui->autoBanIdentities_CB, true);
|
||||
ui->editIdentity->setEnabled(false);
|
||||
ui->removeIdentity->setEnabled(false);
|
||||
mStateHelper->setWidgetEnabled(ui->ownOpinion_CB, true);
|
||||
mStateHelper->setWidgetEnabled(ui->autoBanIdentities_CB, true);
|
||||
// ui->editIdentity->setEnabled(false);
|
||||
// ui->removeIdentity->setEnabled(false);
|
||||
ui->chatIdentity->setEnabled(true);
|
||||
ui->inviteButton->setEnabled(true);
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ private:
|
||||
RsEventsHandlerId_t mEventHandlerId_identity;
|
||||
RsEventsHandlerId_t mEventHandlerId_circles;
|
||||
|
||||
/* UI - Designer */
|
||||
/* UI - Designer */
|
||||
Ui::IdDialog *ui;
|
||||
};
|
||||
|
||||
|
@ -161,7 +161,6 @@ void BoardPostDisplayWidgetBase::setup()
|
||||
titleLabel()->setText(tr("Loading"));
|
||||
dateLabel()->clear();
|
||||
fromLabel()->clear();
|
||||
siteLabel()->clear();
|
||||
|
||||
QObject::connect(commentButton(), SIGNAL(toggled(bool)), this, SLOT(loadComments(bool)));
|
||||
QObject::connect(voteUpButton(), SIGNAL(clicked()), this, SLOT(makeUpVote()));
|
||||
@ -206,8 +205,8 @@ void BoardPostDisplayWidgetBase::setup()
|
||||
qtime.setTime_t(mPost.mMeta.mPublishTs);
|
||||
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
|
||||
QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs) + " " + tr("ago");
|
||||
dateLabel()->setText(timestamp2);
|
||||
dateLabel()->setToolTip(timestamp);
|
||||
dateLabel()->setText(timestamp);
|
||||
dateLabel()->setToolTip(timestamp2);
|
||||
|
||||
fromLabel()->setId(mPost.mMeta.mAuthorId);
|
||||
|
||||
@ -241,17 +240,12 @@ void BoardPostDisplayWidgetBase::setup()
|
||||
urlstr += QString(" </span></a>");
|
||||
|
||||
QString siteurl = url.toEncoded();
|
||||
sitestr = QString("<a href=\"%1\" ><span style=\" text-decoration: underline; color:#0079d3;\"> %2 </span></a>").arg(siteurl).arg(siteurl);
|
||||
|
||||
titleLabel()->setText(urlstr);
|
||||
titleLabel()->setToolTip(siteurl);
|
||||
}
|
||||
else
|
||||
titleLabel()->setText( QString::fromUtf8(mPost.mMeta.mMsgName.c_str()) );
|
||||
|
||||
if (urlarray.isEmpty())
|
||||
siteLabel()->hide();
|
||||
|
||||
siteLabel()->setText(sitestr);
|
||||
}
|
||||
|
||||
//QString score = "Hot" + QString::number(post.mHotScore);
|
||||
@ -419,7 +413,6 @@ QToolButton *BoardPostDisplayWidget_compact::commentButton() { return ui->co
|
||||
QToolButton *BoardPostDisplayWidget_compact::voteDownButton() { return ui->voteDownButton; }
|
||||
QLabel *BoardPostDisplayWidget_compact::newLabel() { return ui->newLabel; }
|
||||
QToolButton *BoardPostDisplayWidget_compact::readButton() { return ui->readButton; }
|
||||
QLabel *BoardPostDisplayWidget_compact::siteLabel() { return ui->siteLabel; }
|
||||
GxsIdLabel *BoardPostDisplayWidget_compact::fromLabel() { return ui->fromLabel; }
|
||||
QLabel *BoardPostDisplayWidget_compact::dateLabel() { return ui->dateLabel; }
|
||||
QLabel *BoardPostDisplayWidget_compact::titleLabel() { return ui->titleLabel; }
|
||||
@ -499,7 +492,6 @@ QToolButton *BoardPostDisplayWidget_card::commentButton() { return ui->comme
|
||||
QToolButton *BoardPostDisplayWidget_card::voteDownButton() { return ui->voteDownButton; }
|
||||
QLabel *BoardPostDisplayWidget_card::newLabel() { return ui->newLabel; }
|
||||
QToolButton *BoardPostDisplayWidget_card::readButton() { return ui->readButton; }
|
||||
QLabel *BoardPostDisplayWidget_card::siteLabel() { return ui->siteLabel; }
|
||||
GxsIdLabel *BoardPostDisplayWidget_card::fromLabel() { return ui->fromLabel; }
|
||||
QLabel *BoardPostDisplayWidget_card::dateLabel() { return ui->dateLabel; }
|
||||
QLabel *BoardPostDisplayWidget_card::titleLabel() { return ui->titleLabel; }
|
||||
|
@ -72,7 +72,6 @@ protected slots:
|
||||
virtual QToolButton *voteDownButton() =0;
|
||||
virtual QLabel *newLabel() =0;
|
||||
virtual QLabel *titleLabel()=0;
|
||||
virtual QLabel *siteLabel()=0;
|
||||
virtual GxsIdLabel *fromLabel()=0;
|
||||
virtual QLabel *dateLabel()=0;
|
||||
virtual QLabel *scoreLabel() =0;
|
||||
@ -120,7 +119,6 @@ public:
|
||||
QToolButton *commentButton() override;
|
||||
QToolButton *voteDownButton() override;
|
||||
QLabel *newLabel() override;
|
||||
QLabel *siteLabel() override;
|
||||
GxsIdLabel *fromLabel() override;
|
||||
QLabel *dateLabel() override;
|
||||
QLabel *titleLabel() override;
|
||||
@ -160,7 +158,6 @@ public:
|
||||
QToolButton *commentButton() override;
|
||||
QToolButton *voteDownButton() override;
|
||||
QLabel *newLabel() override;
|
||||
QLabel *siteLabel() override;
|
||||
GxsIdLabel *fromLabel() override;
|
||||
QLabel *dateLabel() override;
|
||||
QLabel *titleLabel() override;
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>558</width>
|
||||
<height>202</height>
|
||||
<width>426</width>
|
||||
<height>176</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -327,22 +327,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="siteLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">site</string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="pictureLabelLayout">
|
||||
<item>
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>540</width>
|
||||
<height>172</height>
|
||||
<width>542</width>
|
||||
<height>150</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -302,22 +302,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="siteLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">site</string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
|
@ -112,20 +112,11 @@ void PostedCreatePostDialog::processSettings(bool load)
|
||||
Settings->beginGroup(QString("PostedCreatePostDialog"));
|
||||
|
||||
if (load) {
|
||||
// load settings
|
||||
|
||||
// state of ID Chooser combobox
|
||||
int index = Settings->value("IDChooser", 0).toInt();
|
||||
ui->idChooser->setCurrentIndex(index);
|
||||
|
||||
// load last used Stacked Page
|
||||
setPage(Settings->value("viewPage", VIEW_POST).toInt());
|
||||
} else {
|
||||
// save settings
|
||||
|
||||
// state of ID Chooser combobox
|
||||
Settings->setValue("IDChooser", ui->idChooser->currentIndex());
|
||||
|
||||
// store last used Page
|
||||
Settings->setValue("viewPage", viewMode());
|
||||
}
|
||||
|
@ -687,10 +687,20 @@ void PostedListWidgetWithModel::processSettings(bool load)
|
||||
|
||||
if (load)
|
||||
{
|
||||
// state of ID Chooser combobox
|
||||
RsGxsId gxs_id(Settings->value("IDChooser", QString::fromStdString(RsGxsId().toStdString())).toString().toStdString());
|
||||
|
||||
if(!gxs_id.isNull() && rsIdentity->isOwnId(gxs_id))
|
||||
ui->idChooser->setChosenId(gxs_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
// state of ID Chooser combobox
|
||||
RsGxsId id;
|
||||
|
||||
if(ui->idChooser->getChosenId(id))
|
||||
Settings->setValue("IDChooser", QString::fromStdString(id.toStdString()));
|
||||
}
|
||||
|
||||
Settings->endGroup();
|
||||
}
|
||||
|
@ -42,7 +42,9 @@ GxsCommentDialog::GxsCommentDialog(QWidget *parent, const RsGxsId &default_autho
|
||||
|
||||
void GxsCommentDialog::init(const RsGxsId& default_author)
|
||||
{
|
||||
/* Set header resize modes and initial section sizes */
|
||||
ui->refreshButton->hide(); // this is not needed anymore. Let's keep this piece of code for some time just in case.
|
||||
|
||||
/* Set header resize modes and initial section sizes */
|
||||
QHeaderView * ttheader = ui->treeWidget->header () ;
|
||||
ttheader->resizeSection (0, 440);
|
||||
|
||||
|
@ -204,17 +204,28 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem &
|
||||
font.setBold(true);
|
||||
painter->setFont(font);
|
||||
}
|
||||
painter->drawText(QPoint(p.x()+0.5*font_height,y),QString::fromUtf8(post.mMeta.mMsgName.c_str()));
|
||||
y += font_height;
|
||||
|
||||
painter->drawText(QPoint(p.x()+0.5*font_height,y),QDateTime::fromSecsSinceEpoch(post.mMeta.mPublishTs).toString(Qt::DefaultLocaleShortDate));
|
||||
{
|
||||
painter->save();
|
||||
|
||||
QFont font(painter->font());
|
||||
font.setUnderline(true);
|
||||
painter->setFont(font);
|
||||
painter->drawText(QPoint(p.x()+0.5*font_height,y),QString::fromUtf8(post.mMeta.mMsgName.c_str()));
|
||||
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
y += font_height;
|
||||
y += font_height/2.0;
|
||||
|
||||
QString info_text = QDateTime::fromMSecsSinceEpoch(qint64(1000)*post.mMeta.mPublishTs).toString(Qt::DefaultLocaleShortDate);
|
||||
|
||||
if(post.mCount > 0)
|
||||
{
|
||||
painter->drawText(QPoint(p.x()+0.5*font_height,y),QString::number(post.mCount)+ " " +((post.mCount>1)?tr("files"):tr("file")) + " (" + QString::number(post.mSize) + " " + tr("bytes") + ")" );
|
||||
y += font_height;
|
||||
}
|
||||
info_text += ", " + QString::number(post.mCount)+ " " +((post.mCount>1)?tr("files"):tr("file")) + " (" + misc::friendlyUnit(qulonglong(post.mSize)) + ")" ;
|
||||
|
||||
painter->drawText(QPoint(p.x()+0.5*font_height,y),info_text);
|
||||
y += font_height;
|
||||
|
||||
painter->restore();
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ class ChannelPostDelegate: public QAbstractItemDelegate
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ChannelPostDelegate(QObject *parent=0) : QAbstractItemDelegate(parent), mZoom(1.0), mUseGrid(true){}
|
||||
ChannelPostDelegate(QObject *parent=0) : QAbstractItemDelegate(parent), mZoom(1.2), mUseGrid(true){}
|
||||
virtual ~ChannelPostDelegate(){}
|
||||
|
||||
void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const override;
|
||||
|
@ -482,6 +482,12 @@ p, li { white-space: pre-wrap; }
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="postName_LB">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
|
@ -1957,6 +1957,8 @@ void GxsForumThreadWidget::updateGroupData()
|
||||
|
||||
updateForumDescription(true);
|
||||
|
||||
emit groupChanged(this); // signals the parent widget to e.g. update the group tab name
|
||||
|
||||
}, this );
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user