aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/qt/bitcoinamountfield.cpp5
-rw-r--r--src/qt/bitcoingui.cpp27
-rw-r--r--src/qt/bitcoingui.h4
-rw-r--r--src/qt/guiutil.cpp2
-rw-r--r--src/qt/transactionview.cpp8
-rw-r--r--src/qt/transactionview.h1
6 files changed, 45 insertions, 2 deletions
diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp
index ddf185c415..4fa2ca508b 100644
--- a/src/qt/bitcoinamountfield.cpp
+++ b/src/qt/bitcoinamountfield.cpp
@@ -145,6 +145,11 @@ void BitcoinAmountField::unitChanged(int idx)
amount->setDecimals(BitcoinUnits::decimals(currentUnit));
amount->setMaximum(qPow(10, BitcoinUnits::amountDigits(currentUnit)) - qPow(10, -amount->decimals()));
+ if(currentUnit == BitcoinUnits::uBTC)
+ amount->setSingleStep(0.01);
+ else
+ amount->setSingleStep(0.001);
+
if(valid)
{
// If value was valid, re-place it in the widget with the new unit
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 6b6b86eaca..eff8e667f6 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -48,6 +48,8 @@
#include <QUrl>
#include <QMimeData>
#include <QStyle>
+#include <QSettings>
+#include <QDesktopWidget>
#include <QListWidget>
#include <iostream>
@@ -65,7 +67,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
rpcConsole(0),
prevBlocks(0)
{
- resize(850, 550);
+ restoreWindowGeometry();
setWindowTitle(tr("Bitcoin") + " - " + tr("Wallet"));
#ifndef Q_OS_MAC
qApp->setWindowIcon(QIcon(":icons/bitcoin"));
@@ -146,6 +148,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
BitcoinGUI::~BitcoinGUI()
{
+ saveWindowGeometry();
if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu)
trayIcon->hide();
#ifdef Q_OS_MAC
@@ -411,6 +414,28 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
}
#endif
+void BitcoinGUI::saveWindowGeometry()
+{
+ QSettings settings;
+ settings.setValue("nWindowPos", pos());
+ settings.setValue("nWindowSize", size());
+}
+
+void BitcoinGUI::restoreWindowGeometry()
+{
+ QSettings settings;
+ QPoint pos = settings.value("nWindowPos").toPoint();
+ QSize size = settings.value("nWindowSize", QSize(850, 550)).toSize();
+ if (!pos.x() && !pos.y())
+ {
+ QRect screen = qApp->desktop()->screenGeometry();
+ pos.setX((screen.width()-size.width())/2);
+ pos.setY((screen.height()-size.height())/2);
+ }
+ resize(size);
+ move(pos);
+}
+
void BitcoinGUI::optionsClicked()
{
if(!clientModel || !clientModel->getOptionsModel())
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index f9c550035a..750e97104c 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -114,6 +114,10 @@ private:
void createTrayIcon();
/** Create system tray menu (or setup the dock menu) */
void createTrayIconMenu();
+ /** Save window size and position */
+ void saveWindowGeometry();
+ /** Restore window size and position */
+ void restoreWindowGeometry();
public slots:
/** Set number of connections shown in the UI */
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 30ad8ef66b..06ccde3782 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -161,7 +161,7 @@ void copyEntryData(QAbstractItemView *view, int column, int role)
if(!selection.isEmpty())
{
// Copy first item
- QApplication::clipboard()->setText(selection.at(0).data(role).toString());
+ QApplication::clipboard()->setText(selection.at(0).data(role).toString(),QClipboard::Selection);
}
}
diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp
index e7c384161c..9240b71c71 100644
--- a/src/qt/transactionview.cpp
+++ b/src/qt/transactionview.cpp
@@ -123,6 +123,7 @@ TransactionView::TransactionView(QWidget *parent) :
QAction *copyAddressAction = new QAction(tr("Copy address"), this);
QAction *copyLabelAction = new QAction(tr("Copy label"), this);
QAction *copyAmountAction = new QAction(tr("Copy amount"), this);
+ QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
QAction *editLabelAction = new QAction(tr("Edit label"), this);
QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
@@ -130,6 +131,7 @@ TransactionView::TransactionView(QWidget *parent) :
contextMenu->addAction(copyAddressAction);
contextMenu->addAction(copyLabelAction);
contextMenu->addAction(copyAmountAction);
+ contextMenu->addAction(copyTxIDAction);
contextMenu->addAction(editLabelAction);
contextMenu->addAction(showDetailsAction);
@@ -145,6 +147,7 @@ TransactionView::TransactionView(QWidget *parent) :
connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));
connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount()));
+ connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));
connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel()));
connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails()));
}
@@ -309,6 +312,11 @@ void TransactionView::copyAmount()
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::FormattedAmountRole);
}
+void TransactionView::copyTxID()
+{
+ GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxIDRole);
+}
+
void TransactionView::editLabel()
{
if(!transactionView->selectionModel() ||!model)
diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h
index e61515fdae..bb41a83e32 100644
--- a/src/qt/transactionview.h
+++ b/src/qt/transactionview.h
@@ -66,6 +66,7 @@ private slots:
void editLabel();
void copyLabel();
void copyAmount();
+ void copyTxID();
signals:
void doubleClicked(const QModelIndex&);