Skip to content

Commit

Permalink
Initial commit - version 0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cuzbog committed Feb 28, 2016
0 parents commit 9a4595d
Show file tree
Hide file tree
Showing 23 changed files with 1,642 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.user
*~
55 changes: 55 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
project(wattpad)
cmake_minimum_required(VERSION 2.8.10)

# This is required to ensure the correct node modules are included in the project
execute_process(COMMAND unity-js-scopes-tool install ${CMAKE_SOURCE_DIR}/src/node_modules unity-js-scopes)
add_custom_target(build_modules ALL COMMAND unity-js-scopes-tool build ${CMAKE_SOURCE_DIR}/src/node_modules)

# Do not remove this, its required for the correct functionality of the Ubuntu-SDK
set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Tells QtCreator location and name of the manifest file")
set(UBUNTU_PROJECT_TYPE "Scope" CACHE INTERNAL "Tells QtCreator this is a Scope project")

# Important project paths
set(CMAKE_INSTALL_PREFIX /)
set(SCOPE_INSTALL_DIR "/wattpad")
set(GETTEXT_PACKAGE "wattpad")
set(PACKAGE_NAME "wattpad.boghison")
set(SCOPE_NAME "${PACKAGE_NAME}_wattpad")

# This command figures out the target architecture and puts it into the manifest file
execute_process(
COMMAND dpkg-architecture -qDEB_HOST_ARCH
OUTPUT_VARIABLE CLICK_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Install the manifest and apparmor files
configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION "/")
install(FILES "wattpad.apparmor" DESTINATION "/")

# Make these files show up in QtCreator
file(GLOB_RECURSE
_PO_JS_FILES
"po/*.po"
"*.js"
)
add_custom_target(hidden_files
ALL
SOURCES
manifest.json.in
wattpad.apparmor
src/data/wattpad.ini.in
src/data/wattpad-settings.ini.in
po/POTFILES.in.in
po/${GETTEXT_PACKAGE}.pot
${_PO_JS_FILES}
)

# Search for our dependencies
find_package(Intltool)

# Add our main directories
add_subdirectory(po)
add_subdirectory(src)

674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Ubuntu Wattpad Scope
====================

# What is [wattpad](https://wattpad.com)?

From [Wikipedia](https://en.wikipedia.org/wiki/Wattpad)
> Wattpad is a writing community in which users are able to post articles, stories, fan fiction, and poems, either through the website or the mobile app. This gives people the chance to have their creative works available to a wider audience. The content includes work by undiscovered writers, published writers, new writers, with all users being given an equal chance to write popular works. Users are able to comment and like stories or join groups associated with the website. Around half of the users are US based; other users come from the UK, Canada, the Philippines, Australia, Russia, United Arab Emirates and other countries.
Inspiration
===========

My friends LOVE wattpad, they also published some of their stories, so this was one of my first choices for a scope.

Big thanks
==========

I'd like to thank first and foremost David Callé, Benjamin M. Zeller and Ricardo Garcia Silva, but also all the other awesome people, including the developers of the Unity Scopes JS API, who are making scope development mainstream :)
15 changes: 15 additions & 0 deletions manifest.json.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"architecture": "@CLICK_ARCH@",
"description": "Find new, interesting stories on wattpad",
"framework": "ubuntu-sdk-15.04.4",
"hooks": {
"wattpad": {
"apparmor": "wattpad.apparmor",
"scope": "wattpad"
}
},
"maintainer": "Bogdan Cuza <[email protected]>",
"name": "wattpad.boghison",
"title": "wattpad",
"version": "0.1"
}
15 changes: 15 additions & 0 deletions po/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
intltool_update_potfile(
ALL
KEYWORDS "tr" "tr:1,2" "dtr:2" "dtr:2,3" "N_"
COPYRIGHT_HOLDER ""
POTFILES_TEMPLATE "POTFILES.in.in"
GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
)

intltool_install_translations(
ALL
GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
)



1 change: 1 addition & 0 deletions po/Makefile.in.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
XGETTEXT_KEYWORDS=--c++ --keyword=tr --keyword=tr:1,2 --keyword=dtr:2 --keyword=dtr:2,3 --keyword=N_
4 changes: 4 additions & 0 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[type: gettext/ini] src/data/wattpad.ini.in
[type: gettext/ini] src/data/wattpad-settings.ini.in


4 changes: 4 additions & 0 deletions po/POTFILES.in.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[type: gettext/ini] src/data/wattpad.ini.in
[type: gettext/ini] src/data/wattpad-settings.ini.in
@GENERATED_POTFILES@

35 changes: 35 additions & 0 deletions po/wattpad.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-02-28 14:36+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: ../src/data/wattpad.ini.in.h:1
msgid "Wattpad Scope"
msgstr ""

#: ../src/data/wattpad.ini.in.h:2
msgid "Find new, interesting stories on wattpad"
msgstr ""

#: ../src/data/wattpad-settings.ini.in.h:1
msgid "What stories to show to an aggregator?"
msgstr ""

#: ../src/data/wattpad-settings.ini.in.h:2
msgid ""
"Hot;New (Will only work with 1 word - tag);Top in category (non-empty query)"
msgstr ""
63 changes: 63 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Put the ini, image, and js files in the build directory next
# to the scope .so file so test tools can find them easily.
intltool_merge_translations(
"data/wattpad.ini.in"
"${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.ini"
ALL UTF8
)
intltool_merge_translations(
"data/wattpad-settings.ini.in"
"${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}-settings.ini"
ALL UTF8
)

configure_file(
"data/icon.png"
"${CMAKE_CURRENT_BINARY_DIR}/icon.png"
@ONLY COPYONLY
)
configure_file(
"data/logo.svg"
"${CMAKE_CURRENT_BINARY_DIR}/logo.svg"
@ONLY COPYONLY
)
configure_file(
"data/screenshot.png"
"${CMAKE_CURRENT_BINARY_DIR}/screenshot.png"
@ONLY COPYONLY
)

configure_file(
"wattpad.js"
"${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.js"
@ONLY COPYONLY
)

add_custom_target(
copy_modules ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink
"${CMAKE_CURRENT_SOURCE_DIR}/node_modules"
"${CMAKE_CURRENT_BINARY_DIR}/node_modules"
)

# Install the scope ini, image, and js files
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.ini"
"${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}-settings.ini"
"${CMAKE_CURRENT_BINARY_DIR}/icon.png"
"${CMAKE_CURRENT_BINARY_DIR}/logo.svg"
"${CMAKE_CURRENT_BINARY_DIR}/screenshot.png"
"${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.js"
DESTINATION
${SCOPE_INSTALL_DIR}
)

install(
DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/node_modules"
DESTINATION
${SCOPE_INSTALL_DIR}
USE_SOURCE_PERMISSIONS
)

Binary file added src/data/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9a4595d

Please sign in to comment.