void MainWindow::createDockWindows() { // Engine debug QDockWidget* engineDebugDock = new QDockWidget(tr("Engine Debug"), this); m_engineDebugLog = new PlainTextLog(engineDebugDock); connect(m_engineDebugLog, SIGNAL(saveLogToFileRequest()), this, SLOT(saveLogToFile())); engineDebugDock->setWidget(m_engineDebugLog); addDockWidget(Qt::BottomDockWidgetArea, engineDebugDock); // Move list QDockWidget* moveListDock = new QDockWidget(tr("Moves"), this); moveListDock->setWidget(m_moveList); addDockWidget(Qt::RightDockWidgetArea, moveListDock); // Tags QDockWidget* tagsDock = new QDockWidget(tr("Tags"), this); QTreeView* tagsView = new QTreeView(tagsDock); tagsView->setModel(m_tagsModel); tagsView->setAlternatingRowColors(true); tagsView->setRootIsDecorated(false); tagsDock->setWidget(tagsView); addDockWidget(Qt::RightDockWidgetArea, tagsDock); tabifyDockWidget(moveListDock, tagsDock); moveListDock->raise(); // Add toggle view actions to the View menu m_viewMenu->addAction(moveListDock->toggleViewAction()); m_viewMenu->addAction(tagsDock->toggleViewAction()); m_viewMenu->addAction(engineDebugDock->toggleViewAction()); }
GameProcess::GameProcess(ConfigParser* config, QWidget *parent) : QDialog(parent), ui(new Ui::GameProcess) { ui->setupUi(this); process = NULL; configParser = config; connect(ui->pushButton_config, SIGNAL(clicked()), this, SLOT(dumpConfigValues())); connect(ui->pushButton_kill, SIGNAL(clicked()), this, SLOT(killProcess())); connect(ui->pushButton_save, SIGNAL(clicked()), this, SLOT(saveLogToFile())); connect(ui->pushButton_clean, SIGNAL(clicked()), this, SLOT(clearOutputLogScreen())); }
LogDock::~LogDock() { if (timerId) { killTimer(timerId); timerId = 0; }; settings.beginGroup("LogDock"); settings.setValue("LogSize", currLogSize); settings.setValue("AutoSave", autoSaveLog->isChecked()); settings.endGroup(); settings.sync(); if ( autoSaveLog->isChecked() ) saveLogToFile(); }
/* public slots */ void LogDock::appendMsgToLog(QString &msg) { Log->append(msg); Log->setToolTip( QString("Event/Error Log\nMaxSize:\t%1 Bytes\nCurrent:\t%2") .arg(currLogSize * ONE_MB) .arg(Log->toPlainText().count())); if ( Log->toPlainText().count()>currLogSize * ONE_MB ) { if ( autoSaveLog->isChecked() ) { saveLogToFile(); } else { emit overflow(true); }; }; }
void LogDock::_saveLogToFile() { lastProbe = true; saveLogToFile(); }