anotherim-desktop/main/src/ui/settings_dialog.vala

31 lines
1.2 KiB
Vala
Raw Normal View History

2017-03-02 14:37:32 +00:00
using Gtk;
namespace Dino.Ui {
[GtkTemplate (ui = "/im/dino/Dino/settings_dialog.ui")]
2017-03-02 14:37:32 +00:00
class SettingsDialog : Dialog {
[GtkChild] private CheckButton typing_checkbutton;
2017-03-10 17:07:28 +00:00
[GtkChild] private CheckButton marker_checkbutton;
[GtkChild] private CheckButton notification_checkbutton;
2017-03-10 17:07:28 +00:00
[GtkChild] private CheckButton emoji_checkbutton;
2017-03-02 14:37:32 +00:00
2017-08-21 15:16:25 +00:00
Dino.Entities.Settings settings = Dino.Application.get_default().settings;
2017-03-02 14:37:32 +00:00
public SettingsDialog() {
Object(use_header_bar : Util.use_csd() ? 1 : 0);
2017-03-02 14:37:32 +00:00
typing_checkbutton.active = settings.send_typing;
marker_checkbutton.active = settings.send_marker;
notification_checkbutton.active = settings.notifications;
2017-03-02 14:37:32 +00:00
emoji_checkbutton.active = settings.convert_utf8_smileys;
typing_checkbutton.toggled.connect(() => { settings.send_typing = typing_checkbutton.active; } );
marker_checkbutton.toggled.connect(() => { settings.send_marker = marker_checkbutton.active; } );
notification_checkbutton.toggled.connect(() => { settings.notifications = notification_checkbutton.active; } );
2017-03-02 14:37:32 +00:00
emoji_checkbutton.toggled.connect(() => { settings.convert_utf8_smileys = emoji_checkbutton.active; });
}
}
2017-08-17 19:24:01 +00:00
}