Moved settings for private chat from NotifyPage to ChatPage.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5728 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-10-27 15:51:34 +00:00
parent c7c695600f
commit 03e521c024
7 changed files with 216 additions and 158 deletions

View File

@ -22,6 +22,7 @@
#include <QFontDialog>
#include <time.h>
#include <retroshare/rsnotify.h>
#include "ChatPage.h"
#include "gui/chat/ChatStyle.h"
#include "gui/notifyqt.h"
@ -156,6 +157,17 @@ ChatPage::save(QString &/*errmsg*/)
}
}
uint chatflags = 0;
if (ui.chat_NewWindow->isChecked())
chatflags |= RS_CHAT_OPEN;
if (ui.chat_Focus->isChecked())
chatflags |= RS_CHAT_FOCUS;
if (ui.chat_tabbedWindow->isChecked())
chatflags |= RS_CHAT_TABBED_WINDOW;
Settings->setChatFlags(chatflags);
return true;
}
@ -197,6 +209,12 @@ ChatPage::load()
std::string nick ;
rsMsgs->getDefaultNickNameForChatLobby(nick) ;
ui.chatLobbyNick_LE->setText(QString::fromUtf8(nick.c_str())) ;
uint chatflags = Settings->getChatFlags();
ui.chat_NewWindow->setChecked(chatflags & RS_CHAT_OPEN);
ui.chat_Focus->setChecked(chatflags & RS_CHAT_FOCUS);
ui.chat_tabbedWindow->setChecked(chatflags & RS_CHAT_TABBED_WINDOW);
}
void ChatPage::on_pushButtonChangeChatFont_clicked()

View File

@ -20,20 +20,20 @@
<attribute name="title">
<string>General</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Chat Settings</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Chat Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="checkBox_emoteprivchat">
@ -139,6 +139,15 @@
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="chatLobbyGroupBox">
<property name="title">
<string>Chat Lobby</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="label">
<property name="text">
@ -147,7 +156,7 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="nickNameLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
@ -176,87 +185,121 @@
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<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>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Private Chat</string>
</property>
<layout class="QVBoxLayout" name="_2">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="QCheckBox" name="chat_NewWindow">
<property name="text">
<string>Open Window for new chat</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chat_Focus">
<property name="text">
<string>Grab Focus when chat arrives</string>
</property>
</spacer>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chat_tabbedWindow">
<property name="text">
<string>Use a single tabbed window</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBoxIRCColors">
<property name="title">
<string>Chat Font</string>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxIRCColors">
<property name="title">
<string>Chat Font</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>2</number>
</property>
<layout class="QGridLayout" name="gridLayout_47">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>2</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QPushButton" name="pushButtonChangeChatFont">
<property name="text">
<string>Change Chat Font</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelChatFont">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Chat Font:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelChatFontPreview">
<property name="text">
<string notr="true">Font Preview</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<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>
</layout>
</widget>
</item>
</layout>
</widget>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="pushButtonChangeChatFont">
<property name="text">
<string>Change Chat Font</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelChatFont">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Chat Font:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelChatFontPreview">
<property name="text">
<string notr="true">Font Preview</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>

View File

@ -126,16 +126,8 @@ NotifyPage::save(QString &/*errmsg*/)
{
/* extract from rsNotify the flags */
uint chatflags = 0;
uint messageflags = 0;
if (ui.chat_NewWindow->isChecked())
chatflags |= RS_CHAT_OPEN;
if (ui.chat_Focus->isChecked())
chatflags |= RS_CHAT_FOCUS;
if (ui.chat_tabbedWindow->isChecked())
chatflags |= RS_CHAT_TABBED_WINDOW;
if (ui.message_ConnectAttempt->isChecked())
messageflags |= RS_MESSAGE_CONNECT_ATTEMPT;
@ -147,7 +139,6 @@ NotifyPage::save(QString &/*errmsg*/)
Settings->setNotifyFlags(getNotifyFlags());
Settings->setNewsFeedFlags(getNewsFlags());
Settings->setChatFlags(chatflags);
Settings->setMessageFlags(messageflags);
Settings->setDisplayTrayChatLobby(ui.systray_ChatLobby->isChecked());
@ -174,7 +165,6 @@ void NotifyPage::load()
/* extract from rsNotify the flags */
uint notifyflags = Settings->getNotifyFlags();
uint newsflags = Settings->getNewsFeedFlags();
uint chatflags = Settings->getChatFlags();
uint messageflags = Settings->getMessageFlags();
ui.popup_Connect->setChecked(notifyflags & RS_POPUP_CONNECT);
@ -194,10 +184,6 @@ void NotifyPage::load()
ui.notify_Chat->setChecked(newsflags & RS_FEED_TYPE_CHAT);
ui.notify_Security->setChecked(newsflags & RS_FEED_TYPE_SECURITY);
ui.chat_NewWindow->setChecked(chatflags & RS_CHAT_OPEN);
ui.chat_Focus->setChecked(chatflags & RS_CHAT_FOCUS);
ui.chat_tabbedWindow->setChecked(chatflags & RS_CHAT_TABBED_WINDOW);
ui.message_ConnectAttempt->setChecked(messageflags & RS_MESSAGE_CONNECT_ATTEMPT);
ui.systray_GroupChat->setChecked(Settings->getDisplayTrayGroupChat());

View File

@ -144,22 +144,22 @@
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
@ -363,34 +363,17 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Private Chat</string>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QCheckBox" name="chat_NewWindow">
<property name="text">
<string>Open Window for new chat</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chat_Focus">
<property name="text">
<string>Grab Focus when chat arrives</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chat_tabbedWindow">
<property name="text">
<string>Use a single tabbed window</string>
</property>
</widget>
</item>
</layout>
</widget>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>

View File

@ -1210,6 +1210,22 @@ Bitte wähle einen zum Chatten aus.</translation>
<source>Enable Emoticons Private Chat</source>
<translation>Emoticons für privaten Chat</translation>
</message>
<message>
<source>Open Window for new chat</source>
<translation type="unfinished">Fenster für neuen Chat öffnen</translation>
</message>
<message>
<source>Grab Focus when chat arrives</source>
<translation type="unfinished">Fokus auf neues Chatfenster legen</translation>
</message>
<message>
<source>Use a single tabbed window</source>
<translation type="unfinished">Ein Fenster mit Tabs verwenden</translation>
</message>
<message>
<source>Chat Lobby</source>
<translation type="unfinished">Chatlobby</translation>
</message>
</context>
<context>
<name>ChatStyle</name>
@ -4135,6 +4151,10 @@ p, li { white-space: pre-wrap; }
<source>You can&apos;t reply an Anonymous Author</source>
<translation>Du kannst einem anonymen Autor nicht antworten</translation>
</message>
<message>
<source>Search this forum...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ForumsFillThread</name>
@ -7806,15 +7826,15 @@ Rechtsklick und als Freund hinzufügen um zu verbinden.</translation>
</message>
<message>
<source>Open Window for new chat</source>
<translation>Fenster für neuen Chat öffnen</translation>
<translation type="obsolete">Fenster für neuen Chat öffnen</translation>
</message>
<message>
<source>Grab Focus when chat arrives</source>
<translation>Fokus auf neues Chatfenster legen</translation>
<translation type="obsolete">Fokus auf neues Chatfenster legen</translation>
</message>
<message>
<source>Use a single tabbed window</source>
<translation>Ein Fenster mit Tabs verwenden</translation>
<translation type="obsolete">Ein Fenster mit Tabs verwenden</translation>
</message>
<message>
<source>Group chat</source>

View File

@ -1178,6 +1178,22 @@ Please choose one of it to chat with.</source>
<source>Enable Emoticons Private Chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open Window for new chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Grab Focus when chat arrives</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Use a single tabbed window</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Chat Lobby</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatStyle</name>
@ -4071,6 +4087,10 @@ p, li { white-space: pre-wrap; }
<source>You can&apos;t reply an Anonymous Author</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Search this forum...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ForumsFillThread</name>
@ -7635,18 +7655,6 @@ Right-click and select &apos;make friend&apos; to be able to connect.</source>
<source>Private Chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open Window for new chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Grab Focus when chat arrives</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Use a single tabbed window</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Group chat</source>
<translation type="unfinished"></translation>