//window.setTimeout(function() { function runCommand() { var cmd; var cb; var inputData = ""; if (typeof(arguments[0])=='string') { if (arguments[0].indexOf(" ")==-1) cmd = [arguments[0]]; else cmd = arguments[0].split(" "); } else if (arguments[0] instanceof Array) cmd = arguments[0]; if (typeof(arguments[1])=='function') cb = arguments[1]; else if (typeof(arguments[1])=='string') inputData = arguments[1]; if (typeof(arguments[2])=='function') cb = arguments[2]; var cmdRunner = this._createBGRunner(cmd); cmdRunner.setInputData(inputData); if (typeof(cb)=='function') { var that = this; var _cb = function(data) { if (!data) data = {'error': ["no response from server."]}; data.command = cmd; data.connection = that; if (inputData.length>0) data.inputData = inputData; cb(data); this.destroy(); } cmdRunner.runCompleted.connect(cmdRunner,_cb); cmdRunner.execBG(); return null; } else return cmdRunner.exec(); } ClientKit.p4.createP4 = function(config) { if (!config) throw new Error("must provide config object."); var newP4con = ClientKit.p4._newConnection(config); if (!newP4con) throw new Error("invalid config object. (must have a port property!)"); if (!newP4con.run) newP4con.run = runCommand; return newP4con; } try { //for some reason, sometimes getConnections throws an error, //but calling this first seems to remedy it. (Why? I don't know) var connectionNames = ClientKit.p4.getConnections(); var connections = ClientKit.p4.getConnections(); for (var i=0;i<connections.length;i++) { connections[i].run = runCommand; } } catch (e){} console.log(ClientKit.p4); //},1);
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#10 | 8120 | David George | quick fix - was passing an unnecessary arg... | ||
#9 | 8119 | David George |
fixing setInput for -i commands, and fixing connectionObject.run() to take a form as its second argument. (if the second argument is a form, it will check the third argument for a callback function) |
||
#8 | 8117 | David George | removing unnecessary timeout | ||
#7 | 8115 | David George |
a bunch of changes to the GuiApi - probably bound to change, though, so use at your own risk! beginnings of migrating to an "all windows are created equal" model. (as opposed to a MainWindow) removing the unreliable Qt execution of the .js methods - please include in your HTML (<script type="text/javascript" src="qrc:/js/ClientKitMethods.js"></script>) |
||
#6 | 8108 | David George | changing the way the window refreshing gets handled | ||
#5 | 8107 | David George |
a little cleanup / bug squashing. Not much to see here. createP4 method now added directly to p4 object (rather than through proto) removing some methods that were only used for development debugging/testing |
||
#4 | 8106 | David George | restructure callback payload | ||
#3 | 8105 | David George | changing callback response sturcture | ||
#2 | 8104 | David George |
merged .runAsync and .run into one method that runs sync/async depending on the presence of a callback function argument. restored some storage-related QWebSettings |
||
#1 | 8101 | David George |
beginning of _massive_ re-factoring your current build settings will fail create a new project from newly added .pro file (but change its p4api paths to match your old one) look for updated README as soon as Dave agrees that changes are _indeed_ for the best (Changes by Jaimen) |