Browse Source

Minor UI stuff.

cl-refactor
Gav Wood 11 years ago
parent
commit
702e927945
  1. 32
      alethzero/Main.ui
  2. 26
      alethzero/MainWin.cpp
  3. 2
      alethzero/MainWin.h

32
alethzero/Main.ui

@ -130,6 +130,8 @@
<property name="title">
<string>&amp;Network</string>
</property>
<addaction name="go"/>
<addaction name="separator"/>
<addaction name="upnp"/>
<addaction name="usePast"/>
<addaction name="localNetworking"/>
@ -141,15 +143,12 @@
<string>T&amp;ools</string>
</property>
<addaction name="mine"/>
<addaction name="preview"/>
<addaction name="separator"/>
<addaction name="create"/>
<addaction name="importKey"/>
<addaction name="importKeyFile"/>
<addaction name="exportKey"/>
<addaction name="separator"/>
<addaction name="showAll"/>
<addaction name="showAllAccounts"/>
<addaction name="separator"/>
<addaction name="loadJS"/>
</widget>
<widget class="QMenu" name="menu_Help">
@ -191,7 +190,17 @@
<addaction name="separator"/>
<addaction name="usePrivate"/>
</widget>
<widget class="QMenu" name="menu_View">
<property name="title">
<string>&amp;View</string>
</property>
<addaction name="showAll"/>
<addaction name="showAllAccounts"/>
<addaction name="separator"/>
<addaction name="preview"/>
</widget>
<addaction name="menu_File"/>
<addaction name="menu_View"/>
<addaction name="menu_Network"/>
<addaction name="menu_Tools"/>
<addaction name="menu_Debug"/>
@ -507,8 +516,7 @@
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="net"/>
<addaction name="connect"/>
<addaction name="go"/>
<addaction name="preview"/>
<addaction name="mine"/>
<addaction name="refresh"/>
@ -1521,7 +1529,7 @@ font-size: 14pt</string>
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Preview</string>
<string>&amp;Preview Pending Transactions</string>
</property>
</action>
<action name="debugStep">
@ -1740,6 +1748,16 @@ font-size: 14pt</string>
<string>Enable Local Addresses</string>
</property>
</action>
<action name="importKeyFile">
<property name="text">
<string>Import Key &amp;File...</string>
</property>
</action>
<action name="go">
<property name="text">
<string>Go!</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>

26
alethzero/MainWin.cpp

@ -570,6 +570,26 @@ void Main::on_importKey_triggered()
QMessageBox::warning(this, "Invalid Entry", "Could not import the secret key; invalid key entered. Make sure it is 64 hex characters (0-9 or A-F).");
}
void Main::on_importKeyFile_triggered()
{
QString s = QFileDialog::getOpenFileName(this, "Import Account", QDir::homePath(), "JSON Files (*.json);;All Files (*)");
bytes b = fromHex(s.toStdString());
if (b.size() == 32)
{
auto k = KeyPair(h256(b));
if (std::find(m_myKeys.begin(), m_myKeys.end(), k) == m_myKeys.end())
{
m_myKeys.append(k);
m_keysChanged = true;
update();
}
else
QMessageBox::warning(this, "Already Have Key", "Could not import the secret key: we already own this account.");
}
else
QMessageBox::warning(this, "Invalid Entry", "Could not import the secret key; invalid key entered. Make sure it is 64 hex characters (0-9 or A-F).");
}
void Main::on_exportKey_triggered()
{
if (ui->ourAccounts->currentRow() >= 0 && ui->ourAccounts->currentRow() < m_myKeys.size())
@ -1689,6 +1709,12 @@ void Main::on_dumpTraceStorage_triggered()
}
}
void Main::on_go_triggered()
{
ui->net->setChecked(true);
web3()->connect(Host::pocHost());
}
void Main::on_callStack_currentItemChanged()
{
updateDebugger();

2
alethzero/MainWin.h

@ -144,6 +144,8 @@ private slots:
void on_usePrivate_triggered();
void on_enableOptimizer_triggered();
void on_turboMining_triggered();
void on_go_triggered();
void on_importKeyFile_triggered();
signals:
void poll();

Loading…
Cancel
Save