mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
ChatBar: Always use the current channel by default
This commit is contained in:
parent
d7f03aba62
commit
441d06f6d1
@ -105,7 +105,7 @@ void ChatbarTextEdit::inFocus(bool focus) {
|
||||
void ChatbarTextEdit::contextMenuEvent(QContextMenuEvent *qcme) {
|
||||
QMenu *menu = createStandardContextMenu();
|
||||
|
||||
QAction *action = new QAction(tr("Paste and send") + QLatin1Char('\t'), menu);
|
||||
QAction *action = new QAction(tr("Paste and &Send") + QLatin1Char('\t'), menu);
|
||||
action->setEnabled(!QApplication::clipboard()->text().isEmpty());
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(pasteAndSend_triggered()));
|
||||
if (menu->actions().count() > 6)
|
||||
|
||||
@ -133,6 +133,7 @@ void LookConfig::load(const Settings &r) {
|
||||
loadCheckBox(qcbShowUserCount, r.bShowUserCount);
|
||||
loadCheckBox(qcbShowContextMenuInMenuBar, r.bShowContextMenuInMenuBar);
|
||||
loadCheckBox(qcbHighContrast, r.bHighContrast);
|
||||
loadCheckBox(qcbChatBarUseSelection, r.bChatBarUseSelection);
|
||||
}
|
||||
|
||||
void LookConfig::save() const {
|
||||
@ -172,6 +173,7 @@ void LookConfig::save() const {
|
||||
s.bShowUserCount = qcbShowUserCount->isChecked();
|
||||
s.bShowContextMenuInMenuBar = qcbShowContextMenuInMenuBar->isChecked();
|
||||
s.bHighContrast = qcbHighContrast->isChecked();
|
||||
s.bChatBarUseSelection = qcbChatBarUseSelection->isChecked();
|
||||
}
|
||||
|
||||
void LookConfig::accept() const {
|
||||
|
||||
@ -244,6 +244,67 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QGroupBox" name="qgbTray">
|
||||
<property name="title">
|
||||
<string>Tray Icon</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="qcbHideTray">
|
||||
<property name="toolTip">
|
||||
<string>Hide the main Mumble window in the tray when it is minimized.</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><b>If set, minimizing the Mumble main window will cause it to be hidden and accessible only from the tray. Otherwise, it will be minimized as a window normally would.</b></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hide in tray when minimized</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="qcbStateInTray">
|
||||
<property name="toolTip">
|
||||
<string>Displays talking status in system tray</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show talking status in tray icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QGroupBox" name="qgbApplication">
|
||||
<property name="title">
|
||||
@ -313,47 +374,12 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QGroupBox" name="qgbTray">
|
||||
<property name="title">
|
||||
<string>Tray Icon</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="qcbHideTray">
|
||||
<property name="toolTip">
|
||||
<string>Hide the main Mumble window in the tray when it is minimized.</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><b>If set, minimizing the Mumble main window will cause it to be hidden and accessible only from the tray. Otherwise, it will be minimized as a window normally would.</b></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hide in tray when minimized</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="qcbStateInTray">
|
||||
<property name="toolTip">
|
||||
<string>Displays talking status in system tray</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show talking status in tray icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QGroupBox" name="qgbChannel">
|
||||
<property name="title">
|
||||
<string>Channel Tree</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,1">
|
||||
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="qliChannelDrag">
|
||||
<property name="text">
|
||||
@ -411,35 +437,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="qcbChatBarUseSelection">
|
||||
<property name="text">
|
||||
<string>Use selected item as the chat bar target</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
||||
@ -1504,9 +1504,9 @@ void MainWindow::sendChatbarMessage(QString qsText) {
|
||||
qsText = Qt::escape(qsText);
|
||||
qsText = TextMessage::autoFormat(qsText);
|
||||
|
||||
if (p == NULL || p->uiSession == g.uiSession) {
|
||||
if (!g.s.bChatBarUseSelection || p == NULL || p->uiSession == g.uiSession) {
|
||||
// Channel message
|
||||
if (c == NULL) // If no channel selected fallback to current one
|
||||
if (!g.s.bChatBarUseSelection || c == NULL) // If no channel selected fallback to current one
|
||||
c = ClientUser::get(g.uiSession)->cChannel;
|
||||
|
||||
g.sh->sendChannelTextMessage(c->iId, qsText, false);
|
||||
@ -2569,14 +2569,18 @@ void MainWindow::on_Icon_activated(QSystemTrayIcon::ActivationReason reason) {
|
||||
}
|
||||
|
||||
void MainWindow::qtvUserCurrentChanged(const QModelIndex &, const QModelIndex &) {
|
||||
updateChatBar();
|
||||
}
|
||||
|
||||
void MainWindow::updateChatBar() {
|
||||
User *p = pmModel->getUser(qtvUsers->currentIndex());
|
||||
Channel *c = pmModel->getChannel(qtvUsers->currentIndex());
|
||||
|
||||
if (g.uiSession == 0) {
|
||||
qteChat->setDefaultText(tr("<center>Not connected</center>"), true);
|
||||
} else if (p == NULL || p->uiSession == g.uiSession) {
|
||||
} else if (!g.s.bChatBarUseSelection || p == NULL || p->uiSession == g.uiSession) {
|
||||
// Channel tree target
|
||||
if (c == NULL) // If no channel selected fallback to current one
|
||||
if (!g.s.bChatBarUseSelection || c == NULL) // If no channel selected fallback to current one
|
||||
c = ClientUser::get(g.uiSession)->cChannel;
|
||||
|
||||
qteChat->setDefaultText(tr("<center>Type message to channel '%1' here</center>").arg(c->qsName));
|
||||
|
||||
@ -116,6 +116,7 @@ class MainWindow : public QMainWindow, public MessageHandler, public Ui::MainWin
|
||||
QPair<QByteArray, QImage> openImageFile();
|
||||
static const QString defaultStyleSheet;
|
||||
|
||||
void updateChatBar();
|
||||
void openTextMessageDialog(ClientUser *p);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
@ -433,6 +433,10 @@ void MainWindow::msgUserState(const MumbleProto::UserState &msg) {
|
||||
|
||||
pmModel->moveUser(pDst, c);
|
||||
|
||||
if (pDst == pSelf) {
|
||||
g.mw->updateChatBar();
|
||||
}
|
||||
|
||||
if (log && (pDst != pSelf) && (pDst->cChannel == pSelf->cChannel)) {
|
||||
if (pDst == pSrc)
|
||||
g.l->log(Log::ChannelJoin, tr("%1 entered channel.").arg(Log::formatClientUser(pDst, Log::Target)));
|
||||
|
||||
@ -309,6 +309,7 @@ Settings::Settings() {
|
||||
bStateInTray = true;
|
||||
bUsage = true;
|
||||
bShowUserCount = false;
|
||||
bChatBarUseSelection = false;
|
||||
wlWindowLayout = LayoutClassic;
|
||||
bShowContextMenuInMenuBar = false;
|
||||
|
||||
@ -638,6 +639,7 @@ void Settings::load(QSettings* settings_ptr) {
|
||||
SAVELOAD(bStateInTray, "ui/stateintray");
|
||||
SAVELOAD(bUsage, "ui/usage");
|
||||
SAVELOAD(bShowUserCount, "ui/showusercount");
|
||||
SAVELOAD(bChatBarUseSelection, "ui/chatbaruseselection");
|
||||
SAVELOAD(qsImagePath, "ui/imagepath");
|
||||
SAVELOAD(bShowContextMenuInMenuBar, "ui/showcontextmenuinmenubar");
|
||||
SAVELOAD(qbaConnectDialogGeometry, "ui/connect/geometry");
|
||||
@ -911,6 +913,7 @@ void Settings::save() {
|
||||
SAVELOAD(bStateInTray, "ui/stateintray");
|
||||
SAVELOAD(bUsage, "ui/usage");
|
||||
SAVELOAD(bShowUserCount, "ui/showusercount");
|
||||
SAVELOAD(bChatBarUseSelection, "ui/chatbaruseselection");
|
||||
SAVELOAD(qsImagePath, "ui/imagepath");
|
||||
SAVELOAD(bShowContextMenuInMenuBar, "ui/showcontextmenuinmenubar");
|
||||
SAVELOAD(qbaConnectDialogGeometry, "ui/connect/geometry");
|
||||
|
||||
@ -248,6 +248,7 @@ struct Settings {
|
||||
bool bStateInTray;
|
||||
bool bUsage;
|
||||
bool bShowUserCount;
|
||||
bool bChatBarUseSelection;
|
||||
QByteArray qbaConnectDialogHeader, qbaConnectDialogGeometry;
|
||||
bool bShowContextMenuInMenuBar;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user