Commit 79efc022 authored by Sébastien Blin's avatar Sébastien Blin Committed by Andreas Traczyk

usernameregistrationbox: link to new LRC models

Note: refresh UI

Change-Id: Ic22e0235daccc683f41cf4c9238d6b6099804179
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent f9bb72ba
......@@ -619,7 +619,7 @@ build_creation_wizard_view(AccountCreationWizard *view, gboolean show_cancel_but
gtk_image_set_from_pixbuf(GTK_IMAGE(priv->choose_account_type_ring_logo), logo_ring);
/* create the username_registration_box */
priv->username_registration_box = username_registration_box_new(nullptr, FALSE);
priv->username_registration_box = username_registration_box_new_empty(false);
gtk_container_add(GTK_CONTAINER(priv->box_username_entry), priv->username_registration_box);
gtk_widget_show(priv->username_registration_box);
priv->entry_username = GTK_WIDGET(
......
......@@ -670,12 +670,15 @@ build_tab_view(AccountGeneralTab *view)
label = gtk_label_new(_("Username"));
gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_account), label, 0, grid_row, 1, 1);
auto username_registration_box = username_registration_box_new(priv->account, TRUE);
gtk_widget_show_all(priv->grid_account);
auto username_registration_box = username_registration_box_new(*priv->accountInfo_, TRUE);
gtk_grid_attach(GTK_GRID(priv->grid_account), username_registration_box, 1, grid_row, 2, 2);
gtk_widget_show(username_registration_box);
grid_row+=2;
}
gtk_widget_show_all(priv->grid_account);
/* build parameters grid */
grid_row = 0;
......
This diff is collapsed.
......@@ -21,6 +21,9 @@
#include <gtk/gtk.h>
#include <api/account.h>
#include "accountinfopointer.h"
class Account;
G_BEGIN_DECLS
......@@ -35,7 +38,8 @@ typedef struct _UsernameRegistrationBox UsernameRegistrationBox;
typedef struct _UsernameRegistrationBoxClass UsernameRegistrationBoxClass;
GType username_registration_box_get_type (void) G_GNUC_CONST;
GtkWidget *username_registration_box_new (Account *account, gboolean register_button);
GtkWidget *username_registration_box_new_empty (bool register_button);
GtkWidget *username_registration_box_new (AccountInfoPointer const & accountInfo, bool register_button);
GtkEntry* username_registration_box_get_entry (UsernameRegistrationBox *view);
void username_registration_box_set_use_blockchain (UsernameRegistrationBox* view, gboolean use_blockchain);
......
......@@ -2,65 +2,56 @@
<interface>
<requires lib="gtk+" version="3.10"/>
<template class="UsernameRegistrationBox" parent="GtkGrid">
<property name="column-spacing">10</property>
<property name="row-spacing">5</property>
<child>
<object class="GtkEntry" id="entry_username">
<object class="GtkLabel" id="label_username">
<property name="visible">True</property>
<property name="editable">False</property>
<property name="max-width-chars">40</property>
<property name="placeholder-text" translatable="yes">enter username here</property>
<property name="xalign">0.5</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button_register_username">
<property name="visible">False</property>
<property name="no-show-all">True</property>
<property name="label" translatable="yes">Register</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkSpinner" id="spinner">
<property name="visible">False</property>
<property name="no-show-all">True</property>
<property name="halign">center</property>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkImage" id="icon_username_availability">
<property name="visible">True</property>
<property name="no-show-all">True</property>
<property name="halign">center</property>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_status">
<object class="GtkFrame" id="frame_username">
<property name="visible">True</property>
<style>
<class name="dim-label"/>
</style>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">out</property>
<child>
<object class="GtkBox" id="hbox_search">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">0</property>
<child>
<object class="GtkEntry" id="entry_username">
<property name="visible">True</property>
<property name="max_length">256</property>
<property name="truncate_multiline">True</property>
<property name="placeholder-text" translatable="yes">register username</property>
<style>
<class name="search-entry-style"/>
</style>
</object>
</child>
<child>
<object class="GtkSpinner" id="spinner">
<property name="can_focus">False</property>
<style>
<class name="spinner-style"/>
</style>
</object>
</child>
<child>
<object class="GtkButton" id="button_register_username">
<property name="visible">False</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
<property name="relief">none</property>
<style>
<class name="new-conversation-style"/>
</style>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
</template>
</interface>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment