[polari/wip/bastianilso/initial-setup: 1/4] Add initial setup



commit 31f23e5e4be084932a5902b3280cf4a8a62cbdc0
Author: Carlos Soriano <carlos soriano89 gmail com>
Date:   Sat Oct 5 20:24:34 2013 +0200

    Add initial setup

 data/resources/initial-setup.ui |  116 +++++++++++++++++++++++++++++++++++++++
 src/initialSetupWindow.js       |   32 +++++++++++
 2 files changed, 148 insertions(+), 0 deletions(-)
---
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/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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]