2014-04-07 10:42:10 +02:00
|
|
|
/* settings.h
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Toxic All Rights Reserved.
|
|
|
|
*
|
|
|
|
* This file is part of Toxic.
|
|
|
|
*
|
|
|
|
* Toxic is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Toxic is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Toxic. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2014-09-23 03:24:45 +02:00
|
|
|
#ifndef SETTINGS_H
|
|
|
|
#define SETTINGS_H
|
2014-06-22 02:18:23 +02:00
|
|
|
|
2014-08-27 05:21:32 +02:00
|
|
|
#include <limits.h>
|
2014-08-03 07:31:33 +02:00
|
|
|
|
2015-02-26 22:51:20 +01:00
|
|
|
#include <tox/tox.h>
|
|
|
|
|
2015-02-08 13:49:05 +01:00
|
|
|
/* Represents line_* hints max strlen */
|
|
|
|
#define LINE_HINT_MAX 3
|
|
|
|
|
2016-01-19 22:45:52 +01:00
|
|
|
#define PASSWORD_EVAL_MAX 512
|
|
|
|
|
2021-12-05 23:03:42 +01:00
|
|
|
/* Holds user setting values defined in the toxic config file. */
|
2014-04-07 10:42:10 +02:00
|
|
|
struct user_settings {
|
2014-04-08 23:20:21 +02:00
|
|
|
int autolog; /* boolean */
|
2014-04-12 03:47:09 +02:00
|
|
|
int alerts; /* boolean */
|
2015-02-20 00:20:38 +01:00
|
|
|
|
2015-11-01 19:53:31 +01:00
|
|
|
/* boolean (is set to NT_BEEP or 0 after loading) */
|
2016-07-21 11:25:40 +02:00
|
|
|
int bell_on_message;
|
|
|
|
int bell_on_filetrans;
|
|
|
|
int bell_on_filetrans_accept;
|
|
|
|
int bell_on_invite;
|
2015-11-01 19:53:31 +01:00
|
|
|
|
2014-06-29 02:33:46 +02:00
|
|
|
int timestamps; /* boolean */
|
2015-02-20 00:20:38 +01:00
|
|
|
char timestamp_format[TIME_STR_SIZE];
|
|
|
|
char log_timestamp_format[TIME_STR_SIZE];
|
|
|
|
|
2014-04-08 23:20:21 +02:00
|
|
|
int colour_theme; /* boolean (0 for default toxic colours) */
|
2014-06-22 02:18:23 +02:00
|
|
|
int history_size; /* int between MIN_HISTORY and MAX_HISTORY */
|
2018-11-06 04:40:51 +01:00
|
|
|
int notification_timeout;
|
2014-07-30 02:10:28 +02:00
|
|
|
int show_typing_self; /* boolean */
|
|
|
|
int show_typing_other; /* boolean */
|
2014-09-19 07:06:18 +02:00
|
|
|
int show_welcome_msg; /* boolean */
|
2016-02-25 23:06:49 +01:00
|
|
|
int show_connection_msg; /* boolean */
|
2016-09-20 19:13:12 +02:00
|
|
|
int nodeslist_update_freq; /* int (<= 0 to disable updates) */
|
2018-10-28 21:18:17 +01:00
|
|
|
int autosave_freq; /* int (<= 0 to disable autosave) */
|
2014-07-30 02:10:28 +02:00
|
|
|
|
2015-02-08 13:49:05 +01:00
|
|
|
char line_join[LINE_HINT_MAX + 1];
|
|
|
|
char line_quit[LINE_HINT_MAX + 1];
|
|
|
|
char line_alert[LINE_HINT_MAX + 1];
|
|
|
|
char line_normal[LINE_HINT_MAX + 1];
|
2020-11-13 03:30:48 +01:00
|
|
|
char line_special[LINE_HINT_MAX + 1];
|
2015-02-08 13:49:05 +01:00
|
|
|
|
2014-08-27 05:21:32 +02:00
|
|
|
char download_path[PATH_MAX];
|
|
|
|
char chatlogs_path[PATH_MAX];
|
2014-09-26 09:10:44 +02:00
|
|
|
char avatar_path[PATH_MAX];
|
2017-05-17 02:31:23 +02:00
|
|
|
char autorun_path[PATH_MAX];
|
2016-01-19 22:45:52 +01:00
|
|
|
char password_eval[PASSWORD_EVAL_MAX];
|
2014-06-22 02:18:23 +02:00
|
|
|
|
2020-12-05 21:39:33 +01:00
|
|
|
char color_bar_bg[COLOR_STR_SIZE];
|
|
|
|
char color_bar_fg[COLOR_STR_SIZE];
|
|
|
|
char color_bar_accent[COLOR_STR_SIZE];
|
|
|
|
char color_bar_notify[COLOR_STR_SIZE];
|
|
|
|
|
2015-02-08 11:26:36 +01:00
|
|
|
int key_next_tab;
|
|
|
|
int key_prev_tab;
|
|
|
|
int key_scroll_line_up;
|
|
|
|
int key_scroll_line_down;
|
|
|
|
int key_half_page_up;
|
|
|
|
int key_half_page_down;
|
|
|
|
int key_page_bottom;
|
2014-10-08 08:56:54 +02:00
|
|
|
int key_toggle_peerlist;
|
2016-02-28 21:53:33 +01:00
|
|
|
int key_toggle_pastemode;
|
2014-09-26 09:10:44 +02:00
|
|
|
|
2015-02-26 22:51:20 +01:00
|
|
|
int mplex_away; /* boolean (1 for reaction to terminal attach/detach) */
|
2015-03-26 03:56:45 +01:00
|
|
|
char mplex_away_note [TOX_MAX_STATUS_MESSAGE_LENGTH];
|
2020-11-13 03:30:48 +01:00
|
|
|
char group_part_message[TOX_GROUP_MAX_PART_LENGTH];
|
2015-02-26 22:51:20 +01:00
|
|
|
|
2014-09-23 03:24:45 +02:00
|
|
|
#ifdef AUDIO
|
2014-07-21 01:12:13 +02:00
|
|
|
int audio_in_dev;
|
|
|
|
int audio_out_dev;
|
2020-05-07 02:00:00 +02:00
|
|
|
double VAD_threshold;
|
2020-11-18 22:29:01 +01:00
|
|
|
int conference_audio_channels;
|
|
|
|
int chat_audio_channels;
|
2020-11-18 22:57:26 +01:00
|
|
|
int push_to_talk; /* boolean */
|
2014-06-22 02:18:23 +02:00
|
|
|
#endif
|
2014-04-07 10:42:10 +02:00
|
|
|
};
|
|
|
|
|
2021-12-11 23:35:51 +01:00
|
|
|
extern struct user_settings *user_settings;
|
|
|
|
|
2018-01-20 19:30:35 +01:00
|
|
|
enum settings_values {
|
2014-04-07 10:42:10 +02:00
|
|
|
AUTOLOG_OFF = 0,
|
|
|
|
AUTOLOG_ON = 1,
|
|
|
|
|
2014-06-29 02:33:46 +02:00
|
|
|
TIMESTAMPS_OFF = 0,
|
|
|
|
TIMESTAMPS_ON = 1,
|
|
|
|
|
2014-06-29 04:05:05 +02:00
|
|
|
ALERTS_DISABLED = 0,
|
|
|
|
ALERTS_ENABLED = 1,
|
2014-04-12 03:47:09 +02:00
|
|
|
|
2014-04-07 10:42:10 +02:00
|
|
|
DFLT_COLS = 0,
|
2014-07-30 02:10:28 +02:00
|
|
|
NATIVE_COLS = 1,
|
|
|
|
|
|
|
|
SHOW_TYPING_OFF = 0,
|
|
|
|
SHOW_TYPING_ON = 1,
|
2014-06-22 02:18:23 +02:00
|
|
|
|
2014-09-19 07:06:18 +02:00
|
|
|
SHOW_WELCOME_MSG_OFF = 0,
|
|
|
|
SHOW_WELCOME_MSG_ON = 1,
|
|
|
|
|
2016-02-25 23:06:49 +01:00
|
|
|
SHOW_CONNECTION_MSG_OFF = 0,
|
|
|
|
SHOW_CONNECTION_MSG_ON = 1,
|
|
|
|
|
2014-06-22 02:18:23 +02:00
|
|
|
DFLT_HST_SIZE = 700,
|
2015-02-26 22:51:20 +01:00
|
|
|
|
|
|
|
MPLEX_OFF = 0,
|
|
|
|
MPLEX_ON = 1,
|
2018-01-20 19:30:35 +01:00
|
|
|
};
|
2014-04-07 10:42:10 +02:00
|
|
|
|
2015-02-08 13:49:05 +01:00
|
|
|
#define LINE_JOIN "-->"
|
|
|
|
#define LINE_QUIT "<--"
|
|
|
|
#define LINE_ALERT "-!-"
|
2020-11-23 00:53:32 +01:00
|
|
|
#define LINE_NORMAL "-"
|
2020-11-13 03:30:48 +01:00
|
|
|
#define LINE_SPECIAL ">"
|
2020-11-23 00:53:32 +01:00
|
|
|
#define TIMESTAMP_DEFAULT "%H:%M"
|
2015-02-20 00:20:38 +01:00
|
|
|
#define LOG_TIMESTAMP_DEFAULT "%Y/%m/%d [%H:%M:%S]"
|
2020-11-30 06:58:43 +01:00
|
|
|
#define MPLEX_AWAY_NOTE "Away from keyboard, be back soon!"
|
2015-02-08 13:49:05 +01:00
|
|
|
|
2014-07-22 00:14:06 +02:00
|
|
|
int settings_load(struct user_settings *s, const char *patharg);
|
2018-10-08 19:39:04 +02:00
|
|
|
|
|
|
|
#endif /* SETTINGS_H */
|