summaryrefslogtreecommitdiffstats
path: root/qx08/source/class/tr/Application.js
diff options
context:
space:
mode:
Diffstat (limited to 'qx08/source/class/tr/Application.js')
-rw-r--r--qx08/source/class/tr/Application.js140
1 files changed, 75 insertions, 65 deletions
diff --git a/qx08/source/class/tr/Application.js b/qx08/source/class/tr/Application.js
index 7113b14..fe7df8f 100644
--- a/qx08/source/class/tr/Application.js
+++ b/qx08/source/class/tr/Application.js
@@ -17,68 +17,78 @@
/**
* This is the main application class of your custom application "qx08"
*/
-qx.Class.define("tr.Application",
-{
- extend : qx.application.Standalone,
-
- /*
- *****************************************************************************
- MEMBERS
- *****************************************************************************
- */
-
- members :
- {
- /**
- * This method contains the initial application code and gets called
- * during startup of the application
- */
- main : function()
- {
- var self=this;
- // Call super class
- this.base(arguments);
-
- // Enable logging in debug variant
- if (qx.core.Variant.isSet("qx.debug", "on"))
- {
- // support native logging capabilities, e.g. Firebug for Firefox
- qx.log.appender.Native;
- // support additional cross-browser console. Press F7 to toggle visibility
- qx.log.appender.Console;
- }
-
- /*
- -------------------------------------------------------------------------
- Below is your actual application code...
- -------------------------------------------------------------------------
- */
-
-
- // if we run with a file:// url make sure
- // the app finds the Tr service (Tr.cgi)
- Tr.Server.getInstance().setLocalUrl(
- 'http://johan.oetiker.ch/~oetiker/tr/'
- );
- var root=this.getRoot();
- // Document is the application root
- var root = new qx.ui.container.Composite(new qx.ui.layout.VBox());
- this.getRoot().add(root, { left : 0, top: 0});
-
-
-
- var top = new qx.ui.container.Composite(new qx.ui.layout.HBox());
- var title = new qx.ui.basic.Atom('SmokeTrace 2.4.2');
- with(title){
- setTextColor('#b0b0b0');
- setFont(qx.bom.Font.fromString('20px bold sans-serif'));
- }
- top.add(title);
- top.add(new qx.ui.basic.HorizontalSpacer());
- top.add(new Tr.ui.ActionButton());
- root.add(top);
- var trace = new Tr.ui.TraceTable();
- root.add(trace);
- root.add(new Tr.ui.Footer(this.tr("SmokeTrace is part of the of the SmokePing suite created by Tobi Oetiker, Copyright 2008."),'http://oss.oetiker.ch/smokeping'));
- }
-});
+qx.Class.define("tr.Application", {
+ extend : qx.application.Standalone,
+
+ members : {
+ /**
+ * This method contains the initial application code and gets called
+ * during startup of the application
+ *
+ * @type member
+ * @return {void}
+ */
+ main : function() {
+ // Call super class
+ this.base(arguments);
+
+ // Enable logging in debug variant
+ if (qx.core.Variant.isSet("qx.debug", "on")) {
+ // support native logging capabilities, e.g. Firebug for Firefox
+ qx.log.appender.Native;
+
+ // support additional cross-browser console. Press F7 to toggle visibility
+ qx.log.appender.Console;
+ }
+
+ // if we run with a file:// url make sure
+ // the app finds the Tr service (tr.cgi)
+ tr.Server.getInstance().setLocalUrl('http://localhosth/~oetiker/tr/');
+
+ // Document is the application root
+ var root = new qx.ui.container.Composite(new qx.ui.layout.VBox());
+
+ this.getRoot().add(root, {
+ left : 0,
+ top : 0,
+ right : 0,
+ bottom : 0
+ });
+
+ root.set({ margin : 10 });
+ var top = new qx.ui.container.Composite(new qx.ui.layout.HBox().set({ alignY : 'top' }));
+ var title = new tr.ui.Link('SmokeTrace 2.4.2', 'http://oss.oetiker.ch/smokeping/', '#b0b0b0', '20px bold sans-serif');
+
+ top.add(title);
+ top.add(new qx.ui.core.Spacer(), { flex : 1 });
+ top.add(new tr.ui.ActionButton());
+ root.add(top);
+
+ var trace = new tr.ui.TraceTable();
+ root.add(trace, { flex : 1 });
+
+ root.add(new tr.ui.Footer(this.tr("SmokeTrace is part of the of the SmokePing suite created by Tobi Oetiker, Copyright 2008."), 'http://oss.oetiker.ch/smokeping/'));
+
+ var cfgwin = new tr.ui.Config();
+
+ this.getRoot().add(cfgwin, {
+ left : 30,
+ top : 30
+ });
+
+ qx.event.message.Bus.subscribe('tr.config', function(e) {
+ switch(e.getData())
+ {
+ case 'open':
+ cfgwin.open();
+ break;
+
+ case 'cancel':
+ case 'ok':
+ cfgwin.close();
+ break;
+ }
+ });
+ }
+ }
+ }); \ No newline at end of file