|
|
|
@ -2,6 +2,8 @@
@@ -2,6 +2,8 @@
|
|
|
|
|
#include "widget/widget.h" |
|
|
|
|
#include "settings.h" |
|
|
|
|
#include <QFont> |
|
|
|
|
#include <QClipboard> |
|
|
|
|
#include <QApplication> |
|
|
|
|
|
|
|
|
|
SettingsForm::SettingsForm() |
|
|
|
|
: QObject() |
|
|
|
@ -9,15 +11,21 @@ SettingsForm::SettingsForm()
@@ -9,15 +11,21 @@ SettingsForm::SettingsForm()
|
|
|
|
|
main = new QWidget(), head = new QWidget(); |
|
|
|
|
QFont bold, small; |
|
|
|
|
bold.setBold(true); |
|
|
|
|
small.setPixelSize(7); |
|
|
|
|
small.setPixelSize(13); |
|
|
|
|
headLabel.setText(tr("User Settings","\"Headline\" of the window")); |
|
|
|
|
headLabel.setFont(bold); |
|
|
|
|
|
|
|
|
|
nameLabel.setText(tr("Name","Username/nick")); |
|
|
|
|
statusTextLabel.setText(tr("Status","Status message")); |
|
|
|
|
idLabel.setText("Tox ID"); |
|
|
|
|
idLabel.setText("Tox ID (click here to copy)"); |
|
|
|
|
id.setFont(small); |
|
|
|
|
id.setTextInteractionFlags(Qt::TextSelectableByMouse); |
|
|
|
|
id.setReadOnly(true); |
|
|
|
|
id.setFrameStyle(QFrame::NoFrame); |
|
|
|
|
id.setMinimumHeight(10); |
|
|
|
|
id.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); |
|
|
|
|
id.setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents); |
|
|
|
|
id.setMaximumHeight(40); |
|
|
|
|
|
|
|
|
|
videoTest.setText(tr("Test video","Text on a button to test the video/webcam")); |
|
|
|
|
enableIPv6.setText(tr("Enable IPv6 (recommended)","Text on a checkbox to enable IPv6")); |
|
|
|
@ -39,6 +47,7 @@ SettingsForm::SettingsForm()
@@ -39,6 +47,7 @@ SettingsForm::SettingsForm()
|
|
|
|
|
|
|
|
|
|
connect(&videoTest, SIGNAL(clicked()), this, SLOT(onTestVideoClicked())); |
|
|
|
|
connect(&enableIPv6, SIGNAL(stateChanged(int)), this, SLOT(onEnableIPv6Updated())); |
|
|
|
|
connect(&idLabel, SIGNAL(clicked()), this, SLOT(copyIdClicked())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SettingsForm::~SettingsForm() |
|
|
|
@ -69,3 +78,9 @@ void SettingsForm::onEnableIPv6Updated()
@@ -69,3 +78,9 @@ void SettingsForm::onEnableIPv6Updated()
|
|
|
|
|
{ |
|
|
|
|
Settings::getInstance().setEnableIPv6(enableIPv6.isChecked()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SettingsForm::copyIdClicked() |
|
|
|
|
{ |
|
|
|
|
id.selectAll();; |
|
|
|
|
QApplication::clipboard()->setText(id.toPlainText()); |
|
|
|
|
} |
|
|
|
|