~mardy/owncloud-app/test-se

« back to all changes in this revision

Viewing changes to main.qml

  • Committer: DanielHolm
  • Date: 2014-08-23 20:49:51 UTC
  • Revision ID: d.holmen@gmail.com-20140823204951-ok65t9z1v8t3pj2t
Added dialog for entering the URL of owncloud instance

Show diffs side-by-side

added added

removed removed

Lines of Context:
189
189
                   color: UbuntuColors.orange
190
190
                   onClicked: setup.exec()
191
191
               }
 
192
 
 
193
               Button {
 
194
                   objectName: "openURLButton"
 
195
                   text: i18n.tr("Enter URL")
 
196
                   color: UbuntuColors.orange
 
197
                   onClicked: {
 
198
                       PopupUtils.close(noAccount)
 
199
                       PopupUtils.open(ocURLDialog)
 
200
                   }
 
201
               }
 
202
           }
 
203
      }
 
204
 
 
205
    Component {
 
206
           id: ocURLDialog
 
207
           Dialog {
 
208
               id: urlDetails
 
209
               objectName: "urlAccountDialog"
 
210
               title: i18n.tr("ownCloud URL")
 
211
               text: i18n.tr("Please enter the URL of your ownCloud installation")
 
212
 
 
213
               Connections {
 
214
                   target: accounts
 
215
                   onCountChanged: {
 
216
                       if (accounts.count == 1) {
 
217
                           PopupUtils.close(noAccount)
 
218
                           doLogin();
 
219
                       }
 
220
                   }
 
221
               }
 
222
 
 
223
               TextField {
 
224
                   id: urlField
 
225
                   placeholderText: "http://owncloud.org"
 
226
                   width: parent.width
 
227
                   // if there is a "s" in "https" check the checkbox
 
228
               }
 
229
 
 
230
               Button {
 
231
                   text: i18n.tr("Done")
 
232
                   color: "green"
 
233
                   onClicked: {
 
234
                       // Save all the beers
 
235
                       PopupUtils.close(urlDetails)
 
236
                   }
 
237
               }
 
238
 
 
239
               Button {
 
240
                   text: i18n.tr("Cancel")
 
241
                   color: UbuntuColors.silver
 
242
                   onClicked: {
 
243
                       PopupUtils.close(urlDetails)
 
244
                       PopupUtils.open()
 
245
                   }
 
246
               }
192
247
           }
193
248
      }
194
249
}