diff options
author | Kostyantyn Ovechko <fastinetserver@gmail.com> | 2010-07-17 13:33:27 +0300 |
---|---|---|
committer | Kostyantyn Ovechko <fastinetserver@gmail.com> | 2010-07-17 13:33:27 +0300 |
commit | 2ea25367f590f4e3698cb1e224953bf450cf4307 (patch) | |
tree | b73087ecea2a9976e7330f769588e5ba68e31f96 /tuiclient/settings.cpp | |
parent | Add section [network_proxy_fetcher] (diff) | |
download | idfetch-2ea25367f590f4e3698cb1e224953bf450cf4307.tar.gz idfetch-2ea25367f590f4e3698cb1e224953bf450cf4307.tar.bz2 idfetch-2ea25367f590f4e3698cb1e224953bf450cf4307.zip |
Add options from tuiclient.conf file
[ui_server]
tuiclient monitors segget's activity by establishing tcp connection
with segget daemon (ui_server part of it).
UI_IP
Define an ip address segget uses to provide access for tuiclients.
The parameter should be a string holding your host dotted IP address.
Default:
ui_ip=127.0.0.1
UI_PORT
Define a port segget uses to provide access for tuiclients.
The parameter should be an integer.
Minimum value: 1
Maximum value: 65535
Default:
ui_port=9999
[logs]
LOGS_DIR
Define a dir to store log files.
Default:
logs_dir=./logs
GENERAL_LOG_FILE
Define a file name to store general log.
Default:
general_log_file=tuiclient.log
ERROR_LOG_FILE
Define a file name to store error log.
Default:
error_log_file=segget.log
DEBUG_LOG_FILE
Define a file name to store debug log.
Default:
debug_log_file=segget.log
Diffstat (limited to 'tuiclient/settings.cpp')
-rw-r--r-- | tuiclient/settings.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tuiclient/settings.cpp b/tuiclient/settings.cpp new file mode 100644 index 0000000..5ec2453 --- /dev/null +++ b/tuiclient/settings.cpp @@ -0,0 +1,46 @@ +/* +* Copyright (C) 2010 Robin H.Johnson, Ovechko Kostyantyn <fastinetserver@gmail.com>. +* +* Project: IDFetch. +* Developer: Ovechko Kostyantyn Olexandrovich (Kharkiv State Technical University of Construction and Architecture, Ukraine). +* Mentor: Robin H. Johnson (Gentoo Linux: Developer, Trustee & Infrastructure Lead). +* Mentoring organization: Gentoo Linux. +* Sponsored by GSOC 2010. +* +* This file is part of Segget. +* +* Segget is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* Segget 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 +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with Segget; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "settings.h" + +Tsettings settings; + +void Tsettings::init(){ + try{ + Tconfig conf("tuiclient.conf"); + conf.set("logs","general_log_file",general_log_file); + conf.set("logs","logs_dir",logs_dir); + conf.set("logs","error_log_file",error_log_file); + conf.set("logs","debug_log_file",debug_log_file); + + conf.set("ui_server","ui_ip",ui_ip); + conf.set("ui_server","ui_port",ui_port,1,65535); + + conf.clear(); + }catch(...){ +// error_log_no_msg("Error in settings.cpp: init()"); + } +}
\ No newline at end of file |