Permalink
Browse files

gui enhancements

translations initialized (only 'en')
  • Loading branch information...
1 parent f569830 commit 13a84d237c1a79f374234054b18e59cb67a17ad9 tomek committed Jul 19, 2012
@@ -24,7 +24,7 @@ qx.Class.define("helenos.components.MainPane",
this.__createLeftPane();
this.__createRightPane();
- this.add(this.__treePane, 0);
+ this.add(this.__schemaPane, 0);
this.add(this.__rightPane, 1);
},
@@ -31,38 +31,37 @@ qx.Class.define("helenos.components.SchemaPane",
});
this.__createButtons();
- this.__createClusterTree();
+ this.__createSchemaTree();
this.add(this.__btnToolbar);
- this.add(this.__clusterTree, {
+ this.add(this.__schemaTree, {
flex : 1
});
},
members :
{
- __clusterTree : null,
+ __schemaTree : null,
__btnToolbar : null,
__createButtons : function() {
this.__btnToolbar = new qx.ui.toolbar.ToolBar();
var refreshButton = new qx.ui.toolbar.Button("Refresh", "qx/icon/Oxygen/16/actions/view-refresh.png");
- refreshButton.addListener('execute', this.refreshClusterTree);
+ refreshButton.addListener('execute', this.refreshSchemaTree, this);
this.__btnToolbar.add(refreshButton);
},
- __createClusterTree : function() {
- this.__clusterTree = new qx.ui.tree.Tree();
+ __createSchemaTree : function() {
+ this.__schemaTree = new qx.ui.tree.Tree();
- this.refreshClusterTree();
+ this.refreshSchemaTree();
},
refreshSchemaTree : function() {
- this.__clusterTree.resetSelection(); // ?
-
- var rpc = new helenos.util.Rpc('Cluster');
+ this.__schemaTree.resetSelection();
+ this.__schemaTree.resetRoot();
var clusterName = helenos.util.RpcActionsProvider.describeClusterName();
this.__setRootItem(clusterName);
@@ -81,7 +80,7 @@ qx.Class.define("helenos.components.SchemaPane",
icon : 'helenos/keyspace.png',
contextMenu: new helenos.components.menu.KeyspaceContextMenu(ks.name)
});
- this.__clusterTree.getRoot().add(ksItem);
+ this.__schemaTree.getRoot().add(ksItem);
for (var j = 0; j < ks.cfDefs.length; j++) {
var cf = ks.cfDefs[j];
@@ -116,7 +115,7 @@ qx.Class.define("helenos.components.SchemaPane",
var rootItem = new qx.ui.tree.TreeFolder(clusterName);
rootItem.setOpen(true);
rootItem.setIcon("qx/icon/Oxygen/16/devices/computer.png");
- this.__clusterTree.setRoot(rootItem);
+ this.__schemaTree.setRoot(rootItem);
}
}
});
@@ -36,11 +36,13 @@ qx.Class.define("helenos.components.menu.ColumnFamilyContextMenu",
var removeButton = new qx.ui.menu.Button("Remove", "qx/icon/Oxygen/16/actions/edit-delete.png");
removeButton.setUserData('KSNAME', ksName);
removeButton.setUserData('CFNAME', cfName);
+ removeButton.addListener("execute", this.__removeColumnFamily);
this.add(removeButton);
var truncateButton = new qx.ui.menu.Button("Truncate", "qx/icon/Oxygen/16/actions/edit-clear.png");
truncateButton.setUserData('KSNAME', ksName);
truncateButton.setUserData('CFNAME', cfName);
+ truncateButton.addListener("execute", this.__truncateColumnFamily);
this.add(truncateButton);
},
@@ -50,6 +52,28 @@ qx.Class.define("helenos.components.menu.ColumnFamilyContextMenu",
var cfName = e.getTarget().getUserData('CFNAME');
helenos.util.GuiObserver.showColumnFamilyInfoTab(ksName, cfName);
+ },
+
+ __truncateColumnFamily : function(e) {
+ var ksName = e.getTarget().getUserData('KSNAME');
+ var cfName = e.getTarget().getUserData('CFNAME');
+ dialog.Dialog.confirm(this.tr('loss.data.alert'), function(ret) {
+ if (ret == true) {
+ helenos.util.RpcActionsProvider.truncateColumnFamily(ksName, cfName);
+ //helenos.util.GuiObserver.refreshSchemaTree();
+ }
+ }, this);
+ },
+
+ __removeColumnFamily : function(e) {
+ var ksName = e.getTarget().getUserData('KSNAME');
+ var cfName = e.getTarget().getUserData('CFNAME');
+ dialog.Dialog.confirm(this.tr('loss.data.alert'), function(ret) {
+ if (ret == true) {
+ helenos.util.RpcActionsProvider.removeColumnFamily(ksName, cfName);
+ helenos.util.GuiObserver.refreshSchemaTree();
+ }
+ }, this);
}
}
});
@@ -43,7 +43,7 @@ qx.Class.define("helenos.components.menu.KeyspaceContextMenu",
__dropKeyspace : function(e) {
var ksName = e.getTarget().getUserData('KSNAME');
- dialog.Dialog.confirm('<b>Are you sure ?! You will lose all your data !!!</b>', function(ret) {
+ dialog.Dialog.confirm(this.tr('loss.data.alert'), function(ret) {
if (ret == true) {
helenos.util.RpcActionsProvider.dropKeyspace(ksName);
helenos.util.GuiObserver.refreshSchemaTree();
@@ -0,0 +1,16 @@
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: you@your.org\n"
+"POT-Creation-Date: 2012-07-19 15:05+0100\n"
+"PO-Revision-Date: 2012-07-19 15:05+0100\n"
+"Last-Translator: you <you@your.org>\n"
+"Language-Team: Team <yourteam@your.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: helenos/components/menu/ColumnFamilyContextMenu.js:59
+msgid "loss.data.alert"
+msgstr "Are you sure ?! You will lose all your data !!!"

0 comments on commit 13a84d2

Please sign in to comment.