void KyraEngine_HoF::showMessageFromCCode(int id, int16 palIndex, int) { const char *string = getTableString(id, _cCodeBuffer, 1); showMessage(string, palIndex); }
void KyraEngine_HoF::showChapterMessage(int id, int16 palIndex) { showMessage(getChapterString(id), palIndex); }
void TExpandoMenuBar::MouseDown(BPoint where) { BMessage* message = Window()->CurrentMessage(); BMenuItem* menuItem; TTeamMenuItem* item = TeamItemAtPoint(where, &menuItem); // check for three finger salute, a.k.a. Vulcan Death Grip if (message != NULL && item != NULL && !fBarView->Dragging()) { int32 modifiers = 0; message->FindInt32("modifiers", &modifiers); if ((modifiers & B_COMMAND_KEY) != 0 && (modifiers & B_CONTROL_KEY) != 0 && (modifiers & B_SHIFT_KEY) != 0) { const BList* teams = item->Teams(); int32 teamCount = teams->CountItems(); team_id teamID; for (int32 team = 0; team < teamCount; team++) { teamID = (team_id)teams->ItemAt(team); kill_team(teamID); // remove the team immediately from display RemoveTeam(teamID, false); } return; } // control click - show all/hide all shortcut if ((modifiers & B_CONTROL_KEY) != 0) { // show/hide item's teams BMessage showMessage((modifiers & B_SHIFT_KEY) != 0 ? kMinimizeTeam : kBringTeamToFront); showMessage.AddInt32("itemIndex", IndexOf(item)); Window()->PostMessage(&showMessage, this); return; } // Check the bounds of the expand Team icon if (fShowTeamExpander && fVertical) { BRect expanderRect = item->ExpanderBounds(); if (expanderRect.Contains(where)) { // Let the update thread wait... BAutolock locker(sMonLocker); // Toggle the item item->ToggleExpandState(true); item->Draw(); // Absorb the message. return; } } // double-click on an item brings the team to front int32 clicks; if (message->FindInt32("clicks", &clicks) == B_OK && clicks > 1 && item == menuItem && item == fLastClickItem) { // activate this team be_roster->ActivateApp((team_id)item->Teams()->ItemAt(0)); return; } fLastClickItem = item; } BMenuBar::MouseDown(where); }
void KStarsSplash::setMessage(const QString& message) { showMessage( message, Qt::AlignLeft, Qt::lightGray); }
/** * pilot artificial horizon drawing function. * * @param {double} pitch angle [-90, 90] * @param {double} roll angle [-180, 180] * @param {double} yaw angle [-180, 180] * @param {double} density altitude [ft] * @param {double} geometric speed [knots] * @param {double} ROC [ft/min] * @param {double} main rotor collective (+ right yaw rad) * @param {double} tail rotor collective (+ climb rad) * @param {double} A1 swash plate angle = roll cyclic pitch (rad + right roll) * @param {double} B1 swash plate angle = pitch cyclic pitch (rad + nose down) * @param {double} tail rotor RPM (rpm) * @param {double} main rotor RPM (rpm) * @param {char*} 3 characters message to be displayed * * @todo add the following data to HUD: MR RPM, ROC, ACTUATOR ANGLES, **/ void horizon(double xi_pitch, double xi_roll, double xi_yaw, double xi_altitude, double xi_speed, double xi_roc, double xi_mr_col, double xi_tr_col, double xi_A1, double xi_B1, double xi_tr_rev, double xi_mr_rev, char *xi_message) { // static static const char headlabels[37][4] = {"S\0", "19\0", "20\0", "21\0", "22\0", "23\0", "24\0", "25\0", "26\0", "W\0", "28\0", "29\0", "30\0", "31\0", "32\0", "33\0", "34\0", "35\0", "N\0", "1\0", "2\0", "3\0", "4\0", "5\0", "6\0", "7\0", "8\0", "E\0", "10\0", "11\0", "12\0", "13\0", "14\0", "15\0", "16\0", "17\0", "S\0"}; // locals double temp; int n; char buffer[20]; char *txt; // housekeeping glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); // output scree line glColor3f(1.0f, 1.0f, 0.0f); glLineWidth(1.0f); // main/tail RPM sprintf(buffer, "RPM main:%2d\0", (int)(xi_mr_rev)); glPushMatrix(); glTranslatef(-0.2f, -0.02f, -0.8f); showMessage(0.0f, 0.0f, buffer, 1.2); glPopMatrix(); sprintf(buffer, "RPM tail:%2d\0", (int)(xi_tr_rev)); glPushMatrix(); glTranslatef(-0.2f, -0.04f, -0.8f); showMessage(0.0f, 0.0f, buffer, 1.2); glPopMatrix(); // main/tail collective sprintf(buffer, "Col main:%2d\0", (int)(xi_mr_col)); glPushMatrix(); glTranslatef(-0.2f, -0.06f, -0.8f); showMessage(0.0f, 0.0f, buffer, 1.2); glPopMatrix(); sprintf(buffer, "Col tail:%2d\0", (int)(xi_tr_col)); glPushMatrix(); glTranslatef(-0.2f, -0.08f, -0.8f); showMessage(0.0f, 0.0f, buffer, 1.2); glPopMatrix(); // swash plate collective sprintf(buffer, "Cyc pitch:%2d\0", (int)(xi_A1)); glPushMatrix(); glTranslatef(-0.2f, -0.1f, -0.8f); showMessage(0.0f, 0.0f, buffer, 1.2); glPopMatrix(); sprintf(buffer, "Cyc roll:%2d\0", (int)(xi_B1)); glPushMatrix(); glTranslatef(-0.2f, -0.12f, -0.8f); showMessage(0.0f, 0.0f, buffer, 1.2); glPopMatrix(); // xi_altitude readout sprintf(buffer, "Alt:%3d ft\0", (int)(xi_altitude)); glPushMatrix(); glTranslatef(-0.2f, -0.16f, -0.8f); showMessage(0.0f, 0.0f, buffer, 1.2); glPopMatrix(); // xi_speed readout sprintf(buffer, "Vel:%3d kts\0", (int)(xi_speed)); glPushMatrix(); glTranslatef(-0.2f, -0.18f, -0.8f); showMessage(0.0f, 0.0f, buffer, 1.2); glPopMatrix(); // xi_yaw readout sprintf(buffer, "Hdng:%3d\0", (int)(xi_yaw)); glPushMatrix(); glTranslatef(-0.2f, -0.2f, -0.8f); showMessage(0.0f, 0.0f, buffer, 1.2); glPopMatrix(); // WOW readout glLineWidth(3.0f); if (xi_altitude < 1) { glColor3f(1.0f, 0.0f, 0.0f); sprintf(buffer, "ON GROUND\0"); glPushMatrix(); glTranslatef(-0.03f, -0.2f, -0.8f); showMessage(0.0f, 0.0f, buffer, 1.2); } else { glColor3f(0.0f, 1.0f, 0.0f); sprintf(buffer, "AIRBORN\0"); glPushMatrix(); glTranslatef(-0.03f, -0.2f, -0.8f); showMessage(0.0f, 0.0f, buffer, 1.2); } glPopMatrix(); // return line width glLineWidth(1.0f); // message readout //glPushMatrix(); //glTranslatef(0.0f, 0.0f, -0.8f); //showMessage(0.145f, -0.17f, message, 1); //glPopMatrix(); glPopMatrix(); // roll tick marks for(n = -30; n <= 30; n += 15) { glPushMatrix(); glRotatef(n, 0.0f, 0.0f, 1.0f); glColor3f(1.0f, 1.0f, 1.0f); glBegin( GL_LINES ); glVertex3f(0.0f, 0.24f, -0.9f); glVertex3f(0.0f, 0.23f, -0.9f); glEnd(); glPopMatrix(); } glPushMatrix(); glRotatef(xi_roll, 0.0f, 0.0f, 1.0f); glColor3f(0.85f, 0.5f, 0.1f); glBegin( GL_TRIANGLES ); glVertex3f(0.0f, 0.23f, -0.9f); glVertex3f(0.01f, 0.21f, -0.9f); glVertex3f(-0.01f, 0.21f, -0.9f); glEnd(); glPopMatrix(); // center mark glPushMatrix(); glColor3f(1.0f, 1.0f, 1.0f); glBegin( GL_LINES ); // right half glVertex3f(0.0f, 0.0f, -0.9f); glVertex3f(0.015f, -0.02f, -0.9f); glVertex3f(0.015f, -0.02f, -0.9f); glVertex3f(0.03f, 0.0f, -0.9f); glVertex3f(0.03f, 0.0f, -0.9f); glVertex3f(0.06f, 0.0f, -0.9f); // left half glVertex3f(0.0f, 0.0f, -0.9f); glVertex3f(-0.015f, -0.02f, -0.9f); glVertex3f(-0.015f, -0.02f, -0.9f); glVertex3f(-0.03f, 0.0f, -0.9f); glVertex3f(-0.03f, 0.0f, -0.9f); glVertex3f(-0.06f, 0.0f, -0.9f); glEnd(); glPopMatrix(); glRotatef(xi_roll, 0.0f, 0.0f, 1.0f); glTranslatef(-xi_yaw*C_DEG2RAD, 0.0f, 0.0f); // horizon glColor3f(1.0f, 1.0f, 1.0f); glBegin( GL_LINES ); glVertex3f(-(180.0+15)*C_DEG2RAD, 0.0f, -0.9f); glVertex3f((180.0+15)*C_DEG2RAD, 0.0f, -0.9f); glEnd(); // yaw tick lines for(n = 0; n < 37; ++n) { glBegin( GL_LINES ); glVertex3f( (double)(n*10 - 180)*C_DEG2RAD, 0.015f, -0.9f); glVertex3f( (double)(n*10 - 180)*C_DEG2RAD, 0.0f, -0.9f); glEnd(); glPushMatrix(); glTranslatef(0.0f, 0.0f, -0.9f); txt = (char *)&headlabels[n][0]; showMessage((double)(n*10 - 180)*C_DEG2RAD-0.01f, 0.02, txt, 1.2); glPopMatrix(); } // Extra tick mark past S (going W) for overview glBegin( GL_LINES ); glVertex3f( 190.0*C_DEG2RAD, 0.02f, -0.9f); glVertex3f( 190.0*C_DEG2RAD, 0.0f, -0.9f); glEnd(); glPushMatrix(); glTranslatef(0.0f, 0.0f, -0.9f); showMessage( 190.0*C_DEG2RAD-0.015, 0.02, "19\0", 1.0); glPopMatrix(); // Extra tick mark past S (going E) for overview glBegin( GL_LINES ); glVertex3f( -190.0*C_DEG2RAD, 0.02f, -0.9f); glVertex3f( -190.0*C_DEG2RAD, 0.0f, -0.9f); glEnd(); glPushMatrix(); glTranslatef(0.0f, 0.0f, -0.9f); showMessage( -190.0*C_DEG2RAD-0.015, 0.02, "17\0", 1.0); glPopMatrix(); glPushMatrix(); glLoadIdentity(); glRotatef(xi_roll, 0.0f, 0.0f, 1.0f); glTranslatef(0.0f, -xi_pitch*C_DEG2RAD, 0.0f); // colored part of display glColor3f(0.0f, 0.0f, 1.0f); glBegin( GL_QUADS ); glVertex3f(-(180.0+15)*C_DEG2RAD, (90.0+15.0)*C_DEG2RAD, -1.0f); glVertex3f((180.0+15)*C_DEG2RAD, (90.0+15.0)*C_DEG2RAD, -1.0f); glVertex3f((180.0+15)*C_DEG2RAD, 0.0f, -1.0f); glVertex3f(-(180.0+15)*C_DEG2RAD, 0.0f, -1.0f); glEnd(); // bottom of display glColor3f(0.5f, 0.2f, 0.1f); glBegin( GL_QUADS ); glVertex3f(-(180.0+15)*C_DEG2RAD, -(90.0+15.0)*C_DEG2RAD, -1.0f); glVertex3f((180.0+15)*C_DEG2RAD, -(90.0+15.0)*C_DEG2RAD, -1.0f); glVertex3f((180.0+15)*C_DEG2RAD, 0.0f, -1.0f); glVertex3f(-(180.0+15)*C_DEG2RAD, 0.0f, -1.0f); glEnd(); // pitch bars for(n = 0; n < 9; ++n) { temp = (double)(n * 10 + 10) * C_DEG2RAD; glColor3f(1.0f, 1.0f, 1.0f); // positive xi_pitch lines glBegin( GL_LINES ); glVertex3f(-0.1f, temp-0.01, -1.0f); glVertex3f(-0.1f, temp, -1.0f); glVertex3f(-0.1f, temp, -1.0f); glVertex3f(-0.03f, temp, -1.0f); glVertex3f(0.1f, temp-0.01, -1.0f); glVertex3f(0.1f, temp, -1.0f); glVertex3f(0.1f, temp, -1.0f); glVertex3f(0.03f, temp, -1.0f); glEnd(); sprintf(buffer, "%d\0", n*10+10); glPushMatrix(); glTranslatef(0.0f, 0.0f, -1.0f); showMessage(0.11f, temp-0.007, buffer, 1.0); showMessage(-0.13f, temp-0.007, buffer, 1.0); glPopMatrix(); // negative xi_pitch lines glBegin( GL_LINES ); glVertex3f(-0.1f, -temp+0.01, -1.0f); glVertex3f(-0.1f, -temp, -1.0f); glVertex3f(-0.1f, -temp, -1.0f); glVertex3f(-0.03f, -temp, -1.0f); glVertex3f(0.1f, -temp+0.01, -1.0f); glVertex3f(0.1f, -temp, -1.0f); glVertex3f(0.1f, -temp, -1.0f); glVertex3f(0.03f, -temp, -1.0f); glEnd(); sprintf(buffer, "%d\0", -(n*10+10)); glPushMatrix(); glTranslatef(0.0f, 0.0f, -1.0f); showMessage(0.11f, -temp, buffer, 1.0); showMessage(-0.14f, -temp, buffer, 1.0); glPopMatrix(); } // +/- 5 degree tick marks glBegin( GL_LINES ); glVertex3f(-0.05f, 5.0*C_DEG2RAD, -1.0f); glVertex3f(0.05f, 5.0*C_DEG2RAD, -1.0f); glEnd(); glBegin( GL_LINES ); glVertex3f(-0.05f, -5.0*C_DEG2RAD, -1.0f); glVertex3f(0.05f, -5.0*C_DEG2RAD, -1.0f); glEnd(); glPopMatrix(); }
Rekall::Rekall(const QStringList &arguments, QWidget *parent) : QDialog(parent) { trayIconWorking = false; trayIconIndex = 0; trayIconIndexOld = 9999; Global::rekall = this; qApp->setAttribute(Qt::AA_UseHighDpiPixmaps); //Update updateManager = 0; forceUpdate = false; firstTimeOpened = newVersionOfRekall = false; if(arguments.contains("-forceupdate")) forceUpdate = true; //Tray icon trayTimer.setInterval(500); connect(&trayTimer, SIGNAL(timeout()), SLOT(trayIconToOnPrivate())); connect(&trayTimerOff, SIGNAL(timeout()), SLOT(trayIconToOffPrivate())); QString prefix = "mac"; #ifdef Q_OS_WIN prefix = "win"; #endif for(quint16 i = 0 ; i <= 17 ; i++) trayIcons << QIcon(QString(":/icons/rekall-menubar-%1-%2.png").arg(prefix).arg(i, 2, 10, QChar('0'))); trayIcon = new QSystemTrayIcon(this); trayIconToOffPrivate(); trayTimer.start(); connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), SLOT(trayActivated(QSystemTrayIcon::ActivationReason))); //Interfaces Global::userInfos = new UserInfos(this); Global::http = new Http(this); Analyse *analyse = new Analyse(this); Global::analyse = analyse; connect(analyse, SIGNAL(trayChanged(QString,bool)), SLOT(analyseTrayChanged(QString,bool))); connect(analyse, SIGNAL(trayIconToOff()), SLOT(trayIconToOff())); connect(analyse, SIGNAL(trayIconToOn(qint16)), SLOT(trayIconToOn(qint16))); //Wrapper web Global::userInfos->setDockIcon(this, false); Global::webWrapper = new WebWrapper(); /* VideoPlayer *player = new VideoPlayer(); player->open(QUrl::fromLocalFile("/Users/guillaume/Documents/Rekall/Walden/Captations/captation WALDEN_TPV.mov")); player->seek(4000); */ trayMenu = new QMenu(this); trayMenu->setSeparatorsCollapsible(true); trayAnalyse = trayMenu->addAction(tr("File analysis…")); trayAnalysePause = trayMenu->addAction(tr("Pause analysis")); trayAnalysePause->setCheckable(true); connect(trayAnalysePause, SIGNAL(toggled(bool)), SLOT(trayAnalysePaused())); trayMenu->addSeparator(); trayMenu->addAction(tr("Open welcome page"), this, SLOT(openWebPage())); trayMenu->addAction(tr("Open welcome page in webrowser"), this, SLOT(openWebPageInBrowser())); //trayMenu->addAction(tr("Create a new project"), this, SLOT(addProject())); trayMenu->addSeparator(); trayMenuProjects = trayMenu->addAction(tr("Quit Rekall"), this, SLOT(closeRekall())); trayIcon->setContextMenu(trayMenu); trayIcon->show(); trayIconToOnPrivate(); QSettings settings; quint16 projectCount = settings.beginReadArray("projects"); /* if(projectCount == 0) { addProject(new Project("walden", "Walden", true, QFileInfo("/Users/guillaume/Documents/Rekall/Walden"), this)); addProject(new Project("joris-test", "Joris", false, QFileInfo("/Users/guillaume/Documents/Rekall/joris-test"), this)); } */ connect(Global::udp, SIGNAL(outgoingMessage(QString,quint16,QString,QList<QVariant>)), SLOT(incomingMessage(QString,quint16,QString,QList<QVariant>))); for(quint16 projectIndex = 0 ; projectIndex < projectCount ; projectIndex++) { settings.setArrayIndex(projectIndex); Project *project = new Project(settings.value("name").toString(), settings.value("friendlyName").toString(), true, QFileInfo(settings.value("path").toString()), this); addProject(project); } settings.endArray(); //foreach(ProjectInterface *project, Global::projects) // project->load(); //Global settings creation if needed globalSettings = new QSettings(); if((globalSettings) && ((!globalSettings->childKeys().contains("id")) || (arguments.contains("-newuser")))) { firstTimeOpened = true; qsrand(QDateTime::currentDateTime().toTime_t()); updateAnonymousId = QString::number(qrand()); globalSettings->setValue("id", updateAnonymousId); globalSettings->setValue("version", ""); globalSettings->setValue("updatePeriod", 1); globalSettings->setValue("lastUpdate", QDateTime(QDate(2000, 01, 01))); } //Update management if((globalSettings) && (globalSettings->childKeys().contains("id"))) { QDateTime updateLastDate = globalSettings->value("lastUpdate") .toDateTime(); quint16 updatePeriod = globalSettings->value("updatePeriod").toUInt(); updateAnonymousId = globalSettings->value("id") .toString(); QString applicationVersionSettings = globalSettings->value("version").toString(); if(applicationVersionSettings != QCoreApplication::applicationVersion()) { globalSettings->setValue("version", QCoreApplication::applicationVersion()); firstTimeOpened = true; } qDebug("Last update : %s (should update each %d day(s))", qPrintable(updateLastDate.toString("dd/MM/yyyy hh:mm:ss")), updatePeriod); if((updateLastDate.daysTo(QDateTime::currentDateTime()) >= updatePeriod) || (forceUpdate)) checkForUpdates(); } askScreenshot = askAddProject = 0; startTimer(50); if(firstTimeOpened) showMessage(tr("Welcome!\nRekall is now running!")); else showMessage(tr("Rekall is now running!")); if(!arguments.contains("-silent")) openWebPage(); /* QWebView *webView = new QWebView(); webView->load(QUrl("http://127.0.0.1:23411")); webView->show(); */ }
void KexiGUIMessageHandler::showSorryMessage(const QString &title, const QString &details) { showMessage(Sorry, title, details); }
void MsgEdit::processEvent(ICQEvent *e) { ICQUser *u; switch (e->type()){ case EVENT_ACKED: if (e->message() && (e->message() == message())){ sendEvent = NULL; setMessage(); if (bCloseSend){ close(); }else{ action(mnuAction); switch (e->message()->Type()){ case ICQ_MSGxFILE: emit setStatus(i18n("Transfer started"), 2000); break; case ICQ_MSGxCHAT: emit setStatus(i18n("Chat started"), 2000); break; } } } break; case EVENT_INFO_CHANGED: fillPhones(); u = pClient->getUser(Uin); if (u && u->inIgnore()) QTimer::singleShot(10, this, SLOT(close())); break; case EVENT_USER_DELETED: if (e->Uin() == Uin) close(); break; } if (e->message() && (e->message() == message())){ if (e->type() == EVENT_MESSAGE_SEND){ if (e->state == ICQEvent::Success){ history()->addMessage(message()); if (!msgTail.isEmpty()){ emit addMessage(message(), false, true); emit showMessage(Uin(), message()->Id); if (e->message()->Type() == ICQ_MSGxSMS){ ICQSMS *m = new ICQSMS; m->Uin.push_back(Uin); m->Message = smsChunk(); m->Phone = phoneEdit->lineEdit()->text().local8Bit(); msg = m; sendEvent = pClient->sendMessage(msg); return; } log(L_WARN, "Bad type for chunked message"); } if (bCloseSend){ close(); }else{ emit addMessage(message(), false, true); emit showMessage(Uin(), message()->Id); setMessage(); action(mnuAction); emit setStatus(i18n("Message sent"), 2000); } }else{ e->message()->bDelete = false; emit setStatus(i18n("Send failed"), 2000); if (e->message() && *(e->message()->DeclineReason.c_str())) BalloonMsg::message(QString::fromLocal8Bit(msg->DeclineReason.c_str()), btnNext); } bCloseSend = false; sendEvent = NULL; setState(); }else if ((e->type() == EVENT_MESSAGE_RECEIVED) && (e->state == ICQEvent::Fail)){ msg = NULL; setMessage(); action(mnuAction); } } }
FitterResults SwarmFitterInterface::runFitter(ModelTuningParameters * startPoint) { int numberOfFlies = (int)(10.0+2.0*sqrt((double)toInt(fixedParams["Dimensions"]))); showMessage("Running Swarm Optimization with " + str(numberOfFlies) + " flies\n",3,fixedParams); vector< ModelTuningParameters > results; int maxInformed = 3; double w = 1.0/(2.0*log(2.0)); double c = 0.5 + log(2.0); double tempBestValue = 0; ///True if tempBestValue is initialized bool initBest = false; int numberOfRuns = toInt(fixedParams["NumberOfRuns"]); if (numberOfRuns < 0) crash("SwarmFitterInterface","Negative number of runs !!"); MTRand randGen( toInt(fixedParams["Seed"]) ); vector< SwarmFly > swarm(numberOfFlies, SwarmFly(w, c, &randGen, FixedParameters(fixedParams.getGlobals(),true))); vector< ModelTuningParameters > startPoints(numberOfFlies,ModelTuningParameters(*startPoint)); ModelTuningParameters startX; ModelTuningParameters startY; ////////////////////////////////// /// Initialize the swarm flies /// ////////////////////////////////// for (int i = 0; i < numberOfFlies; i++) { startPoints[i] = swarm[i].calculateRandomPosition(); } errorValue->calculateParallelErrorValue(startPoints); results.insert(results.end(),startPoints.begin(),startPoints.end()); for (int i = 0; i < numberOfFlies; i++) { swarm[i].setNewPositionErrorValue(startPoints[i]); } /////////////////////////// /// Initialize topology /// /////////////////////////// randomizeTopology(swarm, maxInformed, randGen); ///////////////////// /// Run Algorithm /// ///////////////////// vector< ModelTuningParameters > flyPositions(numberOfFlies); for (int i = 0; i < numberOfRuns; i++) { for (int j = 0; j < numberOfFlies; j++) { flyPositions[j] = swarm[j].calculateNewPosition(); } errorValue->calculateParallelErrorValue(flyPositions); results.insert(results.end(),flyPositions.begin(),flyPositions.end()); for (int j = 0; j < numberOfFlies; j++) { swarm[j].setNewPositionErrorValue(flyPositions[j]); } showMessage( "Best solution after run " + str(i) + " : " + SwarmFly::bestGlobalSolution.toString() + " : " + str(SwarmFly::bestGlobalSolution.getErrorValue()) + "\n",2,fixedParams); if (SwarmFly::bestGlobalSolution.getErrorValue() < tempBestValue || !initBest) { tempBestValue = SwarmFly::bestGlobalSolution.getErrorValue(); initBest = true; } else { showMessage("No better solution found in the last run: Randomizing swarm topology\n",3,fixedParams); //randomizeWorst(swarm); randomizeTopology(swarm, maxInformed, randGen); } } return FitterResults(results); }
/*virtual*/ void KexiGUIMessageHandler::showErrorMessage(const QString &title, const QString &details) { showMessage(Error, title, details); }
/// \brief To show a message linked to the systray icon void SystrayIcon::showSystrayMessage(const QString& text) { showMessage(tr("Information"),text,QSystemTrayIcon::Information,0); }
void MainWindow::openFile() { // If the current model has been modified, warn the user before opening the new file QMessageBox::StandardButton proceed = QMessageBox::Ok; if (modelLoaded) if (model->wasModified()) proceed = QMessageBox::question(this, tr("Network Editor for SUMO"), tr("Model has been modified and not saved. Continue opening a new file?"), QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel); if (proceed == QMessageBox::Ok) { // Get file name from File Dialog QString filePath = QFileDialog::getOpenFileName(this, tr("Open SUMO Network file"), xmlPath, tr("XML Network files (*.net.xml)")); QCoreApplication::processEvents(); // Open file if (!filePath.isEmpty()) { QFile file(filePath); if (file.open(QIODevice::ReadOnly)) { // Start counting opening time QTime t; t.start(); // Create the model, parsing XML data first statusBar()->showMessage(tr("Loading XML file...")); Model *newModel = new Model(&file, this); // If the file has valid XML data, continue loading the model if (newModel->xmlDataParsed()) { // Delete the old model and connect the new one if (modelLoaded) delete model; connect(newModel, SIGNAL(statusUpdate(QString)), statusBar(), SLOT(showMessage(QString))); // Create the item selection model so that it is passed onto the // individual graphic elements as they are created treeSelections = new QItemSelectionModel(newModel); newModel->setSelectionModel(treeSelections); // Interpret XML tree and create the traffic network elements newModel->loadModel(); // Connect model with tree view tView->setModel(newModel); tView->setSelectionModel(treeSelections); tView->resizeColumnToContents(0); tView->resizeColumnToContents(1); // Connect model with network view nView->setScene(newModel->netScene); nView->setSelectionModel(treeSelections); nView->zoomExtents(); nView->setRenderHint(QPainter::Antialiasing, true); // Connect model with controls and properties view controls->reset(); controls->model = newModel; pView->model = newModel; eView->model = newModel; controlWidget->show(); propsWidget->show(); editWidget->show(); // Replace old model by new model model = newModel; modelLoaded = true; xmlPath = filePath; // Update window title QFileInfo fileInfo(file.fileName()); QString filename(fileInfo.fileName()); setWindowTitle(filename + tr(" - Network Editor for SUMO")); // Connect signals and slots between all views connect(tView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(showItem(QModelIndex))); connect(nView, SIGNAL(updateStatusBar(QString)), statusBar(), SLOT(showMessage(QString))); connect(treeSelections, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), model, SLOT(selectionChanged(QItemSelection, QItemSelection))); connect(treeSelections, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), pView, SLOT(selectionChanged(QItemSelection, QItemSelection))); connect(treeSelections, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), eView, SLOT(selectionChanged(QItemSelection, QItemSelection))); connect(treeSelections, SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(scrollTo(QItemSelection, QItemSelection))); connect(model, SIGNAL(attrUpdate(QItemSelection, QItemSelection)), pView, SLOT(selectionChanged(QItemSelection, QItemSelection))); connect(model, SIGNAL(attrUpdate(QItemSelection, QItemSelection)), eView, SLOT(selectionChanged(QItemSelection, QItemSelection))); statusBar()->showMessage(tr("Ready. Model loaded in %1ms.").arg(t.elapsed())); } else { // The XML data in the file was not valid, so do not load the model delete newModel; QMessageBox::warning(this, tr("Network Editor for SUMO"), tr("Error parsing XML data.")); } // Close file file.close(); } } } }
/** * Main. Creates Application window. */ int main(int argc, char** argv) { QT_REQUIRE_VERSION(argc, argv, "5.2.1"); RS_DEBUG->setLevel(RS_Debug::D_WARNING); QApplication app(argc, argv); QCoreApplication::setOrganizationName("LibreCAD"); QCoreApplication::setApplicationName("LibreCAD"); QCoreApplication::setApplicationVersion(XSTR(LC_VERSION)); QSettings settings; bool first_load = settings.value("Startup/FirstLoad", 1).toBool(); const QString lpDebugSwitch0("-d"),lpDebugSwitch1("--debug") ; const QString help0("-h"), help1("--help"); bool allowOptions=true; QList<int> argClean; for (int i=0; i<argc; i++) { QString argstr(argv[i]); if(allowOptions&&QString::compare("--", argstr)==0) { allowOptions=false; continue; } if (allowOptions && (help0.compare(argstr, Qt::CaseInsensitive)==0 || help1.compare(argstr, Qt::CaseInsensitive)==0 )) { qDebug()<<"librecad::usage: <options> <dxf file>"; qDebug()<<"-h, --help\tdisplay this message"; qDebug()<<""; qDebug()<<" --help\tdisplay this message"; qDebug()<<"-d, --debug <level>"; RS_DEBUG->print( RS_Debug::D_NOTHING, "possible debug levels:"); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Nothing", RS_Debug::D_NOTHING); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Critical", RS_Debug::D_CRITICAL); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Error", RS_Debug::D_ERROR); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Warning", RS_Debug::D_WARNING); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Notice", RS_Debug::D_NOTICE); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Informational", RS_Debug::D_INFORMATIONAL); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Debugging", RS_Debug::D_DEBUGGING); exit(0); } if ( allowOptions&& (argstr.startsWith(lpDebugSwitch0, Qt::CaseInsensitive) || argstr.startsWith(lpDebugSwitch1, Qt::CaseInsensitive) )) { argClean<<i; // to control the level of debugging output use --debug with level 0-6, e.g. --debug3 // for a list of debug levels use --debug? // if no level follows, the debugging level is set argstr.remove(QRegExp("^"+lpDebugSwitch0)); argstr.remove(QRegExp("^"+lpDebugSwitch1)); char level; if(argstr.size()==0) { if(i+1<argc) { if(QRegExp("\\d*").exactMatch(argv[i+1])) { ++i; qDebug()<<"reading "<<argv[i]<<" as debugging level"; level=argv[i][0]; argClean<<i; } else level='3'; } else level='3'; //default to D_WARNING } else level=argstr.toStdString()[0]; switch(level) { case '?' : RS_DEBUG->print( RS_Debug::D_NOTHING, "possible debug levels:"); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Nothing", RS_Debug::D_NOTHING); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Critical", RS_Debug::D_CRITICAL); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Error", RS_Debug::D_ERROR); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Warning", RS_Debug::D_WARNING); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Notice", RS_Debug::D_NOTICE); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Informational", RS_Debug::D_INFORMATIONAL); RS_DEBUG->print( RS_Debug::D_NOTHING, " %d Debugging", RS_Debug::D_DEBUGGING); return 0; case '0' + RS_Debug::D_NOTHING : RS_DEBUG->setLevel( RS_Debug::D_NOTHING); ++i; break; case '0' + RS_Debug::D_CRITICAL : RS_DEBUG->setLevel( RS_Debug::D_CRITICAL); ++i; break; case '0' + RS_Debug::D_ERROR : RS_DEBUG->setLevel( RS_Debug::D_ERROR); ++i; break; case '0' + RS_Debug::D_WARNING : RS_DEBUG->setLevel( RS_Debug::D_WARNING); ++i; break; case '0' + RS_Debug::D_NOTICE : RS_DEBUG->setLevel( RS_Debug::D_NOTICE); ++i; break; case '0' + RS_Debug::D_INFORMATIONAL : RS_DEBUG->setLevel( RS_Debug::D_INFORMATIONAL); ++i; break; case '0' + RS_Debug::D_DEBUGGING : RS_DEBUG->setLevel( RS_Debug::D_DEBUGGING); ++i; break; default : RS_DEBUG->setLevel(RS_Debug::D_DEBUGGING); break; } } } RS_DEBUG->print("param 0: %s", argv[0]); QFileInfo prgInfo( QFile::decodeName(argv[0]) ); QString prgDir(prgInfo.absolutePath()); RS_SETTINGS->init(app.organizationName(), app.applicationName()); RS_SYSTEM->init(app.applicationName(), app.applicationVersion(), XSTR(QC_APPDIR), prgDir); // parse command line arguments that might not need a launched program: QStringList fileList = handleArgs(argc, argv, argClean); QString unit = settings.value("Defaults/Unit", "Invalid").toString(); // show initial config dialog: if (first_load) { RS_DEBUG->print("main: show initial config dialog.."); QG_DlgInitial di(nullptr); QPixmap pxm(":/main/intro_librecad.png"); di.setPixmap(pxm); if (di.exec()) { RS_SETTINGS->beginGroup("/Defaults"); unit = RS_SETTINGS->readEntry("/Unit", "None"); RS_SETTINGS->endGroup(); } RS_DEBUG->print("main: show initial config dialog: OK"); } auto splash = new QSplashScreen; bool show_splash = settings.value("Startup/ShowSplash", 1).toBool(); if (show_splash) { QPixmap pixmap(":/main/splash_librecad.png"); splash->setPixmap(pixmap); splash->setAttribute(Qt::WA_DeleteOnClose); splash->show(); splash->showMessage(QObject::tr("Loading.."), Qt::AlignRight|Qt::AlignBottom, Qt::black); app.processEvents(); RS_DEBUG->print("main: splashscreen: OK"); } RS_DEBUG->print("main: init fontlist.."); RS_FONTLIST->init(); RS_DEBUG->print("main: init fontlist: OK"); RS_DEBUG->print("main: init patternlist.."); RS_PATTERNLIST->init(); RS_DEBUG->print("main: init patternlist: OK"); RS_DEBUG->print("main: loading translation.."); settings.beginGroup("Appearance"); QString lang = settings.value("Language", "en").toString(); QString langCmd = settings.value("LanguageCmd", "en").toString(); settings.endGroup(); RS_SYSTEM->loadTranslation(lang, langCmd); RS_DEBUG->print("main: loading translation: OK"); RS_DEBUG->print("main: creating main window.."); QC_ApplicationWindow appWin; RS_DEBUG->print("main: setting caption"); appWin.setWindowTitle(app.applicationName()); RS_DEBUG->print("main: show main window"); settings.beginGroup("Geometry"); int windowWidth = settings.value("WindowWidth", 1024).toInt(); int windowHeight = settings.value("WindowHeight", 1024).toInt(); int windowX = settings.value("WindowX", 32).toInt(); int windowY = settings.value("WindowY", 32).toInt(); settings.endGroup(); settings.beginGroup("Defaults"); if( !settings.contains("UseQtFileOpenDialog")) { #ifdef Q_OS_LINUX // on Linux don't use native file dialog // because of case insensitive filters (issue #791) settings.setValue("UseQtFileOpenDialog", QVariant(1)); #else settings.setValue("UseQtFileOpenDialog", QVariant(0)); #endif } settings.endGroup(); if (!first_load) appWin.resize(windowWidth, windowHeight); appWin.move(windowX, windowY); bool maximize = settings.value("Startup/Maximize", 0).toBool(); if (maximize || first_load) appWin.showMaximized(); else appWin.show(); RS_DEBUG->print("main: set focus"); appWin.setFocus(); RS_DEBUG->print("main: creating main window: OK"); if (show_splash) { RS_DEBUG->print("main: updating splash"); splash->raise(); splash->showMessage(QObject::tr("Loading..."), Qt::AlignRight|Qt::AlignBottom, Qt::black); RS_DEBUG->print("main: processing events"); qApp->processEvents(); RS_DEBUG->print("main: updating splash: OK"); } // Set LC_NUMERIC so that entering numeric values uses . as the decimal seperator setlocale(LC_NUMERIC, "C"); RS_DEBUG->print("main: loading files.."); bool files_loaded = false; for (QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it ) { if (show_splash) { splash->showMessage(QObject::tr("Loading File %1..") .arg(QDir::toNativeSeparators(*it)), Qt::AlignRight|Qt::AlignBottom, Qt::black); qApp->processEvents(); } appWin.slotFileOpen(*it, RS2::FormatUnknown); files_loaded = true; } RS_DEBUG->print("main: loading files: OK"); if (!files_loaded) { appWin.slotFileNewNew(); } if (show_splash) splash->finish(&appWin); else delete splash; if (first_load) settings.setValue("Startup/FirstLoad", 0); RS_DEBUG->print("main: entering Qt event loop"); int return_code = app.exec(); RS_DEBUG->print("main: exited Qt event loop"); return return_code; }
void KornSubjectsDlg::doubleClicked(QListViewItem *item) { // show the message showMessage(item); }
void MESASystemTrayIcon::onActivated(QSystemTrayIcon::ActivationReason actv){ if(actv==3){ showMessage(QString("AMD-INFO"),daemon.getInfo(),QSystemTrayIcon::Information,10000); } }
Minutor::Minutor(): maxentitydistance(0) { mapview = new MapView; connect(mapview, SIGNAL(hoverTextChanged(QString)), statusBar(), SLOT(showMessage(QString))); connect(mapview, SIGNAL(showProperties(QVariant)), this, SLOT(showProperties(QVariant))); connect(mapview, SIGNAL(addOverlayItemType(QString,QColor)), this, SLOT(addOverlayItemType(QString,QColor))); dm=new DefinitionManager(this); mapview->attach(dm); connect(dm, SIGNAL(packsChanged()), this, SLOT(updateDimensions())); dimensions=dm->dimensionIdentifer(); connect(dimensions, SIGNAL(dimensionChanged(DimensionInfo &)), this, SLOT(viewDimension(DimensionInfo &))); settings = new Settings(this); connect(settings, SIGNAL(settingsUpdated()), this, SLOT(rescanWorlds())); if (settings->autoUpdate) dm->autoUpdate(); createActions(); createMenus(); createStatusBar(); QBoxLayout *mainLayout; if (settings->verticalDepth) { mainLayout = new QHBoxLayout; depth = new LabelledSlider(Qt::Vertical); mainLayout->addWidget(mapview,1); mainLayout->addWidget(depth); } else { mainLayout = new QVBoxLayout; depth = new LabelledSlider(Qt::Horizontal); mainLayout->addWidget(depth); mainLayout->addWidget(mapview,1); } depth->setValue(255); mainLayout->setSpacing(0); mainLayout->setContentsMargins(0,0,0,0); connect(depth, SIGNAL(valueChanged(int)), mapview, SLOT(setDepth(int))); connect(mapview, SIGNAL(demandDepthChange(int)), depth, SLOT(changeValue(int))); connect(this, SIGNAL(worldLoaded(bool)), mapview, SLOT(setEnabled(bool))); connect(this, SIGNAL(worldLoaded(bool)), depth, SLOT(setEnabled(bool))); QWidget *central=new QWidget; central->setLayout(mainLayout); setCentralWidget(central); layout()->setContentsMargins(0,0,0,0); setWindowTitle(qApp->applicationName()); propView = new Properties(this); emit worldLoaded(false); }
void cTrayIcon::showHint(QString text) { showMessage("",text,QSystemTrayIcon::Information,5000); }
void MsgEdit::setMessage(ICQMessage *_msg, bool bMark, bool bInTop, bool bSaveEdit) { msgTail = ""; setUpdatesEnabled(false); if (msg != _msg){ if (msg && (msg->Id < MSG_PROCESS_ID)) delete msg; msg = _msg; } if (bMultiply) toggleMultiply(); if (msg == NULL){ edit->setText(""); edit->resetColors(false); urlEdit->setText(""); users->clear(); url->hide(); edit->hide(); file->hide(); lblUsers->hide(); btnBgColor->hide(); btnFgColor->hide(); btnBold->hide(); btnItalic->hide(); btnUnder->hide(); btnFont->hide(); #ifdef USE_SPELL btnSpell->hide(); #endif btnSend->hide(); chkClose->hide(); btnAccept->hide(); btnDecline->hide(); btnNext->show(); btnReply->hide(); btnQuote->hide(); btnGrant->hide(); btnRefuse->hide(); btnMultiply->hide(); btnForward->hide(); users->hide(); view->hide(); setupNext(); setUpdatesEnabled(true); repaint(); return; } emit showMessage(Uin, msg->Id); if (msg->Received()){ if (bMark) pClient->markAsRead(msg); phone->hide(); url->hide(); edit->hide(); file->hide(); lblUsers->hide(); btnBgColor->hide(); btnFgColor->hide(); btnBold->hide(); btnItalic->hide(); btnUnder->hide(); btnFont->hide(); #ifdef USE_SPELL btnSpell->hide(); #endif btnSend->hide(); chkClose->hide(); btnAccept->hide(); btnDecline->hide(); btnNext->show(); btnMultiply->hide(); setupNext(); if (msg->Type() == ICQ_MSGxCONTACTxLIST){ btnReply->hide(); btnQuote->hide(); btnGrant->hide(); btnRefuse->hide(); users->show(); view->hide(); btnForward->show(); ICQContacts *m = static_cast<ICQContacts*>(msg); for (ContactList::iterator it = m->Contacts.begin(); it != m->Contacts.end(); it++){ Contact *contact = static_cast<Contact*>(*it); users->addUser(contact->Uin, contact->Alias); } users->sender = false; }else{ switch (msg->Type()){ case ICQ_MSGxFILE:{ ICQFile *f = static_cast<ICQFile*>(msg); btnReply->hide(); btnQuote->hide(); btnGrant->hide(); btnRefuse->hide(); if (f->Id >= MSG_PROCESS_ID){ btnAccept->show(); btnDecline->show(); file->show(); ICQUser *u = pClient->getUser(f->getUin()); if ((u == NULL) || !u->AcceptFileOverride()) u = pClient; string path = u->AcceptFilePath.c_str(); if (*path.c_str() == 0) pMain->buildFileName(path, "IncommingFiles/"); QString name = QString::fromLocal8Bit(path.c_str()); #ifdef WIN32 name.replace(QRegExp("/"), "\\"); if ((name.length() == 0) || (name[(int)(name.length() - 1)] != '\\')) name += "\\"; #else if ((name.length() == 0) || (name[(int)(name.length() - 1)] != '/')) name += "/"; #endif name += QString::fromLocal8Bit(f->Name.c_str()); fileEdit->setText(name); fileEdit->setSaveMode(true); ftChanged(); }else{ btnAccept->hide(); btnDecline->hide(); } break; } case ICQ_MSGxAUTHxREQUEST: btnReply->hide(); btnQuote->hide(); btnGrant->show(); btnRefuse->show(); btnAccept->hide(); btnDecline->hide(); btnForward->hide(); break; case ICQ_MSGxMSG: case ICQ_MSGxURL: if (bInTop && !pMain->SimpleMode()){ btnReply->hide(); btnQuote->show(); btnForward->show(); btnGrant->hide(); btnRefuse->hide(); btnAccept->hide(); btnDecline->hide(); users->hide(); view->hide(); edit->setTextFormat(RichText); edit->setText(""); edit->show(); edit->resetColors(true); textChanged(); setUpdatesEnabled(true); edit->setFocus(); repaint(); return; } btnReply->show(); btnQuote->show(); btnGrant->hide(); btnRefuse->hide(); btnAccept->hide(); btnDecline->hide(); btnForward->show(); break; case ICQ_MSGxCHAT: btnReply->hide(); btnQuote->hide(); btnGrant->hide(); btnRefuse->hide(); btnAccept->hide(); btnDecline->hide(); btnForward->hide(); if (msg->Id >= MSG_PROCESS_ID){ btnAccept->show(); btnDecline->show(); chatChanged(); } break; default: btnReply->hide(); btnQuote->hide(); btnGrant->hide(); btnRefuse->hide(); btnAccept->hide(); btnDecline->hide(); btnForward->hide(); } users->hide(); view->show(); view->setText(view->makeMessageText(msg, false)); if (msg->Type() == ICQ_MSGxMSG){ ICQMsg *m = static_cast<ICQMsg*>(msg); if (m->BackColor() != m->ForeColor()){ view->setForeground(QColor(m->ForeColor)); view->setBackground(QColor(m->BackColor)); }else{ view->resetColors(); } }else{ view->resetColors(); } } }else{ btnReply->hide(); btnForward->hide(); btnQuote->hide(); btnGrant->hide(); btnRefuse->hide(); btnNext->hide(); btnAccept->hide(); btnDecline->hide(); chkClose->show(); btnSend->show(); switch (msg->Type()){ case ICQ_MSGxMSG:{ phone->hide(); url->hide(); edit->show(); users->hide(); view->hide(); file->hide(); lblUsers->hide(); btnBgColor->show(); btnFgColor->show(); btnBold->show(); btnItalic->show(); btnUnder->show(); btnFont->show(); btnMultiply->show(); #ifdef USE_SPELL btnSpell->show(); #endif if (!bSaveEdit){ edit->setTextFormat(RichText); ICQMsg *m = static_cast<ICQMsg*>(msg); edit->setText(QString::fromLocal8Bit(m->Message.c_str())); if (m->BackColor() != m->ForeColor()){ edit->setBackground(QColor(m->BackColor)); edit->setForeground(QColor(m->ForeColor)); }else{ edit->resetColors(true); } edit->setFocus(); } break; } case ICQ_MSGxURL:{ phone->hide(); url->show(); edit->show(); edit->setTextFormat(PlainText); users->hide(); view->hide(); file->hide(); lblUsers->hide(); btnBgColor->hide(); btnFgColor->hide(); btnBold->hide(); btnItalic->hide(); btnUnder->hide(); btnFont->hide(); btnMultiply->show(); #ifdef USE_SPELL btnSpell->show(); #endif ICQUrl *m = static_cast<ICQUrl*>(msg); edit->resetColors(false); edit->setText(QString::fromLocal8Bit(m->Message.c_str())); urlEdit->setText(QString::fromLocal8Bit(m->URL.c_str())); urlEdit->setFocus(); break; } case ICQ_MSGxFILE:{ phone->hide(); url->hide(); edit->show(); edit->setTextFormat(PlainText); users->hide(); view->hide(); file->show(); lblUsers->hide(); btnBgColor->hide(); btnFgColor->hide(); btnBold->hide(); btnItalic->hide(); btnUnder->hide(); btnFont->hide(); btnMultiply->hide(); #ifdef USE_SPELL btnSpell->show(); #endif ICQFile *m = static_cast<ICQFile*>(msg); edit->resetColors(false); edit->setText(QString::fromLocal8Bit(m->Description.c_str())); fileEdit->setSaveMode(false); fileEdit->setText(QString::fromLocal8Bit(m->Name.c_str())); fileEdit->setFocus(); break; } case ICQ_MSGxCHAT:{ phone->hide(); url->hide(); edit->show(); edit->setTextFormat(PlainText); users->hide(); view->hide(); file->hide(); lblUsers->hide(); btnBgColor->hide(); btnFgColor->hide(); btnBold->hide(); btnItalic->hide(); btnUnder->hide(); btnFont->hide(); btnMultiply->hide(); #ifdef USE_SPELL btnSpell->show(); #endif ICQChat *m = static_cast<ICQChat*>(msg); edit->resetColors(false); edit->setText(QString::fromLocal8Bit(m->Reason.c_str())); break; } case ICQ_MSGxSMS:{ phone->show(); url->hide(); edit->show(); edit->setTextFormat(RichText); users->hide(); view->hide(); file->hide(); lblUsers->hide(); btnBgColor->hide(); btnFgColor->hide(); btnBold->hide(); btnItalic->hide(); btnUnder->hide(); btnFont->hide(); btnMultiply->hide(); #ifdef USE_SPELL btnSpell->show(); #endif ICQSMS *m = static_cast<ICQSMS*>(msg); edit->resetColors(false); edit->setText(QString::fromLocal8Bit(pClient->clearHTML(m->Message.c_str()).c_str())); if (*m->Phone.c_str()) phoneEdit->lineEdit()->setText(QString::fromLocal8Bit(m->Phone.c_str())); phoneEdit->setFocus(); break; } case ICQ_MSGxCONTACTxLIST:{ phone->hide(); url->hide(); edit->hide(); users->show(); view->hide(); file->hide(); lblUsers->show(); btnBgColor->hide(); btnFgColor->hide(); btnBold->hide(); btnItalic->hide(); btnUnder->hide(); btnFont->hide(); btnMultiply->show(); #ifdef USE_SPELL btnSpell->hide(); #endif ICQContacts *m = static_cast<ICQContacts*>(msg); for (ContactList::iterator it = m->Contacts.begin(); it != m->Contacts.end(); it++){ Contact *contact = static_cast<Contact*>(*it); users->addUser(contact->Uin, contact->Alias); } users->sender = true; break; } case ICQ_MSGxAUTHxREQUEST:{ phone->hide(); url->hide(); edit->show(); edit->setTextFormat(RichText); users->hide(); view->hide(); file->hide(); lblUsers->hide(); btnBgColor->hide(); btnFgColor->hide(); btnBold->hide(); btnItalic->hide(); btnUnder->hide(); btnFont->hide(); btnMultiply->hide(); #ifdef USE_SPELL btnSpell->hide(); #endif ICQAuthRequest *m = static_cast<ICQAuthRequest*>(msg); edit->resetColors(false); edit->setText(QString::fromLocal8Bit(m->Message.c_str())); edit->setFocus(); break; } case ICQ_MSGxAUTHxREFUSED:{ phone->hide(); url->hide(); edit->show(); edit->setTextFormat(RichText); users->hide(); view->hide(); file->hide(); lblUsers->hide(); btnBgColor->hide(); btnFgColor->hide(); btnBold->hide(); btnItalic->hide(); btnUnder->hide(); btnFont->hide(); btnMultiply->hide(); #ifdef USE_SPELL btnSpell->hide(); #endif ICQAuthRefused *m = static_cast<ICQAuthRefused*>(msg); edit->resetColors(false); edit->setText(QString::fromLocal8Bit(m->Message.c_str())); edit->setFocus(); break; } case ICQ_MSGxAUTHxGRANTED:{ phone->hide(); url->hide(); edit->hide(); users->hide(); view->show(); file->hide(); lblUsers->hide(); btnBgColor->hide(); btnFgColor->hide(); btnBold->hide(); btnItalic->hide(); btnUnder->hide(); btnFont->hide(); btnMultiply->hide(); #ifdef USE_SPELL btnSpell->hide(); #endif break; } default: log(L_WARN, "Unknown message type %u", msg->Type()); } } textChanged(); setUpdatesEnabled(true); repaint(); }
void RemotePlainGdbAdapter::startAdapter() { QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); showMessage(QLatin1String("TRYING TO START ADAPTER")); m_engine->requestRemoteSetup(); }
void GeneralColorLayer::finishCallFunc() { isShowingMessage = false; showMessage(); }
void RemotePlainGdbAdapter::handleApplicationOutput(const QByteArray &output) { showMessage(QString::fromUtf8(output), AppOutput); }
void GdbPlainEngine::shutdownEngine() { showMessage(_("PLAIN ADAPTER SHUTDOWN %1").arg(state())); m_outputCollector.shutdown(); notifyAdapterShutdownOk(); }
void KyraEngine_HoF::startup() { _sound->setSoundList(&_soundData[kMusicIngame]); // The track map is exactly the same // for FM-TOWNS and DOS _trackMap = _dosTrackMap; _trackMapSize = _dosTrackMapSize; allocAnimObjects(1, 10, 30); _screen->_curPage = 0; memset(_sceneShapeTable, 0, sizeof(_sceneShapeTable)); _gamePlayBuffer = new uint8[46080]; _unkBuf500Bytes = new uint8[500]; loadMouseShapes(); loadItemShapes(); _screen->setMouseCursor(0, 0, getShapePtr(0)); _screenBuffer = new uint8[64000]; _unkBuf200kByte = new uint8[200000]; loadChapterBuffer(_newChapterFile); loadCCodeBuffer("C_CODE.XXX"); if (_flags.isTalkie) { loadOptionsBuffer("OPTIONS.XXX"); showMessageFromCCode(265, 150, 0); _screen->updateScreen(); openTalkFile(0); _currentTalkFile = 1; openTalkFile(1); } else { _optionsBuffer = _cCodeBuffer; } showMessage(0, 207); _screen->setShapePages(5, 3); _mainCharacter.height = 0x30; _mainCharacter.facing = 4; _mainCharacter.animFrame = 0x12; memset(_sceneAnims, 0, sizeof(_sceneAnims)); for (int i = 0; i < ARRAYSIZE(_sceneAnimMovie); ++i) _sceneAnimMovie[i] = new WSAMovie_v2(this); memset(_wsaSlots, 0, sizeof(_wsaSlots)); for (int i = 0; i < ARRAYSIZE(_wsaSlots); ++i) _wsaSlots[i] = new WSAMovie_v2(this); _screen->_curPage = 0; _talkObjectList = new TalkObject[72]; memset(_talkObjectList, 0, sizeof(TalkObject)*72); _shapeDescTable = new ShapeDesc[55]; memset(_shapeDescTable, 0, sizeof(ShapeDesc)*55); for (int i = 9; i <= 32; ++i) { _shapeDescTable[i-9].width = 30; _shapeDescTable[i-9].height = 55; _shapeDescTable[i-9].xAdd = -15; _shapeDescTable[i-9].yAdd = -50; } for (int i = 19; i <= 24; ++i) { _shapeDescTable[i-9].width = 53; _shapeDescTable[i-9].yAdd = -51; } _gfxBackUpRect = new uint8[_screen->getRectSize(32, 32)]; initItemList(30); loadButtonShapes(); resetItemList(); _characterShapeFile = 1; loadCharacterShapes(_characterShapeFile); initInventoryButtonList(); setupLangButtonShapes(); loadInventoryShapes(); _screen->loadPalette("PALETTE.COL", _screen->getPalette(0)); _screen->loadBitmap("_PLAYFLD.CPS", 3, 3, 0); _screen->copyPage(3, 0); _screen->showMouse(); _screen->hideMouse(); clearAnimObjects(); for (int i = 0; i < 19; ++i) memset(_conversationState[i], -1, sizeof(int8)*14); clearCauldronTable(); memset(_inputColorCode, -1, sizeof(_inputColorCode)); memset(_newSceneDlgState, 0, sizeof(_newSceneDlgState)); for (int i = 0; i < 23; ++i) resetCauldronStateTable(i); _sceneList = new SceneDesc[86]; memset(_sceneList, 0, sizeof(SceneDesc)*86); _sceneListSize = 86; runStartScript(1, 0); loadNPCScript(); if (_gameToLoad == -1) { snd_playWanderScoreViaMap(52, 1); enterNewScene(_mainCharacter.sceneId, _mainCharacter.facing, 0, 0, 1); saveGameStateIntern(0, "New Game", 0); } else { loadGameStateCheck(_gameToLoad); } _screen->showMouse(); if (_menuDirectlyToLoad) (*_inventoryButtons[0].buttonCallback)(&_inventoryButtons[0]); setNextIdleAnimTimer(); setWalkspeed(_configWalkspeed); }
int KyraEngine_MR::o3_showSceneFileMessage(EMCState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_showSceneFileMessage(%p) (%d)", (const void *)script, stackPos(0)); showMessage((const char *)getTableEntry(_scenesFile, stackPos(0)), 0xFF, 0xF0); return 0; }
int readResults(ISocket * socket, bool readBlocked, bool useHTTP, StringBuffer &result) { if (readBlocked) socket->set_block_mode(BF_SYNC_TRANSFER_PULL,0,60*1000); unsigned len; bool is_status; bool isBlockedResult; for (;;) { if (delay) MilliSleep(delay); is_status = false; isBlockedResult = false; try { if (useHTTP) len = 0x10000; else if (readBlocked) len = socket->receive_block_size(); else { socket->read(&len, sizeof(len)); _WINREV(len); } } catch(IException * e) { if (manyResults) showMessage("End of result multiple set\n"); else pexception("failed to read len data", e); e->Release(); return 1; } if (len == 0) { if (manyResults) { showMessage("----End of result set----\n"); continue; } break; } bool isSpecial = false; bool pluginRequest = false; bool dataBlockRequest = false; if (len & 0x80000000) { unsigned char flag; isSpecial = true; socket->read(&flag, sizeof(flag)); switch (flag) { case '-': if (echoResults) fputs("Error:", stdout); if (saveResults && trace != NULL) fputs("Error:", trace); break; case 'D': showMessage("request for datablock\n"); dataBlockRequest = true; break; case 'P': showMessage("request for plugin\n"); pluginRequest = true; break; case 'S': if (showStatus) showMessage("Status:"); is_status=true; break; case 'T': showMessage("Timing:\n"); break; case 'X': showMessage("---Compound query finished---\n"); return 1; case 'R': isBlockedResult = true; break; } len &= 0x7FFFFFFF; len--; // flag already read } char * mem = (char*) malloc(len+1); char * t = mem; unsigned sendlen = len; t[len]=0; try { if (useHTTP) { try { socket->read(t, 0, len, sendlen); } catch (IException *E) { if (E->errorCode()!= JSOCKERR_graceful_close) throw; E->Release(); break; } if (!sendlen) break; } else if (readBlocked) socket->receive_block(t, len); else socket->read(t, len); } catch(IException * e) { pexception("failed to read data", e); return 1; } if (pluginRequest) { //Not very robust! A poor man's implementation for testing... StringBuffer dllname, libname; const char * dot = strchr(t, '.'); dllname.append("\\edata\\bin\\debug\\").append(t); libname.append("\\edata\\bin\\debug\\").append(dot-t,t).append(".lib"); sendFile(dllname.str(), socket); sendFile(libname.str(), socket); } else if (dataBlockRequest) { //Not very robust! A poor man's implementation for testing... offset_t offset; memcpy(&offset, t, sizeof(offset)); _WINREV(offset); sendFileChunk(t+sizeof(offset), offset, socket); } else { if (isBlockedResult) { t += 8; t += strlen(t)+1; sendlen -= (t - mem); } if (echoResults && (!is_status || showStatus)) { fwrite(t, sendlen, 1, stdout); fflush(stdout); } if (!is_status) result.append(sendlen, t); } free(mem); if (abortAfterFirst) return 0; } return 0; }