• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ Wallet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Wallet的典型用法代码示例。如果您正苦于以下问题:C++ Wallet类的具体用法?C++ Wallet怎么用?C++ Wallet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Wallet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: OFX_PASSWORD_KEY

QString MyMoneyOfxConnector::password() const
{
  // if we don't find a password in the wallet, we use the old method
  // and retrieve it from the settings stored in the KMyMoney data storage.
  // in case we don't have a password on file, we ask the user
  QString key = OFX_PASSWORD_KEY(m_fiSettings.value("url"), m_fiSettings.value("uniqueId"));
  QString pwd = m_fiSettings.value("password");

  // now check for the wallet
  Wallet *wallet = openSynchronousWallet();
  if (wallet
      && !Wallet::keyDoesNotExist(Wallet::NetworkWallet(), Wallet::PasswordFolder(), key)) {
    wallet->setFolder(Wallet::PasswordFolder());
    wallet->readPassword(key, pwd);
  }

  if (pwd.isEmpty()) {
    QPointer<KPasswordDialog> dlg = new KPasswordDialog(0);
    dlg->setPrompt(i18n("Enter your password for account <b>%1</b>").arg(m_account.name()));
    if (dlg->exec())
      pwd = dlg->password();
    delete dlg;
  }
  return pwd;
}
开发者ID:CGenie,项目名称:kmymoney,代码行数:25,代码来源:mymoneyofxconnector.cpp


示例2: readPassword

void NetworkAccount::readPassword()
{
    if(!storePasswd())
        return;

    // ### workaround for broken Wallet::keyDoesNotExist() which returns wrong
    // results for new entries without closing and reopening the wallet
    if(Wallet::isOpen(Wallet::NetworkWallet()))
    {
        Wallet *wallet = kmkernel->wallet();
        if(!wallet || !wallet->hasEntry("account-" + QString::number(mId)))
            return;
    }
    else
    {
        if(Wallet::keyDoesNotExist(Wallet::NetworkWallet(), "kmail", "account-" + QString::number(mId)))
            return;
    }

    if(kmkernel->wallet())
    {
        QString passwd;
        kmkernel->wallet()->readPassword("account-" + QString::number(mId), passwd);
        setPasswd(passwd, true);
        mPasswdDirty = false;
    }
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:27,代码来源:networkaccount.cpp


示例3: Clamp

void CoreScript::AddTech()
{
	tech += TECH_ADDED_BY_VISITOR;
	tech = Clamp( tech, 0.0, Min( double(TECH_MAX), double( MaxTech() ) - 0.01 ));
	achievement.techLevel = Max(achievement.techLevel, (int)tech);

	int team = ParentChit()->Team();
	int superTeam = Team::Instance()->SuperTeam(team);
	if (team != superTeam) {
		CoreScript* super = CoreScript::GetCoreFromTeam(superTeam);
		if (super) {
			super->AddTech();

			// EXPERIMENTAL: also transfer Au
			Wallet* wallet = parentChit->GetWallet();
			GLASSERT(wallet);
			if (wallet 
				&& super->ParentChit()->GetWallet() 
				&& (wallet->Gold() > (GOLD_XFER_TAKEOVER *3/2))) 
			{
				int gold = GOLD_XFER_TAKEOVER / 10;
				super->ParentChit()->GetWallet()->Deposit(wallet, gold);
			}
		}
	}
}
开发者ID:csioza,项目名称:alteraorbis,代码行数:26,代码来源:corescript.cpp


示例4: bridgeWatcherStart

Status
bridgeWatcherStart(Wallet &self)
{
    if (watchers_.end() != watchers_.find(self.id()))
        return ABC_ERROR(ABC_CC_Error,
                         "Watcher already exists for " + self.id());

    watchers_[self.id()].reset(new WatcherInfo(self));

    return Status();
}
开发者ID:codeaudit,项目名称:airbitz-core,代码行数:11,代码来源:WatcherBridge.cpp


示例5: argToStr

//public member functions
void Command::parse(char* args[])
{
    mainArg = argToStr(args[1]);
    Wallet wallet;
    
    if(mainArg == "getnewaddress")
    {
        wallet.walletName = argToStr(args[2]);
        wallet.getNewAddress();
    }
}
开发者ID:tommo1296,项目名称:fake_wallet,代码行数:12,代码来源:main.cpp


示例6: if

void MapScene::ItemTapped(const gamui::UIItem* item)
{
	Vector2I sector = { 0, 0 };
	Vector2I v = data->destSector;
	CoreScript* cs = CoreScript::GetCore(v);
	CoreScript* homeCore = lumosChitBag->GetHomeCore();

	if (item == &okay) {
		data->destSector.Zero();
		lumosGame->PopScene();
	}
	else if (item == &gridTravel) {
		lumosGame->PopScene();
	}
	else if (item == &viewButton) {
		data->view = true;
		lumosGame->PopScene();
	}
	else if (item == &mapImage) {
		float x = 0, y = 0;
		gamui2D.GetRelativeTap(&x, &y);
		sector.x = int(x * float(NUM_SECTORS));
		sector.y = int(y * float(NUM_SECTORS));
		data->destSector = sector;
		DrawMap();
		EnableButtons();
	}
	else if (item == &mapImage2) {
		float x = 0, y = 0;
		gamui2D.GetRelativeTap(&x, &y);
		Rectangle2I b = MapBounds2();
		sector.x = b.min.x + int(x * float(b.Width()));
		sector.y = b.min.y + int(y * float(b.Height()));
		data->destSector = sector;
		DrawMap();
		EnableButtons();
	}
	else if (item == &warButton) {
		Team::Instance()->War(cs, homeCore, true, &lumosChitBag->GetSim()->GetCachedWeb());
		DrawMap();
		EnableButtons();
	}
	else if (item == &peaceButton) {
		int cost = Team::Instance()->Peace(cs, homeCore, false, &lumosChitBag->GetSim()->GetCachedWeb());
		Wallet* wallet = homeCore->ParentChit()->GetWallet();
		if (wallet->HasGold(cost)) {
			ReserveBank::Instance()->GetWallet()->Deposit(wallet, cost);
			Team::Instance()->Peace(cs, homeCore, true, &lumosChitBag->GetSim()->GetCachedWeb());
			DrawMap();
			EnableButtons();
		}
	}
}
开发者ID:fordream,项目名称:alteraorbis,代码行数:53,代码来源:mapscene.cpp


示例7: viewWallet

//Get values from wallet class and display them on screen
void viewWallet(Wallet &myWallet)
{
	cout << endl << "	***Viewing Wallet***" << endl << endl
		<< "	 1: Dollars: " << fixed << setprecision(2) << myWallet.getMoney(Wallet::DOLLAR) << "\n"
		<< "	 2: Dinars: " << fixed << setprecision(2) << myWallet.getMoney(Wallet::DINAR) << "\n"
		<< "	 3: Euro: " << fixed << setprecision(2) << myWallet.getMoney(Wallet::EURO) << "\n"
		<< "	 4: Peso: " << fixed << setprecision(2) << myWallet.getMoney(Wallet::PESO) << "\n"
		<< "	 5: Pound: " << fixed << setprecision(2) << myWallet.getMoney(Wallet::POUND) << "\n"
		<< endl << endl;

	system("pause");
}
开发者ID:agbares,项目名称:CIS22C,代码行数:13,代码来源:Source.cpp


示例8: sender

void PasswordHandler::onWalletOpened(bool success)
{
#if USE_KWALLET
    Wallet *wallet = qobject_cast<Wallet*>( sender() );
    if (wallet && success) {
        // read and store the password
        password();
        emit passwordAvailable();
    }
    if (wallet) {
        wallet->deleteLater();
    }
#else
    Q_UNUSED(success);
#endif
}
开发者ID:Acidburn0zzz,项目名称:FatCRM,代码行数:16,代码来源:passwordhandler.cpp


示例9: ABC_BridgeWatcherConnect

tABC_CC ABC_BridgeWatcherConnect(Wallet &self, tABC_Error *pError)
{
    tABC_CC cc = ABC_CC_Ok;
    tABC_GeneralInfo *ppInfo = NULL;
    const char *szServer = FALLBACK_OBELISK;

    Watcher *watcher = nullptr;
    ABC_CHECK_NEW(watcherFind(watcher, self));

    // Pick a server:
    if (isTestnet())
    {
        szServer = TESTNET_OBELISK;
    }
    else if (ABC_CC_Ok == ABC_GeneralGetInfo(&ppInfo, pError) &&
        0 < ppInfo->countObeliskServers)
    {
        ++gLastObelisk;
        if (ppInfo->countObeliskServers <= gLastObelisk)
            gLastObelisk = 0;
        szServer = ppInfo->aszObeliskServers[gLastObelisk];
    }

    // Connect:
    ABC_DebugLog("Wallet %s connecting to %s", self.id().c_str(), szServer);
    watcher->connect(szServer);

exit:
    ABC_GeneralFreeInfo(ppInfo);
    return cc;
}
开发者ID:TSchnaars,项目名称:airbitz-core,代码行数:31,代码来源:WatcherBridge.cpp


示例10: mainBranch

static bc::hd_private_key
mainBranch(const Wallet &wallet)
{
    return bc::hd_private_key(wallet.bitcoinKey()).
           generate_private_key(0).
           generate_private_key(0);
}
开发者ID:BitcoinKinetics,项目名称:airbitz-core,代码行数:7,代码来源:AddressDb.cpp


示例11: bridgeWatcherDelete

Status
bridgeWatcherDelete(Wallet &self)
{
    watcherSave(self).log(); // Failure is not fatal
    watchers_.erase(self.id());

    return Status();
}
开发者ID:codeaudit,项目名称:airbitz-core,代码行数:8,代码来源:WatcherBridge.cpp


示例12: ABC_BridgeWatcherDelete

tABC_CC ABC_BridgeWatcherDelete(Wallet &self, tABC_Error *pError)
{
    tABC_CC cc = ABC_CC_Ok;

    watcherSave(self); // Failure is not fatal
    watchers_.erase(self.id());

    return cc;
}
开发者ID:TSchnaars,项目名称:airbitz-core,代码行数:9,代码来源:WatcherBridge.cpp


示例13: emptyWallet

//Calls function from wallet class to set all values to zero
void emptyWallet(Wallet &myWallet)
{
	cout << endl << "	***Emptying Wallet...***" << endl;
	
	myWallet.emptyWallet();
	
	cout << endl << "	***Wallet Emptied***" << endl;

	system("pause");
}
开发者ID:agbares,项目名称:CIS22C,代码行数:11,代码来源:Source.cpp


示例14: openWallet

// return 0 on success, -1 on error or not found, -2 on user reject
// if success, password contain the password
int SQLManager::readCredentials(const QString &name, QString &password)
{
  Wallet *wallet = openWallet();

  if (!wallet) // user reject
    return -2;

  QMap<QString, QString> map;

  if (wallet->readMap(name, map) == 0)
  {
    if (!map.isEmpty())
    {
      password = map.value("password");
      return 0;
    }
  }

  return -1;
}
开发者ID:azat-archive,项目名称:kate,代码行数:22,代码来源:sqlmanager.cpp


示例15: watcherFind

static Status
watcherFind(WatcherInfo *&result, Wallet &self)
{
    std::string id = self.id();
    auto row = watchers_.find(id);
    if (row == watchers_.end())
        return ABC_ERROR(ABC_CC_Synchronizing, "Cannot find watcher for " + id);

    result = row->second.get();
    return Status();
}
开发者ID:TSchnaars,项目名称:airbitz-core,代码行数:11,代码来源:WatcherBridge.cpp


示例16: queueWriteOAuthCredentials

 void queueWriteOAuthCredentials() {
     if (wallet != NULL && wallet->isOpen())
         p->writeOAuthCredentials(true);
     else {
         /// Wallet is closed or not initialized
         if (wallet != NULL)
             /// Delete existing but closed wallet, will be replaced by new, open wallet soon
             delete wallet;
         p->setEnabled(false);
         p->setCursor(Qt::WaitCursor);
         wallet = Wallet::openWallet(Wallet::NetworkWallet(), p->winId(), Wallet::Asynchronous);
         connect(wallet, &Wallet::walletOpened, p, &ZoteroBrowser::writeOAuthCredentials);
     }
 }
开发者ID:KDE,项目名称:kbibtex,代码行数:14,代码来源:zoterobrowser.cpp


示例17: Wallet

Wallet *Wallet::openWallet(const QString &name, WId w, OpenType ot)
{
    if(ot == Asynchronous)
    {
        Wallet *wallet = new Wallet(-1, name);
        DCOPRef("kded", "kwalletd").send("openAsynchronous", name, wallet->objId(), uint(w));
        return wallet;
    }

    // avoid deadlock if the app has some popup open (#65978/#71048)
    while(QWidget *widget = qApp->activePopupWidget())
        widget->close();

    bool isPath = ot == Path;
    DCOPReply r;

    if(isPath)
    {
        r = DCOPRef("kded", "kwalletd").call("openPath", name, uint(w));
    }
    else
    {
        r = DCOPRef("kded", "kwalletd").call("open", name, uint(w));
    }

    if(r.isValid())
    {
        int drc = -1;
        r.get(drc);
        if(drc != -1)
        {
            return new Wallet(drc, name);
        }
    }

    return 0;
}
开发者ID:,项目名称:,代码行数:37,代码来源:


示例18: ABC_BridgeWatcherStart

tABC_CC ABC_BridgeWatcherStart(Wallet &self,
                               tABC_Error *pError)
{
    tABC_CC cc = ABC_CC_Ok;

    std::string id = self.id();

    if (watchers_.end() != watchers_.find(id))
        ABC_RET_ERROR(ABC_CC_Error, ("Watcher already exists for " + id).c_str());

    watchers_[id].reset(new WatcherInfo(self));

    watcherLoad(self); // Failure is not fatal

exit:
    return cc;
}
开发者ID:TSchnaars,项目名称:airbitz-core,代码行数:17,代码来源:WatcherBridge.cpp


示例19: ABC_BridgeWatchAddr

tABC_CC ABC_BridgeWatchAddr(Wallet &self,
                            const char *pubAddress,
                            tABC_Error *pError)
{
    tABC_CC cc = ABC_CC_Ok;

    ABC_DebugLog("Watching %s for %s", pubAddress, self.id().c_str());
    bc::payment_address addr;

    WatcherInfo *watcherInfo = nullptr;
    ABC_CHECK_NEW(watcherFind(watcherInfo, self));

    if (!addr.set_encoded(pubAddress))
    {
        cc = ABC_CC_Error;
        ABC_DebugLog("Invalid pubAddress %s\n", pubAddress);
        goto exit;
    }
    watcherInfo->addresses.insert(pubAddress);
    watcherInfo->watcher.watch_address(addr);

exit:
    return cc;
}
开发者ID:TSchnaars,项目名称:airbitz-core,代码行数:24,代码来源:WatcherBridge.cpp


示例20: WatcherInfo

 WatcherInfo(Wallet &wallet):
     wallet(wallet),
     parent_(wallet.shared_from_this())
 {
 }
开发者ID:TSchnaars,项目名称:airbitz-core,代码行数:5,代码来源:WatcherBridge.cpp



注:本文中的Wallet类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ WalletModelTransaction类代码示例发布时间:2022-05-31
下一篇:
C++ WallClockTimer类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap