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:
commit
a3beb991e1
|
@ -23,12 +23,14 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QStyleFactory>
|
#include <QStyleFactory>
|
||||||
|
|
||||||
GeneralForm::GeneralForm() :
|
GeneralForm::GeneralForm(SettingsWidget *myParent) :
|
||||||
GenericForm(tr("General Settings"), QPixmap(":/img/settings/general.png"))
|
GenericForm(tr("General Settings"), QPixmap(":/img/settings/general.png"))
|
||||||
{
|
{
|
||||||
bodyUI = new Ui::GeneralSettings;
|
bodyUI = new Ui::GeneralSettings;
|
||||||
bodyUI->setupUi(this);
|
bodyUI->setupUi(this);
|
||||||
|
|
||||||
|
parent = myParent;
|
||||||
|
|
||||||
bodyUI->cbEnableIPv6->setChecked(Settings::getInstance().getEnableIPv6());
|
bodyUI->cbEnableIPv6->setChecked(Settings::getInstance().getEnableIPv6());
|
||||||
bodyUI->cbUseTranslations->setChecked(Settings::getInstance().getUseTranslations());
|
bodyUI->cbUseTranslations->setChecked(Settings::getInstance().getUseTranslations());
|
||||||
bodyUI->cbMakeToxPortable->setChecked(Settings::getInstance().getMakeToxPortable());
|
bodyUI->cbMakeToxPortable->setChecked(Settings::getInstance().getMakeToxPortable());
|
||||||
|
@ -44,6 +46,7 @@ GeneralForm::GeneralForm() :
|
||||||
|
|
||||||
bodyUI->styleBrowser->addItems(QStyleFactory::keys());
|
bodyUI->styleBrowser->addItems(QStyleFactory::keys());
|
||||||
bodyUI->styleBrowser->addItem("None");
|
bodyUI->styleBrowser->addItem("None");
|
||||||
|
|
||||||
if(QStyleFactory::keys().contains(Settings::getInstance().getStyle()))
|
if(QStyleFactory::keys().contains(Settings::getInstance().getStyle()))
|
||||||
bodyUI->styleBrowser->setCurrentText(Settings::getInstance().getStyle());
|
bodyUI->styleBrowser->setCurrentText(Settings::getInstance().getStyle());
|
||||||
else
|
else
|
||||||
|
@ -101,6 +104,7 @@ void GeneralForm::onStyleSelected(QString style)
|
||||||
{
|
{
|
||||||
Settings::getInstance().setStyle(style);
|
Settings::getInstance().setStyle(style);
|
||||||
this->setStyle(QStyleFactory::create(style));
|
this->setStyle(QStyleFactory::create(style));
|
||||||
|
parent->setStyle(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralForm::onSetStatusChange()
|
void GeneralForm::onSetStatusChange()
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
#define GENERALFORM_H
|
#define GENERALFORM_H
|
||||||
|
|
||||||
#include "genericsettings.h"
|
#include "genericsettings.h"
|
||||||
#include <QComboBox>
|
|
||||||
#include <QCheckBox>
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class GeneralSettings;
|
class GeneralSettings;
|
||||||
|
@ -29,7 +27,7 @@ class GeneralForm : public GenericForm
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
GeneralForm();
|
GeneralForm(SettingsWidget *parent);
|
||||||
~GeneralForm();
|
~GeneralForm();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -48,6 +46,7 @@ private slots:
|
||||||
private:
|
private:
|
||||||
Ui::GeneralSettings *bodyUI;
|
Ui::GeneralSettings *bodyUI;
|
||||||
void reloadSmiles();
|
void reloadSmiles();
|
||||||
|
SettingsWidget *parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -52,7 +52,7 @@ SettingsWidget::SettingsWidget(QWidget* parent)
|
||||||
tabBar = new QTabBar;
|
tabBar = new QTabBar;
|
||||||
bodyLayout->addWidget(tabBar);
|
bodyLayout->addWidget(tabBar);
|
||||||
|
|
||||||
GeneralForm *gfrm = new GeneralForm;
|
GeneralForm *gfrm = new GeneralForm(this);
|
||||||
ifrm = new IdentityForm;
|
ifrm = new IdentityForm;
|
||||||
PrivacyForm *pfrm = new PrivacyForm;
|
PrivacyForm *pfrm = new PrivacyForm;
|
||||||
AVForm *avfrm = new AVForm;
|
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)
|
void SettingsWidget::show(Ui::MainWindow& ui)
|
||||||
{
|
{
|
||||||
ui.mainContent->layout()->addWidget(body);
|
ui.mainContent->layout()->addWidget(body);
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QStyleFactory>
|
||||||
|
|
||||||
class Camera;
|
class Camera;
|
||||||
class GenericForm;
|
class GenericForm;
|
||||||
class GeneralForm;
|
class GeneralForm;
|
||||||
|
@ -40,6 +42,7 @@ public:
|
||||||
|
|
||||||
void show(Ui::MainWindow &ui);
|
void show(Ui::MainWindow &ui);
|
||||||
IdentityForm *getIdentityForm() {return ifrm;}
|
IdentityForm *getIdentityForm() {return ifrm;}
|
||||||
|
void setStyle(QString style);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onTabChanged(int);
|
void onTabChanged(int);
|
||||||
|
|
|
@ -113,7 +113,7 @@ Widget::Widget(QWidget *parent)
|
||||||
ui->statusButton->setProperty("status", "offline");
|
ui->statusButton->setProperty("status", "offline");
|
||||||
Style::repolish(ui->statusButton);
|
Style::repolish(ui->statusButton);
|
||||||
|
|
||||||
settingsWidget = new SettingsWidget();
|
settingsWidget = new SettingsWidget(this);
|
||||||
|
|
||||||
// Disable some widgets until we're connected to the DHT
|
// Disable some widgets until we're connected to the DHT
|
||||||
ui->statusButton->setEnabled(false);
|
ui->statusButton->setEnabled(false);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user