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

Merge branch 'pr444'

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-10-16 18:29:12 +02:00
commit a3beb991e1
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
5 changed files with 18 additions and 6 deletions

View File

@ -23,11 +23,13 @@
#include <QMessageBox>
#include <QStyleFactory>
GeneralForm::GeneralForm() :
GeneralForm::GeneralForm(SettingsWidget *myParent) :
GenericForm(tr("General Settings"), QPixmap(":/img/settings/general.png"))
{
bodyUI = new Ui::GeneralSettings;
bodyUI->setupUi(this);
parent = myParent;
bodyUI->cbEnableIPv6->setChecked(Settings::getInstance().getEnableIPv6());
bodyUI->cbUseTranslations->setChecked(Settings::getInstance().getUseTranslations());
@ -44,6 +46,7 @@ GeneralForm::GeneralForm() :
bodyUI->styleBrowser->addItems(QStyleFactory::keys());
bodyUI->styleBrowser->addItem("None");
if(QStyleFactory::keys().contains(Settings::getInstance().getStyle()))
bodyUI->styleBrowser->setCurrentText(Settings::getInstance().getStyle());
else
@ -101,6 +104,7 @@ void GeneralForm::onStyleSelected(QString style)
{
Settings::getInstance().setStyle(style);
this->setStyle(QStyleFactory::create(style));
parent->setStyle(style);
}
void GeneralForm::onSetStatusChange()

View File

@ -18,8 +18,6 @@
#define GENERALFORM_H
#include "genericsettings.h"
#include <QComboBox>
#include <QCheckBox>
namespace Ui {
class GeneralSettings;
@ -29,7 +27,7 @@ class GeneralForm : public GenericForm
{
Q_OBJECT
public:
GeneralForm();
GeneralForm(SettingsWidget *parent);
~GeneralForm();
private slots:
@ -48,6 +46,7 @@ private slots:
private:
Ui::GeneralSettings *bodyUI;
void reloadSmiles();
SettingsWidget *parent;
};
#endif

View File

@ -52,7 +52,7 @@ SettingsWidget::SettingsWidget(QWidget* parent)
tabBar = new QTabBar;
bodyLayout->addWidget(tabBar);
GeneralForm *gfrm = new GeneralForm;
GeneralForm *gfrm = new GeneralForm(this);
ifrm = new IdentityForm;
PrivacyForm *pfrm = new PrivacyForm;
AVForm *avfrm = new AVForm;
@ -73,6 +73,12 @@ SettingsWidget::~SettingsWidget()
{
}
void SettingsWidget::setStyle(QString style)
{
body->setStyle(QStyleFactory::create(style));
head->setStyle(QStyleFactory::create(style));
}
void SettingsWidget::show(Ui::MainWindow& ui)
{
ui.mainContent->layout()->addWidget(body);

View File

@ -19,6 +19,8 @@
#include <QHBoxLayout>
#include <QPushButton>
#include <QStyleFactory>
class Camera;
class GenericForm;
class GeneralForm;
@ -40,6 +42,7 @@ public:
void show(Ui::MainWindow &ui);
IdentityForm *getIdentityForm() {return ifrm;}
void setStyle(QString style);
private slots:
void onTabChanged(int);

View File

@ -113,7 +113,7 @@ Widget::Widget(QWidget *parent)
ui->statusButton->setProperty("status", "offline");
Style::repolish(ui->statusButton);
settingsWidget = new SettingsWidget();
settingsWidget = new SettingsWidget(this);
// Disable some widgets until we're connected to the DHT
ui->statusButton->setEnabled(false);