1- function openDialog ( dialogUrl , id )
1+ function openDialog ( dialogUrl , id , state )
22{
33 console . log ( "open dialog: " + dialogUrl )
44
@@ -7,7 +7,7 @@ function openDialog(dialogUrl, id)
77 console . log ( component . errorString ( ) )
88 } else if ( component . status == Component . Ready )
99 {
10- var dialog = component . createObject ( id )
10+ var dialog = component . createObject ( id , state )
1111 if ( dialog ) {
1212 dialog . open ( )
1313 return dialog
@@ -19,25 +19,33 @@ function openDialog(dialogUrl, id)
1919
2020function openSaveDialog ( id )
2121{
22- return openDialog ( "qrc:/qml/SaveDialog.qml" , id )
22+ return openDialog ( "qrc:/qml/SaveDialog.qml" , id , { } )
2323}
2424
2525function openOpenDialog ( id )
2626{
27- return openDialog ( "qrc:/qml/OpenDialog.qml" , id )
27+ return openDialog ( "qrc:/qml/OpenDialog.qml" , id , { } )
2828}
2929
3030function openAboutDialog ( id )
3131{
32- return openDialog ( "qrc:/qml/AboutWindow.qml" , id )
32+ return openDialog ( "qrc:/qml/AboutWindow.qml" , id , { } )
3333}
3434
3535function openSaveChangesDialog ( id )
3636{
37- return openDialog ( "qrc:/qml/SaveChanges.qml" , id )
37+ return openDialog ( "qrc:/qml/SaveChanges.qml" , id , { } )
3838}
3939
4040function openNewTaskDialog ( id )
4141{
42- return openDialog ( "qrc:/qml/NewTaskDialog.qml" , id )
42+ return openDialog ( "qrc:/qml/NewTaskDialog.qml" , id , { } )
43+ }
44+
45+ function openEditTaskDialog ( id , task )
46+ {
47+ return openDialog ( "qrc:/qml/NewTaskDialog.qml" , id , {
48+ title : qsTr ( "Modify task" ) ,
49+ text : task
50+ } )
4351}
0 commit comments