svn commit: r237530 - user/adrian/ath_radar_stuff/src/qt-hpktlog

Adrian Chadd adrian at FreeBSD.org
Sun Jun 24 09:12:50 UTC 2012


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)),


More information about the svn-src-user mailing list