Commit 44cb3e3cf0
Unsigned
Layout: unified · split
src/config.rs +4 −4
| @@ -26,7 +26,7 @@ use weechat::{ | |||
| 26 | config, | 26 | config, |
| 27 | config::{ | 27 | config::{ |
| 28 | Conf, ConfigOption, ConfigSection, ConfigSectionSettings, | 28 | Conf, ConfigOption, ConfigSection, ConfigSectionSettings, |
| 29 | IntegerOptionSettings, OptionChanged, SectionReadCallback, | 29 | EnumOptionSettings, OptionChanged, SectionReadCallback, |
| 30 | }, | 30 | }, |
| 31 | Weechat, | 31 | Weechat, |
| 32 | }; | 32 | }; |
| @@ -194,7 +194,7 @@ impl ConfigHandle { | |||
| 194 | 194 | ||
| 195 | let servers = servers.clone(); | 195 | let servers = servers.clone(); |
| 196 | 196 | ||
| 197 | let settings = IntegerOptionSettings::new("server_buffer") | 197 | let settings = EnumOptionSettings::new("server_buffer") |
| 198 | .description("Should the server buffer be merged with other buffers or independent") | 198 | .description("Should the server buffer be merged with other buffers or independent") |
| 199 | .set_change_callback(move |_, _| { | 199 | .set_change_callback(move |_, _| { |
| 200 | for server in servers.borrow().values() { | 200 | for server in servers.borrow().values() { |
| @@ -210,7 +210,7 @@ impl ConfigHandle { | |||
| 210 | ); | 210 | ); |
| 211 | 211 | ||
| 212 | look_section | 212 | look_section |
| 213 | .new_integer_option(settings) | 213 | .new_enum_option(settings) |
| 214 | .expect("Can't create server buffers option"); | 214 | .expect("Can't create server buffers option"); |
| 215 | } | 215 | } |
| 216 | 216 | ||
| @@ -228,7 +228,7 @@ impl ConfigHandle { | |||
| 228 | 228 | ||
| 229 | impl<'a> LookSection<'a> { | 229 | impl<'a> LookSection<'a> { |
| 230 | pub fn server_buffer(&self) -> ServerBuffer { | 230 | pub fn server_buffer(&self) -> ServerBuffer { |
| 231 | if let ConfigOption::Integer(o) = | 231 | if let ConfigOption::Enum(o) = |
| 232 | self.search_option("server_buffer").unwrap() | 232 | self.search_option("server_buffer").unwrap() |
| 233 | { | 233 | { |
| 234 | ServerBuffer::from(o.value()) | 234 | ServerBuffer::from(o.value()) |