1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

privacy setting form added

This commit is contained in:
apprb 2014-10-08 23:32:19 +09:00
parent beed30b156
commit 5c1e3360fe
No known key found for this signature in database
GPG Key ID: B001911B5B22FB9B
4 changed files with 147 additions and 2 deletions

View File

@ -29,7 +29,8 @@ FORMS += \
mainwindow.ui \
widget/form/settings/generalsettings.ui \
widget/form/settings/avsettings.ui \
widget/form/settings/identitysettings.ui
widget/form/settings/identitysettings.ui \
widget/form/settings/privacysettings.ui
CONFIG += c++11
TRANSLATIONS = translations/de.ts \

View File

@ -15,13 +15,44 @@
*/
#include "privacyform.h"
#include "ui_privacysettings.h"
#include "widget/form/settingswidget.h"
#include "misc/settings.h"
PrivacyForm::PrivacyForm() :
GenericForm(tr("Privacy settings"), QPixmap(":/img/settings/privacy.png"))
{
bodyUI = new Ui::PrivacySettings;
bodyUI->setupUi(this);
}
PrivacyForm::~PrivacyForm()
{
delete bodyUI;
}
void PrivacyForm::onEnableLoggingUpdated()
{
Settings::getInstance().setEnableLogging(bodyUI->cbKeepHistory->isChecked());
bodyUI->cbEncryptHistory->setEnabled(bodyUI->cbKeepHistory->isChecked());
}
void PrivacyForm::onTypingNotificationEnabledUpdated()
{
Settings::getInstance().setTypingNotification(bodyUI->cbTypingNotification->isChecked());
}
void PrivacyForm::onEncryptLogsUpdated()
{
Settings::getInstance().setEncryptLogs(bodyUI->cbEncryptHistory->isChecked());
}
void PrivacyForm::onEncryptToxUpdated()
{
//
}
void PrivacyForm::onPasswordSet()
{
//
}

View File

@ -19,6 +19,10 @@
#include "genericsettings.h"
namespace Ui {
class PrivacySettings;
}
class PrivacyForm : public GenericForm
{
Q_OBJECT
@ -26,8 +30,16 @@ public:
PrivacyForm();
~PrivacyForm();
private:
private slots:
void onEnableLoggingUpdated();
void onTypingNotificationEnabledUpdated();
void onEncryptLogsUpdated();
void onEncryptToxUpdated();
void onPasswordSet();
private:
Ui::PrivacySettings* bodyUI;
};
#endif

View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PrivacySettings</class>
<widget class="QWidget" name="PrivacySettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="cbTypingNotification">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Typing Notification</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbKeepHistory">
<property name="text">
<string>Keep History</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="encryptionGroup">
<property name="enabled">
<bool>false</bool>
</property>
<property name="title">
<string>Encryption</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="cbEnctyptTox">
<property name="text">
<string>Encrypt Tox datafile</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbEncryptHistory">
<property name="text">
<string>Encrypt History</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pswdBtn">
<property name="text">
<string>Set master password</string>
</property>
</widget>
</item>
</layout>
</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>
</widget>
<resources/>
<connections/>
</ui>