2017-03-02 14:37:32 +00:00
|
|
|
using Gtk;
|
|
|
|
|
|
|
|
namespace Dino.Ui {
|
|
|
|
|
2017-12-03 18:42:15 +00:00
|
|
|
[GtkTemplate (ui = "/im/dino/Dino/settings_dialog.ui")]
|
2017-03-02 14:37:32 +00:00
|
|
|
class SettingsDialog : Dialog {
|
|
|
|
|
2017-05-30 20:31:05 +00:00
|
|
|
[GtkChild] private CheckButton typing_checkbutton;
|
2017-03-10 17:07:28 +00:00
|
|
|
[GtkChild] private CheckButton marker_checkbutton;
|
2017-05-30 20:31:05 +00:00
|
|
|
[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() {
|
2019-02-20 22:08:30 +00:00
|
|
|
Object(use_header_bar : Util.use_csd() ? 1 : 0);
|
2017-03-02 14:37:32 +00:00
|
|
|
|
2017-05-30 20:31:05 +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;
|
|
|
|
|
2017-05-30 20:31:05 +00:00
|
|
|
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
|
|
|
}
|