{"id":177971,"date":"2013-04-26T08:35:03","date_gmt":"2013-04-26T04:35:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=177971"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=177971","title":{"rendered":"<span class=\"post_title\">Google tasks \u0434\u043b\u044f Ubuntu Touch<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/developer.ubuntu.com\/wp-content\/uploads\/2012\/12\/App-dev-tablet-GoMobile.png\" alt=\"image\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0435\u0439 \u043e <a href=\"http:\/\/habrahabr.ru\/post\/177167\/\">\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 Ubuntu Touch \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/a> \u0438 <a href=\"http:\/\/habrahabr.ru\/post\/172639\/\">Qt 5 \u0434\u043b\u044f Android<\/a> \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 Ubuntu SDK \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0412\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 google tasks, \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e oauth \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447 \u0438\u0437 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430. \u041a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/gsdstr\/utasks\">github.<\/a> \u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 QML \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u043d\u0430 <a href=\"http:\/\/developer.ubuntu.com\/resources\/programming-languages\/qml\/\">\u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/a><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h4>\n<p>  \u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f <a href=\"http:\/\/developer.ubuntu.com\/get-started\/gomobile\/#step-get-toolkit\">Ubuntu \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 12.04.<\/a><br \/>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d Qt Creator \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0442 Ubuntu \u0438 \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043d\u0430\u0447\u0430\u0442\u044c \u0441 <a href=\"http:\/\/developer.ubuntu.com\/resources\/app-developer-cookbook\/mobile\/currency-converter-phone-app\/\">\u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435.<\/a><br \/>  \u042f \u0441\u043e\u0437\u0434\u0430\u043b \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 Qt Quick 2 Application, \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432 main.qml \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0412\u044b\u0432\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0435 <i>QQmlComponent: Component is not ready<\/i> \u2014 \u044d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 <a href=\"https:\/\/bugs.launchpad.net\/ubuntu-ui-toolkit\/+bug\/1158246\">\u0431\u0430\u0433<\/a>, \u043d\u043e \u0438 SDK \u043f\u043e\u043a\u0430 \u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u0435 preview.<\/p>\n<h4>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 <a href=\"https:\/\/code.google.com\/apis\/console\">\u043a\u043e\u043d\u0441\u043e\u043b\u0435<\/a>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432 <a href=\"https:\/\/developers.google.com\/appengine\/articles\/python\/getting_started_with_tasks_api\">Step 2: Register Your Application<\/a><br \/>  \u041d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u043a\u0435\u043d. QML \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0443\u0436\u0435 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u044f \u0432\u0437\u044f\u043b \u043a\u043e\u0434 \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <a href=\"https:\/\/code.google.com\/p\/qml-google-tasks\/\">qml-google-tasks<\/a>. \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 <b>GoogleOAuth.qml<\/b> \u2014 GUI \u0438 <b>google_oauth.js<\/b> \u2014 \u043b\u043e\u0433\u0438\u043a\u0430.<br \/>  \u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c <b>GoogleOAuth.qml<\/b> \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 QtQuick 2 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 Ubuntu.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">import QtQuick 2.0 import QtWebKit 3.0 import Ubuntu.Components 0.1 import &quot;google_oauth.js&quot; as OAuth  Page {     id: google_oauth     title: i18n.tr(&quot;Login&quot;)     anchors.fill: parent      property string oauth_link: &quot;https:\/\/accounts.google.com\/o\/oauth2\/auth?&quot; +                                 &quot;client_id=&quot; + OAuth.client_id +                                 &quot;&redirect_uri=&quot; + OAuth.redirect_uri +                                 &quot;&response_type=code&quot; +                                 &quot;&scope=https:\/\/www.googleapis.com\/auth\/tasks&quot; +                                 &quot;&access_type=offline&quot; +                                 &quot;&approval_prompt=force&quot;      property bool authorized: accessToken != &quot;&quot;     property string accessToken: &quot;&quot;     property string refreshToken: &quot;&quot;     signal loginDone();      onAccessTokenChanged: {         console.log('onAccessTokenChanged');         if(accessToken != ''){             console.log(&quot;accessToken = &quot;, accessToken)             loginDone();         }     }      function login(){         loginView.url = oauth_link     }      function refreshAccessToken(refresh_token){         OAuth.refreshAccessToken(refresh_token)     }      Flickable {         id: web_view_window          property bool loading:  false         anchors.fill: parent                 WebView {             id: loginView             anchors.fill: parent              onUrlChanged: OAuth.urlChanged(url)         }     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412 <b>google_oauth.js<\/b> \u043c\u0435\u043d\u044f\u0435\u043c <i>client_id<\/i> <i>client_secret<\/i> \u0438 <i>redirect_uri<\/i> \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0435.<br \/>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u043a\u043e\u0434 <b>GoogleOAuth.qml<\/b>:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">import QtQuick 2.0 import QtWebKit 3.0 import Ubuntu.Components 0.1 import &quot;google_oauth.js&quot; as OAuth  Page {     id: google_oauth     title: i18n.tr(&quot;Login&quot;)     anchors.fill: parent      property string oauth_link: &quot;https:\/\/accounts.google.com\/o\/oauth2\/auth?&quot; +                                 &quot;client_id=&quot; + OAuth.client_id +                                 &quot;&redirect_uri=&quot; + OAuth.redirect_uri +                                 &quot;&response_type=code&quot; +                                 &quot;&scope=https:\/\/www.googleapis.com\/auth\/tasks&quot; +                                 &quot;&access_type=offline&quot; +                                 &quot;&approval_prompt=force&quot;      property bool authorized: accessToken != &quot;&quot;     property string accessToken: &quot;&quot;     property string refreshToken: &quot;&quot;     signal loginDone();      onAccessTokenChanged: {         console.log('onAccessTokenChanged');         if(accessToken != ''){             console.log(&quot;accessToken = &quot;, accessToken)             loginDone();         }     }      function login(){         loginView.url = oauth_link     }      function refreshAccessToken(refresh_token){         OAuth.refreshAccessToken(refresh_token)     }      Flickable {         id: web_view_window          property bool loading:  false         \/\/anchors.fill: parent         \/\/\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f         width:  800         height: 800          WebView {             id: loginView             anchors.fill: parent              onUrlChanged: OAuth.urlChanged(url)         }     }      \/\/\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f     Component.onCompleted: {         console.log(&quot;onCompleted&quot;)         login()     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 qmlscene \u0444\u0430\u0439\u043b <b>GoogleOAuth.qml<\/b> (\u0412 Qt Creator \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432 \u043c\u0435\u043d\u044e: <b>Tools<\/b> &gt; <b>External<\/b> &gt; <b>Qt Quick<\/b> &gt; <b>Qt Quick 2 Preview<\/b>, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0444\u0430\u0439\u043b)<br \/>  \u041f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u043b\u043e\u0433\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0438:<br \/>  <i>onAccessTokenChanged<br \/>  accessToken = xxxx.xxxxxxxxxxxxxxxxxxxxxxxx<\/i><\/p>\n<h6>\u041d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f<\/h6>\n<p>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 <a href=\"http:\/\/developer.ubuntu.com\/api\/ubuntu-12.10\/qml\/mobile\/qml-ubuntu-components0-mainview.html\">MainView<\/a> \u0441 \u043d\u0430\u0431\u043e\u0440\u043e\u043c <a href=\"http:\/\/developer.ubuntu.com\/api\/ubuntu-12.10\/qml\/mobile\/qml-ubuntu-components0-page.html\">Page,<\/a> \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e fragments \u0432 android. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b Page \u044f \u0434\u0435\u043b\u0430\u043b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445, \u0432 <b>main.qml<\/b> \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c PageStack, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438, \u0438 \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">import QtQuick 2.0 import Ubuntu.Components 0.1  import &quot;tasks_data_manager.js&quot; as TasksDataManager  MainView {     objectName: &quot;mainView&quot;     applicationName: &quot;UTasks&quot;     id: root      width: units.gu(60)     height: units.gu(80)      PageStack {         id: pageStack         Component.onCompleted: push(taskLists)          \/\/\u0421\u043f\u0438\u0441\u043a\u0438 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f         TaskLists {             id: taskLists             visible: false              onItemClicked: {                 var item = taskLists.curItem                 console.log(&quot;onItemClicked: &quot;, item)                 tasks.title = item[&quot;title&quot;]                 TasksDataManager.getMyTasks(item[&quot;id&quot;])                 pageStack.push(tasks)             }         }          \/\/\u0417\u0430\u0434\u0430\u0447\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435         Tasks {             id: tasks             visible: false         }          \/\/\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430         GoogleOAuth {             id: google_oauth             visible: false              onLoginDone: {                 pageStack.clear()                 pageStack.push(taskLists)                 console.log(&quot;Login Done&quot;)                 \/\/tasks.refreshToken = refreshToken                  settings.setValueFor(&quot;accessToken&quot;, accessToken)                 settings.setValueFor(&quot;refreshToken&quot;, refreshToken)                  TasksDataManager.getMyTaskLists()             }         }     }      \/\/\u041f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430     Component.onCompleted: {         console.log(&quot;onCompleted&quot;)         if (settings.getValueFor(&quot;refreshToken&quot;) === &quot;&quot;) {             pageStack.push(google_oauth)             console.log(&quot;google_oauth&quot;)             google_oauth.login()         } else {             pageStack.push(taskLists)             google_oauth.refreshAccessToken(settings.getValueFor(&quot;refreshToken&quot;))         }     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/cde\/37c\/e96\/cde37ce9653ca50148411b101a78e30b.png\"\/><\/p>\n<h6>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/h6>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u043e\u043a\u0435\u043d. \u0412 QML 2 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 SQLite, \u043d\u043e \u0440\u0430\u0434\u0438 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c SQL. \u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441++ \u043a\u043b\u0430\u0441\u0441 TasksSettings \u2014 \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u043d\u0430\u0434 <a href=\"http:\/\/qt-project.org\/doc\/qt-5.0\/qtcore\/qsettings.html\">QSettings<\/a>. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u0437 QML \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0441++ \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u0430\u043a Q_INVOKABLE \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442:  <\/p>\n<pre><code class=\"javascript\">viewer.rootContext()-&gt;setContextProperty(&quot;settings&quot;, &settings); <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432 QML \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b <i>getValueFor<\/i> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438 <i>setValueFor<\/i> \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439:  <\/p>\n<pre><code class=\"javascript\">settings.setValueFor(&quot;refreshToken&quot;, refreshToken) if (settings.getValueFor(&quot;refreshToken&quot;) === &quot;&quot;) { <\/code><\/pre>\n<h4>\u0421\u043f\u0438\u0441\u043a\u0438 \u0437\u0430\u0434\u0430\u0447<\/h4>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u2014 <b>TaskLists.qml<\/b>.<br \/>  \u041f\u0440\u043e\u0441\u0442\u043e\u0439 <a href=\"http:\/\/qt-project.org\/doc\/qt-5.0\/qtquick\/qml-qtquick2-listview.html\">ListView<\/a> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"http:\/\/developer.ubuntu.com\/api\/ubuntu-12.10\/qml\/mobile\/qml-ubuntu-components-listitems0-standard.html\">ListItems<\/a> \u0438\u0437 Ubuntu  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">import QtQuick 2.0 import QtQuick.XmlListModel 2.0 import Ubuntu.Components 0.1 import Ubuntu.Components.ListItems 0.1 import Ubuntu.Components.Popups 0.1  Page {     id: taskLists     title: i18n.tr(&quot;Lists&quot;)     anchors.fill: parent      ListModel {         id: taskListsModel         ListElement {             title: &quot;My&quot;         }     }      Flickable {         id: flickable         anchors.fill: parent          ListView {\/\/\u043b\u0438\u0441\u0442             id: taskListsView             model: taskListsModel             anchors.fill: parent              delegate: Standard {                 text: title \/\/\u043e\u0442 \u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435                 progression: true \/\/\u0441\u0442\u0440\u0435\u043b\u043a\u0430 \u0441\u043f\u0440\u0430\u0432\u0430                 onClicked: {                     console.log(&quot;index: &quot;, index);                     taskListsView.currentIndex = index                     curItem = taskListsModel.get(index)                     itemClicked()                 }             }         }     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041b\u043e\u0433\u0438\u043a\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 <b>tasks_data_manager.js<\/b>, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>getMyTaskLists()<\/i>. \u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 <i>onload<\/i> \u043d\u0430   <\/p>\n<pre><code class=\"javascript\">taskLists.itemsList = result[&quot;items&quot;]; <\/code><\/pre>\n<p>  \u0412 <b>TaskLists.qml<\/b> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435:  <\/p>\n<pre><code class=\"javascript\">    property variant itemsList;     signal itemClicked();      onItemsListChanged:     {         taskListsModel.clear()         if(itemsList === undefined)             return          for(var i = 0; i &lt; itemsList.length; ++i)         {             console.log(&quot;append:&quot;, itemsList[i][&quot;title&quot;], itemsList[i][&quot;id&quot;]);             var item = itemsList[i]             taskListsModel.append( item ); \/\/\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043c\u043e\u0434\u0435\u043b\u044c         }     } <\/code><\/pre>\n<p>  \u0418 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430  <\/p>\n<pre><code class=\"javascript\">property variant curItem; onClicked: {                    console.log(&quot;index: &quot;, index);                    taskListsView.currentIndex = index                    curItem = taskListsModel.get(index)                    itemClicked() } <\/code><\/pre>\n<p>  \u0412 <b>main.qml<\/b> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430  <\/p>\n<pre><code class=\"javascript\">onItemClicked: {                var item = taskLists.curItem                console.log(&quot;onItemClicked: &quot;, item)                tasks.title = item[&quot;title&quot;]                TasksDataManager.getMyTasks(item[&quot;id&quot;])                pageStack.push(tasks) } <\/code><\/pre>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u0447 \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u043f\u0438\u0441\u043a\u043e\u0432. \u041a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u044b \u0441 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438:<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/67b\/eb5\/145\/67beb51459faf03ef1a0acae257f8654.png\"\/><br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/cbc\/a2c\/60b\/cbca2c60b9155eadbbe6f85f665f60ba.png\"\/><br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/83f\/b43\/1b3\/83fb431b3464767384730388eab917b5.png\"\/>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442\u2026 \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/177971\/\"> http:\/\/habrahabr.ru\/post\/177971\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/developer.ubuntu.com\/wp-content\/uploads\/2012\/12\/App-dev-tablet-GoMobile.png\" alt=\"image\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0435\u0439 \u043e <a href=\"http:\/\/habrahabr.ru\/post\/177167\/\">\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 Ubuntu Touch \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/a> \u0438 <a href=\"http:\/\/habrahabr.ru\/post\/172639\/\">Qt 5 \u0434\u043b\u044f Android<\/a> \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 Ubuntu SDK \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0412\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 google tasks, \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e oauth \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447 \u0438\u0437 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430. \u041a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/gsdstr\/utasks\">github.<\/a> \u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 QML \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u043d\u0430 <a href=\"http:\/\/developer.ubuntu.com\/resources\/programming-languages\/qml\/\">\u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/a>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-177971","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/177971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=177971"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/177971\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=177971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=177971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=177971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}