GraphicNetNode::GraphicNetNode(NetNode* node, QGraphicsItem* parent) : QGraphicsObject(parent) { this->node = node; //addressText = node->getAddress().toString().c_str(); //hostnameText = node->getName(); addressText = new QGraphicsSimpleTextItem(node->getAddress().toString().c_str(), this); hostnameText = new QGraphicsSimpleTextItem(node->getName(), this); secondAddrsText = new QGraphicsSimpleTextItem(" ", this); QBrush blueBrush(Qt::blue); secondAddrsText->setBrush(blueBrush); QBrush brush(Qt::black); addressText->setBrush(brush); hostnameText->setBrush(brush); QPixmap pic(":/media/serverIcon"); icon = new QGraphicsPixmapItem(pic, this); //icon->scale(0.75, 0.75); addressText->setVisible(true); hostnameText->setVisible(true); icon->setVisible(true); QFont textFont; textFont.setPixelSize(20); addressText->setFont(textFont); hostnameText->setFont(textFont); secondAddrsText->setFont(textFont); updateAddress(); }
void MemberProfile::updateParticularsMenu(string& tempUser) { int options; int location = index(tempUser); do { cout << "--------------------------------------------------" << endl; cout << "Which particulars do you want to update/amend?" << endl; cout << "--------------------------------------------------" << endl; cout << endl; cout << " 1) Update username" << endl; cout << " 2) Update password" << endl; cout << " 3) Update name" << endl; cout << " 4) Update nric" << endl; cout << " 5) Update date of birth" << endl; cout << " 6) Update gender " << endl; cout << " 7) Update address" << endl; cout << " 8) Update booking preference" << endl; cout << " 9) Want notification?" << endl; cout << " 10) Back to main menu" << endl; cout << endl; cout << "Options: "; cin >> options; cin.clear(); cin.ignore(300,'\n'); cout << endl; switch (options) { case 1: updateUsername(location, tempUser); break; case 2: updatePassword(location); break; case 3: updateName(location); break; case 4: updateNric(location); break; case 5: updateDOB(location); break; case 6: updateGender(location); break; case 7: updateAddress(location); break; case 8: cout << "To be updated" << endl;; break; case 9: wantNotification(location); break; default: cout << "Please enter a valid option" << endl; } } while (options != 10); }
ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle* platformStyle, QWidget* parent) : QDialog(parent) , ui(new Ui::ReceiveCoinsDialog) , model(0) , platformStyle(platformStyle) #if defined(HAVE_WEBENGINE_VIEW) || defined(HAVE_WEBKIT) , buyView(NULL) #endif , buyReceiveAddress(NULL) , currentAccount(NULL) { ui->setupUi(this); ui->accountRequestPaymentButton->setCursor(Qt::PointingHandCursor); ui->accountBuyGuldenButton->setCursor(Qt::PointingHandCursor); ui->accountBuyButton->setCursor(Qt::PointingHandCursor); ui->accountSaveQRButton->setCursor(Qt::PointingHandCursor); ui->accountCopyToClipboardButton->setCursor(Qt::PointingHandCursor); ui->cancelButton->setCursor(Qt::PointingHandCursor); ui->closeButton->setCursor(Qt::PointingHandCursor); ui->generateRequestButton->setCursor(Qt::PointingHandCursor); ui->generateAnotherRequestButton->setCursor(Qt::PointingHandCursor); connect(ui->accountCopyToClipboardButton, SIGNAL(clicked()), this, SLOT(copyAddressToClipboard())); connect(ui->accountBuyGuldenButton, SIGNAL(clicked()), this, SLOT(showBuyGuldenDialog())); connect(ui->accountBuyButton, SIGNAL(clicked()), this, SLOT(buyGulden())); connect(ui->accountSaveQRButton, SIGNAL(clicked()), this, SLOT(saveQRAsImage())); connect(ui->accountRequestPaymentButton, SIGNAL(clicked()), this, SLOT(gotoRequestPaymentPage())); connect(ui->generateAnotherRequestButton, SIGNAL(clicked()), this, SLOT(gotoRequestPaymentPage())); connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(cancelRequestPayment())); connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(cancelRequestPayment())); connect(ui->generateRequestButton, SIGNAL(clicked()), this, SLOT(generateRequest())); updateAddress(""); gotoReceievePage(); #ifdef HAVE_WEBENGINE_VIEW buyView = new WebEngineView(this); buyView->setAttribute(Qt::WA_TranslucentBackground); ui->buyGuldenPageLayout->addWidget(buyView); buyView->show(); ui->loadingAnimationLabel->setObjectName("buy_page_error_text"); #elif defined(HAVE_WEBKIT) buyView = new WebView(this); buyView->settings()->setAttribute(QWebSettings::JavascriptEnabled, true); buyView->settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true); buyView->settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows, true); buyView->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); buyView->settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, false); buyView->settings()->setAttribute(QWebSettings::SpatialNavigationEnabled, true); buyView->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true); buyView->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); #ifdef MAC_OSX QSslConfiguration sslCfg = QSslConfiguration::defaultConfiguration(); QList<QSslCertificate> ca_list = sslCfg.caCertificates(); QList<QSslCertificate> ca_new = QSslCertificate::fromData("CaCertificates"); ca_list += ca_new; sslCfg.setCaCertificates(ca_list); sslCfg.setProtocol(QSsl::AnyProtocol); QSslConfiguration::setDefaultConfiguration(sslCfg); connect(buyView->page()->networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)), this, SLOT(sslErrorHandler(QNetworkReply*, const QList<QSslError>&))); #endif ui->buyGuldenPageLayout->addWidget(buyView); buyView->show(); ui->loadingAnimationLabel->setObjectName("buy_page_error_text"); #else ui->accountBuyGuldenButton->setVisible(false); #endif }
//----------------------------------------------------------------------------- void GuiEditor::valueChanged (CControl* control) { //effect->setParameterAutomated (control->getTag (), control->getValue ()); float value; int ival; const char* text; std::string result; char* tempt; switch (control->getTag()) { case kBufferSize: ((COptionMenu*)(control))->getCurrent(tempt); ival = ((COptionMenu*)(control))->getIndex(tempt); updateBufferSize(ival); break; case kGain: value = control->getValue(); result = floatToString(value*maxGain); gainDisplay->setText(result.c_str()); updateGain(value*maxGain); break; case kGainText: text = ((CTextEdit*)(control))->getText(); value = charToFloat(text); gainFader->setValue(value/(float)maxGain); updateGain(value); break; case kXScale: value = control->getValue(); result = floatToString(value*maxXScale); xScaleDisplay->setText(result.c_str()); updateXScale(value*maxXScale); break; case kXScaleText: text = ((CTextEdit*)(control))->getText(); value = charToFloat(text); xScaleFader->setValue(value/(float)maxXScale); updateXScale(value); break; case kYScale: value = control->getValue(); result = floatToString(value*maxYScale); yScaleDisplay->setText(result.c_str()); updateYScale(value*maxYScale); break; case kYScaleText: text = ((CTextEdit*)(control))->getText(); value = charToFloat(text); yScaleFader->setValue(value/(float)maxYScale); updateYScale(value); break; case kResponse: value = control->getValue(); result = floatToString(value); responseDisplay->setText(result.c_str()); updateResponse(value); break; case kResponseText: text = ((CTextEdit*)(control))->getText(); value = charToFloat(text); responseFader->setValue(value); updateResponse(value); break; case kBands: ival = (int)(control->getValue()*maxBands); result = intToString(ival); bandsDisplay->setText(result.c_str()); bandsFader->setValue(((float)ival)/(float)maxBands); updateBands(ival); break; case kBandsText: text = ((CTextEdit*)(control))->getText(); ival = charToInt(text); bandsFader->setValue((float)value/(float)maxBands); updateBands(ival); break; case kAmpScale: ((COptionMenu*)(control))->getCurrent(tempt); ival = ((COptionMenu*)(control))->getIndex(tempt); updateAmpScale(ival); break; case kType: ((COptionMenu*)(control))->getCurrent(tempt); ival = ((COptionMenu*)(control))->getIndex(tempt); updateType(ival); break; case kDisplay: ((COptionMenu*)(control))->getCurrent(tempt); ival = ((COptionMenu*)(control))->getIndex(tempt); updateDisplayt(ival); break; case kResampling: ((COptionMenu*)(control))->getCurrent(tempt); ival = ((COptionMenu*)(control))->getIndex(tempt); updateResampling(ival); break; case kFreqScale: ((COptionMenu*)(control))->getCurrent(tempt); ival = ((COptionMenu*)(control))->getIndex(tempt); updateFreqScale(ival); break; case kAddress: text = ((CTextEdit*)(control))->getText(); updateAddress(text); break; case kPort: text = ((CTextEdit*)(control))->getText(); ival = charToInt(text); updatePort(ival); break; case kHost: text = ((CTextEdit*)(control))->getText(); updateHost(text); break; } }