Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2013
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.         //2
  3.         Row{
  4.         spacing: parent.width / 10
  5.         width: frontEndOptionsRoot.width   / 2.2
  6.         UbuntuShape{
  7.             id: ipboxArea2
  8.             width: mainColumn.width
  9.             height: mainColumn.height / 14
  10.             color: "grey"
  11.             TextInput{
  12.                 id: ipboxEdit2
  13.                 text: {
  14.                     var defaultIp = "http://127.0.0.1"
  15.                     if ( defaultIp ===  DataBase.frontendIp2())
  16.                         return defaultIp
  17.                     else
  18.                         return DataBase.frontendIp2()
  19.                 }
  20.                 color: "white"
  21.                 font.pixelSize:  parent.width / 18
  22.                    anchors{
  23.                     centerIn: ipboxArea2
  24.                 }
  25.                 onAccepted:{
  26.                     DataBase.createInitFrontEndTable()
  27.                     function truncateFrontEnd2(){
  28.                         var db = DataBase.frontendDatabase();
  29.                         db.transaction(
  30.                                     function(tx){
  31.                                         tx.executeSql('DELETE  FROM mythbuntu_frontend WHERE WD_1=2')
  32.                                     }
  33.                              )
  34.                     }
  35.                     function insertIntoFrontEnd2Table() {
  36.                         var db = DataBase.frontendDatabase();
  37.                         db.transaction(
  38.                                     function(tx) {
  39.                                         tx.executeSql('INSERT INTO mythbuntu_frontend VALUES(?, ?, ?)', ['2', text , portboxEdit2.text]);
  40.                                     }
  41.                                     )
  42.                     }
  43.                     truncateFrontEnd2()
  44.                     insertIntoFrontEnd2Table()
  45.         //                                        debugging
  46.                                         console.log("FrontEnd Table 2  is  " + DataBase.frontendIp2())
  47.                 }
  48.             }
  49.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement