Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
defunctec
crown-core
Commits
486ccf24
Commit
486ccf24
authored
12 years ago
by
Wladimir J. van der Laan
Browse files
Options
Download
Email Patches
Plain Diff
When a transaction is clicked on overview page, focus it on history page
parent
613d6d67
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/qt/bitcoingui.cpp
+1
-0
src/qt/bitcoingui.cpp
src/qt/overviewpage.cpp
+9
-3
src/qt/overviewpage.cpp
src/qt/overviewpage.h
+3
-0
src/qt/overviewpage.h
src/qt/transactionview.cpp
+10
-0
src/qt/transactionview.cpp
src/qt/transactionview.h
+1
-0
src/qt/transactionview.h
with
24 additions
and
3 deletions
+24
-3
src/qt/bitcoingui.cpp
View file @
486ccf24
...
...
@@ -157,6 +157,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
// Clicking on a transaction on the overview page simply sends you to transaction history page
connect
(
overviewPage
,
SIGNAL
(
transactionClicked
(
QModelIndex
)),
this
,
SLOT
(
gotoHistoryPage
()));
connect
(
overviewPage
,
SIGNAL
(
transactionClicked
(
QModelIndex
)),
transactionView
,
SLOT
(
focusTransaction
(
QModelIndex
)));
// Doubleclicking on a transaction on the transaction history page shows details
connect
(
transactionView
,
SIGNAL
(
doubleClicked
(
QModelIndex
)),
transactionView
,
SLOT
(
showDetails
()));
...
...
This diff is collapsed.
Click to expand it.
src/qt/overviewpage.cpp
View file @
486ccf24
...
...
@@ -94,7 +94,7 @@ OverviewPage::OverviewPage(QWidget *parent) :
ui
(
new
Ui
::
OverviewPage
),
currentBalance
(
-
1
),
currentUnconfirmedBalance
(
-
1
),
txdelegate
(
new
TxViewDelegate
())
txdelegate
(
new
TxViewDelegate
())
,
filter
(
0
)
{
ui
->
setupUi
(
this
);
...
...
@@ -104,7 +104,13 @@ OverviewPage::OverviewPage(QWidget *parent) :
ui
->
listTransactions
->
setMinimumHeight
(
NUM_ITEMS
*
(
DECORATION_SIZE
+
2
));
ui
->
listTransactions
->
setAttribute
(
Qt
::
WA_MacShowFocusRect
,
false
);
connect
(
ui
->
listTransactions
,
SIGNAL
(
clicked
(
QModelIndex
)),
this
,
SIGNAL
(
transactionClicked
(
QModelIndex
)));
connect
(
ui
->
listTransactions
,
SIGNAL
(
clicked
(
QModelIndex
)),
this
,
SLOT
(
handleTransactionClicked
(
QModelIndex
)));
}
void
OverviewPage
::
handleTransactionClicked
(
const
QModelIndex
&
index
)
{
if
(
filter
)
emit
transactionClicked
(
filter
->
mapToSource
(
index
));
}
OverviewPage
::~
OverviewPage
()
...
...
@@ -132,7 +138,7 @@ void OverviewPage::setModel(WalletModel *model)
if
(
model
)
{
// Set up transaction list
TransactionFilterProxy
*
filter
=
new
TransactionFilterProxy
();
filter
=
new
TransactionFilterProxy
();
filter
->
setSourceModel
(
model
->
getTransactionTableModel
());
filter
->
setLimit
(
NUM_ITEMS
);
filter
->
setDynamicSortFilter
(
true
);
...
...
This diff is collapsed.
Click to expand it.
src/qt/overviewpage.h
View file @
486ccf24
...
...
@@ -12,6 +12,7 @@ namespace Ui {
}
class
WalletModel
;
class
TxViewDelegate
;
class
TransactionFilterProxy
;
/** Overview ("home") page widget */
class
OverviewPage
:
public
QWidget
...
...
@@ -38,9 +39,11 @@ private:
qint64
currentUnconfirmedBalance
;
TxViewDelegate
*
txdelegate
;
TransactionFilterProxy
*
filter
;
private
slots
:
void
displayUnitChanged
();
void
handleTransactionClicked
(
const
QModelIndex
&
index
);
};
#endif // OVERVIEWPAGE_H
This diff is collapsed.
Click to expand it.
src/qt/transactionview.cpp
View file @
486ccf24
...
...
@@ -417,3 +417,13 @@ void TransactionView::dateRangeChanged()
QDateTime
(
dateFrom
->
date
()),
QDateTime
(
dateTo
->
date
()).
addDays
(
1
));
}
void
TransactionView
::
focusTransaction
(
const
QModelIndex
&
idx
)
{
if
(
!
transactionProxyModel
)
return
;
QModelIndex
targetIdx
=
transactionProxyModel
->
mapFromSource
(
idx
);
transactionView
->
scrollTo
(
targetIdx
);
transactionView
->
setCurrentIndex
(
targetIdx
);
transactionView
->
setFocus
();
}
This diff is collapsed.
Click to expand it.
src/qt/transactionview.h
View file @
486ccf24
...
...
@@ -75,6 +75,7 @@ public slots:
void
changedPrefix
(
const
QString
&
prefix
);
void
changedAmount
(
const
QString
&
amount
);
void
exportClicked
();
void
focusTransaction
(
const
QModelIndex
&
);
};
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment