##// END OF EJS Templates
Removed annoying GUI bug with dock widget handling:...
Jeandet Alexis -
r12:a31c7daed0d6 default
parent child
Show More
@@ -16,7 +16,7
16 <hr>
16 <hr>
17 <div align="center">
17 <div align="center">
18 <B>SocExplorer Version $VERSION$.</B><BR><BR>
18 <B>SocExplorer Version $VERSION$.</B><BR><BR>
19 <B> Changeset $Changeset$.</B><BR><BR>
19 <B> Build from Changeset $Changeset$.</B><BR><BR>
20 <B> Branch $Branch$.</B><BR><BR>
20 <B> Branch $Branch$.</B><BR><BR>
21 Copyright (C) 2011-2014 Plasmas Physic Laboratory.<BR>
21 Copyright (C) 2011-2014 Plasmas Physic Laboratory.<BR>
22 This is free software; licenced under the terms of the GPLV2 license.<BR><BR>
22 This is free software; licenced under the terms of the GPLV2 license.<BR><BR>
@@ -25,8 +25,9
25 <ul>
25 <ul>
26 <LI><a href="http://qt.nokia.com" title="Qt">Qt</a> (Copyright 2008-2013 Digia Plc).</LI>
26 <LI><a href="http://qt.nokia.com" title="Qt">Qt</a> (Copyright 2008-2013 Digia Plc).</LI>
27 <LI><a href="http://pythonqt.sourceforge.net" title="PythonQt">PythonQt</a> </LI>
27 <LI><a href="http://pythonqt.sourceforge.net" title="PythonQt">PythonQt</a> </LI>
28 <LI><a href="http://commons.wikimedia.org/wiki/GNOME_Desktop_icons" title="Gnome Icons">Gnome Icons</a> </LI>
28 <LI><a href="http://nsis.sourceforge.net/Main_Page" title="NSIS">NSIS</a> (Nullsoft Scriptable Install System) </LI>
29 <LI><a href="http://nsis.sourceforge.net/Main_Page" title="NSIS">NSIS</a> (Nullsoft Scriptable Install System) </LI>
29 <LI>LppSerial</LI>
30 <LI><a href="https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/INSTRUMENTATION/lppserial" title="LppSerial">LppSerial</a></LI>
30 <LI><a href="http://www.qcustomplot.com/index.php/introduction" title="qhexedit">QCustomPlot</a></LI>
31 <LI><a href="http://www.qcustomplot.com/index.php/introduction" title="qhexedit">QCustomPlot</a></LI>
31 <LI><a href="http://code.google.com/p/qhexedit2/" title="qhexedit">QHexEdit</a></LI>
32 <LI><a href="http://code.google.com/p/qhexedit2/" title="qhexedit">QHexEdit</a></LI>
32 </ul>
33 </ul>
@@ -190,15 +190,15 void socexplorerproxy::changeSysDriverIn
190 emit _self->treeChanged(QList<socexplorerplugin*>(*drivers));
190 emit _self->treeChanged(QList<socexplorerplugin*>(*drivers));
191 }
191 }
192
192
193 void socexplorerproxy::loadChild(socexplorerplugin *parent)
193 //void socexplorerproxy::loadChild(socexplorerplugin *parent)
194 {
194 //{
195 if(!_self)init();
195 // if(!_self)init();
196 parent = parent;
196 // parent = parent;
197 pluginmanagerWDGT* pluginmanager0 = new pluginmanagerWDGT;
197 // pluginmanagerWDGT* pluginmanager0 = new pluginmanagerWDGT;
198 pluginmanager0->setChildLoadable(true);
198 // pluginmanager0->setChildLoadable(true);
199 pluginmanager0->connect(pluginmanager0,SIGNAL(loadSysDrviver(QString)),_self,SLOT(loadSysDriverToParent(QString)));
199 // pluginmanager0->connect(pluginmanager0,SIGNAL(loadSysDrviver(QString)),_self,SLOT(loadSysDriverToParent(QString)));
200 pluginmanager0->show();
200 // pluginmanager0->show();
201 }
201 //}
202
202
203
203
204 void socexplorerproxy::connectChildToParent(socexplorerplugin *parent, socexplorerplugin *child)
204 void socexplorerproxy::connectChildToParent(socexplorerplugin *parent, socexplorerplugin *child)
@@ -318,6 +318,7 void socexplorerproxy::closeSysDriver(so
318 if(!_self)init();
318 if(!_self)init();
319 if(driver!=NULL)
319 if(driver!=NULL)
320 {
320 {
321 emit _self->removePluginGUI(driver);
321 if(driver->parent==NULL)SocExplorerEngine::removeSOC(driver);
322 if(driver->parent==NULL)SocExplorerEngine::removeSOC(driver);
322 while(driver->childs.count()!=0)closeSysDriver(driver->childs.first());
323 while(driver->childs.count()!=0)closeSysDriver(driver->childs.first());
323 linearDriverList->removeOne(driver);
324 linearDriverList->removeOne(driver);
@@ -59,6 +59,7 public:
59
59
60 signals:
60 signals:
61 void addPluginGUI(QDockWidget* plugin);
61 void addPluginGUI(QDockWidget* plugin);
62 void removePluginGUI(QDockWidget* plugin);
62 int registermenu(QMainWindow* menuHolder);
63 int registermenu(QMainWindow* menuHolder);
63 void clearMenu();
64 void clearMenu();
64 QStringList findDrivers(int VID,int PID);
65 QStringList findDrivers(int VID,int PID);
@@ -77,7 +78,7 public slots:
77 QT_ENSURE_STACK_ALIGNED_FOR_SSE void loadSysDriverToParent(socexplorerplugin *driver,socexplorerplugin *parent, const QString instanceName);
78 QT_ENSURE_STACK_ALIGNED_FOR_SSE void loadSysDriverToParent(socexplorerplugin *driver,socexplorerplugin *parent, const QString instanceName);
78 QT_ENSURE_STACK_ALIGNED_FOR_SSE void changeSysDriverInstName(const QString instanceName);
79 QT_ENSURE_STACK_ALIGNED_FOR_SSE void changeSysDriverInstName(const QString instanceName);
79 QT_ENSURE_STACK_ALIGNED_FOR_SSE void changeSysDriverInstName(const QString newinstanceName,const QString previnstanceName);
80 QT_ENSURE_STACK_ALIGNED_FOR_SSE void changeSysDriverInstName(const QString newinstanceName,const QString previnstanceName);
80 QT_ENSURE_STACK_ALIGNED_FOR_SSE void loadChild(socexplorerplugin* parent);
81 // QT_ENSURE_STACK_ALIGNED_FOR_SSE void loadChild(socexplorerplugin* parent);
81 void updateText();
82 void updateText();
82 QT_ENSURE_STACK_ALIGNED_FOR_SSE void closeSysDriverFromDriver(socexplorerplugin* driver);
83 QT_ENSURE_STACK_ALIGNED_FOR_SSE void closeSysDriverFromDriver(socexplorerplugin* driver);
83 QT_ENSURE_STACK_ALIGNED_FOR_SSE void closeSysDriver(socexplorerplugin* driver,bool recursive=false);
84 QT_ENSURE_STACK_ALIGNED_FOR_SSE void closeSysDriver(socexplorerplugin* driver,bool recursive=false);
@@ -36,15 +36,13 LPMONMainWindow::LPMONMainWindow(QString
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 // QProgressBar* test = SocExplorerEngine::getProgressBar("test",10);
40 // statusBar()->setFixedHeight(statusBar()->height());
41 // SocExplorerEngine::deleteProgressBar(test);
42 }
39 }
43
40
44
41
45 void LPMONMainWindow::makeObjects(QString ScriptToEval)
42 void LPMONMainWindow::makeObjects(QString ScriptToEval)
46 {
43 {
47 Q_UNUSED(ScriptToEval)
44 Q_UNUSED(ScriptToEval)
45 this->p_pluginGUIlist = new QList<QDockWidget*>();
48 pluginsDockContainer = new QMainWindow;
46 pluginsDockContainer = new QMainWindow;
49 pluginsDockContainer->setWindowFlags(Qt::Widget);
47 pluginsDockContainer->setWindowFlags(Qt::Widget);
50 pluginsDockContainer->setDockNestingEnabled(true);
48 pluginsDockContainer->setDockNestingEnabled(true);
@@ -64,13 +62,13 void LPMONMainWindow::makeObjects(QStrin
64 SocExplorerEngine::xmlModel()->scanXmlFiles();
62 SocExplorerEngine::xmlModel()->scanXmlFiles();
65 this->regExplorer = new regsExplorer();
63 this->regExplorer = new regsExplorer();
66 this->regExplorer->setAllowedAreas(Qt::AllDockWidgetAreas);
64 this->regExplorer->setAllowedAreas(Qt::AllDockWidgetAreas);
67 // this->pluginsDockContainer->addDockWidget(Qt::TopDockWidgetArea,this->regExplorer);
68 this->addPluginInterface(this->regExplorer);
65 this->addPluginInterface(this->regExplorer);
69 this->PythonConsoleInst = new PythonConsole(socexplorerproxy::self());
66 this->PythonConsoleInst = new PythonConsole(socexplorerproxy::self());
70 this->PythonConsoleInst->addObject("SocExplorerEngine",SocExplorerEngine::self());
67 this->PythonConsoleInst->addObject("SocExplorerEngine",SocExplorerEngine::self());
71 this->pluginManager = new dockablePluginManager();
68 this->pluginManager = new dockablePluginManager();
72 this->toolpane = new toolBar;
69 this->toolpane = new toolBar;
73 this->p_about = new aboutsocexplorer();
70 this->p_about = new aboutsocexplorer();
71
74 }
72 }
75
73
76 void LPMONMainWindow::makeLayout()
74 void LPMONMainWindow::makeLayout()
@@ -89,6 +87,7 void LPMONMainWindow::makeConnections()
89 connect(socexplorerproxy::self(),SIGNAL(clearMenu()),this,SLOT(clearMenu()));
87 connect(socexplorerproxy::self(),SIGNAL(clearMenu()),this,SLOT(clearMenu()));
90 connect(this,SIGNAL(translateSig()),socexplorerproxy::self(),SLOT(updateText()));
88 connect(this,SIGNAL(translateSig()),socexplorerproxy::self(),SLOT(updateText()));
91 connect(socexplorerproxy::self(),SIGNAL(addPluginGUI(QDockWidget*)),this,SLOT(addPluginInterface(QDockWidget*)));
89 connect(socexplorerproxy::self(),SIGNAL(addPluginGUI(QDockWidget*)),this,SLOT(addPluginInterface(QDockWidget*)));
90 connect(socexplorerproxy::self(),SIGNAL(removePluginGUI(QDockWidget*)),this,SLOT(removePluginInterface(QDockWidget*)));
92 connect(this->ManagePlugins,SIGNAL(triggered()),this,SLOT(launchPluginManager()));
91 connect(this->ManagePlugins,SIGNAL(triggered()),this,SLOT(launchPluginManager()));
93 connect(this->Quit,SIGNAL(triggered()),qApp,SLOT(quit()));
92 connect(this->Quit,SIGNAL(triggered()),qApp,SLOT(quit()));
94 connect(this,SIGNAL(registerObject(QObject*,QString)),this->PythonConsoleInst,SLOT(registerObject(QObject*,QString)));
93 connect(this,SIGNAL(registerObject(QObject*,QString)),this->PythonConsoleInst,SLOT(registerObject(QObject*,QString)));
@@ -122,15 +121,20 void LPMONMainWindow::launchPluginManage
122
121
123 void LPMONMainWindow::addPluginInterface(QDockWidget *plugin)
122 void LPMONMainWindow::addPluginInterface(QDockWidget *plugin)
124 {
123 {
125 static QDockWidget* last=NULL;
126 plugin->setAllowedAreas(Qt::AllDockWidgetAreas);
124 plugin->setAllowedAreas(Qt::AllDockWidgetAreas);
127 this->pluginsDockContainer->addDockWidget(Qt::TopDockWidgetArea,plugin);
125 this->pluginsDockContainer->addDockWidget(Qt::TopDockWidgetArea,plugin);
128 if(last!=NULL)
126 if(p_pluginGUIlist->count()!=0)
129 this->pluginsDockContainer->tabifyDockWidget(last,plugin);
127 this->pluginsDockContainer->tabifyDockWidget(p_pluginGUIlist->last(),plugin);
130 last = plugin;
128 p_pluginGUIlist->append(plugin);
131
129
132 }
130 }
133
131
132 void LPMONMainWindow::removePluginInterface(QDockWidget *plugin)
133 {
134 p_pluginGUIlist->removeOne(plugin);
135 this->pluginsDockContainer->removeDockWidget(plugin);
136 }
137
134
138
135 void LPMONMainWindow::clearMenu()
139 void LPMONMainWindow::clearMenu()
136 {
140 {
@@ -159,6 +163,7 void LPMONMainWindow::makeMenu()
159 LPMONMainWindow::~LPMONMainWindow()
163 LPMONMainWindow::~LPMONMainWindow()
160 {
164 {
161 delete this->p_about;
165 delete this->p_about;
166 delete this->p_pluginGUIlist;
162 }
167 }
163
168
164
169
@@ -215,7 +220,6 void LPMONMainWindow::pluginselected(con
215 socexplorerplugin* drv=socexplorerproxy::self()->getSysDriver(instanceName);
220 socexplorerplugin* drv=socexplorerproxy::self()->getSysDriver(instanceName);
216 if(drv)
221 if(drv)
217 drv->raise();
222 drv->raise();
218 // TODO add plugin widget auto focus
219 }
223 }
220
224
221
225
@@ -58,6 +58,7 public:
58 public slots:
58 public slots:
59 void launchPluginManager();
59 void launchPluginManager();
60 void addPluginInterface(QDockWidget* plugin);
60 void addPluginInterface(QDockWidget* plugin);
61 void removePluginInterface(QDockWidget* plugin);
61 void clearMenu();
62 void clearMenu();
62 void updateText();
63 void updateText();
63 void setLangage(QAction* action);
64 void setLangage(QAction* action);
@@ -79,7 +80,7 private:
79 dockablePluginManager* pluginManager;
80 dockablePluginManager* pluginManager;
80 regsExplorer* regExplorer;
81 regsExplorer* regExplorer;
81 aboutsocexplorer* p_about;
82 aboutsocexplorer* p_about;
82
83 QList<QDockWidget*>* p_pluginGUIlist;
83 };
84 };
84
85
85 #endif // MAINWINDOW_H
86 #endif // MAINWINDOW_H
General Comments 0
You need to be logged in to leave comments. Login now