Browse Source

Move "Make Tox portable" to advanced settings tab

pull/1035/head
Dubslow 11 years ago
parent
commit
0428b5c87a
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA
  1. 7
      src/widget/form/settings/advancedform.cpp
  2. 1
      src/widget/form/settings/advancedform.h
  3. 10
      src/widget/form/settings/advancedsettings.ui
  4. 7
      src/widget/form/settings/generalform.cpp
  5. 1
      src/widget/form/settings/generalform.h
  6. 10
      src/widget/form/settings/generalsettings.ui

7
src/widget/form/settings/advancedform.cpp

@ -30,6 +30,7 @@ AdvancedForm::AdvancedForm() : @@ -30,6 +30,7 @@ AdvancedForm::AdvancedForm() :
bodyUI->dbLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
bodyUI->dbLabel->setOpenExternalLinks(true);
bodyUI->cbMakeToxPortable->setChecked(Settings::getInstance().getMakeToxPortable());
bodyUI->syncTypeComboBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
bodyUI->syncTypeComboBox->addItems({tr("FULL - very safe, slowest (recommended)"),
tr("NORMAL - almost as safe as FULL, about 20% faster than FULL"),
@ -38,6 +39,7 @@ AdvancedForm::AdvancedForm() : @@ -38,6 +39,7 @@ AdvancedForm::AdvancedForm() :
int index = 2 - static_cast<int>(Settings::getInstance().getDbSyncType());
bodyUI->syncTypeComboBox->setCurrentIndex(index);
connect(bodyUI->cbMakeToxPortable, &QCheckBox::stateChanged, this, &AdvancedForm::onMakeToxPortableUpdated);
connect(bodyUI->syncTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onDbSyncTypeUpdated()));
connect(bodyUI->resetButton, SIGNAL(clicked()), this, SLOT(resetToDefault()));
}
@ -47,6 +49,11 @@ AdvancedForm::~AdvancedForm() @@ -47,6 +49,11 @@ AdvancedForm::~AdvancedForm()
delete bodyUI;
}
void AdvancedForm::onMakeToxPortableUpdated()
{
Settings::getInstance().setMakeToxPortable(bodyUI->cbMakeToxPortable->isChecked());
}
void AdvancedForm::onDbSyncTypeUpdated()
{
int index = 2 - bodyUI->syncTypeComboBox->currentIndex();

1
src/widget/form/settings/advancedform.h

@ -33,6 +33,7 @@ public: @@ -33,6 +33,7 @@ public:
virtual ~AdvancedForm();
private slots:
void onMakeToxPortableUpdated();
void onDbSyncTypeUpdated();
void resetToDefault();

10
src/widget/form/settings/advancedsettings.ui

@ -29,6 +29,16 @@ @@ -29,6 +29,16 @@
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="cbMakeToxPortable">
<property name="toolTip">
<string extracomment="describes makeToxPortable checkbox">Save settings to the working directory instead of the usual conf dir</string>
</property>
<property name="text">
<string>Make Tox portable</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="warningLabel">
<property name="text">

7
src/widget/form/settings/generalform.cpp

@ -50,7 +50,6 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) : @@ -50,7 +50,6 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
for (int i = 0; i < langs.size(); i++)
bodyUI->transComboBox->insertItem(i, langs[i]);
bodyUI->transComboBox->setCurrentIndex(locales.indexOf(Settings::getInstance().getTranslation()));
bodyUI->cbMakeToxPortable->setChecked(Settings::getInstance().getMakeToxPortable());
bool showSystemTray = Settings::getInstance().getShowSystemTray();
@ -119,7 +118,6 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) : @@ -119,7 +118,6 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
//general
connect(bodyUI->checkUpdates, &QCheckBox::stateChanged, this, &GeneralForm::onCheckUpdateChanged);
connect(bodyUI->transComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onTranslationUpdated()));
connect(bodyUI->cbMakeToxPortable, &QCheckBox::stateChanged, this, &GeneralForm::onMakeToxPortableUpdated);
connect(bodyUI->showSystemTray, &QCheckBox::stateChanged, this, &GeneralForm::onSetShowSystemTray);
connect(bodyUI->startInTray, &QCheckBox::stateChanged, this, &GeneralForm::onSetAutostartInTray);
connect(bodyUI->closeToTray, &QCheckBox::stateChanged, this, &GeneralForm::onSetCloseToTray);
@ -172,11 +170,6 @@ void GeneralForm::onTranslationUpdated() @@ -172,11 +170,6 @@ void GeneralForm::onTranslationUpdated()
Widget::getInstance()->setTranslation();
}
void GeneralForm::onMakeToxPortableUpdated()
{
Settings::getInstance().setMakeToxPortable(bodyUI->cbMakeToxPortable->isChecked());
}
void GeneralForm::onSetShowSystemTray()
{
Settings::getInstance().setShowSystemTray(bodyUI->showSystemTray->isChecked());

1
src/widget/form/settings/generalform.h

@ -33,7 +33,6 @@ public: @@ -33,7 +33,6 @@ public:
private slots:
void onEnableIPv6Updated();
void onTranslationUpdated();
void onMakeToxPortableUpdated();
void onSetShowSystemTray();
void onSetAutostartInTray();
void onSetCloseToTray();

10
src/widget/form/settings/generalsettings.ui

@ -81,16 +81,6 @@ @@ -81,16 +81,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbMakeToxPortable">
<property name="toolTip">
<string extracomment="describes makeToxPortable checkbox">Save settings to the working directory instead of the usual conf dir</string>
</property>
<property name="text">
<string>Make Tox portable</string>
</property>
</widget>
</item>
<item>
<spacer name="generalSpacer">
<property name="orientation">

Loading…
Cancel
Save