diff options
author | Marvin W <git@larma.de> | 2017-05-04 22:05:48 +0200 |
---|---|---|
committer | Marvin W <git@larma.de> | 2017-08-17 19:53:34 +0200 |
commit | 5dc460fc1a72a3dfe83453f4c6683be20a1a2a2d (patch) | |
tree | 764b4770607e0a2997a69a5651c81e90ca3d4e99 /main/src/ui/conversation_titlebar | |
parent | f78818abbee52dc187812428d3eb6542853611a0 (diff) | |
download | dino-5dc460fc1a72a3dfe83453f4c6683be20a1a2a2d.tar.gz dino-5dc460fc1a72a3dfe83453f4c6683be20a1a2a2d.zip |
libdino: remove dependency to GTK+ (all GTK+ code is in main+plugins)
Diffstat (limited to 'main/src/ui/conversation_titlebar')
4 files changed, 29 insertions, 18 deletions
diff --git a/main/src/ui/conversation_titlebar/encryption_entry.vala b/main/src/ui/conversation_titlebar/encryption_entry.vala index 18c09773..12b73409 100644 --- a/main/src/ui/conversation_titlebar/encryption_entry.vala +++ b/main/src/ui/conversation_titlebar/encryption_entry.vala @@ -5,12 +5,15 @@ using Dino.Entities; namespace Dino.Ui { -class EncryptionEntry : Plugins.ConversationTitlebarEntry { - public override string id { get { return "encryption"; } } +class EncryptionEntry : Plugins.ConversationTitlebarEntry, Object { + public string id { get { return "encryption"; } } - public override double order { get { return 2; } } - public override Plugins.ConversationTitlebarWidget get_widget() { - return new EncryptionWidget() { visible=true }; + public double order { get { return 2; } } + public Plugins.ConversationTitlebarWidget get_widget(Plugins.WidgetType type) { + if (type == Plugins.WidgetType.GTK) { + return new EncryptionWidget() { visible=true }; + } + return null; } } diff --git a/main/src/ui/conversation_titlebar/menu_entry.vala b/main/src/ui/conversation_titlebar/menu_entry.vala index 6cead69d..6cdd11c2 100644 --- a/main/src/ui/conversation_titlebar/menu_entry.vala +++ b/main/src/ui/conversation_titlebar/menu_entry.vala @@ -4,8 +4,8 @@ using Dino.Entities; namespace Dino.Ui { -class MenuEntry : Plugins.ConversationTitlebarEntry { - public override string id { get { return "menu"; } } +class MenuEntry : Plugins.ConversationTitlebarEntry, Object { + public string id { get { return "menu"; } } StreamInteractor stream_interactor; @@ -13,9 +13,12 @@ class MenuEntry : Plugins.ConversationTitlebarEntry { this.stream_interactor = stream_interactor; } - public override double order { get { return 0; } } - public override Plugins.ConversationTitlebarWidget get_widget() { - return new MenuWidget(stream_interactor) { visible=true }; + public double order { get { return 0; } } + public Plugins.ConversationTitlebarWidget get_widget(Plugins.WidgetType type) { + if (type == Plugins.WidgetType.GTK) { + return new MenuWidget(stream_interactor) { visible=true }; + } + return null; } } diff --git a/main/src/ui/conversation_titlebar/occupants_entry.vala b/main/src/ui/conversation_titlebar/occupants_entry.vala index c305bed7..904a832a 100644 --- a/main/src/ui/conversation_titlebar/occupants_entry.vala +++ b/main/src/ui/conversation_titlebar/occupants_entry.vala @@ -4,8 +4,8 @@ using Dino.Entities; namespace Dino.Ui { -class OccupantsEntry : Plugins.ConversationTitlebarEntry { - public override string id { get { return "occupants"; } } +class OccupantsEntry : Plugins.ConversationTitlebarEntry, Object { + public string id { get { return "occupants"; } } StreamInteractor stream_interactor; Window window; @@ -15,9 +15,12 @@ class OccupantsEntry : Plugins.ConversationTitlebarEntry { this.window = window; } - public override double order { get { return 3; } } - public override Plugins.ConversationTitlebarWidget get_widget() { - return new OccupantsWidget(stream_interactor, window) { visible=true }; + public double order { get { return 3; } } + public Plugins.ConversationTitlebarWidget get_widget(Plugins.WidgetType type) { + if (type == Plugins.WidgetType.GTK) { + return new OccupantsWidget(stream_interactor, window) { visible=true }; + } + return null; } } diff --git a/main/src/ui/conversation_titlebar/view.vala b/main/src/ui/conversation_titlebar/view.vala index 7debddd6..34191995 100644 --- a/main/src/ui/conversation_titlebar/view.vala +++ b/main/src/ui/conversation_titlebar/view.vala @@ -25,9 +25,11 @@ public class ConversationTitlebar : Gtk.HeaderBar { app.plugin_registry.register_contact_titlebar_entry(new OccupantsEntry(stream_interactor, window)); foreach(var e in app.plugin_registry.conversation_titlebar_entries) { - Plugins.ConversationTitlebarWidget widget = e.get_widget(); - widgets.add(widget); - pack_end(widget); + Plugins.ConversationTitlebarWidget widget = e.get_widget(Plugins.WidgetType.GTK); + if (widget != null) { + widgets.add(widget); + pack_end((Gtk.Widget)widget); + } } stream_interactor.get_module(MucManager.IDENTITY).subject_set.connect((account, jid, subject) => { |