Skip to content
Permalink
Browse files

Merge PR #2534: Send clipboard content to chat

  • Loading branch information...
mkrautz committed Aug 26, 2016
2 parents 2866033 + 79f67f6 commit c05d4de5303ccda8a3c8f29b28267728d5540609
Showing with 16 additions and 1 deletion.
  1. +14 −0 src/mumble/MainWindow.cpp
  2. +2 −1 src/mumble/MainWindow.h
@@ -231,6 +231,10 @@ void MainWindow::createActions() {
gsSendTextMessage=new GlobalShortcut(this, idx++, tr("Send Text Message", "Global Shortcut"), true, QVariant(QString()));
gsSendTextMessage->setObjectName(QLatin1String("gsSendTextMessage"));

gsSendClipboardTextMessage=new GlobalShortcut(this, idx++, tr("Send Clipboard Text Message", "Global Shortcut"));
gsSendClipboardTextMessage->setObjectName(QLatin1String("gsSendClipboardTextMessage"));
gsSendClipboardTextMessage->qsWhatsThis = tr("This will send your Clipboard content to the channel you are currently in.", "Global Shortcut");

#ifndef Q_OS_MAC
qstiIcon->show();
#endif
@@ -2694,6 +2698,16 @@ void MainWindow::on_gsSendTextMessage_triggered(bool down, QVariant scdata) {
g.l->log(Log::TextMessage, tr("To %1: %2").arg(Log::formatChannel(c), qsText), tr("Message to channel %1").arg(c->qsName), true);
}

void MainWindow::on_gsSendClipboardTextMessage_triggered(bool down, QVariant) {
if (!down) {
return;
}

// call sendChatbarMessage() instead of on_gsSendTextMessage_triggered() to handle
// formatting of the content in the clipboard, i.e., href.
sendChatbarMessage(QApplication::clipboard()->text());
}

void MainWindow::whisperReleased(QVariant scdata) {
if (g.iPushToTalk <= 0)
return;
@@ -77,7 +77,7 @@ class MainWindow : public QMainWindow, public MessageHandler, public Ui::MainWin
GlobalShortcut *gsUnlink, *gsPushMute, *gsJoinChannel, *gsToggleOverlay;
GlobalShortcut *gsMinimal, *gsVolumeUp, *gsVolumeDown, *gsWhisper, *gsLinkChannel;
GlobalShortcut *gsCycleTransmitMode;
GlobalShortcut *gsSendTextMessage;
GlobalShortcut *gsSendTextMessage, *gsSendClipboardTextMessage;
DockTitleBar *dtbLogDockTitle, *dtbChatDockTitle;

ACLEditor *aclEdit;
@@ -256,6 +256,7 @@ class MainWindow : public QMainWindow, public MessageHandler, public Ui::MainWin
void removeTarget(ShortcutTarget *);
void on_gsCycleTransmitMode_triggered(bool, QVariant);
void on_gsSendTextMessage_triggered(bool, QVariant);
void on_gsSendClipboardTextMessage_triggered(bool, QVariant);
void on_Reconnect_timeout();
void on_Icon_messageClicked();
void on_Icon_activated(QSystemTrayIcon::ActivationReason);

0 comments on commit c05d4de

Please sign in to comment.
You can’t perform that action at this time.