aboutsummaryrefslogtreecommitdiff
path: root/main/src/view_model
diff options
context:
space:
mode:
authorMiquel Lionel <lionel@les-miquelots.net>2023-10-30 21:48:08 +0100
committerMiquel Lionel <lionel@les-miquelots.net>2023-10-30 21:48:08 +0100
commitd761e8ccd5293d2f30a889b0cbe302c985aee68c (patch)
tree922bb248a7fee4cdff3da114abc7d77200f3d0da /main/src/view_model
parent302e954c99c71d670201828c6746dfaa40276d6d (diff)
parent3de716446819550514d50a8112f5b6dd0c662702 (diff)
downloaddino-d761e8ccd5293d2f30a889b0cbe302c985aee68c.tar.gz
dino-d761e8ccd5293d2f30a889b0cbe302c985aee68c.zip
Show which account is currently used in conversation details in the about sectionadd_conversation_account_indicator
Diffstat (limited to 'main/src/view_model')
-rw-r--r--main/src/view_model/conversation_details.vala49
-rw-r--r--main/src/view_model/preferences_row.vala34
2 files changed, 83 insertions, 0 deletions
diff --git a/main/src/view_model/conversation_details.vala b/main/src/view_model/conversation_details.vala
new file mode 100644
index 00000000..15bf7535
--- /dev/null
+++ b/main/src/view_model/conversation_details.vala
@@ -0,0 +1,49 @@
+using Dino.Entities;
+using Xmpp;
+using Xmpp.Xep;
+using Gee;
+using Gtk;
+
+public class Dino.Ui.ViewModel.ConversationDetails : Object {
+ public signal void pin_changed();
+ public signal void block_changed();
+ public signal void notification_flipped();
+ public signal void notification_changed(NotificationSetting setting);
+
+ public enum NotificationOptions {
+ ON_OFF,
+ ON_HIGHLIGHT_OFF
+ }
+
+ public enum NotificationSetting {
+ DEFAULT,
+ ON,
+ HIGHLIGHT,
+ OFF
+ }
+
+ public ViewModel.CompatAvatarPictureModel avatar { get; set; }
+ public string name { get; set; }
+ public bool pinned { get; set; }
+
+ public NotificationSetting notification { get; set; }
+ public NotificationOptions notification_options { get; set; }
+ public bool notification_is_default { get; set; }
+
+ public bool show_blocked { get; set; }
+ public bool blocked { get; set; }
+
+ public GLib.ListStore preferences_rows = new GLib.ListStore(typeof(PreferencesRow.Any));
+ public GLib.ListStore about_rows = new GLib.ListStore(typeof(PreferencesRow.Any));
+ public GLib.ListStore encryption_rows = new GLib.ListStore(typeof(PreferencesRow.Any));
+ public GLib.ListStore settings_rows = new GLib.ListStore(typeof(PreferencesRow.Any));
+ public GLib.ListStore room_configuration_rows { get; set; }
+}
+
+public class Dino.Ui.Model.ConversationDetails : Object {
+ public Conversation conversation { get; set; }
+ public Dino.Model.ConversationDisplayName display_name { get; set; }
+ public DataForms.DataForm? data_form { get; set; }
+ public string? data_form_bak;
+ public bool blocked { get; set; }
+} \ No newline at end of file
diff --git a/main/src/view_model/preferences_row.vala b/main/src/view_model/preferences_row.vala
new file mode 100644
index 00000000..3a04ee1e
--- /dev/null
+++ b/main/src/view_model/preferences_row.vala
@@ -0,0 +1,34 @@
+using Dino.Entities;
+using Xmpp;
+using Xmpp.Xep;
+using Gee;
+using Gtk;
+
+namespace Dino.Ui.ViewModel.PreferencesRow {
+ public abstract class Any : Object {
+ public string title { get; set; }
+ }
+
+ public class Text : Any {
+ public string text { get; set; }
+ }
+
+ public class Entry : Any {
+ public signal void changed();
+ public string text { get; set; }
+ }
+
+ public class Toggle : Any {
+ public string subtitle { get; set; }
+ public bool state { get; set; }
+ }
+
+ public class ComboBox : Any {
+ public Gee.List<string> items = new ArrayList<string>();
+ public int active_item { get; set; }
+ }
+
+ public class WidgetDeprecated : Any {
+ public Widget widget;
+ }
+} \ No newline at end of file