Use Window instead of ApplicationWindow for main view
This commit is contained in:
parent
56bc45ce4d
commit
a9ae79878e
|
@ -1,5 +1,5 @@
|
|||
#Dino
|
||||
![screenshots](http://i.imgur.com/n9caTuJ.png)
|
||||
![screenshots](http://i.imgur.com/JSHwxNf.png)
|
||||
|
||||
##Build
|
||||
./configure
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
<menu id="menu_add">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="action">win.add_chat</attribute>
|
||||
<attribute name="action">app.add_chat</attribute>
|
||||
<attribute name="label" translatable="yes">Start Chat</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="action">win.add_conference</attribute>
|
||||
<attribute name="action">app.add_conference</attribute>
|
||||
<attribute name="label" translatable="yes">Join Conference</attribute>
|
||||
</item>
|
||||
</section>
|
||||
|
|
|
@ -42,7 +42,7 @@ public class PresenceManager : StreamInteractionModule, Object {
|
|||
public ArrayList<Jid>? get_full_jids(Jid jid, Account account) {
|
||||
Core.XmppStream? stream = stream_interactor.get_stream(account);
|
||||
if (stream != null) {
|
||||
ArrayList<string> resources = Xmpp.Presence.Flag.get_flag(stream).get_resources(jid.bare_jid.to_string());
|
||||
Gee.List<string> resources = Xmpp.Presence.Flag.get_flag(stream).get_resources(jid.bare_jid.to_string());
|
||||
if (resources == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -15,12 +15,12 @@ public class Dino.Ui.ConversationListTitlebar : Gtk.HeaderBar {
|
|||
|
||||
private StreamInteractor stream_interactor;
|
||||
|
||||
public ConversationListTitlebar(ApplicationWindow application, StreamInteractor stream_interactor) {
|
||||
public ConversationListTitlebar(Window application, StreamInteractor stream_interactor) {
|
||||
this.stream_interactor = stream_interactor;
|
||||
create_add_menu(application);
|
||||
}
|
||||
|
||||
private void create_add_menu(ApplicationWindow application) {
|
||||
private void create_add_menu(Window window) {
|
||||
SimpleAction contacts_action = new SimpleAction("add_chat", null);
|
||||
contacts_action.activate.connect(() => {
|
||||
AddConversation.Chat.Dialog add_chat_dialog = new AddConversation.Chat.Dialog(stream_interactor);
|
||||
|
@ -28,7 +28,7 @@ public class Dino.Ui.ConversationListTitlebar : Gtk.HeaderBar {
|
|||
add_chat_dialog.conversation_opened.connect((conversation) => conversation_opened(conversation));
|
||||
add_chat_dialog.show();
|
||||
});
|
||||
application.add_action(contacts_action);
|
||||
window.get_application().add_action(contacts_action);
|
||||
|
||||
SimpleAction conference_action = new SimpleAction("add_conference", null);
|
||||
conference_action.activate.connect(() => {
|
||||
|
@ -37,7 +37,7 @@ public class Dino.Ui.ConversationListTitlebar : Gtk.HeaderBar {
|
|||
add_conference_dialog.conversation_opened.connect((conversation) => conversation_opened(conversation));
|
||||
add_conference_dialog.show();
|
||||
});
|
||||
application.add_action(conference_action);
|
||||
window.get_application().add_action(conference_action);
|
||||
|
||||
Builder builder = new Builder.from_resource("/org/dino-im/menu_add.ui");
|
||||
MenuModel menu = builder.get_object("menu_add") as MenuModel;
|
||||
|
|
|
@ -2,7 +2,7 @@ using Gtk;
|
|||
|
||||
using Dino.Entities;
|
||||
|
||||
public class Dino.Ui.UnifiedWindow : ApplicationWindow {
|
||||
public class Dino.Ui.UnifiedWindow : Window {
|
||||
public ChatInput chat_input;
|
||||
public ConversationListTitlebar conversation_list_titlebar;
|
||||
public ConversationSelector.View filterable_conversation_list;
|
||||
|
|
|
@ -7,14 +7,14 @@ namespace Xmpp.Presence {
|
|||
public class Flag : XmppStreamFlag {
|
||||
public const string ID = "presence";
|
||||
|
||||
private HashMap<string, ArrayList<string>> resources = new HashMap<string, ArrayList<string>>();
|
||||
private HashMap<string, ConcurrentList<string>> resources = new HashMap<string, ConcurrentList<string>>();
|
||||
private HashMap<string, Presence.Stanza> presences = new HashMap<string, Presence.Stanza>();
|
||||
|
||||
public Set<string> get_available_jids() {
|
||||
return resources.keys;
|
||||
}
|
||||
|
||||
public ArrayList<string>? get_resources(string bare_jid) {
|
||||
public Gee.List<string>? get_resources(string bare_jid) {
|
||||
return resources[bare_jid];
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ public class Flag : XmppStreamFlag {
|
|||
public void add_presence(Presence.Stanza presence) {
|
||||
string bare_jid = get_bare_jid(presence.from);
|
||||
if (!resources.has_key(bare_jid)) {
|
||||
resources[bare_jid] = new ArrayList<string>();
|
||||
resources[bare_jid] = new ConcurrentList<string>();
|
||||
}
|
||||
if (resources[bare_jid].contains(presence.from)) {
|
||||
resources[bare_jid].remove(presence.from);
|
||||
|
|
Loading…
Reference in a new issue