[polari/wip/initialSetup: 2/2] Add initial setup
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/initialSetup: 2/2] Add initial setup
- Date: Mon, 7 Oct 2013 15:36:14 +0000 (UTC)
commit c0ce586f8986b77785dda6e6a44e2fe14bdd9533
Author: Carlos Soriano <carlos soriano89 gmail com>
Date: Sat Oct 5 20:24:34 2013 +0200
Add initial setup
data/polari.gresource.xml | 1 +
data/resources/initial-setup.ui | 116 +++++++++++++++++++++++++++++++++++++++
src/Makefile.am | 1 +
src/initialSetupWindow.js | 32 +++++++++++
src/mainWindow.js | 12 ++++-
5 files changed, 161 insertions(+), 1 deletions(-)
---
diff --git a/data/polari.gresource.xml b/data/polari.gresource.xml
index 7ecc781..2522863 100644
--- a/data/polari.gresource.xml
+++ b/data/polari.gresource.xml
@@ -6,6 +6,7 @@
<file alias="connection-list-dialog.ui"
preprocess="xml-stripblanks">resources/connection-list-dialog.ui</file>
<file alias="join-room-dialog.ui" preprocess="xml-stripblanks">resources/join-room-dialog.ui</file>
<file alias="main-window.ui" preprocess="xml-stripblanks">resources/main-window.ui</file>
+ <file alias="initial-setup.ui" preprocess="xml-stripblanks">resources/initial-setup.ui</file>
<file alias="application.css">resources/application.css</file>
</gresource>
</gresources>
diff --git a/data/resources/initial-setup.ui b/data/resources/initial-setup.ui
new file mode 100644
index 0000000..5e9fbdd
--- /dev/null
+++ b/data/resources/initial-setup.ui
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Sat Oct 5 12:07:37 2013 -->
+<interface>
+ <!-- interface-requires gtk+ 3.10 -->
+ <object class="GtkWindow" id="initial_setup">
+ <property name="width_request">600</property>
+ <property name="height_request">320</property>
+ <property name="can_focus">False</property>
+ <property name="modal">True</property>
+ <property name="window_position">center</property>
+ <property name="default_width">440</property>
+ <property name="default_height">250</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="type_hint">dialog</property>
+ <child>
+ <object class="GtkBox" id="content">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">120</property>
+ <property name="margin_right">120</property>
+ <property name="margin_top">40</property>
+ <property name="margin_bottom">40</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="welcome">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">10</property>
+ <property name="margin_right">10</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Welcome to Polari. An Internet Relay Chat client for
Gnome</property>
+ <property name="wrap">True</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="getStarted">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">10</property>
+ <property name="margin_right">10</property>
+ <property name="margin_top">40</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Get started by adding a server connection</property>
+ <property name="wrap">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkListBox" id="connectionList">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkListBoxRow" id="addConnectionRow">
+ <property name="width_request">100</property>
+ <property name="height_request">30</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="addConectionContainer">
+ <property name="height_request">30</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">20</property>
+ <child>
+ <object class="GtkImage" id="addIcon">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixel_size">16</property>
+ <property name="icon_name">list-add-symbolic</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="addConnectionLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">10</property>
+ <property name="label" translatable="yes">Add connection</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/src/Makefile.am b/src/Makefile.am
index 13de457..aca6883 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -34,6 +34,7 @@ dist_js_DATA = \
chatView.js \
connections.js \
ircParser.js \
+ initialSetupWindow.js \
joinDialog.js \
main.js \
mainWindow.js \
diff --git a/src/initialSetupWindow.js b/src/initialSetupWindow.js
new file mode 100644
index 0000000..ee0892d
--- /dev/null
+++ b/src/initialSetupWindow.js
@@ -0,0 +1,32 @@
+const Gtk = imports.gi.Gtk;
+const Tp = imports.gi.TelepathyGLib;
+
+const Connections = imports.connections;
+const Lang = imports.lang;
+const Signals = imports.signals;
+
+const InitialSetupWindow = new Lang.Class({
+ Name: 'InitialSetupWindow',
+
+ _init: function() {
+ let builder = new Gtk.Builder();
+ builder.add_from_resource('/org/gnome/polari/initial-setup.ui');
+
+ this.window = builder.get_object('initial_setup');
+
+ let connectionList = builder.get_object('connectionList');
+ let addConnectionRow = builder.get_object('addConnectionRow');
+ connectionList.connect('row-activated', Lang.bind(this, this._addConnection));
+ this.window.show_all();
+ },
+
+ _addConnection: function() {
+ log("connection activated");
+ let dialog = new Connections.ConnectionsDialog();
+ dialog.widget.show();
+ dialog.widget.connect('response',
+ function(widget) {
+ widget.destroy();
+ });
+ }
+});
\ No newline at end of file
diff --git a/src/mainWindow.js b/src/mainWindow.js
index d784922..db01637 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -9,6 +9,7 @@ const AppNotifications = imports.appNotifications;
const ChatroomManager = imports.chatroomManager;
const ChatView = imports.chatView;
const IrcParser = imports.ircParser;
+const InitialSetupWindow = imports.initialSetupWindow;
const JoinDialog = imports.joinDialog;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
@@ -147,6 +148,10 @@ const MainWindow = new Lang.Class({
this._updateSensitivity();
this.window.show_all();
+
+ //if(this._accountsMonitor.dupAccounts().length == 0) {
+ let initialSetupWindow = new InitialSetupWindow.InitialSetupWindow();
+ //}
},
_onWindowStateEvent: function(widget, event) {
@@ -300,7 +305,12 @@ const MainWindow = new Lang.Class({
account.set_nickname_async(nick, Lang.bind(this,
function(a, res) {
try {
- a.set_nickname_finish(res);
+ log("testing");
+ log(a);
+ log(res);
+ log("End testing");
+ let value = a.set_nickname_finish(res);
+ log(value);
} catch(e) {
logError(e, "Failed to change nick");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]