Merge pull request 'Allow hiding Home tab' (#274) from tobtoht/feather:hide_home into master

Reviewed-on: https://git.wownero.com/feather/feather/pulls/274
This commit is contained in:
tobtoht 2020-12-30 20:29:47 +00:00
commit cd0c110df8
6 changed files with 24 additions and 1 deletions

View file

@ -84,6 +84,11 @@ void HistoryWidget::setModel(TransactionHistoryProxyModel *model, Wallet *wallet
ui->history->hideColumn(TransactionHistoryModel::TxID);
}
void HistoryWidget::resetModel()
{
ui->history->setModel(nullptr);
}
void HistoryWidget::showTxDetails() {
QModelIndex index = ui->history->currentIndex();

View file

@ -27,6 +27,7 @@ public:
public slots:
void setSearchText(const QString &text);
void resetModel();
signals:
void viewOnBlockExplorer(QString txid);

View file

@ -327,7 +327,12 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
connect(ui->coinsWidget, &CoinsWidget::sweepOutput, m_ctx, &AppContext::onSweepOutput);
connect(m_ctx, &AppContext::walletClosing, [=]{
ui->tabWidget->setCurrentIndex(Tabs::HOME);
if (!config()->get(Config::showTabHome).toBool())
ui->tabWidget->setCurrentIndex(Tabs::HISTORY);
else
ui->tabWidget->setCurrentIndex(Tabs::HOME);
ui->historyWidget->resetModel();
});
// window title
@ -389,6 +394,10 @@ void MainWindow::initMenu() {
// hide/show tabs
m_tabShowHideSignalMapper = new QSignalMapper(this);
connect(ui->actionShow_Home, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map));
m_tabShowHideMapper["Home"] = new ToggleTab(ui->tabHome, "Home", "Home", ui->actionShow_Home, Config::showTabHome);
m_tabShowHideSignalMapper->setMapping(ui->actionShow_Home, "Home");
connect(ui->actionShow_Coins, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map));
m_tabShowHideMapper["Coins"] = new ToggleTab(ui->tabCoins, "Coins", "Coins", ui->actionShow_Coins, Config::showTabCoins);
m_tabShowHideSignalMapper->setMapping(ui->actionShow_Coins, "Coins");

View file

@ -463,6 +463,7 @@
<property name="title">
<string>View</string>
</property>
<addaction name="actionShow_Home"/>
<addaction name="actionShow_Coins"/>
<addaction name="actionShow_calc"/>
<addaction name="actionShow_Exchange"/>
@ -714,6 +715,11 @@
<string>Rescan spent</string>
</property>
</action>
<action name="actionShow_Home">
<property name="text">
<string>Show Home</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>

View file

@ -36,6 +36,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
{Config::websocketEnabled,{QS("websocketEnabled"), true}},
{Config::nodeSource,{QS("nodeSource"), 0}},
{Config::useOnionNodes,{QS("useOnionNodes"), false}},
{Config::showTabHome,{QS("showTabHome"), true}},
{Config::showTabCoins,{QS("showTabCoins"), false}},
{Config::showTabExchange, {QS("showTabExchange"), true}},
{Config::showTabXMRig,{QS("showTabXMRig"), false}},

View file

@ -38,6 +38,7 @@ public:
websocketEnabled,
nodeSource,
useOnionNodes,
showTabHome,
showTabCoins,
showTabExchange,
showTabCalc,