Enable original file attachments in the desktop PM composer
This commit is contained in:
1 parent
4cabbc32f5
commit
570f3dfab3
2 files changed
+21
-1
No files matched your search
@@ -273,10 +273,17 @@ void InputBar::onSendClicked() {
|
||||
}
|
||||
|
||||
void InputBar::setRecordingContext(const QString& mediaDirBase, const QString& channelId) {
|
||||
if (m_channelIdForRecord != channelId) clearPendingAttachment();
|
||||
m_mediaDirBase = mediaDirBase;
|
||||
m_channelIdForRecord = channelId;
|
||||
}
|
||||
|
||||
void InputBar::setDmMode(bool enabled) {
|
||||
m_dmMode = enabled;
|
||||
m_pttBtn->setEnabled(!enabled);
|
||||
m_attachBtn->setEnabled(true);
|
||||
}
|
||||
|
||||
void InputBar::setMediaEnabled(bool enabled) {
|
||||
if (m_pttBtn) m_pttBtn->setEnabled(enabled);
|
||||
if (m_attachBtn) m_attachBtn->setEnabled(enabled);
|
||||
@@ -353,6 +360,17 @@ void InputBar::onAttachClicked() {
|
||||
if (srcPath.isEmpty()) return;
|
||||
|
||||
QFileInfo fi(srcPath);
|
||||
if (m_dmMode) {
|
||||
m_pendingAttachSrc = srcPath;
|
||||
m_pendingAttachDest = srcPath;
|
||||
m_pendingAttachName = fi.fileName();
|
||||
m_pendingAttachSize = fi.size();
|
||||
m_pendingAttachAsVideo = m_pendingAttachAsImage = false;
|
||||
m_attachPreviewLabel->setText(QString::fromUtf8("📎 %1 (%2)").arg(fi.fileName(), formatFileSize(fi.size())));
|
||||
m_attachPreview->show();
|
||||
GUI_INFO("InputBar: PM attachment selected name=%s bytes=%lld", qPrintable(fi.fileName()), (long long)fi.size());
|
||||
return;
|
||||
}
|
||||
if (fi.size() == 0) { DEBUG_WARN(DEBUG_CATEGORY_DEBUG, "InputBar::onAttachClicked: empty file"); return; }
|
||||
|
||||
QString mediaPath = m_mediaDirBase + "/" + m_channelIdForRecord;
|
||||
|
||||
Reference in new issue
Block a user