77 destroyWidget ,
88 minimizeWidget ,
99 maximizeWidget ,
10+ updateWidget ,
1011 newWidget
1112} from "../redux/actions/flexlayout" ;
1213import { openBackendErrorDialog , closeBackendErrorDialog } from '../redux/actions/errors' ;
@@ -16,6 +17,8 @@ import {
1617} from "../redux/actions/general" ;
1718import { closeDrawerDialogBox , openDrawerDialogBox } from '../redux/actions/drawer' ;
1819
20+ import { openTopbarDialog , closeTopbarDialog , changePageTransitionMode } from '../redux/actions/topbar'
21+
1922const updateCardsDispatch = dispatch => ( { updateCards : ( ) => dispatch ( updateCards ) } ) ;
2023const pythonCallErrorDispatch = dispatch => ( { pythonCallErrorDialogBox : payload => dispatch ( openBackendErrorDialog ( payload ) ) } ) ;
2124
@@ -76,7 +79,7 @@ export const Dimensions = connect(
7679
7780import _NetPyNE from "./NetPyNE" ;
7881export const NetPyNE = connect (
79- state => ( { editMode : state . general . editMode , } ) ,
82+ state => ( { editMode : state . general . editMode } ) ,
8083 pythonCallErrorDispatch
8184) ( _NetPyNE ) ;
8285
@@ -91,6 +94,7 @@ import _LayoutManager from "./layout/LayoutManager";
9194export const LayoutManager = connect (
9295 state => ( { ...state . flexlayout , editMode : state . general . editMode } ) ,
9396 dispatch => ( {
97+ updateWidget : widget => dispatch ( updateWidget ( widget ) ) ,
9498 minimizeWidget : id => dispatch ( minimizeWidget ( id ) ) ,
9599 destroyWidget : id => dispatch ( destroyWidget ( id ) ) ,
96100 maximizeWidget : id => dispatch ( maximizeWidget ( id ) ) ,
@@ -153,26 +157,6 @@ export const NetPyNESynapses = connect(
153157 updateCardsDispatch
154158) ( PythonControlledCapability . createPythonControlledComponent ( _NetPyNESynapses ) ) ;
155159
156- import _NetPyNETabs from "./settings/NetPyNETabs" ;
157- export const NetPyNETabs = connect (
158- state => state . general ,
159- dispatch => ( {
160- editModel : ( ) => dispatch ( editModel ) ,
161- createNetwork : ( ) => dispatch ( createNetwork ) ,
162- createAndSimulateNetwork : ( ) => dispatch ( createAndSimulateNetwork ) ,
163- showNetwork : ( ) => dispatch ( showNetwork )
164- } )
165- ) ( _NetPyNETabs ) ;
166-
167- import _NetPyNEToolbar from "./settings/NetPyNEToolBar" ;
168- export const NetPyNEToolBar = connect (
169- state => ( { ...state . general , ...state . drawer } ) ,
170- dispatch => ( {
171- closeDrawerDialogBox : ( ) => dispatch ( closeDrawerDialogBox ) ,
172- openDrawerDialogBox : ( ) => dispatch ( openDrawerDialogBox ) ,
173- } )
174- ) ( _NetPyNEToolbar ) ;
175-
176160import SelectField from "./general/Select" ;
177161export const NetPyNESelectField = connect ( ( state , ownProps ) => ( {
178162 ...ownProps ,
@@ -203,7 +187,7 @@ export const NetWorkControlButtons = connect(
203187 } )
204188) ( _NetWorkControlButtons )
205189
206- import _ActionDialog from './settings/actions /ActionDialog'
190+ import _ActionDialog from './topbar/dialogs /ActionDialog'
207191export const ActionDialog = connect (
208192 state => ( { ...state . errors , openErrorDialogBox : state . errors . openDialog } ) ,
209193 dispatch => ( {
@@ -212,18 +196,6 @@ export const ActionDialog = connect(
212196 } )
213197) ( _ActionDialog )
214198
215-
216- import _PlotButton from './instantiation/PlotButtons'
217- export const PlotButtons = connect (
218- state => ( { ...state . errors , openErrorDialogBox : state . errors . openDialog } ) ,
219- dispatch => ( {
220- newWidget : conf => dispatch ( newWidget ( conf ) ) ,
221- closeBackendErrorDialog : ( ) => dispatch ( closeBackendErrorDialog ) ,
222- pythonCallErrorDialogBox : payload => dispatch ( openBackendErrorDialog ( payload ) )
223- } )
224- ) ( _PlotButton )
225-
226-
227199import _NetPyNEPythonConsole from './general/NetPyNEPythonConsole'
228200export const NetPyNEPythonConsole = connect (
229201 null ,
@@ -241,11 +213,44 @@ export const Drawer = connect(
241213 editMode : state . general . editMode
242214 } ) ,
243215 dispatch => ( {
216+ updateWidget : newConf => dispatch ( updateWidget ( newConf ) ) ,
244217 newWidget : widget => dispatch ( newWidget ( widget ) ) ,
245218 activateWidget : widgetId => dispatch ( activateWidget ( widgetId ) )
246219 } )
247220) ( _Drawer )
248221
222+
223+ import _Topbar from "./topbar/Topbar" ;
224+ export const Topbar = connect (
225+ state => ( {
226+ dialogOpen : state . topbar . dialogOpen ,
227+ editMode : state . general . editMode ,
228+ topbarDialogName : state . topbar . dialogName ,
229+ pageTransitionMode : state . topbar . pageTransitionMode
230+ } ) ,
231+ dispatch => ( {
232+ dispatchAction : action => dispatch ( action ) ,
233+ closeDialog : ( ) => dispatch ( closeTopbarDialog ) ,
234+ changePageTransitionMode : mode => dispatch ( changePageTransitionMode ( mode ) )
235+ } )
236+ ) ( _Topbar )
237+
238+ import _SwitchPageButton from "./topbar/SwitchPageButton" ;
239+ export const SwitchPageButton = connect (
240+ state => ( {
241+ editModelPage : state . general . editMode ,
242+ pageTransitionMode : state . topbar . pageTransitionMode ,
243+ } ) ,
244+ dispatch => ( {
245+ switchToEditModelPage : ( ) => dispatch ( editModel ) ,
246+ changePageTransitionMode : mode => dispatch ( changePageTransitionMode ( mode ) ) ,
247+ createNetwork : ( ) => dispatch ( createNetwork ) ,
248+ createAndSimulateNetwork : ( ) => dispatch ( createAndSimulateNetwork ) ,
249+ showNetwork : ( ) => dispatch ( showNetwork )
250+ } )
251+ ) ( _SwitchPageButton )
252+
253+
249254// ---------------------------------------------------------------------------------------- //
250255
251256// DEFAULTS
0 commit comments