Browse Source

Load JS menu item.

Newer addresses in AZ
cl-refactor
Gav Wood 11 years ago
parent
commit
b31d233ecd
  1. 19
      alethzero/Main.ui
  2. 7
      alethzero/MainWin.cpp
  3. 1
      alethzero/MainWin.h
  4. 2
      libethereum/Executive.cpp
  5. 4
      stdserv.js

19
alethzero/Main.ui

@ -95,8 +95,8 @@
<widget class="QLineEdit" name="urlEdit"/> <widget class="QLineEdit" name="urlEdit"/>
</item> </item>
<item> <item>
<widget class="QWebView" name="webView"> <widget class="QWebView" name="webView" native="true">
<property name="url"> <property name="url" stdset="0">
<url> <url>
<string>about:blank</string> <string>about:blank</string>
</url> </url>
@ -117,7 +117,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1711</width> <width>1711</width>
<height>20</height> <height>27</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menu_File"> <widget class="QMenu" name="menu_File">
@ -148,6 +148,8 @@
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="showAll"/> <addaction name="showAll"/>
<addaction name="showAllAccounts"/> <addaction name="showAllAccounts"/>
<addaction name="separator"/>
<addaction name="loadJS"/>
</widget> </widget>
<widget class="QMenu" name="menu_Help"> <widget class="QMenu" name="menu_Help">
<property name="title"> <property name="title">
@ -475,7 +477,7 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>510</width> <width>510</width>
<height>360</height> <height>386</height>
</size> </size>
</property> </property>
<property name="features"> <property name="features">
@ -1046,8 +1048,8 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QWebView" name="jsConsole"> <widget class="QWebView" name="jsConsole" native="true">
<property name="url"> <property name="url" stdset="0">
<url> <url>
<string>about:blank</string> <string>about:blank</string>
</url> </url>
@ -1410,6 +1412,11 @@ font-family: Monospace, Ubuntu Mono, Lucida Console, Courier New</string>
<string>Use &amp;Past Peers</string> <string>Use &amp;Past Peers</string>
</property> </property>
</action> </action>
<action name="loadJS">
<property name="text">
<string>&amp;Load Javascript...</string>
</property>
</action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<customwidgets> <customwidgets>

7
alethzero/MainWin.cpp

@ -285,6 +285,13 @@ void Main::load(QString _s)
} }
// env.load("/home/gav/eth/init.eth") // env.load("/home/gav/eth/init.eth")
void Main::on_loadJS_triggered()
{
QString f = QFileDialog::getOpenFileName(this, "Load Javascript", QString(), "Javascript (*.js);;All files (*)");
if (f.size())
load(f);
}
void Main::note(QString _s) void Main::note(QString _s)
{ {
cnote << _s.toStdString(); cnote << _s.toStdString();

1
alethzero/MainWin.h

@ -110,6 +110,7 @@ private slots:
void on_inject_triggered(); void on_inject_triggered();
void on_showAll_triggered() { refresh(true); } void on_showAll_triggered() { refresh(true); }
void on_showAllAccounts_triggered() { refresh(true); } void on_showAllAccounts_triggered() { refresh(true); }
void on_loadJS_triggered();
void refresh(bool _override = false); void refresh(bool _override = false);
void refreshNetwork(); void refreshNetwork();

2
libethereum/Executive.cpp

@ -26,6 +26,8 @@
using namespace std; using namespace std;
using namespace eth; using namespace eth;
#define EVM_TRACE 1
Executive::~Executive() Executive::~Executive()
{ {
// TODO: Make safe. // TODO: Make safe.

4
stdserv.js

@ -10,7 +10,7 @@ var configCode = eth.lll("{
) )
}") }")
env.note('Config code: ' + configCode.unbin()) env.note('Config code: ' + configCode.unbin())
var config; var config = "0x9ef0f0d81e040012600b0c1abdef7c48f720f88a";
eth.create(eth.key, '0', configCode, 10000, eth.gasPrice, function(a) { config = a; }) eth.create(eth.key, '0', configCode, 10000, eth.gasPrice, function(a) { config = a; })
env.note('Config at address ' + config) env.note('Config at address ' + config)
@ -41,7 +41,7 @@ var nameRegCode = eth.lll("{
}"); }");
env.note('NameReg code: ' + nameRegCode.unbin()) env.note('NameReg code: ' + nameRegCode.unbin())
var nameReg; var nameReg = "0x3face8f2b3ef580265f0f67a57ce0fb78b135613";
env.note('Create NameReg...') env.note('Create NameReg...')
eth.create(eth.key, '0', nameRegCode, 10000, eth.gasPrice, function(a) { nameReg = a; }) eth.create(eth.key, '0', nameRegCode, 10000, eth.gasPrice, function(a) { nameReg = a; })

Loading…
Cancel
Save