mirror of
				https://git.wownero.com/wowlet/wowlet.git
				synced 2024-08-15 01:03:14 +00:00 
			
		
		
		
	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:
		
						commit
						cd0c110df8
					
				
					 6 changed files with 24 additions and 1 deletions
				
			
		| 
						 | 
					@ -84,6 +84,11 @@ void HistoryWidget::setModel(TransactionHistoryProxyModel *model, Wallet *wallet
 | 
				
			||||||
    ui->history->hideColumn(TransactionHistoryModel::TxID);
 | 
					    ui->history->hideColumn(TransactionHistoryModel::TxID);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void HistoryWidget::resetModel()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    ui->history->setModel(nullptr);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void HistoryWidget::showTxDetails() {
 | 
					void HistoryWidget::showTxDetails() {
 | 
				
			||||||
    QModelIndex index = ui->history->currentIndex();
 | 
					    QModelIndex index = ui->history->currentIndex();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,6 +27,7 @@ public:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public slots:
 | 
					public slots:
 | 
				
			||||||
    void setSearchText(const QString &text);
 | 
					    void setSearchText(const QString &text);
 | 
				
			||||||
 | 
					    void resetModel();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
signals:
 | 
					signals:
 | 
				
			||||||
    void viewOnBlockExplorer(QString txid);
 | 
					    void viewOnBlockExplorer(QString txid);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -327,7 +327,12 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
 | 
				
			||||||
    connect(ui->coinsWidget, &CoinsWidget::sweepOutput, m_ctx, &AppContext::onSweepOutput);
 | 
					    connect(ui->coinsWidget, &CoinsWidget::sweepOutput, m_ctx, &AppContext::onSweepOutput);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    connect(m_ctx, &AppContext::walletClosing, [=]{
 | 
					    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
 | 
					    // window title
 | 
				
			||||||
| 
						 | 
					@ -389,6 +394,10 @@ void MainWindow::initMenu() {
 | 
				
			||||||
    // hide/show tabs
 | 
					    // hide/show tabs
 | 
				
			||||||
    m_tabShowHideSignalMapper = new QSignalMapper(this);
 | 
					    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));
 | 
					    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_tabShowHideMapper["Coins"] = new ToggleTab(ui->tabCoins, "Coins", "Coins", ui->actionShow_Coins, Config::showTabCoins);
 | 
				
			||||||
    m_tabShowHideSignalMapper->setMapping(ui->actionShow_Coins, "Coins");
 | 
					    m_tabShowHideSignalMapper->setMapping(ui->actionShow_Coins, "Coins");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -463,6 +463,7 @@
 | 
				
			||||||
    <property name="title">
 | 
					    <property name="title">
 | 
				
			||||||
     <string>View</string>
 | 
					     <string>View</string>
 | 
				
			||||||
    </property>
 | 
					    </property>
 | 
				
			||||||
 | 
					    <addaction name="actionShow_Home"/>
 | 
				
			||||||
    <addaction name="actionShow_Coins"/>
 | 
					    <addaction name="actionShow_Coins"/>
 | 
				
			||||||
    <addaction name="actionShow_calc"/>
 | 
					    <addaction name="actionShow_calc"/>
 | 
				
			||||||
    <addaction name="actionShow_Exchange"/>
 | 
					    <addaction name="actionShow_Exchange"/>
 | 
				
			||||||
| 
						 | 
					@ -714,6 +715,11 @@
 | 
				
			||||||
    <string>Rescan spent</string>
 | 
					    <string>Rescan spent</string>
 | 
				
			||||||
   </property>
 | 
					   </property>
 | 
				
			||||||
  </action>
 | 
					  </action>
 | 
				
			||||||
 | 
					  <action name="actionShow_Home">
 | 
				
			||||||
 | 
					   <property name="text">
 | 
				
			||||||
 | 
					    <string>Show Home</string>
 | 
				
			||||||
 | 
					   </property>
 | 
				
			||||||
 | 
					  </action>
 | 
				
			||||||
 </widget>
 | 
					 </widget>
 | 
				
			||||||
 <layoutdefault spacing="6" margin="11"/>
 | 
					 <layoutdefault spacing="6" margin="11"/>
 | 
				
			||||||
 <customwidgets>
 | 
					 <customwidgets>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,6 +36,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
 | 
				
			||||||
        {Config::websocketEnabled,{QS("websocketEnabled"), true}},
 | 
					        {Config::websocketEnabled,{QS("websocketEnabled"), true}},
 | 
				
			||||||
        {Config::nodeSource,{QS("nodeSource"), 0}},
 | 
					        {Config::nodeSource,{QS("nodeSource"), 0}},
 | 
				
			||||||
        {Config::useOnionNodes,{QS("useOnionNodes"), false}},
 | 
					        {Config::useOnionNodes,{QS("useOnionNodes"), false}},
 | 
				
			||||||
 | 
					        {Config::showTabHome,{QS("showTabHome"), true}},
 | 
				
			||||||
        {Config::showTabCoins,{QS("showTabCoins"), false}},
 | 
					        {Config::showTabCoins,{QS("showTabCoins"), false}},
 | 
				
			||||||
        {Config::showTabExchange, {QS("showTabExchange"), true}},
 | 
					        {Config::showTabExchange, {QS("showTabExchange"), true}},
 | 
				
			||||||
        {Config::showTabXMRig,{QS("showTabXMRig"), false}},
 | 
					        {Config::showTabXMRig,{QS("showTabXMRig"), false}},
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -38,6 +38,7 @@ public:
 | 
				
			||||||
        websocketEnabled,
 | 
					        websocketEnabled,
 | 
				
			||||||
        nodeSource,
 | 
					        nodeSource,
 | 
				
			||||||
        useOnionNodes,
 | 
					        useOnionNodes,
 | 
				
			||||||
 | 
					        showTabHome,
 | 
				
			||||||
        showTabCoins,
 | 
					        showTabCoins,
 | 
				
			||||||
        showTabExchange,
 | 
					        showTabExchange,
 | 
				
			||||||
        showTabCalc,
 | 
					        showTabCalc,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue