Merge pull request #554 from poixen/chatsettingstab
Updated chat setting tab
This commit is contained in:
commit
8e396cadc2
2 changed files with 40 additions and 29 deletions
|
@ -506,10 +506,6 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
||||||
tapAnimationCheckBox->setChecked(settingsCache->getTapAnimation());
|
tapAnimationCheckBox->setChecked(settingsCache->getTapAnimation());
|
||||||
connect(tapAnimationCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setTapAnimation(int)));
|
connect(tapAnimationCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setTapAnimation(int)));
|
||||||
|
|
||||||
chatMentionCheckBox = new QCheckBox;
|
|
||||||
chatMentionCheckBox->setChecked(settingsCache->getChatMention());
|
|
||||||
connect(chatMentionCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setChatMention(int)));
|
|
||||||
|
|
||||||
soundEnabledCheckBox = new QCheckBox;
|
soundEnabledCheckBox = new QCheckBox;
|
||||||
soundEnabledCheckBox->setChecked(settingsCache->getSoundEnabled());
|
soundEnabledCheckBox->setChecked(settingsCache->getSoundEnabled());
|
||||||
connect(soundEnabledCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setSoundEnabled(int)));
|
connect(soundEnabledCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setSoundEnabled(int)));
|
||||||
|
@ -541,16 +537,11 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
||||||
animationGroupBox = new QGroupBox;
|
animationGroupBox = new QGroupBox;
|
||||||
animationGroupBox->setLayout(animationGrid);
|
animationGroupBox->setLayout(animationGrid);
|
||||||
|
|
||||||
QGridLayout *chatGrid = new QGridLayout;
|
|
||||||
chatGrid->addWidget(chatMentionCheckBox, 0, 0);
|
|
||||||
|
|
||||||
chatGroupBox = new QGroupBox;
|
|
||||||
chatGroupBox->setLayout(chatGrid);
|
|
||||||
|
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||||
mainLayout->addWidget(generalGroupBox);
|
mainLayout->addWidget(generalGroupBox);
|
||||||
mainLayout->addWidget(animationGroupBox);
|
mainLayout->addWidget(animationGroupBox);
|
||||||
mainLayout->addWidget(chatGroupBox);
|
|
||||||
mainLayout->addWidget(soundGroupBox);
|
mainLayout->addWidget(soundGroupBox);
|
||||||
|
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
@ -563,9 +554,7 @@ void UserInterfaceSettingsPage::retranslateUi()
|
||||||
doubleClickToPlayCheckBox->setText(tr("&Double-click cards to play them (instead of single-click)"));
|
doubleClickToPlayCheckBox->setText(tr("&Double-click cards to play them (instead of single-click)"));
|
||||||
playToStackCheckBox->setText(tr("&Play all nonlands onto the stack (not the battlefield) by default"));
|
playToStackCheckBox->setText(tr("&Play all nonlands onto the stack (not the battlefield) by default"));
|
||||||
animationGroupBox->setTitle(tr("Animation settings"));
|
animationGroupBox->setTitle(tr("Animation settings"));
|
||||||
chatGroupBox->setTitle(tr("Chat settings"));
|
|
||||||
tapAnimationCheckBox->setText(tr("&Tap/untap animation"));
|
tapAnimationCheckBox->setText(tr("&Tap/untap animation"));
|
||||||
chatMentionCheckBox->setText(tr("Enable chat mentions ('@yourusername' in chat log will be highlighted)"));
|
|
||||||
soundEnabledCheckBox->setText(tr("Enable &sounds"));
|
soundEnabledCheckBox->setText(tr("Enable &sounds"));
|
||||||
soundPathLabel->setText(tr("Path to sounds directory:"));
|
soundPathLabel->setText(tr("Path to sounds directory:"));
|
||||||
soundTestButton->setText(tr("Test system sound engine"));
|
soundTestButton->setText(tr("Test system sound engine"));
|
||||||
|
@ -625,26 +614,43 @@ void DeckEditorSettingsPage::radioPriceTagSourceClicked(bool checked)
|
||||||
|
|
||||||
MessagesSettingsPage::MessagesSettingsPage()
|
MessagesSettingsPage::MessagesSettingsPage()
|
||||||
{
|
{
|
||||||
aAdd = new QAction(this);
|
|
||||||
connect(aAdd, SIGNAL(triggered()), this, SLOT(actAdd()));
|
|
||||||
aRemove = new QAction(this);
|
|
||||||
connect(aRemove, SIGNAL(triggered()), this, SLOT(actRemove()));
|
|
||||||
|
|
||||||
messageList = new QListWidget;
|
chatMentionCheckBox = new QCheckBox;
|
||||||
QToolBar *messageToolBar = new QToolBar;
|
chatMentionCheckBox->setChecked(settingsCache->getChatMention());
|
||||||
messageToolBar->setOrientation(Qt::Vertical);
|
connect(chatMentionCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setChatMention(int)));
|
||||||
messageToolBar->addAction(aAdd);
|
QGridLayout *chatGrid = new QGridLayout;
|
||||||
messageToolBar->addAction(aRemove);
|
chatGrid->addWidget(chatMentionCheckBox, 0, 0);
|
||||||
|
chatGroupBox = new QGroupBox;
|
||||||
|
chatGroupBox->setLayout(chatGrid);
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
messageList = new QListWidget;
|
||||||
settings.beginGroup("messages");
|
settings.beginGroup("messages");
|
||||||
int count = settings.value("count", 0).toInt();
|
int count = settings.value("count", 0).toInt();
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
messageList->addItem(settings.value(QString("msg%1").arg(i)).toString());
|
messageList->addItem(settings.value(QString("msg%1").arg(i)).toString());
|
||||||
|
|
||||||
QHBoxLayout *mainLayout = new QHBoxLayout;
|
aAdd = new QAction(this);
|
||||||
mainLayout->addWidget(messageList);
|
connect(aAdd, SIGNAL(triggered()), this, SLOT(actAdd()));
|
||||||
mainLayout->addWidget(messageToolBar);
|
aRemove = new QAction(this);
|
||||||
|
connect(aRemove, SIGNAL(triggered()), this, SLOT(actRemove()));
|
||||||
|
|
||||||
|
QToolBar *messageToolBar = new QToolBar;
|
||||||
|
messageToolBar->setOrientation(Qt::Vertical);
|
||||||
|
messageToolBar->addAction(aAdd);
|
||||||
|
messageToolBar->addAction(aRemove);
|
||||||
|
|
||||||
|
QHBoxLayout *messageListLayout = new QHBoxLayout;
|
||||||
|
messageListLayout->addWidget(messageList);
|
||||||
|
messageListLayout->addWidget(messageToolBar);
|
||||||
|
|
||||||
|
messageShortcuts = new QGroupBox;
|
||||||
|
messageShortcuts->setLayout(messageListLayout);
|
||||||
|
|
||||||
|
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||||
|
|
||||||
|
mainLayout->addWidget(messageShortcuts);
|
||||||
|
mainLayout->addWidget(chatGroupBox);
|
||||||
|
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
|
@ -682,6 +688,9 @@ void MessagesSettingsPage::retranslateUi()
|
||||||
{
|
{
|
||||||
aAdd->setText(tr("&Add"));
|
aAdd->setText(tr("&Add"));
|
||||||
aRemove->setText(tr("&Remove"));
|
aRemove->setText(tr("&Remove"));
|
||||||
|
chatGroupBox->setTitle(tr("Chat settings"));
|
||||||
|
chatMentionCheckBox->setText(tr("Enable chat mentions ('@yourusername' in chat log will be highlighted)"));
|
||||||
|
messageShortcuts->setTitle(tr("In-game message macros"));
|
||||||
}
|
}
|
||||||
|
|
||||||
DlgSettings::DlgSettings(QWidget *parent)
|
DlgSettings::DlgSettings(QWidget *parent)
|
||||||
|
@ -852,7 +861,7 @@ void DlgSettings::retranslateUi()
|
||||||
appearanceButton->setText(tr("Appearance"));
|
appearanceButton->setText(tr("Appearance"));
|
||||||
userInterfaceButton->setText(tr("User interface"));
|
userInterfaceButton->setText(tr("User interface"));
|
||||||
deckEditorButton->setText(tr("Deck editor"));
|
deckEditorButton->setText(tr("Deck editor"));
|
||||||
messagesButton->setText(tr("Messages"));
|
messagesButton->setText(tr("Chat Settings"));
|
||||||
|
|
||||||
for (int i = 0; i < pagesWidget->count(); i++)
|
for (int i = 0; i < pagesWidget->count(); i++)
|
||||||
dynamic_cast<AbstractSettingsPage *>(pagesWidget->widget(i))->retranslateUi();
|
dynamic_cast<AbstractSettingsPage *>(pagesWidget->widget(i))->retranslateUi();
|
||||||
|
|
|
@ -91,11 +91,10 @@ private:
|
||||||
QCheckBox *doubleClickToPlayCheckBox;
|
QCheckBox *doubleClickToPlayCheckBox;
|
||||||
QCheckBox *playToStackCheckBox;
|
QCheckBox *playToStackCheckBox;
|
||||||
QCheckBox *tapAnimationCheckBox;
|
QCheckBox *tapAnimationCheckBox;
|
||||||
QCheckBox *chatMentionCheckBox;
|
|
||||||
QCheckBox *soundEnabledCheckBox;
|
QCheckBox *soundEnabledCheckBox;
|
||||||
QLabel *soundPathLabel;
|
QLabel *soundPathLabel;
|
||||||
QLineEdit *soundPathEdit;
|
QLineEdit *soundPathEdit;
|
||||||
QGroupBox *generalGroupBox, *animationGroupBox, *soundGroupBox, *chatGroupBox;
|
QGroupBox *generalGroupBox, *animationGroupBox, *soundGroupBox;
|
||||||
QPushButton *soundTestButton;
|
QPushButton *soundTestButton;
|
||||||
public:
|
public:
|
||||||
UserInterfaceSettingsPage();
|
UserInterfaceSettingsPage();
|
||||||
|
@ -128,6 +127,9 @@ private slots:
|
||||||
private:
|
private:
|
||||||
QListWidget *messageList;
|
QListWidget *messageList;
|
||||||
QAction *aAdd, *aRemove;
|
QAction *aAdd, *aRemove;
|
||||||
|
QCheckBox *chatMentionCheckBox;
|
||||||
|
QGroupBox *chatGroupBox;
|
||||||
|
QGroupBox *messageShortcuts;
|
||||||
|
|
||||||
void storeSettings();
|
void storeSettings();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue