aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-11-06 01:02:13 +0100
committerfiaxh <git@mx.ax.lt>2017-11-16 14:09:30 +0100
commit1d0745177e7a116455811dfd26e07b848cb89b75 (patch)
tree7517c4b1e1fd932e22bff091c9eb93f1c1884b35
parentf6ac5bbd26638412a2289fd1d28ef12de1d7e8b5 (diff)
downloaddino-1d0745177e7a116455811dfd26e07b848cb89b75.tar.gz
dino-1d0745177e7a116455811dfd26e07b848cb89b75.zip
Replace deprecated function usages
-rw-r--r--libdino/src/service/connection_manager.vala4
-rw-r--r--libdino/src/service/conversation_manager.vala1
-rw-r--r--main/data/add_conversation/add_contact_dialog.ui2
-rw-r--r--main/data/add_conversation/add_groupchat_dialog.ui6
-rw-r--r--main/data/add_conversation/conference_details_fragment.ui4
-rw-r--r--main/src/ui/add_conversation/add_groupchat_dialog.vala8
-rw-r--r--main/src/ui/application.vala2
-rw-r--r--main/src/ui/contact_details/dialog.vala4
-rw-r--r--main/src/ui/manage_accounts/dialog.vala2
-rw-r--r--main/src/ui/occupant_menu/list.vala4
-rw-r--r--plugins/omemo/src/account_settings_widget.vala3
11 files changed, 20 insertions, 20 deletions
diff --git a/libdino/src/service/connection_manager.vala b/libdino/src/service/connection_manager.vala
index 4c72f229..d0a11cd5 100644
--- a/libdino/src/service/connection_manager.vala
+++ b/libdino/src/service/connection_manager.vala
@@ -140,9 +140,7 @@ public class ConnectionManager {
Xmpp.Presence.Stanza presence = new Xmpp.Presence.Stanza();
presence.type_ = Xmpp.Presence.Stanza.TYPE_UNAVAILABLE;
change_connection_state(account, ConnectionState.DISCONNECTED);
- try {
- connections[account].stream.get_module(Presence.Module.IDENTITY).send_presence(connections[account].stream, presence);
- } catch (Error e) { print(@"on_prepare_for_sleep error $(e.message)\n"); }
+ connections[account].stream.get_module(Presence.Module.IDENTITY).send_presence(connections[account].stream, presence);
}
public void disconnect(Account account) {
diff --git a/libdino/src/service/conversation_manager.vala b/libdino/src/service/conversation_manager.vala
index 471ec74a..44b16d68 100644
--- a/libdino/src/service/conversation_manager.vala
+++ b/libdino/src/service/conversation_manager.vala
@@ -34,6 +34,7 @@ public class ConversationManager : StreamInteractionModule, Object {
public Conversation create_conversation(Jid jid, Account account, Conversation.Type? type = null) {
assert(conversations.has_key(account));
if (conversations[account].has_key(jid)) {
+ conversations[account][jid].type_ = type;
return conversations[account][jid];
} else {
Conversation conversation = new Conversation(jid, account, type);
diff --git a/main/data/add_conversation/add_contact_dialog.ui b/main/data/add_conversation/add_contact_dialog.ui
index c2077647..abf9d892 100644
--- a/main/data/add_conversation/add_contact_dialog.ui
+++ b/main/data/add_conversation/add_contact_dialog.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="DinoUiAddContactDialog">
- <property name="default_width">300</property>
+ <property name="valign">center</property>
<property name="modal">True</property>
<child type="titlebar">
<object class="GtkHeaderBar">
diff --git a/main/data/add_conversation/add_groupchat_dialog.ui b/main/data/add_conversation/add_groupchat_dialog.ui
index 79c92947..29638f53 100644
--- a/main/data/add_conversation/add_groupchat_dialog.ui
+++ b/main/data/add_conversation/add_groupchat_dialog.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="DinoUiAddGroupchatDialog">
- <property name="default_width">400</property>
+ <property name="valign">center</property>
<property name="modal">True</property>
<child type="titlebar">
<object class="GtkHeaderBar">
@@ -39,8 +39,8 @@
<object class="GtkGrid">
<property name="orientation">vertical</property>
<property name="margin">20</property>
- <property name="margin_right">40</property>
- <property name="margin_left">40</property>
+ <property name="margin-start">40</property>
+ <property name="margin-end">40</property>
<property name="row-spacing">7</property>
<property name="column-spacing">10</property>
<property name="visible">True</property>
diff --git a/main/data/add_conversation/conference_details_fragment.ui b/main/data/add_conversation/conference_details_fragment.ui
index 120fbdb6..0ef15c03 100644
--- a/main/data/add_conversation/conference_details_fragment.ui
+++ b/main/data/add_conversation/conference_details_fragment.ui
@@ -9,8 +9,8 @@
<object class="GtkGrid">
<property name="orientation">vertical</property>
<property name="margin">20</property>
- <property name="margin_right">40</property>
- <property name="margin_left">40</property>
+ <property name="margin_end">40</property>
+ <property name="margin_start">40</property>
<property name="row-spacing">7</property>
<property name="column-spacing">10</property>
<property name="visible">True</property>
diff --git a/main/src/ui/add_conversation/add_groupchat_dialog.vala b/main/src/ui/add_conversation/add_groupchat_dialog.vala
index 274ab6f9..b18e9bbb 100644
--- a/main/src/ui/add_conversation/add_groupchat_dialog.vala
+++ b/main/src/ui/add_conversation/add_groupchat_dialog.vala
@@ -18,7 +18,7 @@ protected class AddGroupchatDialog : Gtk.Dialog {
[GtkChild] private Entry nick_entry;
private StreamInteractor stream_interactor;
- private Xmpp.Xep.Bookmarks.Conference? edit_confrence = null;
+ private Xmpp.Xep.Bookmarks.Conference? edit_conference = null;
private bool alias_entry_changed = false;
public AddGroupchatDialog(StreamInteractor stream_interactor) {
@@ -37,7 +37,7 @@ protected class AddGroupchatDialog : Gtk.Dialog {
public AddGroupchatDialog.for_conference(StreamInteractor stream_interactor, Account account, Xmpp.Xep.Bookmarks.Conference conference) {
this(stream_interactor);
- edit_confrence = conference;
+ edit_conference = conference;
ok_button.label = _("Save");
ok_button.sensitive = true;
accounts_stack.set_visible_child_name("label");
@@ -67,10 +67,10 @@ protected class AddGroupchatDialog : Gtk.Dialog {
Xmpp.Xep.Bookmarks.Conference conference = new Xmpp.Xep.Bookmarks.Conference(jid_entry.text);
conference.nick = nick_entry.text != "" ? nick_entry.text : null;
conference.name = alias_entry.text;
- if (edit_confrence == null) {
+ if (edit_conference == null) {
stream_interactor.get_module(MucManager.IDENTITY).add_bookmark(account_combobox.selected, conference);
} else {
- stream_interactor.get_module(MucManager.IDENTITY).replace_bookmark(account_combobox.selected, edit_confrence, conference);
+ stream_interactor.get_module(MucManager.IDENTITY).replace_bookmark(account_combobox.selected, edit_conference, conference);
}
close();
}
diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala
index 625673fb..e4fdd9eb 100644
--- a/main/src/ui/application.vala
+++ b/main/src/ui/application.vala
@@ -102,7 +102,7 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
SimpleAction quit_action = new SimpleAction("quit", null);
quit_action.activate.connect(quit);
add_action(quit_action);
- add_accelerator("<Ctrl>Q", "app.quit", null);
+ set_accels_for_action("app.quit", new string[]{"<Ctrl>Q"});
Builder builder = new Builder.from_resource("/im/dino/menu_app.ui");
MenuModel menu = builder.get_object("menu_app") as MenuModel;
diff --git a/main/src/ui/contact_details/dialog.vala b/main/src/ui/contact_details/dialog.vala
index 70e495d1..2f1fc81e 100644
--- a/main/src/ui/contact_details/dialog.vala
+++ b/main/src/ui/contact_details/dialog.vala
@@ -57,7 +57,7 @@ public class Dialog : Gtk.Dialog {
private void setup_top() {
if (conversation.type_ == Conversation.Type.CHAT) {
name_label.visible = false;
- jid_label.set_padding(new Button().get_style_context().get_padding(StateFlags.NORMAL).left + 1, 0);
+ jid_label.margin_start = new Button().get_style_context().get_padding(StateFlags.NORMAL).left + 1;
name_hybrid.text = Util.get_conversation_display_name(stream_interactor, conversation);
destroy.connect(() => {
if (name_hybrid.text != Util.get_conversation_display_name(stream_interactor, conversation)) {
@@ -79,7 +79,7 @@ public class Dialog : Gtk.Dialog {
add_category(category);
ListBoxRow list_row = new ListBoxRow() { activatable=false, visible=true };
- Box row = new Box(Orientation.HORIZONTAL, 20) { margin_left=15, margin_right=15, margin_top=3, margin_bottom=3, visible=true };
+ Box row = new Box(Orientation.HORIZONTAL, 20) { margin_start=15, margin_end=15, margin_top=3, margin_bottom=3, visible=true };
list_row.add(row);
Label label_label = new Label(label) { xalign=0, yalign=0.5f, hexpand=true, visible=true };
if (description != null && description != "") {
diff --git a/main/src/ui/manage_accounts/dialog.vala b/main/src/ui/manage_accounts/dialog.vala
index 5ce16ec9..6fdce712 100644
--- a/main/src/ui/manage_accounts/dialog.vala
+++ b/main/src/ui/manage_accounts/dialog.vala
@@ -61,7 +61,7 @@ public class Dialog : Gtk.Dialog {
Label label = new Label(e.name) { xalign=1, yalign=0, visible=true };
label.get_style_context().add_class("dim-label");
- label.set_padding(0, e.label_top_padding == -1 ? default_top_padding : e.label_top_padding);
+ label.margin_top = e.label_top_padding == -1 ? default_top_padding : e.label_top_padding;
settings_list.attach(label, 0, row_index);
if (widget is Widget) {
diff --git a/main/src/ui/occupant_menu/list.vala b/main/src/ui/occupant_menu/list.vala
index 3477885f..47adccb6 100644
--- a/main/src/ui/occupant_menu/list.vala
+++ b/main/src/ui/occupant_menu/list.vala
@@ -119,10 +119,10 @@ public class List : Box {
if (aff == affiliation) count++;
}
- Label title_label = new Label("") { margin_left=10, xalign=0, visible=true };
+ Label title_label = new Label("") { margin_start=10, xalign=0, visible=true };
title_label.set_markup(@"<b>$(Markup.escape_text(aff_str))</b>");
- Label count_label = new Label(@"$count") { xalign=0, margin_right=7, expand=true, visible=true };
+ Label count_label = new Label(@"$count") { xalign=0, margin_end=7, expand=true, visible=true };
count_label.get_style_context().add_class("dim-label");
Grid grid = new Grid() { margin_top=top?5:15, column_spacing=5, hexpand=true, visible=true };
diff --git a/plugins/omemo/src/account_settings_widget.vala b/plugins/omemo/src/account_settings_widget.vala
index cec0eecd..6db193fc 100644
--- a/plugins/omemo/src/account_settings_widget.vala
+++ b/plugins/omemo/src/account_settings_widget.vala
@@ -15,7 +15,8 @@ public class AccountSettingWidget : Plugins.AccountSettingsWidget, Box {
fingerprint = new Label("...");
fingerprint.xalign = 0;
Border border = new Button().get_style_context().get_padding(StateFlags.NORMAL);
- fingerprint.set_padding(border.left + 1, border.top + 1);
+ fingerprint.margin_top = border.top + 1;
+ fingerprint.margin_start = border.left + 1;
fingerprint.visible = true;
pack_start(fingerprint);