61 |
set->font = g_strdup ("Courier 12"); |
set->font = g_strdup ("Courier 12"); |
62 |
} |
} |
63 |
g_free (font_desc); |
g_free (font_desc); |
64 |
|
|
65 |
|
set->recent_files = MIN (set->recent_files, MAX_POSSIBLE_RECENT_FILES); |
66 |
} |
} |
67 |
|
|
68 |
t_settings init_settings (void) |
t_settings init_settings (void) |
69 |
{ |
{ |
70 |
t_settings set; |
t_settings set; |
71 |
|
|
72 |
set.recent_files = get_int_conf ("General/RecentFiles/MaxNb"); |
set.recent_files = get_int_conf2 ("General/RecentFiles/MaxNb", 5); |
|
set.recent_files = MIN (set.recent_files, MAX_POSSIBLE_RECENT_FILES); |
|
73 |
set.main_window_size_autosave = |
set.main_window_size_autosave = |
74 |
get_bool_conf ("General/Window/Autosave"); |
get_bool_conf2 ("General/Window/Autosave", TRUE); |
75 |
set.main_window_width = get_int_conf ("General/Window/Width"); |
set.main_window_width = get_int_conf2 ("General/Window/Width", 540); |
76 |
set.main_window_height = get_int_conf ("General/Window/Height"); |
set.main_window_height = get_int_conf2 ("General/Window/Height", 480); |
77 |
set.msgbar_display = get_bool_conf ("General/MsgBar/Display"); |
set.msgbar_display = get_bool_conf2 ("General/MsgBar/Display", TRUE); |
78 |
set.msgbar_interval = get_int_conf ("General/MsgBar/Interval"); |
set.msgbar_interval = get_int_conf2 ("General/MsgBar/Interval", 2000); |
79 |
set.toggle_wordwrap = get_bool_conf ("General/Editor/Wordwrap"); |
set.toggle_wordwrap = get_bool_conf2 ("General/Editor/Wordwrap", FALSE); |
80 |
set.toolbar_display = get_bool_conf ("General/ToolBar/Display"); |
set.toolbar_display = get_bool_conf2 ("General/ToolBar/Display", TRUE); |
81 |
set.max_tab_label_length = get_int_conf ("General/Tabs/LabelLength"); |
set.max_tab_label_length = get_int_conf2 ("General/Tabs/LabelLength", 12); |
82 |
set.tab_position = get_int_conf ("General/Tabs/Position"); |
set.tab_position = get_int_conf2 ("General/Tabs/Position", 1); |
83 |
set.scrollbar_position = get_int_conf ("General/ScrollBar/Position"); |
set.scrollbar_position = get_int_conf2 ("General/ScrollBar/Position", 2); |
84 |
set.complete_window_width = |
set.complete_window_width = |
85 |
get_int_conf ("General/CompletionPopUp/Width"); |
get_int_conf2 ("General/CompletionPopUp/Width", 130); |
86 |
set.complete_window_height = |
set.complete_window_height = |
87 |
get_int_conf ("General/CompletionPopUp/Height"); |
get_int_conf2 ("General/CompletionPopUp/Height", 200); |
88 |
set.backup = get_bool_conf ("General/AutoSave/Backup"); |
set.backup = get_bool_conf2 ("General/AutoSave/Backup", FALSE); |
89 |
set.backup_ext = get_string_conf ("General/AutoSave/BackupExt"); |
#ifdef G_OS_WIN32 |
90 |
set.autosave_delay = get_int_conf ("General/AutoSave/Delay"); |
set.backup_ext = get_string_conf2 ("General/AutoSave/BackupExt", ".bak"); |
91 |
set.directory = get_string_conf ("General/RecentFiles/Directory"); |
#else |
92 |
set.font = get_string_conf ("General/Editor/Font"); |
set.backup_ext = get_string_conf2 ("General/AutoSave/BackupExt", "~"); |
93 |
set.print_cmd = get_string_conf ("General/Misc/PrintCommand"); |
#endif |
94 |
set.wordfile = get_string_conf ("General/Editor/Wordfile"); |
set.autosave_delay = get_int_conf2 ("General/AutoSave/Delay", 0); |
95 |
set.bg[0] = get_int_conf ("General/Editor/BGRed"); |
set.directory = get_string_conf2 ("General/RecentFiles/Directory", ""); |
96 |
set.bg[1] = get_int_conf ("General/Editor/BGGreen"); |
set.font = get_string_conf2 ("General/Editor/Font", "Courier 12"); |
97 |
set.bg[2] = get_int_conf ("General/Editor/BGBlue"); |
#ifdef G_OS_WIN32 |
98 |
set.fg[0] = get_int_conf ("General/Editor/FGRed"); |
set.print_cmd = get_string_conf2 ("General/Misc/PrintCommand", "%s > lpt1"); |
99 |
set.fg[1] = get_int_conf ("General/Editor/FGGreen"); |
#else |
100 |
set.fg[2] = get_int_conf ("General/Editor/FGBlue"); |
set.print_cmd = get_string_conf2 ("General/Misc/PrintCommand", "lpr"); |
101 |
set.selected_bg[0] = get_int_conf ("General/Editor/SelectedBGRed"); |
#endif |
102 |
set.selected_bg[1] = get_int_conf ("General/Editor/SelectedBGGreen"); |
set.wordfile = get_string_conf2 ("General/Editor/Wordfile", ""); |
103 |
set.selected_bg[2] = get_int_conf ("General/Editor/SelectedBGBlue"); |
set.bg[0] = get_int_conf2 ("General/Editor/BGRed", 65535); |
104 |
set.selected_fg[0] = get_int_conf ("General/Editor/SelectedFGRed"); |
set.bg[1] = get_int_conf2 ("General/Editor/BGGreen", 65535); |
105 |
set.selected_fg[1] = get_int_conf ("General/Editor/SelectedFGGreen"); |
set.bg[2] = get_int_conf2 ("General/Editor/BGBlue", 65535); |
106 |
set.selected_fg[2] = get_int_conf ("General/Editor/SelectedFGBlue"); |
set.fg[0] = get_int_conf2 ("General/Editor/FGRed", 0); |
107 |
set.beep = get_bool_conf ("General/Misc/Beep"); |
set.fg[1] = get_int_conf2 ("General/Editor/FGGreen", 0); |
108 |
set.syn_high = get_bool_conf ("General/Adv/SynHigh"); |
set.fg[2] = get_int_conf2 ("General/Editor/FGBlue", 0); |
109 |
set.syn_high_depth = get_int_conf ("General/Adv/SynHighDepth"); |
set.selected_bg[0] = get_int_conf2 ("General/Editor/SelectedBGRed", 40000); |
110 |
set.auto_indent = get_bool_conf ("General/Adv/AutoIndent"); |
set.selected_bg[1] = get_int_conf2 ("General/Editor/SelectedBGGreen", 40000); |
111 |
set.auto_correct = get_bool_conf ("General/Adv/AutoCorrect"); |
set.selected_bg[2] = get_int_conf2 ("General/Editor/SelectedBGBlue", 40000); |
112 |
set.show_line_numbers = get_bool_conf2 ("General/Editor/ShowLineNumbers", TRUE); |
set.selected_fg[0] = get_int_conf2 ("General/Editor/SelectedFGRed", 65535); |
113 |
|
set.selected_fg[1] = get_int_conf2 ("General/Editor/SelectedFGGreen", 65535); |
114 |
|
set.selected_fg[2] = get_int_conf2 ("General/Editor/SelectedFGBlue", 65535); |
115 |
|
set.beep = get_bool_conf2 ("General/Misc/Beep", TRUE); |
116 |
|
set.syn_high = get_bool_conf2 ("General/Adv/SynHigh", TRUE); |
117 |
|
set.syn_high_depth = get_int_conf2 ("General/Adv/SynHighDepth", 12000); |
118 |
|
set.auto_indent = get_bool_conf2 ("General/Adv/AutoIndent", FALSE); |
119 |
|
set.auto_correct = get_bool_conf2 ("General/Adv/AutoCorrect", TRUE); |
120 |
|
set.show_line_numbers = |
121 |
|
get_bool_conf2 ("General/Editor/ShowLineNumbers", TRUE); |
122 |
set.show_margin = get_bool_conf2 ("General/Editor/ShowMargin", FALSE); |
set.show_margin = get_bool_conf2 ("General/Editor/ShowMargin", FALSE); |
123 |
|
|
124 |
normalize_settings (&set); |
normalize_settings (&set); |