Add keyboard shorcuts to focus and unfocus chat (#3898)
* Added keyboard shorcuts to focus and unfocus chat * Fixed format * Changed the Esc behavior to work on any QLineEdit in the main Window and ignore shortcut conflicts * Fixed a conflict with shortcuts * Configurable unfocus shortcut and format fixes * minor style fix
This commit is contained in:
parent
7285f24a29
commit
63b4f9b2f0
25 changed files with 235 additions and 107 deletions
|
@ -22,4 +22,6 @@ AllowShortFunctionsOnASingleLine: None
|
|||
BinPackParameters: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
IndentCaseLabels: true
|
||||
PointerAlignment: Right
|
||||
PointerAlignment: Right
|
||||
SortIncludes: true
|
||||
IncludeBlocks: Regroup
|
||||
|
|
|
@ -86,7 +86,6 @@ SET(cockatrice_SOURCES
|
|||
src/deckstats_interface.cpp
|
||||
src/tappedout_interface.cpp
|
||||
src/chatview/chatview.cpp
|
||||
src/chatview/userlistProxy.h
|
||||
src/userlist.cpp
|
||||
src/userinfobox.cpp
|
||||
src/user_context_menu.cpp
|
||||
|
@ -123,6 +122,7 @@ SET(cockatrice_SOURCES
|
|||
src/carddbparser/cockatricexml3.cpp
|
||||
src/carddbparser/cockatricexml4.cpp
|
||||
src/filter_string.cpp
|
||||
src/customlineedit.cpp
|
||||
${VERSION_STRING_CPP}
|
||||
)
|
||||
|
||||
|
|
72
cockatrice/src/customlineedit.cpp
Normal file
72
cockatrice/src/customlineedit.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
|
||||
#include "customlineedit.h"
|
||||
|
||||
#include "settingscache.h"
|
||||
#include "shortcutssettings.h"
|
||||
|
||||
#include <QKeyEvent>
|
||||
#include <QLineEdit>
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
|
||||
LineEditUnfocusable::LineEditUnfocusable(QWidget *parent) : QLineEdit(parent)
|
||||
{
|
||||
installEventFilter(this);
|
||||
}
|
||||
|
||||
LineEditUnfocusable::LineEditUnfocusable(const QString &contents, QWidget *parent) : QLineEdit(contents, parent)
|
||||
{
|
||||
installEventFilter(this);
|
||||
}
|
||||
|
||||
bool LineEditUnfocusable::isUnfocusShortcut(QKeyEvent *event)
|
||||
{
|
||||
QString modifier;
|
||||
QString keyNoMod;
|
||||
|
||||
if (event->modifiers() & Qt::ShiftModifier)
|
||||
modifier += "Shift+";
|
||||
if (event->modifiers() & Qt::ControlModifier)
|
||||
modifier += "Ctrl+";
|
||||
if (event->modifiers() & Qt::AltModifier)
|
||||
modifier += "Alt+";
|
||||
if (event->modifiers() & Qt::MetaModifier)
|
||||
modifier += "Meta+";
|
||||
|
||||
keyNoMod = QKeySequence(event->key()).toString();
|
||||
|
||||
QKeySequence key(modifier + keyNoMod);
|
||||
QList<QKeySequence> unfocusShortcut = settingsCache->shortcuts().getShortcut("Textbox/unfocusTextBox");
|
||||
|
||||
for (QList<QKeySequence>::iterator i = unfocusShortcut.begin(); i != unfocusShortcut.end(); ++i) {
|
||||
if (key.matches(*i) == QKeySequence::ExactMatch)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void LineEditUnfocusable::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (isUnfocusShortcut(event)) {
|
||||
clearFocus();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
QLineEdit::keyPressEvent(event);
|
||||
}
|
||||
|
||||
bool LineEditUnfocusable::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::ShortcutOverride) {
|
||||
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
|
||||
|
||||
if (isUnfocusShortcut(keyEvent)) {
|
||||
event->accept();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return QLineEdit::eventFilter(watched, event);
|
||||
}
|
27
cockatrice/src/customlineedit.h
Normal file
27
cockatrice/src/customlineedit.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
|
||||
#ifndef CUSTOMLINEEDIT_H
|
||||
#define CUSTOMLINEEDIT_H
|
||||
|
||||
#include <QLineEdit>
|
||||
|
||||
class QKeyEvent;
|
||||
class QWidget;
|
||||
class QString;
|
||||
|
||||
// Should be used when the there is a risk of conflict between line editor
|
||||
// shortcuts and other shortcuts
|
||||
class LineEditUnfocusable : public QLineEdit
|
||||
{
|
||||
public:
|
||||
LineEditUnfocusable(QWidget *parent = nullptr);
|
||||
LineEditUnfocusable(const QString &contents, QWidget *parent = nullptr);
|
||||
|
||||
private:
|
||||
bool isUnfocusShortcut(QKeyEvent *key);
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,12 +1,12 @@
|
|||
#include "filterbuilder.h"
|
||||
|
||||
#include "cardfilter.h"
|
||||
#include "customlineedit.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QGridLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "cardfilter.h"
|
||||
|
||||
FilterBuilder::FilterBuilder(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
filterCombo = new QComboBox;
|
||||
|
@ -23,7 +23,7 @@ FilterBuilder::FilterBuilder(QWidget *parent) : QWidget(parent)
|
|||
ok->setObjectName("ok");
|
||||
ok->setMaximumSize(20, 20);
|
||||
|
||||
edit = new QLineEdit;
|
||||
edit = new LineEditUnfocusable;
|
||||
edit->setObjectName("edit");
|
||||
edit->setPlaceholderText(tr("Type your filter here"));
|
||||
edit->setClearButtonEnabled(true);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
class QLineEdit;
|
||||
class LineEditUnfocusable;
|
||||
class CardFilter;
|
||||
|
||||
class FilterBuilder : public QWidget
|
||||
|
@ -15,7 +15,7 @@ class FilterBuilder : public QWidget
|
|||
private:
|
||||
QComboBox *typeCombo;
|
||||
QComboBox *filterCombo;
|
||||
QLineEdit *edit;
|
||||
LineEditUnfocusable *edit;
|
||||
CardFilter *fltr;
|
||||
|
||||
void destroyFilter();
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
#include "lineeditcompleter.h"
|
||||
|
||||
#include <QAbstractItemView>
|
||||
#include <QCompleter>
|
||||
#include <QFocusEvent>
|
||||
#include <QKeyEvent>
|
||||
#include <QLineEdit>
|
||||
#include <QScrollBar>
|
||||
#include <QStringListModel>
|
||||
#include <QTextCursor>
|
||||
#include <QWidget>
|
||||
|
||||
LineEditCompleter::LineEditCompleter(QWidget *parent) : QLineEdit(parent), c(nullptr)
|
||||
LineEditCompleter::LineEditCompleter(QWidget *parent) : LineEditUnfocusable(parent), c(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
void LineEditCompleter::focusOutEvent(QFocusEvent *e)
|
||||
{
|
||||
QLineEdit::focusOutEvent(e);
|
||||
LineEditUnfocusable::focusOutEvent(e);
|
||||
if (c->popup()->isVisible()) {
|
||||
// Remove Popup
|
||||
c->popup()->hide();
|
||||
|
@ -73,7 +73,7 @@ void LineEditCompleter::keyPressEvent(QKeyEvent *event)
|
|||
break;
|
||||
}
|
||||
|
||||
QLineEdit::keyPressEvent(event);
|
||||
LineEditUnfocusable::keyPressEvent(event);
|
||||
// return if the completer is null or if the most recently typed char was '@'.
|
||||
// Only want the popup AFTER typing the first char of the mention.
|
||||
if (!c || text().right(1).contains("@")) {
|
||||
|
@ -130,4 +130,4 @@ void LineEditCompleter::setCompletionList(QStringList completionList)
|
|||
if (model == NULL)
|
||||
model = new QStringListModel();
|
||||
model->setStringList(completionList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#ifndef LINEEDITCOMPLETER_H
|
||||
#define LINEEDITCOMPLETER_H
|
||||
|
||||
#include "customlineedit.h"
|
||||
|
||||
#include <QFocusEvent>
|
||||
#include <QKeyEvent>
|
||||
#include <QLineEdit>
|
||||
#include <QStringList>
|
||||
|
||||
class LineEditCompleter : public QLineEdit
|
||||
class LineEditCompleter : public LineEditUnfocusable
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
|
@ -25,4 +26,4 @@ public:
|
|||
void setCompletionList(QStringList);
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -529,6 +529,12 @@ private:
|
|||
{"Player/aRotateViewCCW", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Rotate view counterclockwise"),
|
||||
parseSequenceString(""),
|
||||
ShortcutGroup::Drawing)},
|
||||
{"Textbox/unfocusTextBox", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Unfocus text box"),
|
||||
parseSequenceString("Esc"),
|
||||
ShortcutGroup::Chat_room)},
|
||||
{"tab_game/aFocusChat", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Focus Chat"),
|
||||
parseSequenceString("Shift+Return"),
|
||||
ShortcutGroup::Chat_room)},
|
||||
{"tab_room/aClearChat", ShortcutKey(QT_TRANSLATE_NOOP("shortcutsTab", "Clear chat"),
|
||||
parseSequenceString("F12"),
|
||||
ShortcutGroup::Chat_room)},
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "tab_deck_editor.h"
|
||||
|
||||
#include "abstractclient.h"
|
||||
#include "carddatabasemodel.h"
|
||||
#include "cardframe.h"
|
||||
|
@ -16,6 +17,7 @@
|
|||
#include "settingscache.h"
|
||||
#include "tab_supervisor.h"
|
||||
#include "tappedout_interface.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
|
@ -28,6 +30,7 @@
|
|||
#include <QHBoxLayout>
|
||||
#include <QHeaderView>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QMessageBox>
|
||||
|
@ -50,7 +53,7 @@ void SearchLineEdit::keyPressEvent(QKeyEvent *event)
|
|||
{
|
||||
if (treeView && ((event->key() == Qt::Key_Up) || (event->key() == Qt::Key_Down)))
|
||||
QCoreApplication::sendEvent(treeView, event);
|
||||
QLineEdit::keyPressEvent(event);
|
||||
LineEditUnfocusable::keyPressEvent(event);
|
||||
}
|
||||
|
||||
void TabDeckEditor::createDeckDock()
|
||||
|
@ -79,7 +82,7 @@ void TabDeckEditor::createDeckDock()
|
|||
|
||||
nameLabel = new QLabel();
|
||||
nameLabel->setObjectName("nameLabel");
|
||||
nameEdit = new QLineEdit;
|
||||
nameEdit = new LineEditUnfocusable;
|
||||
nameEdit->setObjectName("nameEdit");
|
||||
nameLabel->setBuddy(nameEdit);
|
||||
connect(nameEdit, SIGNAL(textChanged(const QString &)), this, SLOT(updateName(const QString &)));
|
||||
|
@ -121,7 +124,7 @@ void TabDeckEditor::createDeckDock()
|
|||
auto *hashSizePolicy = new QSizePolicy();
|
||||
hashSizePolicy->setHorizontalPolicy(QSizePolicy::Fixed);
|
||||
hashLabel1->setSizePolicy(*hashSizePolicy);
|
||||
hashLabel = new QLineEdit;
|
||||
hashLabel = new LineEditUnfocusable;
|
||||
hashLabel->setObjectName("hashLabel");
|
||||
hashLabel->setReadOnly(true);
|
||||
hashLabel->setFrame(false);
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#ifndef WINDOW_DECKEDITOR_H
|
||||
#define WINDOW_DECKEDITOR_H
|
||||
|
||||
#include "carddatabase.h"
|
||||
#include "customlineedit.h"
|
||||
#include "keysignals.h"
|
||||
#include "tab.h"
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QDir>
|
||||
#include <QLineEdit>
|
||||
|
||||
#include "carddatabase.h"
|
||||
|
||||
class CardDatabaseModel;
|
||||
class CardDatabaseDisplayModel;
|
||||
|
@ -27,7 +27,7 @@ class QVBoxLayout;
|
|||
class QPushButton;
|
||||
class QDockWidget;
|
||||
|
||||
class SearchLineEdit : public QLineEdit
|
||||
class SearchLineEdit : public LineEditUnfocusable
|
||||
{
|
||||
private:
|
||||
QTreeView *treeView;
|
||||
|
@ -36,7 +36,7 @@ protected:
|
|||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
public:
|
||||
SearchLineEdit() : QLineEdit(), treeView(nullptr)
|
||||
SearchLineEdit() : LineEditUnfocusable(), treeView(nullptr)
|
||||
{
|
||||
}
|
||||
void setTreeView(QTreeView *_treeView)
|
||||
|
@ -117,11 +117,11 @@ private:
|
|||
KeySignals searchKeySignals;
|
||||
|
||||
QLabel *nameLabel;
|
||||
QLineEdit *nameEdit;
|
||||
LineEditUnfocusable *nameEdit;
|
||||
QLabel *commentsLabel;
|
||||
QTextEdit *commentsEdit;
|
||||
QLabel *hashLabel1;
|
||||
QLineEdit *hashLabel;
|
||||
LineEditUnfocusable *hashLabel;
|
||||
FilterTreeModel *filterModel;
|
||||
QTreeView *filterView;
|
||||
KeySignals filterViewKeySignals;
|
||||
|
|
|
@ -1,17 +1,4 @@
|
|||
#include <QAction>
|
||||
#include <QCompleter>
|
||||
#include <QDebug>
|
||||
#include <QDockWidget>
|
||||
#include <QFileDialog>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QSplitter>
|
||||
#include <QStackedWidget>
|
||||
#include <QTimer>
|
||||
#include <QToolButton>
|
||||
#include <QWidget>
|
||||
#include "tab_game.h"
|
||||
|
||||
#include "abstractclient.h"
|
||||
#include "arrowitem.h"
|
||||
|
@ -24,22 +11,10 @@
|
|||
#include "dlg_load_remote_deck.h"
|
||||
#include "gamescene.h"
|
||||
#include "gameview.h"
|
||||
#include "get_pb_extension.h"
|
||||
#include "lineeditcompleter.h"
|
||||
#include "main.h"
|
||||
#include "messagelogwidget.h"
|
||||
#include "phasestoolbar.h"
|
||||
#include "pictureloader.h"
|
||||
#include "player.h"
|
||||
#include "playerlistwidget.h"
|
||||
#include "replay_timeline_widget.h"
|
||||
#include "settingscache.h"
|
||||
#include "tab_game.h"
|
||||
#include "tab_supervisor.h"
|
||||
#include "window_sets.h"
|
||||
#include "zoneviewwidget.h"
|
||||
#include "zoneviewzone.h"
|
||||
|
||||
#include "get_pb_extension.h"
|
||||
#include "pb/command_concede.pb.h"
|
||||
#include "pb/command_deck_select.pb.h"
|
||||
#include "pb/command_delete_arrow.pb.h"
|
||||
|
@ -70,6 +45,31 @@
|
|||
#include "pb/game_replay.pb.h"
|
||||
#include "pb/response_deck_download.pb.h"
|
||||
#include "pending_command.h"
|
||||
#include "phasestoolbar.h"
|
||||
#include "pictureloader.h"
|
||||
#include "player.h"
|
||||
#include "playerlistwidget.h"
|
||||
#include "replay_timeline_widget.h"
|
||||
#include "settingscache.h"
|
||||
#include "tab_supervisor.h"
|
||||
#include "window_sets.h"
|
||||
#include "zoneviewwidget.h"
|
||||
#include "zoneviewzone.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QCompleter>
|
||||
#include <QDebug>
|
||||
#include <QDockWidget>
|
||||
#include <QFileDialog>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QSplitter>
|
||||
#include <QStackedWidget>
|
||||
#include <QTimer>
|
||||
#include <QToolButton>
|
||||
#include <QWidget>
|
||||
#include <google/protobuf/descriptor.h>
|
||||
|
||||
ToggleButton::ToggleButton(QWidget *parent) : QPushButton(parent), state(false)
|
||||
|
@ -248,6 +248,9 @@ void TabGame::refreshShortcuts()
|
|||
if (aResetLayout) {
|
||||
aResetLayout->setShortcuts(settingsCache->shortcuts().getShortcut("Player/aResetLayout"));
|
||||
}
|
||||
if (aFocusChat) {
|
||||
aFocusChat->setShortcuts(settingsCache->shortcuts().getShortcut("tab_game/aFocusChat"));
|
||||
}
|
||||
}
|
||||
|
||||
void DeckViewContainer::loadLocalDeck()
|
||||
|
@ -531,6 +534,9 @@ void TabGame::retranslateUi()
|
|||
if (aCloseReplay) {
|
||||
aCloseReplay->setText(tr("C&lose replay"));
|
||||
}
|
||||
if (aFocusChat) {
|
||||
aFocusChat->setText(tr("&Focus Chat"));
|
||||
}
|
||||
if (sayLabel) {
|
||||
sayLabel->setText(tr("&Say:"));
|
||||
}
|
||||
|
@ -971,8 +977,6 @@ void TabGame::startGame(bool resuming)
|
|||
playerListWidget->setGameStarted(true, resuming);
|
||||
gameInfo.set_started(true);
|
||||
static_cast<GameScene *>(gameView->scene())->rearrange();
|
||||
if (sayEdit && players.size() > 1)
|
||||
sayEdit->setFocus();
|
||||
}
|
||||
|
||||
void TabGame::stopGame()
|
||||
|
@ -1413,6 +1417,8 @@ void TabGame::createMenuItems()
|
|||
connect(aConcede, SIGNAL(triggered()), this, SLOT(actConcede()));
|
||||
aLeaveGame = new QAction(this);
|
||||
connect(aLeaveGame, SIGNAL(triggered()), this, SLOT(actLeaveGame()));
|
||||
aFocusChat = new QAction(this);
|
||||
connect(aFocusChat, SIGNAL(triggered()), sayEdit, SLOT(setFocus()));
|
||||
aCloseReplay = nullptr;
|
||||
|
||||
phasesMenu = new TearOffMenu(this);
|
||||
|
@ -1440,6 +1446,7 @@ void TabGame::createMenuItems()
|
|||
gameMenu->addSeparator();
|
||||
gameMenu->addAction(aGameInfo);
|
||||
gameMenu->addAction(aConcede);
|
||||
gameMenu->addAction(aFocusChat);
|
||||
gameMenu->addAction(aLeaveGame);
|
||||
addTabMenu(gameMenu);
|
||||
}
|
||||
|
@ -1456,6 +1463,7 @@ void TabGame::createReplayMenuItems()
|
|||
aResetLayout = nullptr;
|
||||
aGameInfo = nullptr;
|
||||
aConcede = nullptr;
|
||||
aFocusChat = nullptr;
|
||||
aLeaveGame = nullptr;
|
||||
aCloseReplay = new QAction(this);
|
||||
connect(aCloseReplay, SIGNAL(triggered()), this, SLOT(actLeaveGame()));
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "pb/serverinfo_game.pb.h"
|
||||
#include "tab.h"
|
||||
#include "tearoffmenu.h"
|
||||
|
||||
#include <QCompleter>
|
||||
#include <QMap>
|
||||
#include <QPushButton>
|
||||
|
@ -19,7 +20,6 @@ class MessageLogWidget;
|
|||
class QTimer;
|
||||
class QSplitter;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QToolButton;
|
||||
class QMenu;
|
||||
|
@ -170,6 +170,7 @@ private:
|
|||
*aReverseTurn, *aRemoveLocalArrows, *aRotateViewCW, *aRotateViewCCW, *aResetLayout, *aResetReplayLayout;
|
||||
QAction *aCardInfoDockVisible, *aCardInfoDockFloating, *aMessageLayoutDockVisible, *aMessageLayoutDockFloating,
|
||||
*aPlayerListDockVisible, *aPlayerListDockFloating, *aReplayDockVisible, *aReplayDockFloating;
|
||||
QAction *aFocusChat;
|
||||
QList<QAction *> phaseActions;
|
||||
|
||||
Player *addPlayer(int playerId, const ServerInfo_User &info);
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
#include "tab_logs.h"
|
||||
|
||||
#include "abstractclient.h"
|
||||
#include "customlineedit.h"
|
||||
#include "pb/moderator_commands.pb.h"
|
||||
#include "pb/response_viewlog_history.pb.h"
|
||||
#include "pending_command.h"
|
||||
#include "window_sets.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QRadioButton>
|
||||
#include <QSpinBox>
|
||||
#include <QTabWidget>
|
||||
|
||||
#include <QtGui>
|
||||
#include <QtWidgets>
|
||||
|
||||
|
@ -147,19 +148,19 @@ void TabLog::createDock()
|
|||
{
|
||||
|
||||
labelFindUserName = new QLabel(tr("Username: "));
|
||||
findUsername = new QLineEdit("");
|
||||
findUsername = new LineEditUnfocusable("");
|
||||
findUsername->setAlignment(Qt::AlignCenter);
|
||||
labelFindIPAddress = new QLabel(tr("IP Address: "));
|
||||
findIPAddress = new QLineEdit("");
|
||||
findIPAddress = new LineEditUnfocusable("");
|
||||
findIPAddress->setAlignment(Qt::AlignCenter);
|
||||
labelFindGameName = new QLabel(tr("Game Name: "));
|
||||
findGameName = new QLineEdit("");
|
||||
findGameName = new LineEditUnfocusable("");
|
||||
findGameName->setAlignment(Qt::AlignCenter);
|
||||
labelFindGameID = new QLabel(tr("GameID: "));
|
||||
findGameID = new QLineEdit("");
|
||||
findGameID = new LineEditUnfocusable("");
|
||||
findGameID->setAlignment(Qt::AlignCenter);
|
||||
labelMessage = new QLabel(tr("Message: "));
|
||||
findMessage = new QLineEdit("");
|
||||
findMessage = new LineEditUnfocusable("");
|
||||
findMessage->setAlignment(Qt::AlignCenter);
|
||||
|
||||
mainRoom = new QCheckBox(tr("Main Room"));
|
||||
|
@ -340,4 +341,4 @@ void TabLog::restartLayout()
|
|||
searchDock->setFloating(false);
|
||||
addDockWidget(Qt::LeftDockWidgetArea, searchDock);
|
||||
searchDock->setVisible(true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,14 +2,15 @@
|
|||
#define TAB_LOG_H
|
||||
|
||||
#include "tab.h"
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class AbstractClient;
|
||||
class LineEditUnfocusable;
|
||||
|
||||
class QGroupBox;
|
||||
class QPushButton;
|
||||
class QSpinBox;
|
||||
class QLineEdit;
|
||||
class QCheckBox;
|
||||
class QRadioButton;
|
||||
class QLabel;
|
||||
|
@ -29,7 +30,7 @@ private:
|
|||
AbstractClient *client;
|
||||
QLabel *labelFindUserName, *labelFindIPAddress, *labelFindGameName, *labelFindGameID, *labelMessage, *labelMaximum,
|
||||
*labelDescription;
|
||||
QLineEdit *findUsername, *findIPAddress, *findGameName, *findGameID, *findMessage;
|
||||
LineEditUnfocusable *findUsername, *findIPAddress, *findGameName, *findGameID, *findMessage;
|
||||
QCheckBox *mainRoom, *gameRoom, *privateChat;
|
||||
QRadioButton *pastDays, *today, *lastHour;
|
||||
QSpinBox *maximumResults, *pastXDays;
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
#include "tab_message.h"
|
||||
|
||||
#include "abstractclient.h"
|
||||
#include "chatview/chatview.h"
|
||||
#include "customlineedit.h"
|
||||
#include "main.h"
|
||||
#include "settingscache.h"
|
||||
#include "soundengine.h"
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QLineEdit>
|
||||
#include <QMenu>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "pb/event_user_message.pb.h"
|
||||
#include "pb/serverinfo_user.pb.h"
|
||||
#include "pb/session_commands.pb.h"
|
||||
#include "pending_command.h"
|
||||
#include "settingscache.h"
|
||||
#include "soundengine.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QMenu>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
TabMessage::TabMessage(TabSupervisor *_tabSupervisor,
|
||||
AbstractClient *_client,
|
||||
|
@ -27,7 +28,7 @@ TabMessage::TabMessage(TabSupervisor *_tabSupervisor,
|
|||
connect(chatView, SIGNAL(showCardInfoPopup(QPoint, QString)), this, SLOT(showCardInfoPopup(QPoint, QString)));
|
||||
connect(chatView, SIGNAL(deleteCardInfoPopup(QString)), this, SLOT(deleteCardInfoPopup(QString)));
|
||||
connect(chatView, SIGNAL(addMentionTag(QString)), this, SLOT(addMentionTag(QString)));
|
||||
sayEdit = new QLineEdit;
|
||||
sayEdit = new LineEditUnfocusable;
|
||||
connect(sayEdit, SIGNAL(returnPressed()), this, SLOT(sendMessage()));
|
||||
|
||||
QVBoxLayout *vbox = new QVBoxLayout;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
class AbstractClient;
|
||||
class ChatView;
|
||||
class QLineEdit;
|
||||
class LineEditUnfocusable;
|
||||
class Event_UserMessage;
|
||||
class Response;
|
||||
class ServerInfo_User;
|
||||
|
@ -21,7 +21,7 @@ private:
|
|||
bool userOnline;
|
||||
|
||||
ChatView *chatView;
|
||||
QLineEdit *sayEdit;
|
||||
LineEditUnfocusable *sayEdit;
|
||||
|
||||
QAction *aLeave;
|
||||
signals:
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "tab_room.h"
|
||||
|
||||
#include "abstractclient.h"
|
||||
#include "chatview/chatview.h"
|
||||
#include "dlg_settings.h"
|
||||
|
@ -16,10 +17,10 @@
|
|||
#include "tab_supervisor.h"
|
||||
#include "tab_userlists.h"
|
||||
#include "userlist.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCompleter>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
|
@ -323,4 +324,4 @@ PendingCommand *TabRoom::prepareRoomCommand(const ::google::protobuf::Message &c
|
|||
void TabRoom::sendRoomCommand(PendingCommand *pend)
|
||||
{
|
||||
client->sendCommand(pend);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
#include "lineeditcompleter.h"
|
||||
#include "tab.h"
|
||||
|
||||
#include <QFocusEvent>
|
||||
#include <QGroupBox>
|
||||
#include <QKeyEvent>
|
||||
#include <QLineEdit>
|
||||
#include <QMap>
|
||||
|
||||
namespace google
|
||||
|
@ -20,7 +20,6 @@ class AbstractClient;
|
|||
class UserList;
|
||||
class QLabel;
|
||||
class ChatView;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QTextTable;
|
||||
class QCompleter;
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
#include "tab_server.h"
|
||||
|
||||
#include "abstractclient.h"
|
||||
#include "pb/event_list_rooms.pb.h"
|
||||
#include "pb/event_server_message.pb.h"
|
||||
#include "pb/response_join_room.pb.h"
|
||||
#include "pb/session_commands.pb.h"
|
||||
#include "pending_command.h"
|
||||
#include "tab_supervisor.h"
|
||||
#include "userlist.h"
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QDebug>
|
||||
#include <QHBoxLayout>
|
||||
#include <QHeaderView>
|
||||
#include <QInputDialog>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QTextEdit>
|
||||
#include <QTreeView>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "pb/event_list_rooms.pb.h"
|
||||
#include "pb/event_server_message.pb.h"
|
||||
#include "pb/response_join_room.pb.h"
|
||||
#include "pb/session_commands.pb.h"
|
||||
#include "pending_command.h"
|
||||
|
||||
RoomSelector::RoomSelector(AbstractClient *_client, QWidget *parent) : QGroupBox(parent), client(_client)
|
||||
{
|
||||
roomList = new QTreeWidget;
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
#include "tab_userlists.h"
|
||||
#include "abstractclient.h"
|
||||
#include "soundengine.h"
|
||||
#include "userinfobox.h"
|
||||
#include "userlist.h"
|
||||
#include <QHBoxLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "abstractclient.h"
|
||||
#include "customlineedit.h"
|
||||
#include "pb/event_add_to_list.pb.h"
|
||||
#include "pb/event_remove_from_list.pb.h"
|
||||
#include "pb/event_user_joined.pb.h"
|
||||
|
@ -15,6 +9,13 @@
|
|||
#include "pb/response_list_users.pb.h"
|
||||
#include "pb/session_commands.pb.h"
|
||||
#include "pending_command.h"
|
||||
#include "soundengine.h"
|
||||
#include "userinfobox.h"
|
||||
#include "userlist.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
TabUserLists::TabUserLists(TabSupervisor *_tabSupervisor,
|
||||
AbstractClient *_client,
|
||||
|
@ -58,7 +59,7 @@ TabUserLists::TabUserLists(TabSupervisor *_tabSupervisor,
|
|||
vbox->addWidget(allUsersList);
|
||||
|
||||
QHBoxLayout *addToBuddyList = new QHBoxLayout;
|
||||
addBuddyEdit = new QLineEdit;
|
||||
addBuddyEdit = new LineEditUnfocusable;
|
||||
addBuddyEdit->setPlaceholderText(tr("Add to Buddy List"));
|
||||
connect(addBuddyEdit, SIGNAL(returnPressed()), this, SLOT(addToBuddyList()));
|
||||
QPushButton *addBuddyButton = new QPushButton("Add");
|
||||
|
@ -67,7 +68,7 @@ TabUserLists::TabUserLists(TabSupervisor *_tabSupervisor,
|
|||
addToBuddyList->addWidget(addBuddyButton);
|
||||
|
||||
QHBoxLayout *addToIgnoreList = new QHBoxLayout;
|
||||
addIgnoreEdit = new QLineEdit;
|
||||
addIgnoreEdit = new LineEditUnfocusable;
|
||||
addIgnoreEdit->setPlaceholderText(tr("Add to Ignore List"));
|
||||
connect(addIgnoreEdit, SIGNAL(returnPressed()), this, SLOT(addToIgnoreList()));
|
||||
QPushButton *addIgnoreButton = new QPushButton("Add");
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
#include "pb/serverinfo_user.pb.h"
|
||||
#include "tab.h"
|
||||
#include <QLineEdit>
|
||||
|
||||
class AbstractClient;
|
||||
class UserList;
|
||||
class UserInfoBox;
|
||||
class LineEditUnfocusable;
|
||||
|
||||
class Event_ListRooms;
|
||||
class Event_UserJoined;
|
||||
|
@ -41,8 +41,8 @@ private:
|
|||
UserList *buddyList;
|
||||
UserList *ignoreList;
|
||||
UserInfoBox *userInfoBox;
|
||||
QLineEdit *addBuddyEdit;
|
||||
QLineEdit *addIgnoreEdit;
|
||||
LineEditUnfocusable *addBuddyEdit;
|
||||
LineEditUnfocusable *addIgnoreEdit;
|
||||
void addToList(const std::string &listName, const QString &userName);
|
||||
|
||||
public:
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "userlist.h"
|
||||
|
||||
#include "abstractclient.h"
|
||||
#include "gameselector.h"
|
||||
#include "pb/moderator_commands.pb.h"
|
||||
|
@ -10,12 +11,14 @@
|
|||
#include "tab_supervisor.h"
|
||||
#include "tab_userlists.h"
|
||||
#include "user_context_menu.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCheckBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QHeaderView>
|
||||
#include <QInputDialog>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QMouseEvent>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#include "window_sets.h"
|
||||
|
||||
#include "customlineedit.h"
|
||||
#include "main.h"
|
||||
#include "pictureloader.h"
|
||||
#include "setsmodel.h"
|
||||
|
@ -16,7 +18,6 @@
|
|||
#include <QPushButton>
|
||||
#include <QToolBar>
|
||||
#include <QTreeView>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#define SORT_RESET -1
|
||||
|
@ -60,10 +61,10 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent)
|
|||
setsEditToolBar->addAction(aBottom);
|
||||
|
||||
// search field
|
||||
searchField = new QLineEdit;
|
||||
searchField = new LineEditUnfocusable;
|
||||
searchField->setObjectName("searchEdit");
|
||||
searchField->setPlaceholderText(tr("Search by set name, code, or type"));
|
||||
searchField->addAction(QPixmap("theme:icons/search"), QLineEdit::LeadingPosition);
|
||||
searchField->addAction(QPixmap("theme:icons/search"), LineEditUnfocusable::LeadingPosition);
|
||||
searchField->setClearButtonEnabled(true);
|
||||
setFocusProxy(searchField);
|
||||
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
#include <QDialogButtonBox>
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QMainWindow>
|
||||
#include <QSet>
|
||||
|
||||
class CardDatabase;
|
||||
class LineEditUnfocusable;
|
||||
class QGroupBox;
|
||||
class QItemSelection;
|
||||
class QPushButton;
|
||||
|
@ -35,7 +35,7 @@ private:
|
|||
QGroupBox *sortWarning;
|
||||
QLabel *sortWarningText;
|
||||
QPushButton *sortWarningButton;
|
||||
QLineEdit *searchField;
|
||||
LineEditUnfocusable *searchField;
|
||||
QGridLayout *mainLayout;
|
||||
QHBoxLayout *filterBox;
|
||||
int sortIndex;
|
||||
|
|
Loading…
Reference in a new issue