@@ -0,0 +1,12 | |||||
|
1 | QGroupBox { | |||
|
2 | border: 1px solid gray; | |||
|
3 | border-radius: 9px; | |||
|
4 | margin-top: 0.5em; | |||
|
5 | } | |||
|
6 | ||||
|
7 | QGroupBox::title { | |||
|
8 | subcontrol-origin: margin; | |||
|
9 | left: 10px; | |||
|
10 | padding: 0 3px 0 3px; | |||
|
11 | } | |||
|
12 |
@@ -1,12 +1,12 | |||||
1 |
#!/usr/bin/ |
|
1 | #!/usr/bin/socexplorer -e | |
2 |
|
2 | |||
3 | proxy.loadSysDriver("AHBUARTplugin","AHBUART"); |
|
3 | proxy.loadSysDriver("AHBUARTplugin","AHBUART"); | |
4 | proxy.loadSysDriverToParent("dsu3plugin","AHBUART"); |
|
4 | proxy.loadSysDriverToParent("dsu3plugin","AHBUART"); | |
5 |
proxy.loadSysDriverToParent("APB |
|
5 | proxy.loadSysDriverToParent("APB_UART_PLUGIN","AHBUART"); | |
6 | AHBUART.open("/dev/ttyUSB0",30000000) |
|
6 | AHBUART.open("/dev/ttyUSB0",30000000) | |
7 | FILE=QtGui.QFileDialog.getOpenFileName() |
|
7 | FILE=QtGui.QFileDialog.getOpenFileName() | |
8 | if FILE!="": |
|
8 | if FILE!="": | |
9 | dsu3plugin0.openFile(FILE) |
|
9 | dsu3plugin0.openFile(FILE) | |
10 | dsu3plugin0.loadFile() |
|
10 | dsu3plugin0.loadFile() | |
11 | dsu3plugin0.run() |
|
11 | dsu3plugin0.run() | |
12 | print "File loaded and running" |
|
12 | print "File loaded and running" |
@@ -1,19 +1,22 | |||||
1 | <RCC> |
|
1 | <RCC> | |
2 | <qresource prefix="/images"> |
|
2 | <qresource prefix="/images"> | |
3 | <file alias="logolpp.png">images/logo-lpp.png</file> |
|
3 | <file alias="logolpp.png">images/logo-lpp.png</file> | |
4 | <file alias="logocnrs.png">images/LOGO CNRS.png</file> |
|
4 | <file alias="logocnrs.png">images/LOGO CNRS.png</file> | |
5 | <file alias="logoso.png">images/LOGO SO.png</file> |
|
5 | <file alias="logoso.png">images/LOGO SO.png</file> | |
6 | <file alias="logolppcutted.png">images/logo-lpp-cutted.png</file> |
|
6 | <file alias="logolppcutted.png">images/logo-lpp-cutted.png</file> | |
7 | <file alias="trash.svg">images/Gnome-user-trash.svg</file> |
|
7 | <file alias="trash.svg">images/Gnome-user-trash.svg</file> | |
8 | <file alias="refresh.svg">images/Gnome-view-refresh.svg</file> |
|
8 | <file alias="refresh.svg">images/Gnome-view-refresh.svg</file> | |
9 | <file alias="open.svg">images/Gnome-document-open.svg</file> |
|
9 | <file alias="open.svg">images/Gnome-document-open.svg</file> | |
10 | <file alias="add.svg">images/Gnome-list-add.svg</file> |
|
10 | <file alias="add.svg">images/Gnome-list-add.svg</file> | |
11 | <file alias="server.svg">images/Gnome-network-server.svg</file> |
|
11 | <file alias="server.svg">images/Gnome-network-server.svg</file> | |
12 | <file alias="config.svg">images/Gnome-preferences-system.svg</file> |
|
12 | <file alias="config.svg">images/Gnome-preferences-system.svg</file> | |
13 | <file alias="up.svg">images/Gnome-go-up.svg</file> |
|
13 | <file alias="up.svg">images/Gnome-go-up.svg</file> | |
14 | <file alias="down.svg">images/Gnome-go-down.svg</file> |
|
14 | <file alias="down.svg">images/Gnome-go-down.svg</file> | |
15 | </qresource> |
|
15 | </qresource> | |
16 | <qresource prefix="/about"> |
|
16 | <qresource prefix="/about"> | |
17 | <file alias="about.html">txt/about.html</file> |
|
17 | <file alias="about.html">txt/about.html</file> | |
18 | </qresource> |
|
18 | </qresource> | |
|
19 | <qresource prefix="/styles"> | |||
|
20 | <file alias="SocExplorer.css">Styles/SocExplorer.css</file> | |||
|
21 | </qresource> | |||
19 | </RCC> |
|
22 | </RCC> |
@@ -1,238 +1,242 | |||||
1 | /*------------------------------------------------------------------------------ |
|
1 | /*------------------------------------------------------------------------------ | |
2 | -- This file is a part of the SocExplorer Software |
|
2 | -- This file is a part of the SocExplorer Software | |
3 | -- Copyright (C) 2011, Plasma Physics Laboratory - CNRS |
|
3 | -- Copyright (C) 2011, Plasma Physics Laboratory - CNRS | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 2 of the License, or |
|
7 | -- the Free Software Foundation; either version 2 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | -------------------------------------------------------------------------------*/ |
|
18 | -------------------------------------------------------------------------------*/ | |
19 | /*-- Author : Alexis Jeandet |
|
19 | /*-- Author : Alexis Jeandet | |
20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr |
|
20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr | |
21 | ----------------------------------------------------------------------------*/ |
|
21 | ----------------------------------------------------------------------------*/ | |
22 | #include "mainwindow.h" |
|
22 | #include "mainwindow.h" | |
23 | #include <QDockWidget> |
|
23 | #include <QDockWidget> | |
24 |
|
24 | |||
25 | SocExplorerMainWindow::SocExplorerMainWindow(QString ScriptToEval, QWidget *parent) |
|
25 | SocExplorerMainWindow::SocExplorerMainWindow(QString ScriptToEval, QWidget *parent) | |
26 | : QMainWindow(parent) |
|
26 | : QMainWindow(parent) | |
27 | { |
|
27 | { | |
28 | QCoreApplication::setApplicationName("SocExplorer"); |
|
28 | QCoreApplication::setApplicationName("SocExplorer"); | |
29 | QCoreApplication::setOrganizationName("LPP"); |
|
29 | QCoreApplication::setOrganizationName("LPP"); | |
30 | QCoreApplication::setOrganizationDomain("lpp.fr"); |
|
30 | QCoreApplication::setOrganizationDomain("lpp.fr"); | |
31 | this->makeObjects(ScriptToEval); |
|
31 | this->makeObjects(ScriptToEval); | |
32 | this->makeLayout(); |
|
32 | this->makeLayout(); | |
33 | this->makeMenu(); |
|
33 | this->makeMenu(); | |
34 | this->makeConnections(); |
|
34 | this->makeConnections(); | |
35 | this->setWindowIcon(QIcon(tr(":/images/logolppcutted.png"))); |
|
35 | this->setWindowIcon(QIcon(tr(":/images/logolppcutted.png"))); | |
36 | this->setAcceptDrops(true); |
|
36 | this->setAcceptDrops(true); | |
37 | this->pluginManager->setRootLoadable(true); |
|
37 | this->pluginManager->setRootLoadable(true); | |
38 | this->PythonConsoleInst->pyConsoleRunFile(ScriptToEval); |
|
38 | this->PythonConsoleInst->pyConsoleRunFile(ScriptToEval); | |
|
39 | QFile file(":/styles/SocExplorer.css"); | |||
|
40 | if(file.open(QIODevice::ReadOnly | QIODevice::Text)) | |||
|
41 | { | |||
|
42 | qApp->setStyleSheet(file.readAll()); | |||
|
43 | file.close(); | |||
|
44 | } | |||
39 | } |
|
45 | } | |
40 |
|
46 | |||
41 |
|
47 | |||
42 | void SocExplorerMainWindow::makeObjects(QString ScriptToEval) |
|
48 | void SocExplorerMainWindow::makeObjects(QString ScriptToEval) | |
43 | { |
|
49 | { | |
44 | Q_UNUSED(ScriptToEval) |
|
50 | Q_UNUSED(ScriptToEval) | |
45 | this->p_pluginGUIlist = new QList<QDockWidget*>(); |
|
51 | this->p_pluginGUIlist = new QList<QDockWidget*>(); | |
46 | pluginsDockContainer = new QMainWindow; |
|
52 | pluginsDockContainer = new QMainWindow; | |
47 | pluginsDockContainer->setWindowFlags(Qt::Widget); |
|
53 | pluginsDockContainer->setWindowFlags(Qt::Widget); | |
48 | pluginsDockContainer->setDockNestingEnabled(true); |
|
54 | pluginsDockContainer->setDockNestingEnabled(true); | |
49 | this->mainWidget = new QSplitter(Qt::Vertical); |
|
55 | this->mainWidget = new QSplitter(Qt::Vertical); | |
50 | this->appTranslator = new QTranslator; |
|
56 | this->appTranslator = new QTranslator; | |
51 | this->Quit = new QAction(tr("&Quit"),this); |
|
57 | this->Quit = new QAction(tr("&Quit"),this); | |
52 | this->Quit->setShortcut(tr("CTRL+Q")); |
|
58 | this->Quit->setShortcut(tr("CTRL+Q")); | |
53 | this->ManagePlugins = new QAction(tr("&Manage Plugins"),this); |
|
59 | this->ManagePlugins = new QAction(tr("&Manage Plugins"),this); | |
54 | this->ManagePlugins->setShortcut(tr("CTRL+P")); |
|
60 | this->ManagePlugins->setShortcut(tr("CTRL+P")); | |
55 | this->regsManager = new QAction(tr("&Manage registers"),this); |
|
61 | this->regsManager = new QAction(tr("&Manage registers"),this); | |
56 | this->exploreRegs = new QAction(tr("&Explore registers"),this); |
|
62 | this->exploreRegs = new QAction(tr("&Explore registers"),this); | |
57 | this->help = new QAction(tr("&Help"),this); |
|
63 | this->help = new QAction(tr("&Help"),this); | |
58 | this->help->setShortcut(tr("CTRL+H")); |
|
64 | this->help->setShortcut(tr("CTRL+H")); | |
59 | this->about = new QAction(tr("&About"),this); |
|
65 | this->about = new QAction(tr("&About"),this); | |
60 | socexplorerproxy::setMainWindow(this); |
|
66 | socexplorerproxy::setMainWindow(this); | |
61 | SocExplorerEngine::setMainWindow(this); |
|
67 | SocExplorerEngine::setMainWindow(this); | |
62 | SocExplorerEngine::xmlModel()->scanXmlFiles(); |
|
68 | SocExplorerEngine::xmlModel()->scanXmlFiles(); | |
63 | this->regExplorer = new regsExplorer(); |
|
69 | this->regExplorer = new regsExplorer(); | |
64 | this->regExplorer->setAllowedAreas(Qt::AllDockWidgetAreas); |
|
70 | this->regExplorer->setAllowedAreas(Qt::AllDockWidgetAreas); | |
65 | this->addPluginInterface(this->regExplorer); |
|
71 | this->addPluginInterface(this->regExplorer); | |
66 | this->PythonConsoleInst = new PythonConsole(socexplorerproxy::self()); |
|
72 | this->PythonConsoleInst = new PythonConsole(socexplorerproxy::self()); | |
67 | this->PythonConsoleInst->addObject("SocExplorerEngine",SocExplorerEngine::self()); |
|
73 | this->PythonConsoleInst->addObject("SocExplorerEngine",SocExplorerEngine::self()); | |
68 | this->pluginManager = new dockablePluginManager(); |
|
74 | this->pluginManager = new dockablePluginManager(); | |
69 | this->toolpane = new toolBar; |
|
75 | this->toolpane = new toolBar; | |
70 | this->p_about = new aboutsocexplorer(); |
|
76 | this->p_about = new aboutsocexplorer(); | |
71 |
|
77 | |||
72 | } |
|
78 | } | |
73 |
|
79 | |||
74 | void SocExplorerMainWindow::makeLayout() |
|
80 | void SocExplorerMainWindow::makeLayout() | |
75 | { |
|
81 | { | |
76 | this->mainWidget->addWidget(pluginsDockContainer); |
|
82 | this->mainWidget->addWidget(pluginsDockContainer); | |
77 | this->mainWidget->addWidget(this->PythonConsoleInst); |
|
83 | this->mainWidget->addWidget(this->PythonConsoleInst); | |
78 | this->toolpane->setAllowedAreas(Qt::RightDockWidgetArea|Qt::LeftDockWidgetArea); |
|
84 | this->toolpane->setAllowedAreas(Qt::RightDockWidgetArea|Qt::LeftDockWidgetArea); | |
79 | this->addDockWidget(Qt::LeftDockWidgetArea,this->toolpane); |
|
85 | this->addDockWidget(Qt::LeftDockWidgetArea,this->toolpane); | |
80 | this->toolpane->addTool(this->pluginManager); |
|
86 | this->toolpane->addTool(this->pluginManager); | |
81 | this->setCentralWidget(this->mainWidget); |
|
87 | this->setCentralWidget(this->mainWidget); | |
82 | } |
|
88 | } | |
83 |
|
89 | |||
84 |
|
90 | |||
85 | void SocExplorerMainWindow::makeConnections() |
|
91 | void SocExplorerMainWindow::makeConnections() | |
86 | { |
|
92 | { | |
87 | connect(socexplorerproxy::self(),SIGNAL(clearMenu()),this,SLOT(clearMenu())); |
|
93 | connect(socexplorerproxy::self(),SIGNAL(clearMenu()),this,SLOT(clearMenu())); | |
88 | connect(this,SIGNAL(translateSig()),socexplorerproxy::self(),SLOT(updateText())); |
|
94 | connect(this,SIGNAL(translateSig()),socexplorerproxy::self(),SLOT(updateText())); | |
89 | connect(socexplorerproxy::self(),SIGNAL(addPluginGUI(QDockWidget*)),this,SLOT(addPluginInterface(QDockWidget*))); |
|
95 | connect(socexplorerproxy::self(),SIGNAL(addPluginGUI(QDockWidget*)),this,SLOT(addPluginInterface(QDockWidget*))); | |
90 | connect(socexplorerproxy::self(),SIGNAL(removePluginGUI(QDockWidget*)),this,SLOT(removePluginInterface(QDockWidget*))); |
|
96 | connect(socexplorerproxy::self(),SIGNAL(removePluginGUI(QDockWidget*)),this,SLOT(removePluginInterface(QDockWidget*))); | |
91 | connect(this->ManagePlugins,SIGNAL(triggered()),this,SLOT(launchPluginManager())); |
|
97 | connect(this->ManagePlugins,SIGNAL(triggered()),this,SLOT(launchPluginManager())); | |
92 | connect(this->Quit,SIGNAL(triggered()),qApp,SLOT(quit())); |
|
98 | connect(this->Quit,SIGNAL(triggered()),qApp,SLOT(quit())); | |
93 | connect(this,SIGNAL(registerObject(QObject*,QString)),this->PythonConsoleInst,SLOT(registerObject(QObject*,QString))); |
|
99 | connect(this,SIGNAL(registerObject(QObject*,QString)),this->PythonConsoleInst,SLOT(registerObject(QObject*,QString))); | |
94 | connect(socexplorerproxy::self(),SIGNAL(registerObject(QObject*,QString)),this,SIGNAL(registerObject(QObject*,QString))); |
|
100 | connect(socexplorerproxy::self(),SIGNAL(registerObject(QObject*,QString)),this,SIGNAL(registerObject(QObject*,QString))); | |
95 | connect(this->pluginManager,SIGNAL(geteplugintree()),socexplorerproxy::self(),SLOT(geteplugintree())); |
|
101 | connect(this->pluginManager,SIGNAL(geteplugintree()),socexplorerproxy::self(),SLOT(geteplugintree())); | |
96 | connect(socexplorerproxy::self(),SIGNAL(treeChanged(QList<socexplorerplugin*>)),this->pluginManager,SIGNAL(treeChanged(QList<socexplorerplugin*>))); |
|
102 | connect(socexplorerproxy::self(),SIGNAL(treeChanged(QList<socexplorerplugin*>)),this->pluginManager,SIGNAL(treeChanged(QList<socexplorerplugin*>))); | |
97 | connect(this->pluginManager,SIGNAL(changeSysDriverInstName(QString,QString)),socexplorerproxy::self(),SLOT(changeSysDriverInstName(QString,QString))); |
|
103 | connect(this->pluginManager,SIGNAL(changeSysDriverInstName(QString,QString)),socexplorerproxy::self(),SLOT(changeSysDriverInstName(QString,QString))); | |
98 | connect(this->pluginManager,SIGNAL(changeSysDriverInstName(QString,QString)),this->PythonConsoleInst,SLOT(changeSysDriverInstName(QString,QString))); |
|
104 | connect(this->pluginManager,SIGNAL(changeSysDriverInstName(QString,QString)),this->PythonConsoleInst,SLOT(changeSysDriverInstName(QString,QString))); | |
99 | connect(this->pluginManager,SIGNAL(closeSysDriver(QString)),socexplorerproxy::self(),SLOT(closeSysDriver(QString))); |
|
105 | connect(this->pluginManager,SIGNAL(closeSysDriver(QString)),socexplorerproxy::self(),SLOT(closeSysDriver(QString))); | |
100 | connect(this->pluginManager,SIGNAL(closeSysDriver(QString)),this->PythonConsoleInst,SLOT(removeDriver(QString))); |
|
106 | connect(this->pluginManager,SIGNAL(closeSysDriver(QString)),this->PythonConsoleInst,SLOT(removeDriver(QString))); | |
101 | connect(this->pluginManager,SIGNAL(pluginselected(QString)),this,SLOT(pluginselected(QString))); |
|
107 | connect(this->pluginManager,SIGNAL(pluginselected(QString)),this,SLOT(pluginselected(QString))); | |
102 | connect(this->about,SIGNAL(triggered()),this,SLOT(showAboutBox())); |
|
108 | connect(this->about,SIGNAL(triggered()),this,SLOT(showAboutBox())); | |
103 | connect(this->exploreRegs,SIGNAL(triggered()),this->regExplorer,SLOT(show())); |
|
109 | connect(this->exploreRegs,SIGNAL(triggered()),this->regExplorer,SLOT(show())); | |
104 |
|
110 | |||
105 | this->pluginManager->connect(this->pluginManager,SIGNAL(loadSysDrviver(QString)),socexplorerproxy::self(),SLOT(loadSysDriver(QString))); |
|
111 | this->pluginManager->connect(this->pluginManager,SIGNAL(loadSysDrviver(QString)),socexplorerproxy::self(),SLOT(loadSysDriver(QString))); | |
106 | this->pluginManager->connect(this->pluginManager,SIGNAL(loadSysDriverToParent(QString,QString)),socexplorerproxy::self(),SLOT(loadSysDriverToParent(QString,QString))); |
|
112 | this->pluginManager->connect(this->pluginManager,SIGNAL(loadSysDriverToParent(QString,QString)),socexplorerproxy::self(),SLOT(loadSysDriverToParent(QString,QString))); | |
107 |
|
113 | |||
108 | } |
|
114 | } | |
109 |
|
115 | |||
110 |
|
116 | |||
111 | void SocExplorerMainWindow::launchPluginManager() |
|
117 | void SocExplorerMainWindow::launchPluginManager() | |
112 | { |
|
118 | { | |
113 |
|
119 | |||
114 | if(this->pluginManager->isHidden()) |
|
120 | if(this->pluginManager->isHidden()) | |
115 | { |
|
121 | { | |
116 | this->pluginManager->setHidden(false); |
|
122 | this->pluginManager->setHidden(false); | |
117 | } |
|
123 | } | |
118 |
|
124 | |||
119 | } |
|
125 | } | |
120 |
|
126 | |||
121 |
|
127 | |||
122 | void SocExplorerMainWindow::addPluginInterface(QDockWidget *plugin) |
|
128 | void SocExplorerMainWindow::addPluginInterface(QDockWidget *plugin) | |
123 | { |
|
129 | { | |
124 | plugin->setAllowedAreas(Qt::AllDockWidgetAreas); |
|
130 | plugin->setAllowedAreas(Qt::AllDockWidgetAreas); | |
125 | this->pluginsDockContainer->addDockWidget(Qt::TopDockWidgetArea,plugin); |
|
131 | this->pluginsDockContainer->addDockWidget(Qt::TopDockWidgetArea,plugin); | |
126 | if(p_pluginGUIlist->count()!=0) |
|
132 | if(p_pluginGUIlist->count()!=0) | |
127 | this->pluginsDockContainer->tabifyDockWidget(p_pluginGUIlist->last(),plugin); |
|
133 | this->pluginsDockContainer->tabifyDockWidget(p_pluginGUIlist->last(),plugin); | |
128 | p_pluginGUIlist->append(plugin); |
|
134 | p_pluginGUIlist->append(plugin); | |
129 |
|
135 | |||
130 | } |
|
136 | } | |
131 |
|
137 | |||
132 | void SocExplorerMainWindow::removePluginInterface(QDockWidget *plugin) |
|
138 | void SocExplorerMainWindow::removePluginInterface(QDockWidget *plugin) | |
133 | { |
|
139 | { | |
134 | p_pluginGUIlist->removeOne(plugin); |
|
140 | p_pluginGUIlist->removeOne(plugin); | |
135 | this->pluginsDockContainer->removeDockWidget(plugin); |
|
141 | this->pluginsDockContainer->removeDockWidget(plugin); | |
136 | } |
|
142 | } | |
137 |
|
143 | |||
138 |
|
144 | |||
139 | void SocExplorerMainWindow::clearMenu() |
|
145 | void SocExplorerMainWindow::clearMenu() | |
140 | { |
|
146 | { | |
141 | this->menuBar()->clear(); |
|
147 | this->menuBar()->clear(); | |
142 | this->makeMenu(); |
|
148 | this->makeMenu(); | |
143 | } |
|
149 | } | |
144 |
|
150 | |||
145 |
|
151 | |||
146 | void SocExplorerMainWindow::makeMenu() |
|
152 | void SocExplorerMainWindow::makeMenu() | |
147 | { |
|
153 | { | |
148 | this->FileMenu = menuBar()->addMenu(tr("&File")); |
|
154 | this->FileMenu = menuBar()->addMenu(tr("&File")); | |
149 | this->PluginsMenu = menuBar()->addMenu(tr("&Plugins")); |
|
155 | this->PluginsMenu = menuBar()->addMenu(tr("&Plugins")); | |
150 | this->ToolsMenu = menuBar()->addMenu(tr("&Tools")); |
|
156 | this->ToolsMenu = menuBar()->addMenu(tr("&Tools")); | |
151 | this->ToolsMenu->addAction(this->exploreRegs); |
|
157 | this->ToolsMenu->addAction(this->exploreRegs); | |
152 | this->FileMenu->addAction(this->Quit); |
|
158 | this->FileMenu->addAction(this->Quit); | |
153 | socexplorerproxy::self()->makeMenu(this->PluginsMenu); |
|
159 | socexplorerproxy::self()->makeMenu(this->PluginsMenu); | |
154 | this->PluginsMenu->addAction(this->ManagePlugins); |
|
160 | this->PluginsMenu->addAction(this->ManagePlugins); | |
155 |
|
161 | |||
156 | this->helpMenu = menuBar()->addMenu(tr("Help")); |
|
162 | this->helpMenu = menuBar()->addMenu(tr("Help")); | |
157 | this->helpMenu->addAction(this->help); |
|
163 | this->helpMenu->addAction(this->help); | |
158 | this->helpMenu->addAction(this->about); |
|
164 | this->helpMenu->addAction(this->about); | |
159 |
|
165 | |||
160 | } |
|
166 | } | |
161 |
|
167 | |||
162 |
|
168 | |||
163 | SocExplorerMainWindow::~SocExplorerMainWindow() |
|
169 | SocExplorerMainWindow::~SocExplorerMainWindow() | |
164 | { |
|
170 | { | |
165 | delete this->p_about; |
|
|||
166 | delete this->p_pluginGUIlist; |
|
|||
167 | } |
|
171 | } | |
168 |
|
172 | |||
169 |
|
173 | |||
170 | void SocExplorerMainWindow::setLangage(QAction *action) |
|
174 | void SocExplorerMainWindow::setLangage(QAction *action) | |
171 | { |
|
175 | { | |
172 | QString local = action->data().toString(); |
|
176 | QString local = action->data().toString(); | |
173 | QString qmPath = QDir(QString("translations")).absolutePath(); |
|
177 | QString qmPath = QDir(QString("translations")).absolutePath(); | |
174 | appTranslator->load(qmPath+"/socexplorer_"+local+".qm"); |
|
178 | appTranslator->load(qmPath+"/socexplorer_"+local+".qm"); | |
175 | qApp->installTranslator(appTranslator); |
|
179 | qApp->installTranslator(appTranslator); | |
176 | emit this->translateSig(); |
|
180 | emit this->translateSig(); | |
177 | } |
|
181 | } | |
178 |
|
182 | |||
179 |
|
183 | |||
180 | void SocExplorerMainWindow::createLangMenu() |
|
184 | void SocExplorerMainWindow::createLangMenu() | |
181 | { |
|
185 | { | |
182 | this->langMenu = menuBar()->addMenu(tr("&Langue")); |
|
186 | this->langMenu = menuBar()->addMenu(tr("&Langue")); | |
183 | this->langActionGrp = new QActionGroup(this); |
|
187 | this->langActionGrp = new QActionGroup(this); | |
184 | connect(this->langActionGrp,SIGNAL(triggered(QAction*)),this,SLOT(setLangage(QAction*))); |
|
188 | connect(this->langActionGrp,SIGNAL(triggered(QAction*)),this,SLOT(setLangage(QAction*))); | |
185 | QDir* qmDir = new QDir(QString("translations")); |
|
189 | QDir* qmDir = new QDir(QString("translations")); | |
186 | QStringList LangFiles = qmDir->entryList(QStringList("socexplorer_*.qm")); |
|
190 | QStringList LangFiles = qmDir->entryList(QStringList("socexplorer_*.qm")); | |
187 | for(int i=0;i<LangFiles.size();++i) |
|
191 | for(int i=0;i<LangFiles.size();++i) | |
188 | { |
|
192 | { | |
189 | QString Local = LangFiles[i]; |
|
193 | QString Local = LangFiles[i]; | |
190 | Local.remove(0,Local.indexOf('_')+1); |
|
194 | Local.remove(0,Local.indexOf('_')+1); | |
191 | Local.chop(3); |
|
195 | Local.chop(3); | |
192 | QTranslator translator; |
|
196 | QTranslator translator; | |
193 | translator.load(LangFiles[i],qmDir->absolutePath()); |
|
197 | translator.load(LangFiles[i],qmDir->absolutePath()); | |
194 | QString langage = translator.translate("MainWindow","English"); |
|
198 | QString langage = translator.translate("MainWindow","English"); | |
195 | QAction *action = new QAction(tr("&%1 %2").arg(i+1).arg(langage),this); |
|
199 | QAction *action = new QAction(tr("&%1 %2").arg(i+1).arg(langage),this); | |
196 | action->setCheckable(true); |
|
200 | action->setCheckable(true); | |
197 | action->setData(Local); |
|
201 | action->setData(Local); | |
198 | langMenu->addAction(action); |
|
202 | langMenu->addAction(action); | |
199 | langActionGrp->addAction(action); |
|
203 | langActionGrp->addAction(action); | |
200 | if(langage==tr("English")) |
|
204 | if(langage==tr("English")) | |
201 | action->setChecked(true); |
|
205 | action->setChecked(true); | |
202 | } |
|
206 | } | |
203 | } |
|
207 | } | |
204 |
|
208 | |||
205 |
|
209 | |||
206 | void SocExplorerMainWindow::updateText() |
|
210 | void SocExplorerMainWindow::updateText() | |
207 | { |
|
211 | { | |
208 | emit this->translateSig(); |
|
212 | emit this->translateSig(); | |
209 | } |
|
213 | } | |
210 |
|
214 | |||
211 |
|
215 | |||
212 |
|
216 | |||
213 | void SocExplorerMainWindow::showAboutBox() |
|
217 | void SocExplorerMainWindow::showAboutBox() | |
214 | { |
|
218 | { | |
215 | p_about->show(); |
|
219 | p_about->show(); | |
216 | } |
|
220 | } | |
217 |
|
221 | |||
218 | void SocExplorerMainWindow::pluginselected(const QString &instanceName) |
|
222 | void SocExplorerMainWindow::pluginselected(const QString &instanceName) | |
219 | { |
|
223 | { | |
220 | socexplorerplugin* drv=socexplorerproxy::self()->getSysDriver(instanceName); |
|
224 | socexplorerplugin* drv=socexplorerproxy::self()->getSysDriver(instanceName); | |
221 | if(drv) |
|
225 | if(drv) | |
222 | drv->raise(); |
|
226 | drv->raise(); | |
223 | } |
|
227 | } | |
224 |
|
228 | |||
225 |
|
229 | |||
226 |
|
230 | |||
227 | void SocExplorerMainWindow::closeEvent(QCloseEvent *event) |
|
231 | void SocExplorerMainWindow::closeEvent(QCloseEvent *event) | |
228 | { |
|
232 | { | |
229 | socexplorerproxy::self()->close(); |
|
233 | socexplorerproxy::self()->close(); | |
230 | qApp->closeAllWindows(); |
|
234 | qApp->closeAllWindows(); | |
231 | event->accept(); |
|
235 | event->accept(); | |
232 | } |
|
236 | } | |
233 |
|
237 | |||
234 |
|
238 | |||
235 |
|
239 | |||
236 |
|
240 | |||
237 |
|
241 | |||
238 |
|
242 |
@@ -1,128 +1,133 | |||||
1 | #------------------------------------------------- |
|
1 | #------------------------------------------------- | |
2 | # |
|
2 | # | |
3 | # Project created by QtCreator 2011-09-19T22:52:10 |
|
3 | # Project created by QtCreator 2011-09-19T22:52:10 | |
4 | # |
|
4 | # | |
5 | #------------------------------------------------- |
|
5 | #------------------------------------------------- | |
6 | SOCEXPLORER_ROOT = $${PWD}/.. |
|
6 | SOCEXPLORER_ROOT = $${PWD}/.. | |
7 | include(../build_cfg/socexplorer.pri) |
|
7 | include(../build_cfg/socexplorer.pri) | |
8 |
|
8 | |||
9 | TARGET = socexplorer$${DEBUG_EXT} |
|
9 | TARGET = socexplorer$${DEBUG_EXT} | |
10 | TEMPLATE = app |
|
10 | TEMPLATE = app | |
11 | CONFIG += pythonqt |
|
11 | CONFIG += pythonqt | |
12 |
|
12 | |||
13 |
|
13 | |||
14 | QMAKE_LFLAGS_RELEASE += --enable-auto-import -mstackrealign |
|
14 | QMAKE_LFLAGS_RELEASE += --enable-auto-import -mstackrealign | |
15 | QMAKE_LFLAGS_DEBUG += --enable-auto-import -mstackrealign |
|
15 | QMAKE_LFLAGS_DEBUG += --enable-auto-import -mstackrealign | |
16 |
|
16 | |||
17 | include ( common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer.pri ) |
|
17 | include ( common/pythonQtOut/generated_cpp/PySocExplorer/PySocExplorer.pri ) | |
18 | include ( SocExplorerEngine/plugins/socexplorerplugin.prf ) |
|
18 | include ( SocExplorerEngine/plugins/socexplorerplugin.prf ) | |
19 |
|
19 | |||
20 | INCLUDEPATH+=$${PWD} \ |
|
20 | INCLUDEPATH+=$${PWD} \ | |
21 | $${PWD}/common \ |
|
21 | $${PWD}/common \ | |
22 | $${PWD}/common/qhexedit \ |
|
22 | $${PWD}/common/qhexedit \ | |
23 | $${PWD}/common/QCustomPlot \ |
|
23 | $${PWD}/common/QCustomPlot \ | |
24 | $${PWD}/common/elf \ |
|
24 | $${PWD}/common/elf \ | |
25 | SocExplorerEngine/engine \ |
|
25 | SocExplorerEngine/engine \ | |
26 | SocExplorerEngine/pluginloader \ |
|
26 | SocExplorerEngine/pluginloader \ | |
27 | SocExplorerEngine/pluginsInterface \ |
|
27 | SocExplorerEngine/pluginsInterface \ | |
28 | SocExplorerEngine/proxy \ |
|
28 | SocExplorerEngine/proxy \ | |
29 | SocExplorerEngine/pluginManagerWdgt \ |
|
29 | SocExplorerEngine/pluginManagerWdgt \ | |
30 | SocExplorerEngine/plugins \ |
|
30 | SocExplorerEngine/plugins \ | |
31 | SocExplorerEngine/RegisterMVS \ |
|
31 | SocExplorerEngine/RegisterMVS \ | |
32 | SocExplorerEngine/XmlEngine \ |
|
32 | SocExplorerEngine/XmlEngine \ | |
33 | SocExplorerEngine/SOC \ |
|
33 | SocExplorerEngine/SOC \ | |
34 | SocExplorerEngine/PeripheralWidget/src |
|
34 | SocExplorerEngine/PeripheralWidget/src | |
35 |
|
35 | |||
36 | win32:INCLUDEPATH+= \ |
|
36 | win32:INCLUDEPATH+= \ | |
37 | $${PWD}/common/elf/libelfWin32/include \ |
|
37 | $${PWD}/common/elf/libelfWin32/include \ | |
38 | $${PWD}/common/elf/libelfWin32/include/libelf \ |
|
38 | $${PWD}/common/elf/libelfWin32/include/libelf \ | |
39 |
|
39 | |||
40 |
|
40 | |||
41 | RC_FILE = ../win32cfg/socexplorer.rc |
|
41 | RC_FILE = ../win32cfg/socexplorer.rc | |
42 |
|
42 | |||
43 |
|
43 | |||
44 | unix:LIBS+=-L$${SOCEXPLORER_ROOT}/bin/linux -lsocexplorercommon$${DEBUG_EXT} -L$${SOCEXPLORER_ROOT}/bin/linux -lsocexplorerengine$${DEBUG_EXT} |
|
44 | unix:LIBS+=-L$${SOCEXPLORER_ROOT}/bin/linux -lsocexplorercommon$${DEBUG_EXT} -L$${SOCEXPLORER_ROOT}/bin/linux -lsocexplorerengine$${DEBUG_EXT} | |
45 |
|
45 | |||
46 | win32-g++:LIBS += $${SOCEXPLORER_ROOT}/bin/win32/socexplorercommon$${DEBUG_EXT}.dll $${SOCEXPLORER_ROOT}/bin/win32/socexplorerengine$${DEBUG_EXT}.dll |
|
46 | win32-g++:LIBS += $${SOCEXPLORER_ROOT}/bin/win32/socexplorercommon$${DEBUG_EXT}.dll $${SOCEXPLORER_ROOT}/bin/win32/socexplorerengine$${DEBUG_EXT}.dll | |
47 |
|
47 | |||
48 |
|
48 | |||
49 | unix{ |
|
49 | unix{ | |
50 | translation.files = $${SOCEXPLORER_ROOT}/translations/socexplorer_fr.qm \ |
|
50 | translation.files = $${SOCEXPLORER_ROOT}/translations/socexplorer_fr.qm \ | |
51 | $${SOCEXPLORER_ROOT}/translations/socexplorer_en.qm |
|
51 | $${SOCEXPLORER_ROOT}/translations/socexplorer_en.qm | |
52 | translation.path = $${SOCEXPLORER_TRANSLATION_INSTALL_PATH} |
|
52 | translation.path = $${SOCEXPLORER_TRANSLATION_INSTALL_PATH} | |
53 | target.path = /usr/bin |
|
53 | target.path = /usr/bin | |
54 | INSTALLS += translation target |
|
54 | INSTALLS += translation target | |
55 | } |
|
55 | } | |
56 |
|
56 | |||
57 | header.path = $$[QT_INSTALL_HEADERS]/SocExplorer/common |
|
57 | header.path = $$[QT_INSTALL_HEADERS]/SocExplorer/common | |
58 | header.files = \ |
|
58 | header.files = \ | |
59 | socexplorer.h |
|
59 | socexplorer.h | |
60 | INSTALLS += header |
|
60 | INSTALLS += header | |
61 |
|
61 | |||
62 |
|
62 | |||
63 | SOURCES += main.cpp\ |
|
63 | SOURCES += main.cpp\ | |
64 | mainwindow.cpp \ |
|
64 | mainwindow.cpp \ | |
65 | PyWdgt/pythonconsole.cpp \ |
|
65 | PyWdgt/pythonconsole.cpp \ | |
66 | PyWdgt/pythonqtscriptingconsoledandd.cpp \ |
|
66 | PyWdgt/pythonqtscriptingconsoledandd.cpp \ | |
67 | dockablepluginmanager.cpp \ |
|
67 | dockablepluginmanager.cpp \ | |
68 | toolbar.cpp \ |
|
68 | toolbar.cpp \ | |
69 | toolbarcontainer.cpp \ |
|
69 | toolbarcontainer.cpp \ | |
70 | regsExplorer/regsexplorer.cpp \ |
|
70 | regsExplorer/regsexplorer.cpp \ | |
71 | regsExplorer/regsviewer.cpp \ |
|
71 | regsExplorer/regsviewer.cpp \ | |
72 | regsExplorer/regsexplorercfg.cpp \ |
|
72 | regsExplorer/regsexplorercfg.cpp \ | |
73 | aboutsocexplorer.cpp |
|
73 | aboutsocexplorer.cpp | |
74 |
|
74 | |||
75 | # regWidget/xmltagtextedit.cpp \ |
|
75 | # regWidget/xmltagtextedit.cpp \ | |
76 | # regWidget/xmltaglabeledit.cpp \ |
|
76 | # regWidget/xmltaglabeledit.cpp \ | |
77 | # regWidget/xmlelementslistwidget.cpp \ |
|
77 | # regWidget/xmlelementslistwidget.cpp \ | |
78 | # regWidget/xmlelementslistview.cpp \ |
|
78 | # regWidget/xmlelementslistview.cpp \ | |
79 | # regWidget/regpropeditor.cpp \ |
|
79 | # regWidget/regpropeditor.cpp \ | |
80 | # regWidget/registerwdgt.cpp \ |
|
80 | # regWidget/registerwdgt.cpp \ | |
81 | # regWidget/registereditor.cpp \ |
|
81 | # regWidget/registereditor.cpp \ | |
82 | # regWidget/registercel.cpp \ |
|
82 | # regWidget/registercel.cpp \ | |
83 | # regWidget/periphpropeditor.cpp \ |
|
83 | # regWidget/periphpropeditor.cpp \ | |
84 | # regWidget/peripherialregs.cpp \ |
|
84 | # regWidget/peripherialregs.cpp \ | |
85 | # regWidget/bitfieldpropeditor.cpp \ |
|
85 | # regWidget/bitfieldpropeditor.cpp \ | |
86 | # regWidget/bitfield.cpp |
|
86 | # regWidget/bitfield.cpp | |
87 |
|
87 | |||
88 |
|
88 | |||
89 | HEADERS += mainwindow.h \ |
|
89 | HEADERS += mainwindow.h \ | |
90 | PyWdgt/pythonconsole.h \ |
|
90 | PyWdgt/pythonconsole.h \ | |
91 | PyWdgt/pythonqtscriptingconsoledandd.h \ |
|
91 | PyWdgt/pythonqtscriptingconsoledandd.h \ | |
92 | dockablepluginmanager.h \ |
|
92 | dockablepluginmanager.h \ | |
93 | toolbar.h \ |
|
93 | toolbar.h \ | |
94 | toolbarcontainer.h \ |
|
94 | toolbarcontainer.h \ | |
95 | regsExplorer/regsexplorer.h \ |
|
95 | regsExplorer/regsexplorer.h \ | |
96 | regsExplorer/regsviewer.h \ |
|
96 | regsExplorer/regsviewer.h \ | |
97 | regsExplorer/regsexplorercfg.h \ |
|
97 | regsExplorer/regsexplorercfg.h \ | |
98 | socexplorer.h \ |
|
98 | socexplorer.h \ | |
99 | SocExplorerEngine/plugins/socexplorerplugin.h \ |
|
99 | SocExplorerEngine/plugins/socexplorerplugin.h \ | |
100 | aboutsocexplorer.h |
|
100 | aboutsocexplorer.h | |
101 | # regWidget/xmltagtextedit.h \ |
|
101 | # regWidget/xmltagtextedit.h \ | |
102 | # regWidget/xmltaglabeledit.h \ |
|
102 | # regWidget/xmltaglabeledit.h \ | |
103 | # regWidget/xmlelementslistwidget.h \ |
|
103 | # regWidget/xmlelementslistwidget.h \ | |
104 | # regWidget/xmlelementslistview.h \ |
|
104 | # regWidget/xmlelementslistview.h \ | |
105 | # regWidget/regpropeditor.h \ |
|
105 | # regWidget/regpropeditor.h \ | |
106 | # regWidget/registerwdgt.h \ |
|
106 | # regWidget/registerwdgt.h \ | |
107 | # regWidget/registereditor.h \ |
|
107 | # regWidget/registereditor.h \ | |
108 | # regWidget/registercel.h \ |
|
108 | # regWidget/registercel.h \ | |
109 | # regWidget/periphpropeditor.h \ |
|
109 | # regWidget/periphpropeditor.h \ | |
110 | # regWidget/peripherialregs.h \ |
|
110 | # regWidget/peripherialregs.h \ | |
111 | # regWidget/bitfieldpropeditor.h \ |
|
111 | # regWidget/bitfieldpropeditor.h \ | |
112 | # regWidget/bitfield.h |
|
112 | # regWidget/bitfield.h | |
113 |
|
113 | |||
114 |
|
114 | |||
115 | include ( NicePyConsole/NicePyConsole.pri) |
|
115 | include ( NicePyConsole/NicePyConsole.pri) | |
116 |
|
116 | |||
117 | win32:RESOURCES = $${SOCEXPLORER_ROOT}/ressources/socexplorer.qrc |
|
117 | win32{ | |
118 |
|
|
118 | RESOURCES = ../ressources/SocExplorer.qrc | |
|
119 | } | |||
|
120 | ||||
|
121 | unix{ | |||
|
122 | RESOURCES = ../ressources/SocExplorer.qrc | |||
|
123 | } | |||
119 |
|
124 | |||
120 | TRANSLATIONS = ../translations/socexplorer_fr.ts \ |
|
125 | TRANSLATIONS = ../translations/socexplorer_fr.ts \ | |
121 | ../translations/socexplorer_en.ts |
|
126 | ../translations/socexplorer_en.ts | |
122 |
|
127 | |||
123 |
|
128 | |||
124 |
|
129 | |||
125 |
|
130 | |||
126 |
|
131 | |||
127 |
|
132 | |||
128 |
|
133 |
General Comments 0
You need to be logged in to leave comments.
Login now