Reformat [GtkChild]

This commit is contained in:
fiaxh 2017-03-10 18:07:28 +01:00
parent cf51e1dee2
commit 4c48c5c16d
30 changed files with 127 additions and 215 deletions

View File

@ -8,23 +8,12 @@ namespace Dino.Ui.AddConversation.Chat {
[GtkTemplate (ui = "/org/dino-im/add_conversation/add_contact_dialog.ui")]
protected class AddContactDialog : Gtk.Dialog {
[GtkChild]
private ComboBoxText accounts_comboboxtext;
[GtkChild]
private Button ok_button;
[GtkChild]
private Button cancel_button;
[GtkChild]
private Entry jid_entry;
[GtkChild]
private Entry alias_entry;
[GtkChild]
private CheckButton subscribe_checkbutton;
[GtkChild] private ComboBoxText accounts_comboboxtext;
[GtkChild] private Button ok_button;
[GtkChild] private Button cancel_button;
[GtkChild] private Entry jid_entry;
[GtkChild] private Entry alias_entry;
[GtkChild] private CheckButton subscribe_checkbutton;
private StreamInteractor stream_interactor;

View File

@ -79,4 +79,5 @@ public class Dialog : Gtk.Dialog {
close();
}
}
}

View File

@ -5,6 +5,7 @@ using Dino.Entities;
using Xmpp;
namespace Dino.Ui.AddConversation.Chat {
protected class RosterList : FilterableList {
public signal void conversation_selected(Conversation? conversation);
@ -74,4 +75,5 @@ protected class RosterList : FilterableList {
return c1.name_label.label.collate(c2.name_label.label);
}
}
}

View File

@ -8,32 +8,15 @@ namespace Dino.Ui.AddConversation.Conference {
[GtkTemplate (ui = "/org/dino-im/add_conversation/add_groupchat_dialog.ui")]
protected class AddGroupchatDialog : Gtk.Dialog {
[GtkChild]
private Stack accounts_stack;
[GtkChild]
private ComboBoxText accounts_comboboxtext;
[GtkChild]
private Label account_label;
[GtkChild]
private Button ok_button;
[GtkChild]
private Button cancel_button;
[GtkChild]
private Entry jid_entry;
[GtkChild]
private Entry alias_entry;
[GtkChild]
private Entry nick_entry;
[GtkChild]
private CheckButton autojoin_checkbutton;
[GtkChild] private Stack accounts_stack;
[GtkChild] private ComboBoxText accounts_comboboxtext;
[GtkChild] private Label account_label;
[GtkChild] private Button ok_button;
[GtkChild] private Button cancel_button;
[GtkChild] private Entry jid_entry;
[GtkChild] private Entry alias_entry;
[GtkChild] private Entry nick_entry;
[GtkChild] private CheckButton autojoin_checkbutton;
private StreamInteractor stream_interactor;
private Xmpp.Xep.Bookmarks.Conference? edit_confrence = null;
@ -104,4 +87,5 @@ protected class AddGroupchatDialog : Gtk.Dialog {
close();
}
}
}

View File

@ -53,53 +53,25 @@ protected class ConferenceDetailsFragment : Box {
}
}
[GtkChild]
private Stack accounts_stack;
[GtkChild] private Stack accounts_stack;
[GtkChild] private Button accounts_button;
[GtkChild] private Label accounts_label;
[GtkChild] private ComboBoxText accounts_comboboxtext;
[GtkChild]
private Stack jid_stack;
[GtkChild] private Stack jid_stack;
[GtkChild] private Button jid_button;
[GtkChild] private Label jid_label;
[GtkChild] private Entry jid_entry;
[GtkChild]
private Stack nick_stack;
[GtkChild] private Stack nick_stack;
[GtkChild] private Button nick_button;
[GtkChild] private Label nick_label;
[GtkChild] private Entry nick_entry;
[GtkChild]
private Stack password_stack;
[GtkChild]
private Button accounts_button;
[GtkChild]
private Button jid_button;
[GtkChild]
private Button nick_button;
[GtkChild]
private Button password_button;
[GtkChild]
private Label accounts_label;
[GtkChild]
private Label jid_label;
[GtkChild]
private Label nick_label;
[GtkChild]
private Label password_label;
[GtkChild]
private ComboBoxText accounts_comboboxtext;
[GtkChild]
private Entry jid_entry;
[GtkChild]
private Entry nick_entry;
[GtkChild]
private Entry password_entry;
[GtkChild] private Stack password_stack;
[GtkChild] private Button password_button;
[GtkChild] private Label password_label;
[GtkChild] private Entry password_entry;
private StreamInteractor stream_interactor;

View File

@ -5,6 +5,7 @@ using Xmpp;
using Dino.Entities;
namespace Dino.Ui.AddConversation.Conference {
protected class ConferenceList : FilterableList {
public signal void conversation_selected(Conversation? conversation);
@ -102,4 +103,5 @@ internal class ConferenceListRow : ListRow {
image.set_from_pixbuf((new AvatarGenerator(35, 35)).set_stateless(true).draw_jid(stream_interactor, jid, account));
}
}
}

View File

@ -8,14 +8,9 @@ namespace Dino.Ui.AddConversation {
[GtkTemplate (ui = "/org/dino-im/add_conversation/list_row.ui")]
public class ListRow : ListBoxRow {
[GtkChild]
public Image image;
[GtkChild]
public Label name_label;
[GtkChild]
public Label via_label;
[GtkChild] public Image image;
[GtkChild] public Label name_label;
[GtkChild] public Label via_label;
public Jid? jid;
public Account? account;
@ -40,4 +35,5 @@ public class ListRow : ListBoxRow {
image.set_from_pixbuf((new AvatarGenerator(35, 35)).draw_jid(stream_interactor, jid, account));
}
}
}

View File

@ -17,20 +17,11 @@ public class SelectJidFragment : Gtk.Box {
}
private set {} }
[GtkChild]
private Entry entry;
[GtkChild]
private Box box;
[GtkChild]
private Button add_button;
[GtkChild]
private Button edit_button;
[GtkChild]
private Button remove_button;
[GtkChild] private Entry entry;
[GtkChild] private Box box;
[GtkChild] private Button add_button;
[GtkChild] private Button edit_button;
[GtkChild] private Button remove_button;
private FilterableList filterable_list;
private ArrayList<AddListRow> added_rows = new ArrayList<AddListRow>();

View File

@ -6,6 +6,7 @@ using Gtk;
using Dino.Entities;
namespace Dino.Ui {
public class AvatarGenerator {
private const string COLOR_GREY = "E0E0E0";
@ -230,4 +231,5 @@ public class AvatarGenerator {
hex_color.length > 6 ? (double) hex_color.substring(6, 2).to_long(null, 16) / 255 : 1);
}
}
}

View File

@ -6,11 +6,11 @@ using Dino.Entities;
using Xmpp;
namespace Dino.Ui {
[GtkTemplate (ui = "/org/dino-im/chat_input.ui")]
public class ChatInput : Grid {
[GtkChild]
private TextView text_input;
[GtkChild] private TextView text_input;
private Conversation? conversation;
private StreamInteractor stream_interactor;
@ -120,4 +120,5 @@ public class ChatInput : Grid {
return false;
}
}
}

View File

@ -2,16 +2,15 @@ using Gtk;
using Dino.Entities;
namespace Dino.Ui {
[GtkTemplate (ui = "/org/dino-im/conversation_list_titlebar.ui")]
public class Dino.Ui.ConversationListTitlebar : Gtk.HeaderBar {
public class ConversationListTitlebar : Gtk.HeaderBar {
public signal void conversation_opened(Conversation conversation);
[GtkChild]
private MenuButton add_button;
[GtkChild]
public ToggleButton search_button;
[GtkChild] private MenuButton add_button;
[GtkChild] public ToggleButton search_button;
private StreamInteractor stream_interactor;
@ -45,3 +44,4 @@ public class Dino.Ui.ConversationListTitlebar : Gtk.HeaderBar {
}
}
}

View File

@ -6,6 +6,7 @@ using Xmpp;
using Dino.Entities;
namespace Dino.Ui.ConversationSelector {
public class ChatRow : ConversationRow {
public ChatRow(StreamInteractor stream_interactor, Conversation conversation) {
@ -85,4 +86,5 @@ public class ChatRow : ConversationRow {
return main_box;
}
}
}

View File

@ -11,29 +11,14 @@ namespace Dino.Ui.ConversationSelector {
[GtkTemplate (ui = "/org/dino-im/conversation_selector/conversation_row.ui")]
public abstract class ConversationRow : ListBoxRow {
[GtkChild]
protected Image image;
[GtkChild]
private Label name_label;
[GtkChild]
private Label time_label;
[GtkChild]
private Label message_label;
[GtkChild]
protected Button x_button;
[GtkChild]
private Revealer time_revealer;
[GtkChild]
private Revealer xbutton_revealer;
[GtkChild]
public Revealer main_revealer;
[GtkChild] protected Image image;
[GtkChild] private Label name_label;
[GtkChild] private Label time_label;
[GtkChild] private Label message_label;
[GtkChild] protected Button x_button;
[GtkChild] private Revealer time_revealer;
[GtkChild] private Revealer xbutton_revealer;
[GtkChild] public Revealer main_revealer;
public Conversation conversation { get; private set; }
@ -170,6 +155,6 @@ public abstract class ConversationRow : ListBoxRow {
return "Just now";
}
}
}
}
}

View File

@ -1,6 +1,7 @@
using Dino.Entities;
namespace Dino.Ui.ConversationSelector {
public class GroupchatRow : ConversationRow {
public GroupchatRow(StreamInteractor stream_interactor, Conversation conversation) {
@ -30,4 +31,5 @@ public class GroupchatRow : ConversationRow {
MucManager.get_instance(stream_interactor).part(conversation.account, conversation.counterpart);
}
}
}

View File

@ -5,6 +5,7 @@ using Xmpp;
using Dino.Entities;
namespace Dino.Ui.ConversationSelector {
public class List : ListBox {
public signal void conversation_selected(Conversation conversation);
@ -170,4 +171,5 @@ public class List : ListBox {
return 0;
}
}
}

View File

@ -10,14 +10,9 @@ namespace Dino.Ui.ConversationSelector {
public class View : Grid {
public List conversation_list;
[GtkChild]
public SearchEntry search_entry;
[GtkChild]
public SearchBar search_bar;
[GtkChild]
private ScrolledWindow scrolled;
[GtkChild] public SearchEntry search_entry;
[GtkChild] public SearchBar search_bar;
[GtkChild] private ScrolledWindow scrolled;
public View(StreamInteractor stream_interactor) {
conversation_list = new List(stream_interactor);
@ -53,4 +48,5 @@ public class View : Grid {
return false;
}
}
}

View File

@ -15,23 +15,12 @@ public class MergedMessageItem : Grid {
public DateTime initial_time { get; private set; }
public ArrayList<Message> messages = new ArrayList<Message>(Message.equals_func);
[GtkChild]
private Image image;
[GtkChild]
private Label time_label;
[GtkChild]
private Label name_label;
[GtkChild]
private Image encryption_image;
[GtkChild]
private Image received_image;
[GtkChild]
private TextView message_text_view;
[GtkChild] private Image image;
[GtkChild] private Label time_label;
[GtkChild] private Label name_label;
[GtkChild] private Image encryption_image;
[GtkChild] private Image received_image;
[GtkChild] private TextView message_text_view;
public MergedMessageItem(StreamInteractor stream_interactor, Conversation conversation, Message message) {
this.conversation = conversation;

View File

@ -27,4 +27,5 @@ private class MergedStatusItem : Expander {
}
}
}
}

View File

@ -26,4 +26,5 @@ private class StatusItem : Grid {
show_all();
}
}
}

View File

@ -13,11 +13,8 @@ public class View : Box {
public Conversation? conversation { get; private set; }
public HashMap<Entities.Message, MergedMessageItem> message_items = new HashMap<Entities.Message, MergedMessageItem>(Entities.Message.hash_func, Entities.Message.equals_func);
[GtkChild]
private ScrolledWindow scrolled;
[GtkChild]
private Box main;
[GtkChild] private ScrolledWindow scrolled;
[GtkChild] private Box main;
private StreamInteractor stream_interactor;
private MergedMessageItem? last_message_item;
@ -219,4 +216,5 @@ public class View : Box {
main.@foreach((widget) => { main.remove(widget); });
}
}
}

View File

@ -2,20 +2,18 @@ using Gtk;
using Dino.Entities;
namespace Dino.Ui {
[GtkTemplate (ui = "/org/dino-im/conversation_titlebar.ui")]
public class Dino.Ui.ConversationTitlebar : Gtk.HeaderBar {
public class ConversationTitlebar : Gtk.HeaderBar {
[GtkChild]
private MenuButton menu_button;
[GtkChild] private MenuButton menu_button;
[GtkChild] private MenuButton encryption_button;
[GtkChild] private MenuButton groupchat_button;
[GtkChild]
private MenuButton encryption_button;
private RadioButton? button_unencrypted;
private RadioButton? button_pgp;
[GtkChild]
private MenuButton groupchat_button;
private StreamInteractor stream_interactor;
private Conversation? conversation;
@ -122,3 +120,4 @@ public class Dino.Ui.ConversationTitlebar : Gtk.HeaderBar {
}
}
}

View File

@ -7,11 +7,8 @@ namespace Dino.Ui.ManageAccounts {
[GtkTemplate (ui = "/org/dino-im/manage_accounts/account_row.ui")]
public class AccountRow : Gtk.ListBoxRow {
[GtkChild]
public Image image;
[GtkChild]
public Label jid_label;
[GtkChild] public Image image;
[GtkChild] public Label jid_label;
public Account account;
@ -21,4 +18,5 @@ public class AccountRow : Gtk.ListBoxRow {
jid_label.set_label(account.bare_jid.to_string());
}
}
}

View File

@ -10,20 +10,11 @@ public class AddAccountDialog : Gtk.Dialog {
public signal void added(Account account);
[GtkChild]
private Button cancel_button;
[GtkChild]
private Button ok_button;
[GtkChild]
private Entry alias_entry;
[GtkChild]
private Entry jid_entry;
[GtkChild]
private Entry password_entry;
[GtkChild] private Button cancel_button;
[GtkChild] private Button ok_button;
[GtkChild] private Entry alias_entry;
[GtkChild] private Entry jid_entry;
[GtkChild] private Entry password_entry;
public AddAccountDialog(StreamInteractor stream_interactor) {
Object(use_header_bar : 1);
@ -67,4 +58,5 @@ public class AddAccountDialog : Gtk.Dialog {
close();
}
}
}

View File

@ -20,14 +20,17 @@ public class Dialog : Gtk.Window {
[GtkChild] public Button image_button;
[GtkChild] public Label jid_label;
[GtkChild] public Switch active_switch;
[GtkChild] public Stack password_stack;
[GtkChild] public Label password_label;
[GtkChild] public Button password_button;
[GtkChild] public Entry password_entry;
[GtkChild] public Stack alias_stack;
[GtkChild] public Label alias_label;
[GtkChild] public Button alias_button;
[GtkChild] public Entry alias_entry;
[GtkChild] public Stack pgp_stack;
[GtkChild] public Label pgp_label;
[GtkChild] public Button pgp_button;
@ -189,5 +192,6 @@ public class Dialog : Gtk.Window {
if (stack != pgp_stack) pgp_stack.set_visible_child_name("label");
}
}
}

View File

@ -2,6 +2,7 @@ using Dino.Entities;
using Xmpp;
namespace Dino.Ui {
public class Notifications : GLib.Object {
private StreamInteractor stream_interactor;
@ -52,4 +53,5 @@ public class Notifications : GLib.Object {
} catch (Error error) { }
}
}
}

View File

@ -4,17 +4,15 @@ using Gtk;
using Dino.Entities;
namespace Dino.Ui{
[GtkTemplate (ui = "/org/dino-im/occupant_list.ui")]
public class OccupantList : Box {
public signal void conversation_selected(Conversation? conversation);
private StreamInteractor stream_interactor;
[GtkChild]
private ListBox list_box;
[GtkChild]
private SearchEntry search_entry;
[GtkChild] private ListBox list_box;
[GtkChild] private SearchEntry search_entry;
private Conversation? conversation;
private string[]? filter_values;
@ -109,4 +107,5 @@ public class OccupantList : Box {
return 0;
}
}
}

View File

@ -8,11 +8,8 @@ namespace Dino.Ui {
[GtkTemplate (ui = "/org/dino-im/occupant_list_item.ui")]
public class OccupantListRow : ListBoxRow {
[GtkChild]
private Image image;
[GtkChild]
public Label name_label;
[GtkChild] private Image image;
[GtkChild] public Label name_label;
public OccupantListRow(StreamInteractor stream_interactor, Account account, Jid jid) {
name_label.label = Util.get_display_name(stream_interactor, jid, account);
@ -24,4 +21,5 @@ public class OccupantListRow : ListBoxRow {
}
}
}

View File

@ -5,11 +5,8 @@ namespace Dino.Ui {
[GtkTemplate (ui = "/org/dino-im/settings_dialog.ui")]
class SettingsDialog : Dialog {
[GtkChild]
private CheckButton marker_checkbutton;
[GtkChild]
private CheckButton emoji_checkbutton;
[GtkChild] private CheckButton marker_checkbutton;
[GtkChild] private CheckButton emoji_checkbutton;
Dino.Settings settings = Dino.Settings.instance();

View File

@ -2,7 +2,9 @@ using Gtk;
using Dino.Entities;
public class Dino.Ui.UnifiedWindow : Window {
namespace Dino.Ui {
public class UnifiedWindow : Window {
public ChatInput chat_input;
public ConversationListTitlebar conversation_list_titlebar;
public ConversationSelector.View filterable_conversation_list;
@ -76,3 +78,4 @@ public class Dino.Ui.UnifiedWindow : Window {
}
}
}

View File

@ -3,7 +3,9 @@ using Gtk;
using Dino.Entities;
using Xmpp;
public class Dino.Ui.Util : GLib.Object {
namespace Dino.Ui {
public class Util : Object {
private const string[] tango_colors_light = {"FCE94F", "FCAF3E", "E9B96E", "8AE234", "729FCF", "AD7FA8", "EF2929"};
private const string[] tango_colors_medium = {"EDD400", "F57900", "C17D11", "73D216", "3465A4", "75507B", "CC0000"};
@ -69,3 +71,5 @@ public class Dino.Ui.Util : GLib.Object {
image.set_from_surface(Gdk.cairo_surface_create_from_pixbuf(pixbuf, scale, image.get_window()));
}
}
}