The standard font is now used for new chat lobbies.

Added a new menu item to set the font of a private chat and chat lobby to the default font.
Fixed german language.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4926 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-02-11 21:41:41 +00:00
parent f441f4a407
commit d828d23ca7
9 changed files with 215 additions and 186 deletions

View File

@ -119,8 +119,8 @@ FriendsDialog::FriendsDialog(QWidget *parent)
connect(ui.textboldChatButton, SIGNAL(clicked()), this, SLOT(setFont())); connect(ui.textboldChatButton, SIGNAL(clicked()), this, SLOT(setFont()));
connect(ui.textunderlineChatButton, SIGNAL(clicked()), this, SLOT(setFont())); connect(ui.textunderlineChatButton, SIGNAL(clicked()), this, SLOT(setFont()));
connect(ui.textitalicChatButton, SIGNAL(clicked()), this, SLOT(setFont())); connect(ui.textitalicChatButton, SIGNAL(clicked()), this, SLOT(setFont()));
connect(ui.fontsButton, SIGNAL(clicked()), this, SLOT(getFont())); connect(ui.fontsButton, SIGNAL(clicked()), this, SLOT(chooseFont()));
connect(ui.colorChatButton, SIGNAL(clicked()), this, SLOT(setColor())); connect(ui.colorChatButton, SIGNAL(clicked()), this, SLOT(chooseColor()));
connect(ui.actionSave_History, SIGNAL(triggered()), this, SLOT(fileSaveAs())); connect(ui.actionSave_History, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
connect(ui.hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>))); connect(ui.hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
@ -130,8 +130,9 @@ FriendsDialog::FriendsDialog(QWidget *parent)
mCurrentColor = Qt::black; mCurrentColor = Qt::black;
mCurrentFont.fromString(Settings->getChatScreenFont()); mCurrentFont.fromString(Settings->getChatScreenFont());
colorChanged(mCurrentColor); colorChanged();
fontChanged(mCurrentFont); fontChanged();
setColorAndFont();
style.setStyleFromSettings(ChatStyle::TYPE_PUBLIC); style.setStyleFromSettings(ChatStyle::TYPE_PUBLIC);
@ -150,14 +151,14 @@ FriendsDialog::FriendsDialog(QWidget *parent)
} }
} }
QMenu * grpchatmenu = new QMenu();
grpchatmenu->addAction(ui.actionClear_Chat_History);
grpchatmenu->addAction(ui.actionDelete_Chat_History);
grpchatmenu->addAction(ui.actionSave_History);
grpchatmenu->addAction(ui.actionMessageHistory);
ui.menuButton->setMenu(grpchatmenu);
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
menu->addAction(ui.actionClear_Chat_History);
menu->addAction(ui.actionDelete_Chat_History);
menu->addAction(ui.actionSave_History);
menu->addAction(ui.actionMessageHistory);
ui.menuButton->setMenu(menu);
menu = new QMenu();
menu->addAction(ui.actionAdd_Friend); menu->addAction(ui.actionAdd_Friend);
menu->addAction(ui.actionAdd_Group); menu->addAction(ui.actionAdd_Group);
menu->addAction(ui.actionCreate_new_Chat_lobby); menu->addAction(ui.actionCreate_new_Chat_lobby);
@ -493,7 +494,7 @@ void FriendsDialog::sendMsg()
// QTextEdit::clear() does not reset the CharFormat if document contains hyperlinks that have been accessed. // QTextEdit::clear() does not reset the CharFormat if document contains hyperlinks that have been accessed.
ui.lineEdit->setCurrentCharFormat(QTextCharFormat ()); ui.lineEdit->setCurrentCharFormat(QTextCharFormat ());
setFont(); setColorAndFont();
/* redraw send list */ /* redraw send list */
insertSendList(); insertSendList();
@ -590,56 +591,60 @@ void FriendsDialog::insertSendList()
//============================================================================ //============================================================================
void FriendsDialog::setColor() void FriendsDialog::chooseColor()
{ {
bool ok; bool ok;
QRgb color = QColorDialog::getRgba(ui.lineEdit->textColor().rgba(), &ok, this); QRgb color = QColorDialog::getRgba(ui.lineEdit->textColor().rgba(), &ok, this);
if (ok) { if (ok) {
mCurrentColor = QColor(color); mCurrentColor = QColor(color);
colorChanged(mCurrentColor); colorChanged();
setColorAndFont();
} }
setFont();
} }
void FriendsDialog::colorChanged(const QColor &c) void FriendsDialog::colorChanged()
{ {
QPixmap pxm(16,16); QPixmap pxm(16,16);
pxm.fill(c); pxm.fill(mCurrentColor);
ui.colorChatButton->setIcon(pxm); ui.colorChatButton->setIcon(pxm);
} }
void FriendsDialog::getFont() void FriendsDialog::chooseFont()
{ {
bool ok; bool ok;
mCurrentFont = QFontDialog::getFont(&ok, mCurrentFont, this); QFont font = QFontDialog::getFont(&ok, mCurrentFont, this);
if (ok) { if (ok) {
fontChanged(mCurrentFont); mCurrentFont = font;
fontChanged();
setFont();
} }
} }
void FriendsDialog::fontChanged(const QFont &font) void FriendsDialog::fontChanged()
{ {
mCurrentFont = font;
ui.textboldChatButton->setChecked(mCurrentFont.bold()); ui.textboldChatButton->setChecked(mCurrentFont.bold());
ui.textunderlineChatButton->setChecked(mCurrentFont.underline()); ui.textunderlineChatButton->setChecked(mCurrentFont.underline());
ui.textitalicChatButton->setChecked(mCurrentFont.italic()); ui.textitalicChatButton->setChecked(mCurrentFont.italic());
setFont();
} }
void FriendsDialog::setFont() void FriendsDialog::setColorAndFont()
{ {
mCurrentFont.setBold(ui.textboldChatButton->isChecked()); mCurrentFont.setBold(ui.textboldChatButton->isChecked());
mCurrentFont.setUnderline(ui.textunderlineChatButton->isChecked()); mCurrentFont.setUnderline(ui.textunderlineChatButton->isChecked());
mCurrentFont.setItalic(ui.textitalicChatButton->isChecked()); mCurrentFont.setItalic(ui.textitalicChatButton->isChecked());
ui.lineEdit->setFont(mCurrentFont); ui.lineEdit->setFont(mCurrentFont);
ui.lineEdit->setTextColor(mCurrentColor); ui.lineEdit->setTextColor(mCurrentColor);
Settings->setChatScreenFont(mCurrentFont.toString());
ui.lineEdit->setFocus(); ui.lineEdit->setFocus();
} }
void FriendsDialog::setFont()
{
setColorAndFont();
Settings->setChatScreenFont(mCurrentFont.toString());
}
// Update Chat Info information // Update Chat Info information
void FriendsDialog::setChatInfo(QString info, QColor color) void FriendsDialog::setChatInfo(QString info, QColor color)
{ {

View File

@ -86,14 +86,14 @@ private slots:
void addFriend(); void addFriend();
void setColor(); void chooseColor();
void insertSendList(); void insertSendList();
void sendMsg(); void sendMsg();
void statusmessage(); void statusmessage();
void setFont(); void setFont();
void getFont(); void chooseFont();
void getAvatar(); void getAvatar();
@ -122,8 +122,9 @@ private:
void processSettings(bool bLoad); void processSettings(bool bLoad);
void addChatMsg(bool incoming, bool history, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message); void addChatMsg(bool incoming, bool history, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message);
void colorChanged(const QColor &c); void colorChanged();
void fontChanged(const QFont &font); void fontChanged();
void setColorAndFont();
QString fileName; QString fileName;

View File

@ -864,9 +864,6 @@ border: 1px solid #CCCCCC;}</string>
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::NoFocus</enum> <enum>Qt::NoFocus</enum>
</property> </property>
<property name="text">
<string/>
</property>
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset resource="images.qrc">
<normaloff>:/images/emoticons/kopete/kopete020.png</normaloff>:/images/emoticons/kopete/kopete020.png</iconset> <normaloff>:/images/emoticons/kopete/kopete020.png</normaloff>:/images/emoticons/kopete/kopete020.png</iconset>
@ -908,9 +905,6 @@ border: 1px solid #CCCCCC;}</string>
<property name="toolTip"> <property name="toolTip">
<string>Bold</string> <string>Bold</string>
</property> </property>
<property name="text">
<string/>
</property>
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset resource="images.qrc">
<normaloff>:/images/edit-bold.png</normaloff>:/images/edit-bold.png</iconset> <normaloff>:/images/edit-bold.png</normaloff>:/images/edit-bold.png</iconset>
@ -990,9 +984,6 @@ border: 1px solid #CCCCCC;}</string>
<property name="toolTip"> <property name="toolTip">
<string>Italic</string> <string>Italic</string>
</property> </property>
<property name="text">
<string/>
</property>
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset resource="images.qrc">
<normaloff>:/images/edit-italic.png</normaloff>:/images/edit-italic.png</iconset> <normaloff>:/images/edit-italic.png</normaloff>:/images/edit-italic.png</iconset>
@ -1031,9 +1022,6 @@ border: 1px solid #CCCCCC;}</string>
<property name="toolTip"> <property name="toolTip">
<string>Font</string> <string>Font</string>
</property> </property>
<property name="text">
<string/>
</property>
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset resource="images.qrc">
<normaloff>:/images/fonts.png</normaloff>:/images/fonts.png</iconset> <normaloff>:/images/fonts.png</normaloff>:/images/fonts.png</iconset>
@ -1069,16 +1057,13 @@ border: 1px solid #CCCCCC;}</string>
<property name="toolTip"> <property name="toolTip">
<string>Text Color</string> <string>Text Color</string>
</property> </property>
<property name="text">
<string/>
</property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="menuButton"> <widget class="QToolButton" name="menuButton">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1100,24 +1085,6 @@ border: 1px solid #CCCCCC;}</string>
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::NoFocus</enum> <enum>Qt::NoFocus</enum>
</property> </property>
<property name="styleSheet">
<string notr="true">QPushButton::menu-indicator {
subcontrol-origin: padding;
subcontrol-position: bottom right;
}
QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
position: relative;
top: 1px; left: 1px; /* shift the arrow by 2 px */
}
QPushButton:hover {
border: 1px solid #CCCCCC;
}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset resource="images.qrc">
<normaloff>:/images/configure.png</normaloff>:/images/configure.png</iconset> <normaloff>:/images/configure.png</normaloff>:/images/configure.png</iconset>
@ -1128,7 +1095,10 @@ border: 1px solid #CCCCCC;}</string>
<height>22</height> <height>22</height>
</size> </size>
</property> </property>
<property name="flat"> <property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
@ -1159,9 +1129,6 @@ border: 1px solid #CCCCCC;}</string>
<property name="toolTip"> <property name="toolTip">
<string>Attach File</string> <string>Attach File</string>
</property> </property>
<property name="text">
<string/>
</property>
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset resource="images.qrc">
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset> <normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
@ -1445,6 +1412,16 @@ background: white;}</string>
<string>Friend Recommendations</string> <string>Friend Recommendations</string>
</property> </property>
</action> </action>
<action name="actionChooseFont">
<property name="text">
<string>Choose Font</string>
</property>
</action>
<action name="actionResetFont">
<property name="text">
<string>Reset font to default</string>
</property>
</action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>

View File

@ -71,13 +71,14 @@ ChatWidget::ChatWidget(QWidget *parent) :
connect(ui->textunderlineButton, SIGNAL(clicked()), this, SLOT(setFont())); connect(ui->textunderlineButton, SIGNAL(clicked()), this, SLOT(setFont()));
connect(ui->textitalicButton, SIGNAL(clicked()), this, SLOT(setFont())); connect(ui->textitalicButton, SIGNAL(clicked()), this, SLOT(setFont()));
connect(ui->attachPictureButton, SIGNAL(clicked()), this, SLOT(addExtraPicture())); connect(ui->attachPictureButton, SIGNAL(clicked()), this, SLOT(addExtraPicture()));
connect(ui->fontButton, SIGNAL(clicked()), this, SLOT(getFont())); connect(ui->colorButton, SIGNAL(clicked()), this, SLOT(chooseColor()));
connect(ui->colorButton, SIGNAL(clicked()), this, SLOT(setColor()));
connect(ui->emoteiconButton, SIGNAL(clicked()), this, SLOT(smileyWidget())); connect(ui->emoteiconButton, SIGNAL(clicked()), this, SLOT(smileyWidget()));
connect(ui->actionSaveChatHistory, SIGNAL(triggered()), this, SLOT(fileSaveAs())); connect(ui->actionSaveChatHistory, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
connect(ui->actionClearChatHistory, SIGNAL(triggered()), this, SLOT(clearChatHistory())); connect(ui->actionClearChatHistory, SIGNAL(triggered()), this, SLOT(clearChatHistory()));
connect(ui->actionDeleteChatHistory, SIGNAL(triggered()), this, SLOT(deleteChatHistory())); connect(ui->actionDeleteChatHistory, SIGNAL(triggered()), this, SLOT(deleteChatHistory()));
connect(ui->actionMessageHistory, SIGNAL(triggered()), this, SLOT(messageHistory())); connect(ui->actionMessageHistory, SIGNAL(triggered()), this, SLOT(messageHistory()));
connect(ui->actionChooseFont, SIGNAL(triggered()), this, SLOT(chooseFont()));
connect(ui->actionResetFont, SIGNAL(triggered()), this, SLOT(resetFont()));
connect(ui->hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>))); connect(ui->hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
@ -89,27 +90,22 @@ ChatWidget::ChatWidget(QWidget *parent) :
ui->infoframe->setVisible(false); ui->infoframe->setVisible(false);
ui->statusmessagelabel->hide(); ui->statusmessagelabel->hide();
ui->textboldButton->setIcon(QIcon(QString(":/images/edit-bold.png")));
ui->textunderlineButton->setIcon(QIcon(QString(":/images/edit-underline.png")));
ui->textitalicButton->setIcon(QIcon(QString(":/images/edit-italic.png")));
ui->fontButton->setIcon(QIcon(QString(":/images/fonts.png")));
ui->emoteiconButton->setIcon(QIcon(QString(":/images/emoticons/kopete/kopete020.png")));
ui->textboldButton->setCheckable(true);
ui->textunderlineButton->setCheckable(true);
ui->textitalicButton->setCheckable(true);
setAcceptDrops(true); setAcceptDrops(true);
ui->chattextEdit->setAcceptDrops(false); ui->chattextEdit->setAcceptDrops(false);
ui->hashBox->setDropWidget(this); ui->hashBox->setDropWidget(this);
ui->hashBox->setAutoHide(true); ui->hashBox->setAutoHide(true);
QMenu *toolmenu = new QMenu(); QMenu *menu = new QMenu();
toolmenu->addAction(ui->actionClearChatHistory); menu->addAction(ui->actionChooseFont);
toolmenu->addAction(ui->actionDeleteChatHistory); menu->addAction(ui->actionResetFont);
toolmenu->addAction(ui->actionSaveChatHistory); ui->fontButton->setMenu(menu);
toolmenu->addAction(ui->actionMessageHistory);
ui->pushtoolsButton->setMenu(toolmenu); menu = new QMenu();
menu->addAction(ui->actionClearChatHistory);
menu->addAction(ui->actionDeleteChatHistory);
menu->addAction(ui->actionSaveChatHistory);
menu->addAction(ui->actionMessageHistory);
ui->pushtoolsButton->setMenu(menu);
ui->chattextEdit->installEventFilter(this); ui->chattextEdit->installEventFilter(this);
@ -148,8 +144,9 @@ void ChatWidget::init(const std::string &peerId, const QString &title)
currentColor.setNamedColor(PeerSettings->getPrivateChatColor(peerId)); currentColor.setNamedColor(PeerSettings->getPrivateChatColor(peerId));
currentFont.fromString(PeerSettings->getPrivateChatFont(peerId)); currentFont.fromString(PeerSettings->getPrivateChatFont(peerId));
colorChanged(currentColor); colorChanged();
fontChanged(currentFont); fontChanged();
setColorAndFont();
// load style // load style
PeerSettings->getStyle(peerId, "ChatWidget", style); PeerSettings->getStyle(peerId, "ChatWidget", style);
@ -407,7 +404,7 @@ void ChatWidget::sendChat()
// QTextEdit::clear() does not reset the CharFormat if document contains hyperlinks that have been accessed. // QTextEdit::clear() does not reset the CharFormat if document contains hyperlinks that have been accessed.
chatWidget->setCurrentCharFormat(QTextCharFormat ()); chatWidget->setCurrentCharFormat(QTextCharFormat ());
setFont(); setColorAndFont();
} }
void ChatWidget::on_closeInfoFrameButton_clicked() void ChatWidget::on_closeInfoFrameButton_clicked()
@ -415,46 +412,51 @@ void ChatWidget::on_closeInfoFrameButton_clicked()
ui->infoframe->setVisible(false); ui->infoframe->setVisible(false);
} }
void ChatWidget::setColor() void ChatWidget::chooseColor()
{ {
bool ok; bool ok;
QRgb color = QColorDialog::getRgba(ui->chattextEdit->textColor().rgba(), &ok, window()); QRgb color = QColorDialog::getRgba(ui->chattextEdit->textColor().rgba(), &ok, window());
if (ok) { if (ok) {
currentColor = QColor(color); currentColor = QColor(color);
PeerSettings->setPrivateChatColor(peerId, currentColor.name()); PeerSettings->setPrivateChatColor(peerId, currentColor.name());
colorChanged(currentColor); colorChanged();
setColorAndFont();
} }
setFont();
} }
void ChatWidget::colorChanged(const QColor &c) void ChatWidget::colorChanged()
{ {
QPixmap pix(16, 16); QPixmap pix(16, 16);
pix.fill(c); pix.fill(currentColor);
ui->colorButton->setIcon(pix); ui->colorButton->setIcon(pix);
} }
void ChatWidget::getFont() void ChatWidget::chooseFont()
{ {
bool ok; bool ok;
QFont font = QFontDialog::getFont(&ok, currentFont, this); QFont font = QFontDialog::getFont(&ok, currentFont, this);
if (ok) { if (ok) {
fontChanged(font); currentFont = font;
fontChanged();
setFont();
} }
} }
void ChatWidget::fontChanged(const QFont &font) void ChatWidget::resetFont()
{ {
currentFont = font; currentFont.fromString(Settings->getChatScreenFont());
fontChanged();
ui->textboldButton->setChecked(currentFont.bold());
ui->textunderlineButton->setChecked(currentFont.underline());
ui->textitalicButton->setChecked(currentFont.italic());
setFont(); setFont();
} }
void ChatWidget::setFont() void ChatWidget::fontChanged()
{
ui->textboldButton->setChecked(currentFont.bold());
ui->textunderlineButton->setChecked(currentFont.underline());
ui->textitalicButton->setChecked(currentFont.italic());
}
void ChatWidget::setColorAndFont()
{ {
currentFont.setBold(ui->textboldButton->isChecked()); currentFont.setBold(ui->textboldButton->isChecked());
currentFont.setUnderline(ui->textunderlineButton->isChecked()); currentFont.setUnderline(ui->textunderlineButton->isChecked());
@ -464,7 +466,11 @@ void ChatWidget::setFont()
ui->chattextEdit->setTextColor(currentColor); ui->chattextEdit->setTextColor(currentColor);
ui->chattextEdit->setFocus(); ui->chattextEdit->setFocus();
}
void ChatWidget::setFont()
{
setColorAndFont();
PeerSettings->setPrivateChatFont(peerId, currentFont.toString()); PeerSettings->setPrivateChatFont(peerId, currentFont.toString());
} }

View File

@ -101,8 +101,9 @@ private slots:
void addExtraPicture(); void addExtraPicture();
void on_closeInfoFrameButton_clicked(); void on_closeInfoFrameButton_clicked();
void setColor(); void chooseColor();
void getFont(); void chooseFont();
void resetFont();
void setFont(); void setFont();
void sendChat(); void sendChat();
@ -117,8 +118,9 @@ private:
void updateStatusTyping(); void updateStatusTyping();
void setCurrentFileName(const QString &fileName); void setCurrentFileName(const QString &fileName);
void colorChanged(const QColor &c); void colorChanged();
void fontChanged(const QFont &font); void fontChanged();
void setColorAndFont();
void processSettings(bool load); void processSettings(bool load);
std::string peerId; std::string peerId;

View File

@ -288,6 +288,10 @@ background: white;}</string>
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::NoFocus</enum> <enum>Qt::NoFocus</enum>
</property> </property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/emoticons/kopete/kopete020.png</normaloff>:/images/emoticons/kopete/kopete020.png</iconset>
</property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>24</width> <width>24</width>
@ -319,8 +323,12 @@ background: white;}</string>
<property name="toolTip"> <property name="toolTip">
<string>Bold</string> <string>Bold</string>
</property> </property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/edit-bold.png</normaloff>:/images/edit-bold.png</iconset>
</property>
<property name="checkable"> <property name="checkable">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>true</bool>
@ -347,8 +355,12 @@ background: white;}</string>
<property name="toolTip"> <property name="toolTip">
<string>Underline</string> <string>Underline</string>
</property> </property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/edit-underline.png</normaloff>:/images/edit-underline.png</iconset>
</property>
<property name="checkable"> <property name="checkable">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>true</bool>
@ -375,8 +387,12 @@ background: white;}</string>
<property name="toolTip"> <property name="toolTip">
<string>Italic</string> <string>Italic</string>
</property> </property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/edit-italic.png</normaloff>:/images/edit-italic.png</iconset>
</property>
<property name="checkable"> <property name="checkable">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>true</bool>
@ -387,13 +403,13 @@ background: white;}</string>
<widget class="QToolButton" name="fontButton"> <widget class="QToolButton" name="fontButton">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>28</width> <width>32</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>28</width> <width>32</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
@ -403,8 +419,12 @@ background: white;}</string>
<property name="toolTip"> <property name="toolTip">
<string>Font</string> <string>Font</string>
</property> </property>
<property name="checkable"> <property name="icon">
<bool>false</bool> <iconset resource="../images.qrc">
<normaloff>:/images/fonts.png</normaloff>:/images/fonts.png</iconset>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property> </property>
<property name="autoRaise"> <property name="autoRaise">
<bool>true</bool> <bool>true</bool>
@ -456,9 +476,6 @@ background: white;}</string>
<property name="toolTip"> <property name="toolTip">
<string>Attach a Picture</string> <string>Attach a Picture</string>
</property> </property>
<property name="text">
<string/>
</property>
<property name="icon"> <property name="icon">
<iconset resource="../images.qrc"> <iconset resource="../images.qrc">
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset> <normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
@ -488,9 +505,6 @@ background: white;}</string>
<property name="toolTip"> <property name="toolTip">
<string>Add a File for your Friend</string> <string>Add a File for your Friend</string>
</property> </property>
<property name="text">
<string/>
</property>
<property name="icon"> <property name="icon">
<iconset resource="../images.qrc"> <iconset resource="../images.qrc">
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset> <normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
@ -507,7 +521,7 @@ background: white;}</string>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushtoolsButton"> <widget class="QToolButton" name="pushtoolsButton">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>28</width> <width>28</width>
@ -523,24 +537,6 @@ background: white;}</string>
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::NoFocus</enum> <enum>Qt::NoFocus</enum>
</property> </property>
<property name="styleSheet">
<string notr="true">QPushButton::menu-indicator {
subcontrol-origin: padding;
subcontrol-position: bottom right;
}
QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
position: relative;
top: 1px; left: 1px; /* shift the arrow by 2 px */
}
QPushButton:hover {
border: 1px solid #CCCCCC;
}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon"> <property name="icon">
<iconset resource="../images.qrc"> <iconset resource="../images.qrc">
<normaloff>:/images/configure.png</normaloff>:/images/configure.png</iconset> <normaloff>:/images/configure.png</normaloff>:/images/configure.png</iconset>
@ -551,7 +547,10 @@ border: 1px solid #CCCCCC;
<height>22</height> <height>22</height>
</size> </size>
</property> </property>
<property name="flat"> <property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
@ -651,6 +650,16 @@ border: 1px solid #CCCCCC;
<string>Deletes all stored and displayed chat history</string> <string>Deletes all stored and displayed chat history</string>
</property> </property>
</action> </action>
<action name="actionChooseFont">
<property name="text">
<string>Choose font</string>
</property>
</action>
<action name="actionResetFont">
<property name="text">
<string>Reset font to default</string>
</property>
</action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>

View File

@ -32,6 +32,7 @@
#include <retroshare/rsmsgs.h> #include <retroshare/rsmsgs.h>
#include "RsharePeerSettings.h" #include "RsharePeerSettings.h"
#include "rsharesettings.h"
#include "gui/style/RSStyle.h" #include "gui/style/RSStyle.h"
/** The file in which all settings of he peers will read and written. */ /** The file in which all settings of he peers will read and written. */
@ -144,7 +145,11 @@ void RsharePeerSettings::set(const std::string &peerId, const QString &key, cons
} }
beginGroup(QString::fromStdString(settingsId)); beginGroup(QString::fromStdString(settingsId));
setValue(key, value); if (value.isNull()) {
remove(key);
} else {
setValue(key, value);
}
endGroup(); endGroup();
} }
@ -160,12 +165,16 @@ void RsharePeerSettings::setPrivateChatColor(const std::string &peerId, const QS
QString RsharePeerSettings::getPrivateChatFont(const std::string &peerId) QString RsharePeerSettings::getPrivateChatFont(const std::string &peerId)
{ {
return get(peerId, "PrivateChatFont", QFont("Comic Sans MS", 10).toString()).toString(); return get(peerId, "PrivateChatFont", Settings->getChatScreenFont()).toString();
} }
void RsharePeerSettings::setPrivateChatFont(const std::string &peerId, const QString &value) void RsharePeerSettings::setPrivateChatFont(const std::string &peerId, const QString &value)
{ {
set(peerId, "PrivateChatFont", value); if (Settings->getChatScreenFont() == value) {
set(peerId, "PrivateChatFont", QVariant());
} else {
set(peerId, "PrivateChatFont", value);
}
} }
bool RsharePeerSettings::getPrivateChatOnTop(const std::string &peerId) bool RsharePeerSettings::getPrivateChatOnTop(const std::string &peerId)

View File

@ -790,7 +790,7 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message> <message>
<location line="+26"/> <location line="+26"/>
<location filename="../gui/feeds/ChanMsgItem.cpp" line="+323"/> <location filename="../gui/feeds/ChanMsgItem.cpp" line="+324"/>
<source>Expand</source> <source>Expand</source>
<translation>Erweitern</translation> <translation>Erweitern</translation>
</message> </message>
@ -1102,7 +1102,7 @@ Do you want to send them a Message instead</source>
<context> <context>
<name>ChatLobbyDialog</name> <name>ChatLobbyDialog</name>
<message> <message>
<location filename="../gui/chat/ChatLobbyDialog.cpp" line="+115"/> <location filename="../gui/chat/ChatLobbyDialog.cpp" line="+117"/>
<source>Please enter your new nick name</source> <source>Please enter your new nick name</source>
<translation>Bitte gib deinen neuen Spitznamen ein</translation> <translation>Bitte gib deinen neuen Spitznamen ein</translation>
</message> </message>
@ -1469,50 +1469,50 @@ p, li { white-space: pre-wrap; }
<translation>Schliessen</translation> <translation>Schliessen</translation>
</message> </message>
<message> <message>
<location line="+332"/> <location line="+346"/>
<source>Attach a Picture</source> <source>Attach a Picture</source>
<translation>Bild anhängen</translation> <translation>Bild anhängen</translation>
</message> </message>
<message> <message>
<location line="+32"/> <location line="+29"/>
<source>Add a File for your Friend</source> <source>Add a File for your Friend</source>
<translation>Füge eine Datei für deinen Freund hinzu</translation> <translation>Füge eine Datei für deinen Freund hinzu</translation>
</message> </message>
<message> <message>
<location line="+86"/> <location line="+68"/>
<source>Send</source> <source>Send</source>
<translation>Senden</translation> <translation>Senden</translation>
</message> </message>
<message> <message>
<location line="-255"/> <location line="-250"/>
<location line="+271"/> <location line="+266"/>
<source>Bold</source> <source>Bold</source>
<translation>Fett</translation> <translation>Fett</translation>
</message> </message>
<message> <message>
<location line="-243"/> <location line="-234"/>
<location line="+253"/> <location line="+244"/>
<source>Underline</source> <source>Underline</source>
<translation>Unterstrichen</translation> <translation>Unterstrichen</translation>
</message> </message>
<message> <message>
<location line="-225"/> <location line="-212"/>
<location line="+220"/> <location line="+207"/>
<source>Italic</source> <source>Italic</source>
<translation>Kursiv</translation> <translation>Kursiv</translation>
</message> </message>
<message> <message>
<location line="-192"/> <location line="-175"/>
<source>Font</source> <source>Font</source>
<translation>Schriftart</translation> <translation>Schriftart</translation>
</message> </message>
<message> <message>
<location line="+28"/> <location line="+32"/>
<source>Text Color</source> <source>Text Color</source>
<translation>Textfarbe</translation> <translation>Textfarbe</translation>
</message> </message>
<message> <message>
<location line="+174"/> <location line="+153"/>
<source>Strike</source> <source>Strike</source>
<translation>Durchgestrichen</translation> <translation>Durchgestrichen</translation>
</message> </message>
@ -1553,7 +1553,17 @@ p, li { white-space: pre-wrap; }
<translation>Löscht den gespeicherten und angezeigten Chat Verlauf</translation> <translation>Löscht den gespeicherten und angezeigten Chat Verlauf</translation>
</message> </message>
<message> <message>
<location filename="../gui/chat/ChatWidget.cpp" line="+348"/> <location line="+5"/>
<source>Choose font</source>
<translation>Schriftart wählen</translation>
</message>
<message>
<location line="+5"/>
<source>Reset font to default</source>
<translation>Schriftart auf den Standard setzen</translation>
</message>
<message>
<location filename="../gui/chat/ChatWidget.cpp" line="+344"/>
<source>Paste RetroShare Link</source> <source>Paste RetroShare Link</source>
<translation>RetroShare Link einfügen</translation> <translation>RetroShare Link einfügen</translation>
</message> </message>
@ -1563,7 +1573,7 @@ p, li { white-space: pre-wrap; }
<translation>tippt...</translation> <translation>tippt...</translation>
</message> </message>
<message> <message>
<location line="+118"/> <location line="+129"/>
<source>Do you really want to physically delete the history?</source> <source>Do you really want to physically delete the history?</source>
<translation>Möchtest du wirklich den Nachrichtenverlauf physisch löschen?</translation> <translation>Möchtest du wirklich den Nachrichtenverlauf physisch löschen?</translation>
</message> </message>
@ -1684,7 +1694,7 @@ p, li { white-space: pre-wrap; }
<context> <context>
<name>ConfCertDialog</name> <name>ConfCertDialog</name>
<message> <message>
<location filename="../gui/connect/ConfCertDialog.ui" line="+753"/> <location filename="../gui/connect/ConfCertDialog.ui" line="+746"/>
<source>Cancel</source> <source>Cancel</source>
<translation>Abbrechen</translation> <translation>Abbrechen</translation>
</message> </message>
@ -1694,7 +1704,7 @@ p, li { white-space: pre-wrap; }
<translation>OK</translation> <translation>OK</translation>
</message> </message>
<message> <message>
<location line="-702"/> <location line="-695"/>
<source>Peer Info</source> <source>Peer Info</source>
<translation>Nachbar Info</translation> <translation>Nachbar Info</translation>
</message> </message>
@ -1714,12 +1724,12 @@ p, li { white-space: pre-wrap; }
<translation>Peer ID</translation> <translation>Peer ID</translation>
</message> </message>
<message> <message>
<location line="+137"/> <location line="+134"/>
<source>Peer Address</source> <source>Peer Address</source>
<translation>Adresse des Nachbarn</translation> <translation>Adresse des Nachbarn</translation>
</message> </message>
<message> <message>
<location line="+448"/> <location line="+444"/>
<source>Deny Friend</source> <source>Deny Friend</source>
<translation>Blockiere Freund</translation> <translation>Blockiere Freund</translation>
</message> </message>
@ -1735,7 +1745,7 @@ p, li { white-space: pre-wrap; }
<translation>Unterzeichne GPG Schlüssel</translation> <translation>Unterzeichne GPG Schlüssel</translation>
</message> </message>
<message> <message>
<location line="-196"/> <location line="-192"/>
<source>Your trust in this peer is:</source> <source>Your trust in this peer is:</source>
<translation>Dein Vertrauen zu diesem Nachbar ist:</translation> <translation>Dein Vertrauen zu diesem Nachbar ist:</translation>
</message> </message>
@ -1755,7 +1765,7 @@ p, li { white-space: pre-wrap; }
<translation>Nachbar Schlüssel ist unterzeichnet von:</translation> <translation>Nachbar Schlüssel ist unterzeichnet von:</translation>
</message> </message>
<message> <message>
<location line="-476"/> <location line="-473"/>
<source>Last Contact</source> <source>Last Contact</source>
<translation>Letzter Kontakt</translation> <translation>Letzter Kontakt</translation>
</message> </message>
@ -1775,7 +1785,7 @@ p, li { white-space: pre-wrap; }
<translation>Ort</translation> <translation>Ort</translation>
</message> </message>
<message> <message>
<location line="+52"/> <location line="+49"/>
<source>Status</source> <source>Status</source>
<translation>Status</translation> <translation>Status</translation>
</message> </message>
@ -1816,7 +1826,7 @@ p, li { white-space: pre-wrap; }
<translation>Voll </translation> <translation>Voll </translation>
</message> </message>
<message> <message>
<location line="+94"/> <location line="+90"/>
<location line="+29"/> <location line="+29"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
@ -1915,7 +1925,7 @@ und meinen GPG Schlüssel nicht unterzeichnet</translation>
<translation>Vielleicht ist das Passwort falsch</translation> <translation>Vielleicht ist das Passwort falsch</translation>
</message> </message>
<message> <message>
<location filename="../gui/connect/ConfCertDialog.ui" line="-329"/> <location filename="../gui/connect/ConfCertDialog.ui" line="-325"/>
<source>Trust </source> <source>Trust </source>
<translation>Vertrauen </translation> <translation>Vertrauen </translation>
</message> </message>
@ -1930,12 +1940,12 @@ und meinen GPG Schlüssel nicht unterzeichnet</translation>
<translation>Zeige Hilfe</translation> <translation>Zeige Hilfe</translation>
</message> </message>
<message> <message>
<location line="-414"/> <location line="-411"/>
<source>RetroShare ID</source> <source>RetroShare ID</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location line="+588"/> <location line="+581"/>
<source>Certificate</source> <source>Certificate</source>
<translation>Zertifikat</translation> <translation>Zertifikat</translation>
</message> </message>
@ -4582,7 +4592,7 @@ p, li { white-space: pre-wrap; }
<translation>Forum erstellen</translation> <translation>Forum erstellen</translation>
</message> </message>
<message> <message>
<location line="+620"/> <location line="+614"/>
<source>Print</source> <source>Print</source>
<translation>Drucken</translation> <translation>Drucken</translation>
</message> </message>
@ -4598,7 +4608,7 @@ p, li { white-space: pre-wrap; }
<translation>Erstelle neues Thema</translation> <translation>Erstelle neues Thema</translation>
</message> </message>
<message> <message>
<location filename="../gui/ForumsDialog.ui" line="-227"/> <location filename="../gui/ForumsDialog.ui" line="-221"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
@ -5062,17 +5072,17 @@ p, li { white-space: pre-wrap; }
<translation>Gruppenchat</translation> <translation>Gruppenchat</translation>
</message> </message>
<message> <message>
<location line="+456"/> <location line="+417"/>
<source>Messages entered here are sent to all connected friends</source> <source>Messages entered here are sent to all connected friends</source>
<translation>Nachrichten, die Du hier eingibst, werden an alle verbundenen Freunde versendet</translation> <translation>Nachrichten, die Du hier eingibst, werden an alle verbundenen Freunde versendet</translation>
</message> </message>
<message> <message>
<location line="-369"/> <location line="-333"/>
<source>Bold</source> <source>Bold</source>
<translation>Fett</translation> <translation>Fett</translation>
</message> </message>
<message> <message>
<location line="+41"/> <location line="+38"/>
<source>Underline</source> <source>Underline</source>
<translation>Unterstrichen</translation> <translation>Unterstrichen</translation>
</message> </message>
@ -5082,27 +5092,27 @@ p, li { white-space: pre-wrap; }
<translation>Kursiv</translation> <translation>Kursiv</translation>
</message> </message>
<message> <message>
<location line="+41"/> <location line="+38"/>
<source>Font</source> <source>Font</source>
<translation>Schriftart</translation> <translation>Schriftart</translation>
</message> </message>
<message> <message>
<location line="+38"/> <location line="+35"/>
<source>Text Color</source> <source>Text Color</source>
<translation>Textfarbe</translation> <translation>Textfarbe</translation>
</message> </message>
<message> <message>
<location line="+90"/> <location line="+72"/>
<source>Attach File</source> <source>Attach File</source>
<translation>Datei anhängen</translation> <translation>Datei anhängen</translation>
</message> </message>
<message> <message>
<location line="+41"/> <location line="+38"/>
<source>Send</source> <source>Send</source>
<translation>Senden</translation> <translation>Senden</translation>
</message> </message>
<message> <message>
<location line="+117"/> <location line="+111"/>
<source>Clear Chat History</source> <source>Clear Chat History</source>
<translation>Nachrichtenverlauf leeren</translation> <translation>Nachrichtenverlauf leeren</translation>
</message> </message>
@ -5181,10 +5191,20 @@ p, li { white-space: pre-wrap; }
<translation>Neue Chat Lobby erstellen</translation> <translation>Neue Chat Lobby erstellen</translation>
</message> </message>
<message> <message>
<location line="+5"/> <location line="+9"/>
<source>Friend Recommendations</source> <source>Friend Recommendations</source>
<translation>Freundempfehlungen</translation> <translation>Freundempfehlungen</translation>
</message> </message>
<message>
<location line="+5"/>
<source>Choose Font</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Reset font to default</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Hide Offline Friends</source> <source>Hide Offline Friends</source>
<translation type="obsolete">Verstecke offline Freunde</translation> <translation type="obsolete">Verstecke offline Freunde</translation>
@ -5206,7 +5226,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Status ausblenden</translation> <translation type="obsolete">Status ausblenden</translation>
</message> </message>
<message> <message>
<location line="-32"/> <location line="-46"/>
<location line="+3"/> <location line="+3"/>
<source>Add a new Group</source> <source>Add a new Group</source>
<translation>Neue Gruppe hinzufügen</translation> <translation>Neue Gruppe hinzufügen</translation>
@ -7874,7 +7894,7 @@ Möchtest du die Nachricht speichern ?</translation>
<context> <context>
<name>MessageWidget</name> <name>MessageWidget</name>
<message> <message>
<location filename="../gui/msgs/MessageWidget.ui" line="+80"/> <location filename="../gui/msgs/MessageWidget.ui" line="+74"/>
<source>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; <source>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;Arial&apos;; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;Arial&apos;; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;
@ -13909,7 +13929,7 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location line="+125"/> <location line="+125"/>
<source>Priority (Speed)...</source> <source>Priority (Speed)...</source>
<translation>Prioritä t(Geschwindigkeit)...</translation> <translation>Priorität (Geschwindigkeit)...</translation>
</message> </message>
<message> <message>
<location line="-123"/> <location line="-123"/>