INT_PTR CALLBACK Pin2DialogProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { static char *pin2; switch(message) { case WM_INITDIALOG: setLabelText(hwnd, IDC_NAME, ((DialogData *)lParam)->name); if(((DialogData *)lParam)->message != NULL) { setLabelText(hwnd, IDC_ERROR, ((DialogData *)lParam)->message); } pin2 = ((DialogData *)lParam)->pin2; return true; case WM_COMMAND: switch(LOWORD(wParam)) { case IDOK: GetDlgItemText(hwnd, IDC_PIN2, pin2, PIN2_MAX_LEN); case IDCANCEL: EndDialog(hwnd, LOWORD(wParam)); break; } if(HIWORD(wParam) == EN_CHANGE && LOWORD(wParam) == IDC_PIN2) { Button_Enable(GetDlgItem(hwnd, IDOK), isAcceptableLengthPIN2(hwnd, IDC_PIN2)); } return true; case WM_CTLCOLORSTATIC: if(GetDlgItem(hwnd, IDC_ERROR) == ((HWND)lParam)){ SetTextColor((HDC)wParam, RGB(255, 0, 0)); SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE)); return (INT_PTR)GetStockObject(NULL_BRUSH); } default: return false; } return DefWindowProc(hwnd, message, wParam, lParam); }
void ofxUIDropDownList::checkAndSetTitleLabel() { if(bShowCurrentSelected && selected.size() > 0) { string title = ""; int index = 0; for(vector<ofxUIWidget *>::iterator it = selected.begin(); it != selected.end(); it++) { if(index == 0) { title+=(*it)->getName(); } else { title+=","+(*it)->getName(); } index++; } if(title.length()) { setLabelText(title); } } else { setLabelText(name); } }
void ScanProgressDialog::setDeviceName(const QString& d) { if (d.isEmpty()) setLabelText(i18nc("@label", "Scanning...")); else setLabelText(xi18nc("@label", "Scanning device: <filename>%1</filename>", d)); }
void RecursiveDirJob::run() { RecursiveDirJobHelper helper(m_pd != NULL); //report progress info if pd != NULL connect(&helper, SIGNAL(setValue(quint64)), this, SLOT(setValue(quint64)), Qt::QueuedConnection); connect(&helper, SIGNAL(setMaximum(quint64)), this, SLOT(setMaximum(quint64)), Qt::QueuedConnection); connect(&helper, SIGNAL(setLabelText(QString)), this, SLOT(setLabelText(QString)), Qt::QueuedConnection); qRegisterMetaType<RecursiveDirJob::Error>(); connect(&helper, SIGNAL(errorOccured(RecursiveDirJob::Error)), this, SLOT(slotErrorOccured(RecursiveDirJob::Error)), Qt::QueuedConnection); switch( d->m_jobType ) { case CalculateDirSize: d->m_result = helper.calculateDirSize(d->m_args[0].toString()); break; case CpDir: helper.recursiveCpDir(d->m_args[0].toString(), d->m_args[1].toString(), d->m_args[2].value<CopyOptions>()); break; case RmDir: helper.recursiveRmDir(d->m_args[0].toString()); break; default: Q_ASSERT(false); } }
void UpdaterDialog::updateDone(bool result) { if (result) setLabelText(tr("There's a new version available,<br> please see <a href=\"http://lightscreen.sourceforge.net/new-version\">the Lighscreen website</a>.")); else setLabelText(tr("No new versions available")); setMaximum(1); setCancelButtonText(tr("Close")); }
void UpdaterDialog::updateDone(bool result) { if (result) { setLabelText(tr("There's a new version available,<br> please see <a href=\"https://lightscreen.com.ar/whatsnew/%1\">the Lighscreen website</a>.").arg(qApp->applicationVersion())); } else { setLabelText(tr("No new versions available.")); } setMaximum(1); setCancelButtonText(tr("Close")); }
void Ui::setDetailedMode(bool mode) { detailedMode = mode; if(detailedMode) { setLabelText(controls["Status"], statusStr); setLabelText(controls["TotalProgressLabel"], msg("Total progress")); } else setLabelText(controls["TotalProgressLabel"], statusStr); }
void Kleo::ProgressDialog::slotProgress(const QString &what, int current, int total) { kdDebug(5150) << "Kleo::ProgressDialog::slotProgress( \"" << what << "\", " << current << ", " << total << " )" << endl; if(mBaseText.isEmpty()) setLabelText(what); else if(what.isEmpty()) setLabelText(mBaseText); else setLabelText(i18n("%1: %2").arg(mBaseText, what)); setProgress(current, total); }
/** * Show the screen. */ void HomeScreen::showScreen() { // Make the home screen listen for key events. MAUtil::Environment::getEnvironment().addKeyListener(this); // Reset the progress bar value to 0, and dismiss it. maWidgetSetProperty(mProgressLabel,MAW_WIDGET_VISIBLE, "false"); setWidgetProperty(mProgressBar,MAW_PROGRESS_BAR_PROGRESS, 0); maWidgetSetProperty(mProgressBar,MAW_WIDGET_VISIBLE, "false"); maWidgetSetProperty(mSearchButton, MAW_WIDGET_ENABLED, "true"); // Reset the slider value. setWidgetProperty(mSlider, MAW_SLIDER_VALUE, 10); // Clear the edit box. maWidgetSetProperty(mEditBox, MAW_EDIT_BOX_TEXT, ""); // Check all categories. for (int i=0; i<mCategoryBoxes.size(); i++) { maWidgetSetProperty(mCategoryBoxes[i], MAW_CHECK_BOX_CHECKED, "true"); } // Initialize the top text label. setLabelText(mLabel, " "); // Display this screen. BasicScreen::showScreen(); }
ProgressSlideshowDialog::ProgressSlideshowDialog(const QStringList &slidesDirectories, const QString &statusMsg, int changeInterval, QWidget *parent) : QDialog(parent), _pos(0), _changeInterval(changeInterval), _maxSectors(0), _pausedAt(0), ui(new Ui::ProgressSlideshowDialog) { ui->setupUi(this); setLabelText(statusMsg); QRect s = QApplication::desktop()->screenGeometry(); if (s.height() < 400) setWindowFlags(Qt::Window | Qt::FramelessWindowHint); else setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint); foreach (QString slidesDirectory, slidesDirectories) { QDir dir(slidesDirectory, "*.jpg *.jpeg *.png"); if (dir.exists()) { QStringList s = dir.entryList(); s.sort(); foreach (QString slide, s) { _slides.append(slidesDirectory+"/"+slide); }
AppWindow::AppWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::AppWindow) { main_all_groups_window = new AllGroups(); group_info_window = new GroupInfo(this); main_login_window = new LoginWindow(this); myAppWindow = new AppWindowData(); this->setFixedSize(900, 600); connect(this, SIGNAL(sendGroupID(QString)), group_info_window, SLOT(setLabelText(QString))); ui->setupUi(this); addItemsToCourseNameComboBox(); resetRowCount(); setColumnsOfTable(); main_login_window->show(); QHeaderView* header = ui->listOfAllGroups->horizontalHeader(); header->setSectionResizeMode(QHeaderView::Stretch); web_interface = HTTPInterface::getInstance(); ui->deleteButton->hide(); ui->userdeleteButton_2->hide(); ui->adminprivButton->hide(); ui->userlistbox->hide(); }
void Strip::resizeEvent(QResizeEvent* ev) { //printf("Strip::resizeEvent\n"); QFrame::resizeEvent(ev); setLabelText(); setLabelFont(); }
LabeledLineEdit::LabeledLineEdit(String objectName, String label, String text, bool key) : QWidget(0), m_text(text), m_ui(new Ui::LabeledLineEdit) { Logger::getInstance()->debug("LabeledLineEdit::LabeledLineEdit(String objectName, String label, String text, bool key)"); m_ui->setupUi(this); setLabelText(label); setText(text); if (key) { m_ui->lineEdit->setReadOnly(true); m_ui->lineEdit->setStyleSheet("QLineEdit{background: pink;}"); } setObjectName(objectName.c_str()); connect( m_ui->lineEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged())); connect( m_ui->lineEdit, SIGNAL(editingFinished()), this, SLOT(itemChanged())); }
DownloadDialog::DownloadDialog(QUrl source, QString destination, QWidget *parent) : QProgressDialog("Downloading", "Cancel", 0, 100, parent) , _download(nullptr) , _completed(false) { setMinimumDuration(0); setWindowTitle("File Download"); _destination.setFileName(destination); _destination.remove(); if (_destination.open(QIODevice::WriteOnly)) { QNetworkRequest request(source); request.setRawHeader("User-Agent", "Mozilla Firefox"); _download = _manager.get(request); //qDebug() << _download->error(); connect(_download, SIGNAL(downloadProgress(qint64,qint64)), SLOT(downloadProgress(qint64,qint64))); connect(_download, SIGNAL(finished()), SLOT(dispose())); connect(_download, SIGNAL(readyRead()), SLOT(downloadReadyRead())); connect(this, SIGNAL(canceled()), SLOT(dispose())); setLabelText("Downloading " + destination); setValue(0); } }
QModernProgressDialog::QModernProgressDialog(const QString & labelText, const QString & cancelButtonText, QWidget* parent, Qt::WindowFlags f): QDialog(parent, f) { createWidgets(); setLabelText(labelText); setCancelButtonText(cancelButtonText); }
KRPleaseWait::KRPleaseWait(QString msg, QWidget *parent, int count, bool cancel): QProgressDialog(cancel ? 0 : parent) , inc(true) { setModal(!cancel); timer = new QTimer(this); setWindowTitle(i18n("Krusader::Wait")); setMinimumDuration(500); setAutoClose(false); setAutoReset(false); connect(timer, SIGNAL(timeout()), this, SLOT(cycleProgress())); QProgressBar* progress = new QProgressBar(this); progress->setMaximum(count); progress->setMinimum(0); setBar(progress); QLabel* label = new QLabel(this); setLabel(label); QPushButton* btn = new QPushButton(i18n("&Cancel"), this); setCancelButton(btn); btn->setEnabled(canClose = cancel); setLabelText(msg); show(); }
void onCancel() { m_isCanceled = true; setLabelText("Aborting render..."); reset(); hide(); }
bool Port::saveStreams(QString fileName, QString fileType, QString &error) { bool ret = false; QProgressDialog progress("Saving Streams", "Cancel", 0, 0, mainWindow); AbstractFileFormat *fmt = AbstractFileFormat::fileFormatFromType(fileType); OstProto::StreamConfigList streams; if (fmt == NULL) goto _fail; progress.setAutoReset(false); progress.setAutoClose(false); progress.setMinimumDuration(0); progress.show(); mainWindow->setDisabled(true); progress.setEnabled(true); // to override the mainWindow disable connect(fmt, SIGNAL(status(QString)),&progress,SLOT(setLabelText(QString))); connect(fmt, SIGNAL(target(int)), &progress, SLOT(setMaximum(int))); connect(fmt, SIGNAL(progress(int)), &progress, SLOT(setValue(int))); connect(&progress, SIGNAL(canceled()), fmt, SLOT(cancel())); progress.setLabelText("Preparing Streams..."); progress.setRange(0, mStreams.size()); streams.mutable_port_id()->set_id(0); for (int i = 0; i < mStreams.size(); i++) { OstProto::Stream *s = streams.add_stream(); mStreams[i]->protoDataCopyInto(*s); if (progress.wasCanceled()) goto _user_cancel; progress.setValue(i); if (i % 32 == 0) qApp->processEvents(); } fmt->saveStreamsOffline(streams, fileName, error); qDebug("after save offline"); while (!fmt->isFinished()) qApp->processEvents(); qDebug("wait over for offline operation"); ret = fmt->result(); goto _exit; _user_cancel: goto _exit; _fail: error = QString("Unsupported File Type - %1").arg(fileType); goto _exit; _exit: progress.close(); mainWindow->setEnabled(true); return ret; }
void FileSendProgressDialog::accept() { qDebug() << "Accept called"; setLabelText(tr("Waiting for %1 to accept").arg(m_to->name())); setRange(0, 0); QProgressDialog::accept(); }
void InfoWidget::LabeledWidget::setLabeledText( const QString &label, const TextWithEntities &textWithEntities, const TextWithEntities &shortTextWithEntities, const QString ©Text, int availableWidth) { _label.destroy(); _text.destroy(); _shortText.destroy(); if (textWithEntities.text.isEmpty()) return; _label.create(this, label, Ui::FlatLabel::InitType::Simple, st::settingsBlockLabel); _label->show(); setLabelText(_text, textWithEntities, copyText); setLabelText(_shortText, shortTextWithEntities, copyText); resizeToNaturalWidth(availableWidth); }
BuilderHomeButton::BuilderHomeButton(Glib::RefPtr<Gtk::Action> Action) { initialize(); setImage(*Gtk::manage(new Gtk::Image(Action->get_stock_id(), Gtk::ICON_SIZE_DIALOG))); setLabelText(Action->get_tooltip()); Action->connect_proxy(*this); }
void Ui::clearLabel(HWND l) { _TCHAR spaces[40]; for(int i = 0; i < 40; i++) spaces[i] = _T(' '); spaces[39] = 0; setLabelText(l, spaces); }
/** * The UI is notified when an engine error occurs. */ void HomeScreen::engineError(MAUtil::String errorMessage) { // Some error occurred. setLabelText(mLabel, errorMessage.c_str()); // Hide the progress bar and it's label. maWidgetSetProperty(mProgressBar, MAW_WIDGET_VISIBLE, "false"); maWidgetSetProperty(mProgressLabel,MAW_WIDGET_VISIBLE, "false"); }
void FileDownloader::download(QUrl url) { QNetworkRequest req(url); req.setRawHeader("User-Agent", "SMPlayer"); reply = manager->get(req); connect(reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(updateDataReadProgress(qint64, qint64))); setLabelText(tr("Connecting to %1").arg(url.host())); }
Progress::Progress(int n, const char * lbl, QApplication * a) : QProgressDialog(0, 0, n, 0, 0, FALSE, WDestructiveClose), n(0), app(a) { if (it != 0) delete it; it = this; setLabelText(lbl); setMinimumDuration(1000); }
medLoadLUTDialog::medLoadLUTDialog(const QStringList & titles, QWidget *parent) : QInputDialog(parent) { setModal(Qt::WindowModal); setInputMode(QInputDialog::TextInput); setLabelText(tr("Choose a transfert Function:")); setComboBoxItems(titles);; setOkButtonText(tr("Choose")); }
URIEditor::URIEditor(QWidget *parent, const char* name) : TLPEditor(parent,name){ QString whatsthis =i18n("With this line edit you can insert the URI of the resource you want to reach"); setWhatsThis(whatsthis); setLabelText(" Uri :"); setButtonIcon("fileopen"); setToolTip(i18n("Open the URI selector")); connect(m_pb, SIGNAL(clicked()), this, SLOT(openFileDialog())); }
void onCancel() { m_isCanceled = true; setLabelText("Aborting render..."); TRenderer *trenderer(m_renderer->getTRenderer()); if (m_renderer) trenderer->stopRendering(true); reset(); hide(); }
ProgressDialog::ProgressDialog(const QUrl &url, QWidget *parent) : QProgressDialog(parent) { setWindowTitle(tr("Download Progress")); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setLabelText(tr("Downloading %1.").arg(url.toDisplayString())); setMinimum(0); setValue(0); setMinimumDuration(0); }
/* Denna funktion omvandlar en int till en strang och renderar denna i fonstret. */ void ScoreCounter::draw() { std::string str; std::ostringstream os; os << score; str = os.str(); setLabelText(str); SDL_RenderCopy(getEngine()->getRenderer(), getTexture(), NULL, &rectangle); }