Date: Sun, 24 Jun 2012 09:12:49 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r237530 - user/adrian/ath_radar_stuff/src/qt-hpktlog Message-ID: <201206240912.q5O9CnP5099786@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Sun Jun 24 09:12:49 2012 New Revision: 237530 URL: http://svn.freebsd.org/changeset/base/237530 Log: Change the window title to be something useful, so I can easily determine what's going on with multiple windows. Modified: user/adrian/ath_radar_stuff/src/qt-hpktlog/MainApp.cpp user/adrian/ath_radar_stuff/src/qt-hpktlog/MainApp.h user/adrian/ath_radar_stuff/src/qt-hpktlog/main.cpp Modified: user/adrian/ath_radar_stuff/src/qt-hpktlog/MainApp.cpp ============================================================================== --- user/adrian/ath_radar_stuff/src/qt-hpktlog/MainApp.cpp Sun Jun 24 08:47:19 2012 (r237529) +++ user/adrian/ath_radar_stuff/src/qt-hpktlog/MainApp.cpp Sun Jun 24 09:12:49 2012 (r237530) @@ -1,3 +1,5 @@ +#include <string> + #include <QtGui/QWidget> #include <QtGui/QFileDialog> #include <QtGui/QMessageBox> @@ -64,6 +66,13 @@ MainApp::~MainApp() delete q_plot; } +void +MainApp::SetTitle(std::string s) +{ + + q_plot->setTitle(QString::fromStdString(s)); +} + // // This causes the radar entry to get received and replotted. // It's quite possible we should just fire off a 1ms timer event Modified: user/adrian/ath_radar_stuff/src/qt-hpktlog/MainApp.h ============================================================================== --- user/adrian/ath_radar_stuff/src/qt-hpktlog/MainApp.h Sun Jun 24 08:47:19 2012 (r237529) +++ user/adrian/ath_radar_stuff/src/qt-hpktlog/MainApp.h Sun Jun 24 09:12:49 2012 (r237530) @@ -2,6 +2,7 @@ #define __MAINAPP_H__ #include <vector> +#include <string> #include <pcap.h> #include <sys/types.h> @@ -64,6 +65,8 @@ class MainApp : public QMainWindow void timerEvent(QTimerEvent *event); + void SetTitle(std::string s); + public slots: void getRadarEntry(struct radar_entry re); Modified: user/adrian/ath_radar_stuff/src/qt-hpktlog/main.cpp ============================================================================== --- user/adrian/ath_radar_stuff/src/qt-hpktlog/main.cpp Sun Jun 24 08:47:19 2012 (r237529) +++ user/adrian/ath_radar_stuff/src/qt-hpktlog/main.cpp Sun Jun 24 09:12:49 2012 (r237530) @@ -79,6 +79,7 @@ main(int argc, char *argv[]) QApplication a(argc, argv); PktSource ps; MainApp m; + std::string title; int type = 0; @@ -94,6 +95,12 @@ main(int argc, char *argv[]) // Ensure the chip is correct ps.SetChipId(type); + title = "Scatterplot "; + title.append(argv[1]); + title.append(" ("); + title.append(argv[2]); + title.append(")"); + m.SetTitle(title); // Connect the ps source -> mainapp handler QObject::connect(&ps, SIGNAL(emitRadarEntry(struct radar_entry)),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206240912.q5O9CnP5099786>