From fac80b9b4f4b538a9eb08b2ae79239baeca7298d Mon Sep 17 00:00:00 2001 From: Ethereal Date: Sat, 15 Jan 2011 15:46:53 -0700 Subject: [PATCH] Continueed playing around with the buildsystem. --- SConstruct | 7 ++-- build/config | 2 +- .../visualizer/{DisplayWindow.h => MainWindow.h} | 16 +++++---- visualizer/src/Aesalon.cpp | 20 +++++++++-- visualizer/src/DisplayWindow.cpp | 24 ------------- visualizer/src/MainWindow.cpp | 41 ++++++++++++++++++++++ visualizer/src/SConscript | 4 +-- 7 files changed, 75 insertions(+), 39 deletions(-) rename include/visualizer/{DisplayWindow.h => MainWindow.h} (56%) delete mode 100644 visualizer/src/DisplayWindow.cpp create mode 100644 visualizer/src/MainWindow.cpp diff --git a/SConstruct b/SConstruct index f772a2d..0ec225d 100644 --- a/SConstruct +++ b/SConstruct @@ -1,5 +1,6 @@ import sys import os +import subprocess colors = {} colors["cyan"] = '\033[96m' @@ -47,8 +48,10 @@ env = Environment( 'TERM' : os.environ['TERM'], 'HOME' : os.environ['HOME']}) -env.Append(CPPPATH = [os.environ["PWD"] + "/include/"]) -env.Append(includeRoot = os.environ["PWD"] + "/include/") +cwd = subprocess.Popen("pwd", stdout=subprocess.PIPE).stdout.read().strip() + +env.Append(CPPPATH = [cwd + "/include/"]) +env.Append(includeRoot = cwd + "/include/") Export('env') diff --git a/build/config b/build/config index cca4011..42a3347 100644 --- a/build/config +++ b/build/config @@ -2,7 +2,7 @@ { # The version of Aesalon. - "version": "0.3.9.1", + "version": "0.4.0", # The name of the module configuration file in the module root. "moduleConfigFileName": "module.conf", diff --git a/include/visualizer/DisplayWindow.h b/include/visualizer/MainWindow.h similarity index 56% rename from include/visualizer/DisplayWindow.h rename to include/visualizer/MainWindow.h index 0f4b871..143157e 100644 --- a/include/visualizer/DisplayWindow.h +++ b/include/visualizer/MainWindow.h @@ -5,21 +5,23 @@ Aesalon is distributed under the terms of the GNU GPLv3. For more licensing information, see the file LICENSE included with the distribution. - @file include/visualizer//DisplayWindow.h + @file include/visualizer/MainWindow.h */ -#ifndef AesalonVisualizer_DisplayWindow_H -#define AesalonVisualizer_DisplayWindow_H +#include -#include +#ifndef AesalonVisualizer_MainWindow_H +#define AesalonVisualizer_MainWindow_H namespace Visualizer { -class DisplayWindow : public QObject { Q_OBJECT +class MainWindow : public QMainWindow { Q_OBJECT public: - DisplayWindow(); - virtual ~DisplayWindow(); + MainWindow(); + virtual ~MainWindow(); +private: + void setupMenus(); }; } // namespace Visualizer diff --git a/visualizer/src/Aesalon.cpp b/visualizer/src/Aesalon.cpp index 3b11555..00ea62b 100644 --- a/visualizer/src/Aesalon.cpp +++ b/visualizer/src/Aesalon.cpp @@ -1,10 +1,24 @@ #include #include +#include + +#include "MainWindow.h" + +#include "common/Config.h" int main(int argc, char *argv[]) { - QApplication qapp(argc, argv); + QApplication app(argc, argv); + + QCoreApplication::setApplicationName("visualizer"); + QCoreApplication::setOrganizationName("aesalon"); + QCoreApplication::setApplicationVersion(AesalonVersion); + + QTranslator translator; + translator.load("en_ca"); + app.installTranslator(&translator); - qapp.aboutQt(); + Visualizer::MainWindow mw; + mw.show(); - return 0; + return app.exec(); } diff --git a/visualizer/src/DisplayWindow.cpp b/visualizer/src/DisplayWindow.cpp deleted file mode 100644 index 287bbec..0000000 --- a/visualizer/src/DisplayWindow.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/** - Aesalon, a tool to visualize a program's behaviour at run-time. - Copyright (C) 2010, Aesalon Development Team. - - Aesalon is distributed under the terms of the GNU GPLv3. For more - licensing information, see the file LICENSE included with the distribution. - - @file visualizer/src//DisplayWindow.cpp - -*/ - -#include "DisplayWindow.h" - -namespace Visualizer { - -DisplayWindow::DisplayWindow() { - -} - -DisplayWindow::~DisplayWindow() { - -} - -} // namespace Visualizer diff --git a/visualizer/src/MainWindow.cpp b/visualizer/src/MainWindow.cpp new file mode 100644 index 0000000..5710d99 --- /dev/null +++ b/visualizer/src/MainWindow.cpp @@ -0,0 +1,41 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file visualizer/src/MainWindow.cpp + +*/ + +#include +#include +#include + +#include "MainWindow.h" + +namespace Visualizer { + +MainWindow::MainWindow() { + setupMenus(); +} + +MainWindow::~MainWindow() { + +} + +void MainWindow::setupMenus() { + QMenuBar *mb = menuBar(); + + QAction *action = NULL; + + QMenu *aesalonMenu = new QMenu(tr("Aesalon")); + + action = aesalonMenu->addAction(tr("Quit")); + connect(action, SIGNAL(triggered(bool)), SLOT(close())); + + mb->addMenu(aesalonMenu); +} + +} // namespace Visualizer diff --git a/visualizer/src/SConscript b/visualizer/src/SConscript index c6b3ca8..dbaad38 100644 --- a/visualizer/src/SConscript +++ b/visualizer/src/SConscript @@ -10,11 +10,11 @@ visualizerIncludePath = env.Dictionary()["includeRoot"] + "/visualizer" env.Append(CPPPATH = [visualizerIncludePath]) env.Append(CCFLAGS = ["-W", "-Wall", "-g", "-DAesalonVisualizer"]) -pkgconfig = subprocess.Popen("pkg-config QtCore QtGui --cflags", stdout=subprocess.PIPE, shell=True) +pkgconfig = subprocess.Popen("pkg-config QtCore QtGui QtNetwork --cflags", stdout=subprocess.PIPE, shell=True) qtCFlags = pkgconfig.stdout.read() env.Append(CCFLAGS = qtCFlags.split()) -pkgconfig = subprocess.Popen("pkg-config QtCore QtGui --libs", stdout=subprocess.PIPE, shell=True) +pkgconfig = subprocess.Popen("pkg-config QtCore QtGui QtNetwork --libs", stdout=subprocess.PIPE, shell=True) qtLibs = pkgconfig.stdout.read() env.Append(LIBS = qtLibs.split()) -- 2.11.4.GIT