src/mainwindow.cpp
// Adds z-addresses to the combo box. Technically, returns a
// lambda, which can be connected to the appropriate signal
Adds z-addresses to the combo box. Technically, returns a
lambda, which can be connected to the appropriate signal
Adds z - addresses to the combo box . Technically returns a lambda which can be connected to the appropriate signal
std::function<void(bool)> MainWindow::addZAddrsToComboList(bool sapling) {
    return [=] (bool checked) {
        if (checked && this->rpc->getAllZAddresses() != nullptr) {
            auto addrs = this->rpc->getAllZAddresses();
            ui->listReceiveAddresses->clear();
            std::for_each(addrs->begin(), addrs->end(), [=] (auto addr) {
                if ( (sapling &&  Settings::getInstance()->isSaplingAddress(addr)) ||
                    (!sapling && !Settings::getInstance()->isSaplingAddress(addr))) {
                        if (rpc->getAllBalances()) {
                            auto bal = rpc->getAllBalances()->value(addr);
                            ui->listReceiveAddresses->addItem(addr, bal);
                        }
                }
            });
            if (addrs->isEmpty()) {
                addNewZaddr();
            }
        }
    };
}
std :: function < void ( bool ) > MainWindow :: addZAddrsToComboList ( bool sapling ) { return [ = ] ( bool checked ) { if ( checked && this -> rpc -> getAllZAddresses ( ) != nullptr ) { auto addrs = this -> rpc -> getAllZAddresses ( ) ; ui -> listReceiveAddresses -> clear ( ) ; std :: for_each ( addrs -> begin ( ) , addrs -> end ( ) , [ = ] ( auto addr ) { if ( ( sapling && Settings :: getInstance ( ) -> isSaplingAddress ( addr ) ) || ( ! sapling && ! Settings :: getInstance ( ) -> isSaplingAddress ( addr ) ) ) { if ( rpc -> getAllBalances ( ) ) { auto bal = rpc -> getAllBalances ( ) -> value ( addr ) ; ui -> listReceiveAddresses -> addItem ( addr , bal ) ; } } } ) ; if ( addrs -> isEmpty ( ) ) { addNewZaddr ( ) ; } } } ; }
Adds z-addresses to the combo box.
Adds z - addresses to the combo box .
// If z-addrs are empty, then create a new one.