Add dialog: Convert flags to bool before use, disallow dups by default

Flags are converted to bool before using them as Check state since
Eina_Bool doesn't accept values >sizeof(uchar)
This commit is contained in:
Kai Huuhko 2015-04-22 05:31:26 +03:00
parent 055a4e86a1
commit 522959b225
1 changed files with 2 additions and 1 deletions

View File

@ -143,6 +143,7 @@ class TorrentSelector(StandardWindow):
self.add_dict["flags"] = \
add_torrent_params_flags_t.flag_apply_ip_filter + \
add_torrent_params_flags_t.flag_update_subscribe + \
add_torrent_params_flags_t.flag_duplicate_is_error + \
add_torrent_params_flags_t.flag_auto_managed
def option_flag_cb(c, flag):
@ -154,7 +155,7 @@ class TorrentSelector(StandardWindow):
c = Check(
opt_box, size_hint_align=(0.0, 0.5),
text=" ".join(name.split("_")[1:]).capitalize(),
state=self.add_dict["flags"] & int(flag)
state=bool(self.add_dict["flags"] & int(flag))
)
c.callback_changed_add(option_flag_cb, int(flag))
opt_box.pack_end(c)