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 <QFontDialog>
#include <time.h> #include <time.h>
#include <retroshare/rsnotify.h>
#include "ChatPage.h" #include "ChatPage.h"
#include "gui/chat/ChatStyle.h" #include "gui/chat/ChatStyle.h"
#include "gui/notifyqt.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; return true;
} }
@ -197,6 +209,12 @@ ChatPage::load()
std::string nick ; std::string nick ;
rsMsgs->getDefaultNickNameForChatLobby(nick) ; rsMsgs->getDefaultNickNameForChatLobby(nick) ;
ui.chatLobbyNick_LE->setText(QString::fromUtf8(nick.c_str())) ; 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() void ChatPage::on_pushButtonChangeChatFont_clicked()

View File

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

View File

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

View File

@ -144,22 +144,22 @@
</property> </property>
</widget> </widget>
</item> </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> </layout>
</widget> </widget>
</item> </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> </layout>
</item> </item>
<item> <item>
@ -363,34 +363,17 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_2"> <spacer name="verticalSpacer_4">
<property name="title"> <property name="orientation">
<string>Private Chat</string> <enum>Qt::Vertical</enum>
</property> </property>
<layout class="QVBoxLayout"> <property name="sizeHint" stdset="0">
<item> <size>
<widget class="QCheckBox" name="chat_NewWindow"> <width>20</width>
<property name="text"> <height>40</height>
<string>Open Window for new chat</string> </size>
</property> </property>
</widget> </spacer>
</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>
</item> </item>
</layout> </layout>
</item> </item>

View File

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