added pastFromClipboard button and confirmation when closing with ESC in channel post creation

This commit is contained in:
csoler 2020-10-24 14:07:45 +02:00
parent 25c836d443
commit 8903abe98c
3 changed files with 43 additions and 1 deletions

View File

@ -67,6 +67,7 @@ CreateGxsChannelMsg::CreateGxsChannelMsg(const RsGxsGroupId &cId, RsGxsMessageId
connect(postButton, SIGNAL(clicked()), this, SLOT(sendMsg()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelMsg()));
connect(pasteFromClipboardButton, SIGNAL(clicked()), this, SLOT(pasteLink()));
connect(addFileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
connect(removeAllFilesButton, SIGNAL(clicked() ), this , SLOT(clearAllAttachments()));
@ -159,6 +160,13 @@ void CreateGxsChannelMsg::changeAspectRatio(int s)
break;
}
}
void CreateGxsChannelMsg::reject()
{
if(QMessageBox::warning(nullptr,tr("Close this window?"),tr("Do you really want to discard your post?"),QMessageBox::Ok,QMessageBox::Cancel) == QMessageBox::Cancel)
return;
QDialog::reject();
}
void CreateGxsChannelMsg::contextMenu(QPoint /*point*/)
{
QList<RetroShareLink> links ;

View File

@ -41,7 +41,9 @@ public:
/** Default Destructor */
~CreateGxsChannelMsg();
void addHtmlText(const QString& text) ;
void reject() override;
void addHtmlText(const QString& text) ;
void addSubject(const QString& text) ;
void addAttachment(const std::string &path);
void addAttachment(const RsFileHash &hash, const std::string &fname, uint64_t size, bool local, const RsPeerId &srcId,bool assume_file_ready = false);

View File

@ -296,6 +296,38 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pasteFromClipboardButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>34</width>
<height>34</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Paste retroshare link(s) from clipboard.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/png/copy.png</normaloff>:/icons/png/copy.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeAllFilesButton">
<property name="sizePolicy">