main.qml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import QtQuick 1.1
  2. import com.nokia.meego 1.0
  3. import "Logic.js" as Logic
  4. PageStackWindow {
  5. id: appWindow
  6. showStatusBar: screen.orientationString == "Landscape" || screen.orientationString == "LandscapeInverted" ? false : true
  7. UserTheme { id: userTheme }
  8. function checkFile( __file ) {
  9. return cppMeeWords.checkFile( __file )
  10. }
  11. //initialPage: mainPage
  12. initialPage: splashPage
  13. /* набор параметров на процесс обучения */
  14. property string learnWord: "word"
  15. property string learnTranslation: "translation"
  16. property int answTrue: 0
  17. property int answFalse: 0
  18. property variant bufWords
  19. property int siz_bufWords:0
  20. property int porgressLearn: 0
  21. property int curShowTrue: 0
  22. property int curShowFalse: 0
  23. property int curWordId: 0
  24. /*--------------------------------------------------*/
  25. property variant bufWordsErrorTest
  26. /*--------------------------------------------------*/
  27. property variant filterWords: []
  28. property variant filterWords_indx: []
  29. function initTableDB() {
  30. var db = Logic.getDatabase()
  31. console.log("initTableDB()")
  32. db.transaction( function(tx) {
  33. //tx.executeSql("drop table categories")
  34. //tx.executeSql("drop table words")
  35. tx.executeSql( "CREATE TABLE IF NOT EXISTS categories ('id' INTEGER UNIQUE PRIMARY KEY AUTOINCREMENT NOT NULL, category TEXT, description TEXT )" )
  36. tx.executeSql( "CREATE TABLE IF NOT EXISTS words ('id' INTEGER UNIQUE PRIMARY KEY AUTOINCREMENT NOT NULL, word TEXT, translation TEXT, show_true INTEGER, show_false INTEGER, category_id INTEGER REFERENCES categories ('id') ON DELETE CASCADE ON UPDATE CASCADE )" )
  37. }
  38. )
  39. }
  40. MainPage { id: mainPage }
  41. Splash { id: splashPage }
  42. Component.onCompleted: {
  43. initTableDB()
  44. }
  45. }