mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-13 16:39:43 -05:00
load/save prefered identity for voting in posted
This commit is contained in:
parent
a498d4e370
commit
01c4534a20
@ -27,6 +27,7 @@
|
||||
#include "util/qtthreadsutils.h"
|
||||
#include "gui/gxs/GxsIdDetails.h"
|
||||
#include "PostedCreatePostDialog.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "PostedItem.h"
|
||||
#include "PostedCardView.h"
|
||||
#include "gui/common/UIStateHelper.h"
|
||||
@ -113,6 +114,7 @@ PostedListWidget::PostedListWidget(const RsGxsGroupId &postedId, QWidget *parent
|
||||
/* Initialize GUI */
|
||||
setGroupId(postedId);
|
||||
}
|
||||
|
||||
PostedListWidget::~PostedListWidget()
|
||||
{
|
||||
// save settings
|
||||
@ -147,16 +149,37 @@ void PostedListWidget::processSettings(bool load)
|
||||
{
|
||||
Settings->beginGroup(QString("PostedListWidget"));
|
||||
|
||||
if (load) {
|
||||
if (load)
|
||||
{
|
||||
// load settings
|
||||
|
||||
/* View mode */
|
||||
setViewMode(Settings->value("viewMode", VIEW_MODE_CLASSIC).toInt());
|
||||
} else {
|
||||
|
||||
RsGxsId voteId(Settings->value("defaultIdentity",QString()).toString().toStdString());
|
||||
|
||||
if(!voteId.isNull())
|
||||
ui->idChooser->setChosenId(voteId);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// save settings
|
||||
|
||||
/* View mode */
|
||||
Settings->setValue("viewMode", viewMode());
|
||||
|
||||
RsGxsId voteId;
|
||||
|
||||
switch (ui->idChooser->getChosenId(voteId))
|
||||
{
|
||||
case GxsIdChooser::KnowId:
|
||||
case GxsIdChooser::UnKnowId: Settings->setValue("defaultIdentity",QString::fromStdString(voteId.toStdString()));
|
||||
break;
|
||||
default:
|
||||
case GxsIdChooser::NoId:
|
||||
case GxsIdChooser::None:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Settings->endGroup();
|
||||
@ -310,10 +333,10 @@ void PostedListWidget::submitVote(const RsGxsGrpMsgIdPair &msgId, bool up)
|
||||
std::cerr << "PostedListWidget::createPost() ERROR GETTING AuthorId!, Vote Failed";
|
||||
std::cerr << std::endl;
|
||||
|
||||
QMessageBox::warning(this, tr("RetroShare"),tr("Please create or choose a Signing Id before Voting"), QMessageBox::Ok, QMessageBox::Ok);
|
||||
QMessageBox::warning(this, tr("RetroShare"),tr("Please create or choose a default identity to use for voting"), QMessageBox::Ok, QMessageBox::Ok);
|
||||
|
||||
return;
|
||||
}//switch (ui.idChooser->getChosenId(authorId))
|
||||
}
|
||||
|
||||
RsGxsVote vote;
|
||||
|
||||
@ -322,11 +345,10 @@ void PostedListWidget::submitVote(const RsGxsGrpMsgIdPair &msgId, bool up)
|
||||
vote.mMeta.mParentId = msgId.second;
|
||||
vote.mMeta.mAuthorId = authorId;
|
||||
|
||||
if (up) {
|
||||
if (up)
|
||||
vote.mVoteType = GXS_VOTE_UP;
|
||||
} else { //if (up)
|
||||
else
|
||||
vote.mVoteType = GXS_VOTE_DOWN;
|
||||
}//if (up)
|
||||
|
||||
#ifdef DEBUG_POSTED_LIST_WIDGET
|
||||
std::cerr << "PostedListWidget::submitVote()";
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>616</width>
|
||||
<height>595</height>
|
||||
<width>950</width>
|
||||
<height>771</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -250,7 +250,11 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="GxsIdChooser" name="idChooser"/>
|
||||
<widget class="GxsIdChooser" name="idChooser">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Default identity used when voting</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@ -508,7 +512,7 @@
|
||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
</style></head><body style=" font-family:'Sans'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Description</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
@ -557,7 +561,7 @@ p, li { white-space: pre-wrap; }
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>614</width>
|
||||
<width>98</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -613,7 +617,7 @@ p, li { white-space: pre-wrap; }
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>614</width>
|
||||
<width>948</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -667,9 +671,9 @@ p, li { white-space: pre-wrap; }
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
<include location="../icons.qrc"/>
|
||||
<include location="Posted_images.qrc"/>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
Loading…
Reference in New Issue
Block a user