#include "../include/optionssetup.h"\r
#include "../include/db/sqlite3db.h"\r
+#include "../include/global.h"\r
\r
#include <Poco/Message.h>\r
\r
#include <string>\r
#include <sstream>\r
\r
-void SetupDefaultOptions()\r
+void SetupDefaultOptions(SQLite3DB::DB *db)\r
{\r
// OptionValue should always be inserted as a string, even if the option really isn't a string - just to keep the field data type consistent\r
\r
+ db->Execute("BEGIN;");\r
+\r
std::ostringstream tempstr; // must set tempstr to "" between db inserts\r
- SQLite3DB::DB *db=SQLite3DB::DB::Instance();\r
SQLite3DB::Statement st=db->Prepare("INSERT INTO tblOption(Option,OptionValue) VALUES(?,?);");\r
- SQLite3DB::Statement upd=db->Prepare("UPDATE tblOption SET Section=?, SortOrder=?, ValidValues=?, OptionDescription=? WHERE Option=?;");\r
+ SQLite3DB::Statement upd=db->Prepare("UPDATE tblOption SET Section=?, SortOrder=?, ValidValues=?, OptionDescription=?, DisplayType=?, DisplayParam1=?, DisplayParam2=?, Mode=? WHERE Option=?;");\r
int order=0;\r
\r
// LogLevel\r
upd.Bind(1,order++);\r
upd.Bind(2,"1|1 - Fatal Errors|2|2 - Critical Errors|3|3 - Errors|4|4 - Warnings|5|5 - Notices|6|6 - Informational Messages|7|7 - Debug Messages|8|8 - Trace Messages");\r
upd.Bind(3,"The maximum logging level that will be written to file. Higher levels will include all messages from the previous levels.");\r
- upd.Bind(4,"LogLevel");\r
+ upd.Bind(4,"select");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"LogLevel");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2,"true|true|false|false");\r
upd.Bind(3,"VACUUM the database every time FMS starts. This will defragment the free space in the database and create a smaller database file. Vacuuming the database can be CPU and disk intensive.");\r
- upd.Bind(4,"VacuumOnStartup");\r
+ upd.Bind(4,"select");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"VacuumOnStartup");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"A unique string shared by all clients who want to communicate with each other. This should not be changed unless you want to create your own separate communications network.");\r
- upd.Bind(4,"MessageBase");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"advanced");\r
+ upd.Bind(8,"MessageBase");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"The USK key which contains information about the latest version of FMS.");\r
- upd.Bind(4,"FMSVersionKey");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5,"80");\r
+ upd.Bind(6);\r
+ upd.Bind(7,"advanced");\r
+ upd.Bind(8,"FMSVersionKey");\r
upd.Step();\r
upd.Reset();\r
\r
st.Bind(0,"FMSVersionEdition");\r
- st.Bind(1,"15");\r
+ st.Bind(1,FMS_VERSION_EDITION);\r
st.Step();\r
st.Reset();\r
upd.Bind(0,"Program");\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"The latest found edition of the FMS version USK.");\r
- upd.Bind(4,"FMSVersionEdition");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"advanced");\r
+ upd.Bind(8,"FMSVersionEdition");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2,"true|true|false|false");\r
upd.Bind(3,"Start NNTP server.");\r
- upd.Bind(4,"StartNNTP");\r
+ upd.Bind(4,"select");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"StartNNTP");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"The port that the NNTP service will listen for incoming connections.");\r
- upd.Bind(4,"NNTPListenPort");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"NNTPListenPort");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"A comma separated list of valid IPv4 or IPv6 addresses/hostnames that the NNTP service will try to bind to.");\r
- upd.Bind(4,"NNTPBindAddresses");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"NNTPBindAddresses");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2,"true|true|false|false");\r
upd.Bind(3,"Allow posting messages from NNTP. Setting to false will make the newsgroups read only.");\r
- upd.Bind(4,"NNTPAllowPost");\r
+ upd.Bind(4,"select");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"NNTPAllowPost");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2,"true|true|false|false");\r
upd.Bind(3,"Start HTTP server. WARNING: If you turn this off, you won't be able to access the administration pages.");\r
- upd.Bind(4,"StartHTTP");\r
+ upd.Bind(4,"select");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"StartHTTP");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Port HTTP server will listen on.");\r
- upd.Bind(4,"HTTPListenPort");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"HTTPListenPort");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Comma separated list of addresses and/or subnet masks that are allowed access to the administration pages. Default is localhost only. + allows a host, - denies a host.");\r
- upd.Bind(4,"HTTPAccessControl");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"HTTPAccessControl");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2,"true|true|false|false");\r
upd.Bind(3,"Set to true to start the Freenet Updater thread and connect to Freenet. Set to false to prevent communication with Freenet.");\r
- upd.Bind(4,"StartFreenetUpdater");\r
+ upd.Bind(4,"select");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"StartFreenetUpdater");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Host name or address of Freenet node.");\r
- upd.Bind(4,"FCPHost");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"FCPHost");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"The port that Freenet is listening for FCP connections on.");\r
- upd.Bind(4,"FCPPort");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"FCPPort");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"The port that Freenet is listening for http connections on.");\r
- upd.Bind(4,"FProxyPort");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"FProxyPort");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Maximum number of concurrent requests for new Identity xml files");\r
- upd.Bind(4,"MaxIdentityRequests");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"advanced");\r
+ upd.Bind(8,"MaxIdentityRequests");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Maximum number of concurrent identities requesting IdentityIntroduction xml files. Each identity may have multiple requests pending.");\r
- upd.Bind(4,"MaxIdentityIntroductionRequests");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"advanced");\r
+ upd.Bind(8,"MaxIdentityIntroductionRequests");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Maximum number of concurrent requests for new IntroductionPuzzle xml files");\r
- upd.Bind(4,"MaxIntroductionPuzzleRequests");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"advanced");\r
+ upd.Bind(8,"MaxIntroductionPuzzleRequests");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Maximum number of concurrent requests for new Trust Lists");\r
- upd.Bind(4,"MaxTrustListRequests");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"advanced");\r
+ upd.Bind(8,"MaxTrustListRequests");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Maximum number of concurrent requests for new Message Lists");\r
- upd.Bind(4,"MaxMessageListRequests");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"advanced");\r
+ upd.Bind(8,"MaxMessageListRequests");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Maximum number of concurrent requests for new Messages");\r
- upd.Bind(4,"MaxMessageRequests");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"advanced");\r
+ upd.Bind(8,"MaxMessageRequests");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"The maximum number of concurrent requests for new Board Lists. Set to 0 to disable.");\r
- upd.Bind(4,"MaxBoardListRequests");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"advanced");\r
+ upd.Bind(8,"MaxBoardListRequests");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Specifies a local message trust level that a peer must have before its messages will be downloaded.");\r
- upd.Bind(4,"MinLocalMessageTrust");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"MinLocalMessageTrust");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Specifies a peer message trust level that a peer must have before its messages will be downloaded.");\r
- upd.Bind(4,"MinPeerMessageTrust");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"MinPeerMessageTrust");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Specifies a local trust list trust level that a peer must have before its trust list will be included in the weighted average. Any peers below this number will be excluded from the results.");\r
- upd.Bind(4,"MinLocalTrustListTrust");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"MinLocalTrustListTrust");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Specifies a peer trust list trust level that a peer must have before its trust list will be included in the weighted average. Any peers below this number will be excluded from the results.");\r
- upd.Bind(4,"MinPeerTrustListTrust");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"MinPeerTrustListTrust");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2,"true|true|false|false");\r
upd.Bind(3,"Set to true if you want your local trust levels to override the peer levels when determining which identities you will poll.");\r
- upd.Bind(4,"LocalTrustOverridesPeerTrust");\r
+ upd.Bind(4,"select");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"LocalTrustOverridesPeerTrust");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"The maximum number of days backward that messages will be downloaded from each identity");\r
- upd.Bind(4,"MessageDownloadMaxDaysBackward");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"MessageDownloadMaxDaysBackward");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"The number of days backward that messages you have inserted will appear in your MessageLists");\r
- upd.Bind(4,"MessageListDaysBackward");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"MessageListDaysBackward");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"The maximum number of messages you will download from each peer on a given day.");\r
- upd.Bind(4,"MaxPeerMessagesPerDay");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"MaxPeerMessagesPerDay");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"The maximum number of boards a received message may be sent to. Boards over this limit will be ignored.");\r
- upd.Bind(4,"MaxBoardsPerMessage");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"MaxBoardsPerMessage");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2,"true|true|false|false");\r
upd.Bind(3,"Set to true to automatically save messages posted to new boards. Set to false to ignore messages to new boards.");\r
- upd.Bind(4,"SaveMessagesFromNewBoards");\r
+ upd.Bind(4,"select");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"SaveMessagesFromNewBoards");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"How much the local message trust level of an identity should change when you reply to one of their messages.");\r
- upd.Bind(4,"ChangeMessageTrustOnReply");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"ChangeMessageTrustOnReply");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2,"true|true|false|false");\r
upd.Bind(3,"Set to true to automatically create new identities when you send a message using a new name. If you set this to false, posting messages will fail until you manually create the identity.");\r
- upd.Bind(4,"AddNewPostFromIdentities");\r
+ upd.Bind(4,"select");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"AddNewPostFromIdentities");\r
upd.Step();\r
upd.Reset();\r
\r
upd.Bind(1,order++);\r
upd.Bind(2);\r
upd.Bind(3,"Automatically delete messages older than this many days.");\r
- upd.Bind(4,"DeleteMessagesOlderThan");\r
+ upd.Bind(4,"textbox");\r
+ upd.Bind(5);\r
+ upd.Bind(6);\r
+ upd.Bind(7,"simple");\r
+ upd.Bind(8,"DeleteMessagesOlderThan");\r
upd.Step();\r
upd.Reset();\r
\r
+ db->Execute("COMMIT;");\r
+\r
}\r