@ -18,7 +18,6 @@ void Settings::save() {
s . setValue ( " log_size " , can_msg_log_size ) ;
s . setValue ( " log_size " , can_msg_log_size ) ;
s . setValue ( " cached_segment " , cached_segment_limit ) ;
s . setValue ( " cached_segment " , cached_segment_limit ) ;
s . setValue ( " chart_height " , chart_height ) ;
s . setValue ( " chart_height " , chart_height ) ;
s . setValue ( " chart_theme " , chart_theme ) ;
s . setValue ( " max_chart_x_range " , max_chart_x_range ) ;
s . setValue ( " max_chart_x_range " , max_chart_x_range ) ;
s . setValue ( " last_dir " , last_dir ) ;
s . setValue ( " last_dir " , last_dir ) ;
s . setValue ( " splitter_state " , splitter_state ) ;
s . setValue ( " splitter_state " , splitter_state ) ;
@ -30,7 +29,6 @@ void Settings::load() {
can_msg_log_size = s . value ( " log_size " , 50 ) . toInt ( ) ;
can_msg_log_size = s . value ( " log_size " , 50 ) . toInt ( ) ;
cached_segment_limit = s . value ( " cached_segment " , 3 ) . toInt ( ) ;
cached_segment_limit = s . value ( " cached_segment " , 3 ) . toInt ( ) ;
chart_height = s . value ( " chart_height " , 200 ) . toInt ( ) ;
chart_height = s . value ( " chart_height " , 200 ) . toInt ( ) ;
chart_theme = s . value ( " chart_theme " , 0 ) . toInt ( ) ;
max_chart_x_range = s . value ( " max_chart_x_range " , 3 * 60 ) . toInt ( ) ;
max_chart_x_range = s . value ( " max_chart_x_range " , 3 * 60 ) . toInt ( ) ;
last_dir = s . value ( " last_dir " , QDir : : homePath ( ) ) . toString ( ) ;
last_dir = s . value ( " last_dir " , QDir : : homePath ( ) ) . toString ( ) ;
splitter_state = s . value ( " splitter_state " ) . toByteArray ( ) ;
splitter_state = s . value ( " splitter_state " ) . toByteArray ( ) ;
@ -72,11 +70,6 @@ SettingsDlg::SettingsDlg(QWidget *parent) : QDialog(parent) {
chart_height - > setValue ( settings . chart_height ) ;
chart_height - > setValue ( settings . chart_height ) ;
form_layout - > addRow ( tr ( " Chart height " ) , chart_height ) ;
form_layout - > addRow ( tr ( " Chart height " ) , chart_height ) ;
chart_theme = new QComboBox ( ) ;
chart_theme - > addItems ( { " Light " , " Dark " } ) ;
chart_theme - > setCurrentIndex ( settings . chart_theme = = 1 ? 1 : 0 ) ;
form_layout - > addRow ( tr ( " Chart theme " ) , chart_theme ) ;
auto buttonBox = new QDialogButtonBox ( QDialogButtonBox : : Ok | QDialogButtonBox : : Cancel ) ;
auto buttonBox = new QDialogButtonBox ( QDialogButtonBox : : Ok | QDialogButtonBox : : Cancel ) ;
form_layout - > addRow ( buttonBox ) ;
form_layout - > addRow ( buttonBox ) ;
@ -90,7 +83,6 @@ void SettingsDlg::save() {
settings . can_msg_log_size = log_size - > value ( ) ;
settings . can_msg_log_size = log_size - > value ( ) ;
settings . cached_segment_limit = cached_segment - > value ( ) ;
settings . cached_segment_limit = cached_segment - > value ( ) ;
settings . chart_height = chart_height - > value ( ) ;
settings . chart_height = chart_height - > value ( ) ;
settings . chart_theme = chart_theme - > currentIndex ( ) ;
settings . max_chart_x_range = max_chart_x_range - > value ( ) * 60 ;
settings . max_chart_x_range = max_chart_x_range - > value ( ) * 60 ;
settings . save ( ) ;
settings . save ( ) ;
accept ( ) ;
accept ( ) ;