Commit db489ea6 authored by Adrien Dorsaz's avatar Adrien Dorsaz

adjust stuff for the new assistant

parent 3e0ddbcf
......@@ -46,10 +46,11 @@ IbexWindow::IbexWindow()
builder->get_widget("popover_main", popover_main);
builder->get_widget("accounts", accounts);
builder->get_widget("accounts_back", accounts_back);
builder->get_widget("accounts_add", accounts_add);
accounts->signal_clicked().connect(sigc::mem_fun(*this, &IbexWindow::main_menu_show_accounts));
accounts_back->signal_clicked().connect(sigc::mem_fun(*this, &IbexWindow::main_menu_show_start));
accounts_add->signal_clicked().connect(sigc::mem_fun(*this, &IbexWindow::add_account));
}
void
......@@ -99,3 +100,12 @@ IbexWindow::main_menu_show_accounts()
popover_main->open_submenu("accounts");
}
void
IbexWindow::add_account()
{
XmppClient client {settings};
IbexAccountAssistant assistant {client, settings};
clients.push_back(client);
}
......@@ -31,6 +31,7 @@
#include "ibex-settings.h"
#include "xmpp-client.h"
#include "ibex-account-assistant.h"
class IbexWindow : public Gtk::Window
{
......@@ -38,12 +39,6 @@ public:
IbexWindow();
void start_clients();
void toggle_search();
void toggle_searchbar();
void main_menu_show_start();
void main_menu_show_accounts();
private:
Glib::RefPtr<Gtk::Builder> builder;
......@@ -56,7 +51,7 @@ private:
// Main menu
Gtk::PopoverMenu *popover_main;
Gtk::Button *accounts, *accounts_back;
Gtk::Button *accounts, *accounts_back, *accounts_add;
// Main content
Gtk::Box *body;
......@@ -65,4 +60,12 @@ private:
IbexSettings settings;
std::vector<XmppClient> clients;
void toggle_search();
void toggle_searchbar();
void main_menu_show_start();
void main_menu_show_accounts();
void add_account();
};
......@@ -176,18 +176,44 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkButton" id="accounts_back">
<object class="GtkButtonBox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="can_focus">False</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="accounts_back">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">go-first-symbolic</property>
<property name="icon_size">2</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkImage">
<object class="GtkButton" id="accounts_add">
<property name="label">gtk-add</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">go-first-symbolic</property>
<property name="icon_size">2</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
......@@ -201,9 +227,9 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">account_list</property>
<property name="headers_visible">False</property>
<property name="enable_search">False</property>
<property name="show_expanders">False</property>
<property name="enable_grid_lines">horizontal</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
......@@ -211,7 +237,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
</object>
......
......@@ -73,6 +73,19 @@ XmppClient::set_websocket_uri (ustring websocket_uri)
websocket_uri = websocket_uri;
}
XmppClient::XmppClient(IbexSettings settings)
: settings {settings}
{
// Init soup session and logger
soup_session = soup_session_new_with_options (
SOUP_SESSION_USER_AGENT, "org.gnome.ibex/0.1.0",
NULL);
soup_logger = soup_logger_new(SOUP_LOGGER_LOG_BODY, -1);
soup_session_add_feature(soup_session, SOUP_SESSION_FEATURE(soup_logger));
}
XmppClient::XmppClient(ustring jid, IbexSettings settings)
: jid {jid}
, settings {settings}
......
......@@ -32,6 +32,7 @@ using Glib::ustring;
class XmppClient
{
public:
XmppClient(IbexSettings settings);
XmppClient(ustring jid, IbexSettings settings);
XmppClient(const XmppClient& other);
......
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