Commit 1eece87b authored by Edric Milaret's avatar Edric Milaret Committed by Stepan Salenikovich

settings: add general settings tab

Refs #75332
Refs #75239

Change-Id: Ib36fc74e8f41f6c9cbe204a89e644ff5427a1773
parent 303bbf14
......@@ -19,6 +19,8 @@
#include "configurationwidget.h"
#include "ui_configurationwidget.h"
#include <QMessageBox>
#include "video/devicemodel.h"
#include "video/channel.h"
#include "video/resolution.h"
......@@ -32,6 +34,8 @@
#include "protocolmodel.h"
#include "accountdetails.h"
#include "callmodel.h"
#include "ringtonemodel.h"
#include "categorizedhistorymodel.h"
#include "utils.h"
......@@ -60,6 +64,9 @@ ConfigurationWidget::ConfigurationWidget(QWidget *parent) :
ui->accountDetailLayout->addWidget(accountDetails_);
ui->accountTypeBox->setModel(accountModel_->protocolModel());
ui->startupBox->setChecked(Utils::CheckStartupLink());
ui->ringtonesBox->setModel(RingtoneModel::instance());
ui->historyDaySettingsSpinBox->setValue(CategorizedHistoryModel::instance()->historyLimit());
}
void ConfigurationWidget::atExit() {
......@@ -185,3 +192,23 @@ ConfigurationWidget::showEvent(QShowEvent* event)
Video::PreviewManager::instance()->startPreview();
}
}
void
ConfigurationWidget::on_clearHistoryButton_clicked()
{
QMessageBox confirmationDialog;
confirmationDialog.setText("Are you sure you want to clear all your history?");
confirmationDialog.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
auto ret = confirmationDialog.exec();
if (ret == QMessageBox::Ok)
CategorizedHistoryModel::instance()->clearAllCollections();
}
void
ConfigurationWidget::on_historyDaySettingsSpinBox_valueChanged(int limit)
{
if (CategorizedHistoryModel::instance()->historyLimit() != limit)
CategorizedHistoryModel::instance()->setHistoryLimit(limit);
}
......@@ -54,6 +54,8 @@ private slots:
void on_deleteAccountButton_clicked();
void on_addAccountButton_clicked();
void on_startupBox_toggled(bool checked);
void on_clearHistoryButton_clicked();
void on_historyDaySettingsSpinBox_valueChanged(int limit);
private slots:
void accountSelected(QItemSelection itemSel);
......
......@@ -25,6 +25,127 @@
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="generalTab">
<attribute name="title">
<string>General</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>History Settings</string>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Keep History for (days)</string>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QSpinBox" name="historyDaySettingsSpinBox">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>(Set to 0 for unlimited history)</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="clearHistoryButton">
<property name="text">
<string>Clear History</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Ringtones Selection</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="ringtonesBox"/>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<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>
<widget class="QWidget" name="videoTab">
<attribute name="title">
<string>Video</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment