projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src: Yearly copyright bump
[quassel.git]
/
src
/
qtui
/
inputwidget.cpp
diff --git
a/src/qtui/inputwidget.cpp
b/src/qtui/inputwidget.cpp
index
8d84233
..
b0272b2
100644
(file)
--- a/
src/qtui/inputwidget.cpp
+++ b/
src/qtui/inputwidget.cpp
@@
-1,5
+1,5
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-201
8
by the Quassel Project *
+ * Copyright (C) 2005-201
9
by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-118,11
+118,6
@@
InputWidget::InputWidget(QWidget *parent)
UiSettings s("InputWidget");
UiSettings s("InputWidget");
-#ifdef HAVE_KDE4
- s.notify("EnableSpellCheck", this, SLOT(setEnableSpellCheck(QVariant)));
- setEnableSpellCheck(s.value("EnableSpellCheck", false));
-#endif
-
s.notify("EnableEmacsMode", this, SLOT(setEnableEmacsMode(QVariant)));
setEnableEmacsMode(s.value("EnableEmacsMode", false));
s.notify("EnableEmacsMode", this, SLOT(setEnableEmacsMode(QVariant)));
setEnableEmacsMode(s.value("EnableEmacsMode", false));
@@
-189,12
+184,6
@@
void InputWidget::setCustomFont(const QVariant &v)
}
}
-void InputWidget::setEnableSpellCheck(const QVariant &v)
-{
- ui.inputEdit->setSpellCheckEnabled(v.toBool());
-}
-
-
void InputWidget::setEnableEmacsMode(const QVariant &v)
{
ui.inputEdit->setEmacsMode(v.toBool());
void InputWidget::setEnableEmacsMode(const QVariant &v)
{
ui.inputEdit->setEmacsMode(v.toBool());
@@
-554,16
+543,16
@@
void InputWidget::changeNick(const QString &newNick) const
void InputWidget::onTextEntered(const QString &text)
{
Client::userInput(currentBufferInfo(), text);
void InputWidget::onTextEntered(const QString &text)
{
Client::userInput(currentBufferInfo(), text);
- ui.boldButton->setChecked(false);
- ui.underlineButton->setChecked(false);
- ui.italicButton->setChecked(false);
+ // Remove formatting from entered text
+ // TODO: Offer a way to convert pasted text to mIRC formatting codes
setFormatClear(true);
}
void InputWidget::setFormatClear(const bool global)
{
setFormatClear(true);
}
void InputWidget::setFormatClear(const bool global)
{
+ // Apply formatting
QTextCharFormat fmt;
fmt.setFontWeight(QFont::Normal);
fmt.setFontUnderline(false);
QTextCharFormat fmt;
fmt.setFontWeight(QFont::Normal);
fmt.setFontUnderline(false);
@@
-575,30
+564,44
@@
void InputWidget::setFormatClear(const bool global)
} else {
setFormatOnSelection(fmt);
}
} else {
setFormatOnSelection(fmt);
}
+
+ // Make sure UI state follows
+ ui.boldButton->setChecked(false);
+ ui.italicButton->setChecked(false);
+ ui.underlineButton->setChecked(false);
}
void InputWidget::setFormatBold(const bool bold)
{
}
void InputWidget::setFormatBold(const bool bold)
{
+ // Apply formatting
QTextCharFormat fmt;
fmt.setFontWeight(bold ? QFont::Bold : QFont::Normal);
mergeFormatOnSelection(fmt);
QTextCharFormat fmt;
fmt.setFontWeight(bold ? QFont::Bold : QFont::Normal);
mergeFormatOnSelection(fmt);
+ // Make sure UI state follows
+ ui.boldButton->setChecked(bold);
}
void InputWidget::setFormatItalic(const bool italic)
{
}
void InputWidget::setFormatItalic(const bool italic)
{
+ // Apply formatting
QTextCharFormat fmt;
fmt.setFontItalic(italic);
mergeFormatOnSelection(fmt);
QTextCharFormat fmt;
fmt.setFontItalic(italic);
mergeFormatOnSelection(fmt);
+ // Make sure UI state follows
+ ui.italicButton->setChecked(italic);
}
void InputWidget::setFormatUnderline(const bool underline)
{
}
void InputWidget::setFormatUnderline(const bool underline)
{
+ // Apply formatting
QTextCharFormat fmt;
fmt.setFontUnderline(underline);
mergeFormatOnSelection(fmt);
QTextCharFormat fmt;
fmt.setFontUnderline(underline);
mergeFormatOnSelection(fmt);
+ // Make sure UI state follows
+ ui.underlineButton->setChecked(underline);
}
}