diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile.am | 5 | ||||
-rwxr-xr-x | autogen.sh | 9 | ||||
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | docs/reference/endless/Makefile.am | 16 | ||||
-rw-r--r-- | docs/reference/endless/endless-sections.txt | 2 | ||||
-rw-r--r-- | docs/reference/endless/gtkdoc-test-dummy-file | 0 | ||||
-rw-r--r-- | endless/eosactionbutton.c | 18 | ||||
-rw-r--r-- | wikipedia/PrebuiltArticlesPage.js | 6 | ||||
-rw-r--r-- | wikipedia/PrebuiltWikipediaApplication.js | 5 | ||||
-rw-r--r-- | wikipedia/WikipediaApplication.js | 7 | ||||
-rw-r--r-- | wikipedia/WikipediaWebView.js | 7 | ||||
-rw-r--r-- | wikipedia/models/domain_wiki_model.js | 8 | ||||
-rw-r--r-- | wikipedia/presenters/domain_wiki_presenter.js | 19 | ||||
-rw-r--r-- | wikipedia/views/domain_wiki_view.js | 4 |
15 files changed, 80 insertions, 37 deletions
@@ -117,7 +117,7 @@ pip-log.txt .coverage .tox nosetests.xml -test-results.xml +*.log # Translations *.mo diff --git a/Makefile.am b/Makefile.am index 80a6476..feee832 100644 --- a/Makefile.am +++ b/Makefile.am @@ -158,7 +158,6 @@ m4_DATA = \ include $(top_srcdir)/test/Makefile.am # Run tests when running 'make check' -TESTS_ENVIRONMENT = gtester -k -o test-results.xml --verbose TESTS = test/run-tests - -CLEANFILES += test-results.xml +LOG_COMPILER = gtester +AM_LOG_FLAGS = -k --verbose @@ -32,15 +32,6 @@ if test -z "$NOCONFIGURE"; then echo "environment." fi -am_ver=`automake --version | grep -m 1 -o '[^ ]*$'` -# Autmake 1.11.x doesn't grasp the 'serial-tests' option. Add a m4 file which -# defines HAS_SERIAL_TESTS_OPTION so we can keep our configure.ac forward -# compatible -case $am_ver in - 1.11*|1.12*) echo '';; - *) echo 'm4_define([HAS_SERIAL_TESTS_OPTION], [1])';; -esac > m4/serial-tests.m4 - # Run the actual tools to prepare the clean checkout gtkdocize || exit $? autoreconf -fi || exit $? diff --git a/configure.ac b/configure.ac index 028360a..eb450a6 100644 --- a/configure.ac +++ b/configure.ac @@ -36,12 +36,9 @@ AC_INIT([Open Endless SDK], [_EOS_SDK_VERSION_MACRO], dnl AC_CONFIG_SRCDIR([src/hello.c]) # Initialize Automake: enable all warnings and do not insist on GNU standards # no-portability suppresses warnings about syntax specific to GNU make -# If Automake >= 1.13 we need the serial-tests options -# We use an serial-test.m4 file set up in autogen.sh to test if we need it -m4_include([m4/serial-tests.m4]) -m4_ifdef([HAS_SERIAL_TESTS_OPTION], - [AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign 1.11 serial-tests])], - [AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign 1.11])]) +# parallel-tests specifies that we use the new parallel-running test harness. +# Unlike serial-tests, this option is accepted by Automake 1.11 +AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign 1.11 parallel-tests]) # Avoid spewing garbage over the terminal ('make V=1' to see the garbage) AM_SILENT_RULES([yes]) # Initialize Libtool; don't build static libraries diff --git a/docs/reference/endless/Makefile.am b/docs/reference/endless/Makefile.am index 7131b0c..420200c 100644 --- a/docs/reference/endless/Makefile.am +++ b/docs/reference/endless/Makefile.am @@ -86,12 +86,14 @@ EXTRA_DIST += # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt #DISTCLEANFILES += -# Comment this out if you want 'make check' to test you doc status -# and run some sanity checks if ENABLE_GTK_DOC -TESTS_ENVIRONMENT = cd $(srcdir) && \ - DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \ - SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) -TESTS = $(GTKDOC_CHECK) +AM_TESTS_ENVIRONMENT = \ + export DOC_MODULE=$(DOC_MODULE); \ + export DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE); \ + export SRCDIR=$(abs_srcdir); \ + export BUILDDIR=$(abs_builddir) +# Need a dummy file to feed to GTKDOC_CHECK in the parallel test harness +TESTS = gtkdoc-test-dummy-file +LOG_COMPILER = $(GTKDOC_CHECK) +EXTRA_DIST += gtkdoc-test-dummy-file endif - diff --git a/docs/reference/endless/endless-sections.txt b/docs/reference/endless/endless-sections.txt index a02e5c7..805bcf4 100644 --- a/docs/reference/endless/endless-sections.txt +++ b/docs/reference/endless/endless-sections.txt @@ -121,6 +121,8 @@ eos_action_button_get_label eos_action_button_set_label eos_action_button_get_size eos_action_button_set_size +eos_action_button_get_label_position +eos_action_button_set_label_position EosActionButtonSize <SUBSECTION Standard> EOS_ACTION_BUTTON diff --git a/docs/reference/endless/gtkdoc-test-dummy-file b/docs/reference/endless/gtkdoc-test-dummy-file new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/docs/reference/endless/gtkdoc-test-dummy-file diff --git a/endless/eosactionbutton.c b/endless/eosactionbutton.c index 901538c..83c437d 100644 --- a/endless/eosactionbutton.c +++ b/endless/eosactionbutton.c @@ -421,6 +421,15 @@ eos_action_button_get_label (EosActionButton *button) return priv->label; } +/** + * eos_action_button_set_label_position: + * @button: the button + * @position: position of the label: top, bottom, left or right + * + * Changes the position of the label to be above, below, or to one side of the + * action button. + * See #EosActionButton:label-position for more information. + */ void eos_action_button_set_label_position (EosActionButton *button, GtkPositionType position) @@ -458,6 +467,15 @@ eos_action_button_set_label_position (EosActionButton *button, } } +/** + * eos_action_button_get_label_position: + * @button: the button + * + * Gets the position of the label respective to the button. + * See #EosActionButton:label-position for more information. + * + * Returns: the position of the label: top, bottom, left, or right + */ GtkPositionType eos_action_button_get_label_position (EosActionButton *button) { diff --git a/wikipedia/PrebuiltArticlesPage.js b/wikipedia/PrebuiltArticlesPage.js index 0d0491b..756fee6 100644 --- a/wikipedia/PrebuiltArticlesPage.js +++ b/wikipedia/PrebuiltArticlesPage.js @@ -30,7 +30,7 @@ const PrebuiltArticlesPage = new Lang.Class({ this._wiki_view = new EndlessWikipedia.WikipediaWebView({ expand:true, hide_links:true - }, []); + }); this.parent(props); @@ -41,6 +41,10 @@ const PrebuiltArticlesPage = new Lang.Class({ context.add_class(EndlessWikipedia.STYLE_CLASS_ARTICLES_PAGE); }, + setShowableLinks: function(linked_articles){ + this._wiki_view.setShowableLinks(linked_articles); + }, + get article_title() { return this._article_title; }, diff --git a/wikipedia/PrebuiltWikipediaApplication.js b/wikipedia/PrebuiltWikipediaApplication.js index d6e2e5b..dcfcfd4 100644 --- a/wikipedia/PrebuiltWikipediaApplication.js +++ b/wikipedia/PrebuiltWikipediaApplication.js @@ -21,7 +21,8 @@ const PrebuiltWikipediaApplication = new Lang.Class({ vfunc_startup: function() { this.parent(); this._domain_wiki_view = new DomainWikiView.DomainWikiView(this); - let filename = this.application_uri; - this._domain_wiki_presenter = new DomainWikiPresenter.DomainWikiPresenter(this._domain_wiki_model, this._domain_wiki_view, filename); + let app_filename = this.application_uri; + let linked_articles_filename = this.linked_articles_uri; + this._domain_wiki_presenter = new DomainWikiPresenter.DomainWikiPresenter(this._domain_wiki_model, this._domain_wiki_view, app_filename, linked_articles_filename); } }); diff --git a/wikipedia/WikipediaApplication.js b/wikipedia/WikipediaApplication.js index 152f770..e932ada 100644 --- a/wikipedia/WikipediaApplication.js +++ b/wikipedia/WikipediaApplication.js @@ -33,6 +33,13 @@ const WikipediaApplication = new Lang.Class({ 'Application Base Path', 'Path to base directory where execution began', GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY, + ''), + + // resource:// URI for the linked articles JSON file + 'linked-articles-uri': GObject.ParamSpec.string('linked-articles-uri', + 'Linked articles file URI', + 'URI for the data file describing which articles can have their links shown', + GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY, '') }, diff --git a/wikipedia/WikipediaWebView.js b/wikipedia/WikipediaWebView.js index 63e85e6..c942fbd 100644 --- a/wikipedia/WikipediaWebView.js +++ b/wikipedia/WikipediaWebView.js @@ -36,7 +36,7 @@ const WikipediaWebView = new Lang.Class({ false) }, - _init: function(params, links_to_show) { + _init: function(params) { this.parent(params); // For debugging //let settings = this.get_settings(); @@ -44,13 +44,16 @@ const WikipediaWebView = new Lang.Class({ //this.set_settings(settings); this.connect('context-menu', Lang.bind(this, function(){return true})); - this._links_to_show = links_to_show; this.connect('decide-policy', Lang.bind(this, this._onNavigation)); this.connect('load-changed', Lang.bind(this, this._onLoadChange)); }, + setShowableLinks: function(linked_articles){ + this._links_to_show = linked_articles; + }, + _getFullURL: function(base_url, params){ let full_url = base_url; for(let key in params){ diff --git a/wikipedia/models/domain_wiki_model.js b/wikipedia/models/domain_wiki_model.js index a387ff9..cb9071b 100644 --- a/wikipedia/models/domain_wiki_model.js +++ b/wikipedia/models/domain_wiki_model.js @@ -18,6 +18,14 @@ const DomainWikiModel = new Lang.Class({ this.parent(params); }, + setLinkedArticles:function(articles){ + this._linked_articles = articles; + }, + + getLinkedArticles:function(){ + return this._linked_articles; + }, + //categories should be a list of category models, already populated with article models. addCategories: function(categories){ this._categories = categories; diff --git a/wikipedia/presenters/domain_wiki_presenter.js b/wikipedia/presenters/domain_wiki_presenter.js index b6b432a..2ddaa5d 100644 --- a/wikipedia/presenters/domain_wiki_presenter.js +++ b/wikipedia/presenters/domain_wiki_presenter.js @@ -18,21 +18,23 @@ const DomainWikiPresenter = new Lang.Class({ Name: "DomainWikiPresenter", Extends: GObject.Object, - _init: function(model, view, filename) { + _init: function(model, view, app_filename, linked_articles_filename) { this._domain_wiki_model = model; this._domain_wiki_view = view; this._domain_wiki_view.set_presenter(this) this._domain_wiki_view.connect('category-chosen', Lang.bind(this, this._onCategoryClicked)); this._domain_wiki_view.connect('article-chosen', Lang.bind(this, this._onArticleClicked)); - this.initFromJsonFile(filename); + this.initAppInfoFromJsonFile(app_filename); + this.initPageRankFromJsonFile(linked_articles_filename); - let categories = this._domain_wiki_model.getCategories(); + this._domain_wiki_view.set_categories(this._domain_wiki_model.getCategories()); - this._domain_wiki_view.set_categories(categories); + let linked_articles = this._domain_wiki_model.getLinkedArticles(); + let to_show = linked_articles["app_articles"].concat(linked_articles["extra_linked_articles"]); + this._domain_wiki_view.set_showable_links(to_show); }, - initArticleModels: function(articles) { let _articles = new Array(); for(let i = 0; i < articles.length; i++) { @@ -44,7 +46,12 @@ const DomainWikiPresenter = new Lang.Class({ return _articles; }, - initFromJsonFile: function(filename) { + initPageRankFromJsonFile: function(filename){ + let articles = JSON.parse(Utils.load_file_from_resource(filename)); + this._domain_wiki_model.setLinkedArticles(articles); + }, + + initAppInfoFromJsonFile: function(filename) { let app_content = JSON.parse(Utils.load_file_from_resource(filename)); this._lang_code = filename.substring(0, 2); let categories = app_content['categories']; diff --git a/wikipedia/views/domain_wiki_view.js b/wikipedia/views/domain_wiki_view.js index a44eaa2..29f638a 100644 --- a/wikipedia/views/domain_wiki_view.js +++ b/wikipedia/views/domain_wiki_view.js @@ -192,6 +192,10 @@ const DomainWikiView = new Lang.Class({ this._front_page.setCategories(categories); }, + set_showable_links: function(linked_articles){ + this._article_view.setShowableLinks(linked_articles); + }, + _onCategoryClicked: function(page, title, index) { this.emit('category-chosen', title, index); }, |