├── debian ├── compat ├── source │ └── format ├── control ├── rules ├── copyright └── changelog ├── .gitignore ├── po ├── extra │ ├── LINGUAS │ ├── POTFILES │ ├── meson.build │ ├── nl.po │ ├── extra.pot │ └── fr.po ├── LINGUAS ├── meson.build ├── POTFILES ├── com.github.bartzaalberg.lottery.pot ├── pl.po ├── nl.po └── fr.po ├── AUTHORS ├── hooks └── pre-commit.hook ├── screenshot.png ├── screenshot2.png ├── screenshot3.png ├── screenshot4.png ├── snap ├── gui │ └── lottery.png ├── com.github.bartzaalberg.lottery.desktop └── snapcraft.yaml ├── src ├── Components │ ├── HeaderLabel.vala │ └── HeaderBar.vala ├── Constants.vala ├── Views │ ├── WelcomeView.vala │ ├── NotFoundView.vala │ ├── ListView.vala │ └── WinnerView.vala ├── Dialogs │ ├── Alert.vala │ ├── DeleteConfirm.vala │ └── AddEntry.vala ├── ListManager.vala ├── EntryManager.vala ├── ListBoxRow.vala ├── ListBox.vala ├── Application.vala ├── StackManager.vala └── MainWindow.vala ├── data ├── icons │ ├── 16 │ │ └── com.github.bartzaalberg.lottery.svg │ ├── 24 │ │ └── com.github.bartzaalberg.lottery.svg │ ├── 32 │ │ └── com.github.bartzaalberg.lottery.svg │ ├── 48 │ │ └── com.github.bartzaalberg.lottery.svg │ ├── 64 │ │ └── com.github.bartzaalberg.lottery.svg │ ├── 128 │ │ └── com.github.bartzaalberg.lottery.svg │ ├── icons.gresource.xml │ └── lottery-crown.svg ├── com.github.bartzaalberg.lottery.desktop.in ├── com.github.bartzaalberg.lottery.gschema.xml ├── meson.build └── com.github.bartzaalberg.lottery.appdata.xml.in ├── .travis.yml ├── meson.build ├── README.md ├── LICENSE └── COPYING /debian/compat: -------------------------------------------------------------------------------- 1 | 9 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | build/ 3 | -------------------------------------------------------------------------------- /po/extra/LINGUAS: -------------------------------------------------------------------------------- 1 | fr 2 | nl 3 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | fr 2 | pl 3 | nl 4 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Bart Zaalberg 2 | -------------------------------------------------------------------------------- /hooks/pre-commit.hook: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | io.elementary.vala-lint -d src 4 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unbelievableflavour/lottery/HEAD/screenshot.png -------------------------------------------------------------------------------- /screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unbelievableflavour/lottery/HEAD/screenshot2.png -------------------------------------------------------------------------------- /screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unbelievableflavour/lottery/HEAD/screenshot3.png -------------------------------------------------------------------------------- /screenshot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unbelievableflavour/lottery/HEAD/screenshot4.png -------------------------------------------------------------------------------- /snap/gui/lottery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unbelievableflavour/lottery/HEAD/snap/gui/lottery.png -------------------------------------------------------------------------------- /po/extra/POTFILES: -------------------------------------------------------------------------------- 1 | data/com.github.bartzaalberg.lottery.appdata.xml.in 2 | data/com.github.bartzaalberg.lottery.desktop.in 3 | -------------------------------------------------------------------------------- /po/extra/meson.build: -------------------------------------------------------------------------------- 1 | i18n.gettext('extra', 2 | args: ['--directory='+meson.source_root(), '--from-code=UTF-8'], 3 | install: false, 4 | preset: 'glib' 5 | ) 6 | -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | i18n.gettext(meson.project_name(), 2 | args: ['--directory='+meson.source_root(), '--from-code=UTF-8'], 3 | preset: 'glib' 4 | ) 5 | subdir('extra') 6 | -------------------------------------------------------------------------------- /src/Components/HeaderLabel.vala: -------------------------------------------------------------------------------- 1 | namespace Application { 2 | public class HeaderLabel : Gtk.Label { 3 | 4 | public HeaderLabel (string text) { 5 | label = text; 6 | get_style_context ().add_class ("h4"); 7 | halign = Gtk.Align.START; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /data/icons/icons.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | lottery-crown.svg 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Constants.vala: -------------------------------------------------------------------------------- 1 | namespace Application.Constants { 2 | public const string APPLICATION_NAME = "com.github.bartzaalberg.lottery"; 3 | public const int APPLICATION_HEIGHT = 810; 4 | public const int APPLICATION_WIDTH = 200; 5 | 6 | 7 | public const Gdk.RGBA BRAND_COLOR = { 1.000, 0.157, 0.318, 1.0 }; 8 | } 9 | -------------------------------------------------------------------------------- /src/Views/WelcomeView.vala: -------------------------------------------------------------------------------- 1 | using Granite.Widgets; 2 | 3 | namespace Application { 4 | public class WelcomeView : Gtk.ScrolledWindow { 5 | 6 | public WelcomeView () { 7 | var welcome_view = new Welcome (_("Add some names!"), _("Click the upper left button")); 8 | 9 | this.add (welcome_view); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Views/NotFoundView.vala: -------------------------------------------------------------------------------- 1 | using Granite.Widgets; 2 | 3 | namespace Application { 4 | public class NotFoundView : Gtk.ScrolledWindow { 5 | 6 | public NotFoundView () { 7 | var not_found_view = new Welcome (_("Nothing was found"), _("Try searching for something else")); 8 | 9 | this.add (not_found_view); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Views/ListView.vala: -------------------------------------------------------------------------------- 1 | namespace Application { 2 | public class ListView : Gtk.ScrolledWindow { 3 | 4 | ListManager list_manager = ListManager.get_instance (); 5 | 6 | public ListView () { 7 | add (list_manager.get_list ()); 8 | hscrollbar_policy = Gtk.PolicyType.NEVER; 9 | 10 | this.show_all (); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /snap/com.github.bartzaalberg.lottery.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Lottery 3 | GenericName=Lottery 4 | Comment=Application to determine a winner 5 | Categories=GTK;Utility; 6 | Exec=com.github.bartzaalberg.lottery 7 | Icon=${SNAP}/meta/com.github.bartzaalberg.lottery.svg 8 | Terminal=false 9 | Type=Application 10 | X-GNOME-Gettext-Domain=lottery 11 | Keywords=guess;lottery; 12 | 13 | -------------------------------------------------------------------------------- /src/Views/WinnerView.vala: -------------------------------------------------------------------------------- 1 | using Granite.Widgets; 2 | 3 | namespace Application { 4 | public class WinnerView : Gtk.ScrolledWindow { 5 | 6 | public Welcome winner_view = new Welcome (_("The winner is"), _("him") + "!"); 7 | 8 | public WinnerView () { 9 | this.add (winner_view); 10 | } 11 | 12 | public void set_winner (string winner) { 13 | winner_view.subtitle = winner; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | language: node_js 4 | 5 | node_js: 6 | - 10.17.0 7 | 8 | sudo: required 9 | 10 | services: 11 | - docker 12 | 13 | addons: 14 | apt: 15 | sources: 16 | - ubuntu-toolchain-r-test 17 | packages: 18 | - libstdc++-5-dev 19 | 20 | install: 21 | - npm i -g @elementaryos/houston 22 | 23 | script: 24 | - houston ci 25 | --type system-app 26 | --name-domain com.github.bartzaalberg.lottery 27 | --name-human Lottery 28 | -------------------------------------------------------------------------------- /data/com.github.bartzaalberg.lottery.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Lottery 3 | GenericName=Lottery 4 | Comment=Who will be the winner? 5 | Categories=GTK;Utility; 6 | Exec=com.github.bartzaalberg.lottery 7 | Icon=com.github.bartzaalberg.lottery 8 | Terminal=false 9 | Type=Application 10 | X-GNOME-Gettext-Domain=lottery 11 | Keywords=guess;lottery; 12 | Actions=AboutDialog; 13 | 14 | [Desktop Action AboutDialog] 15 | Exec=xdg-open appstream://com.github.bartzaalberg.lottery 16 | Name=About Lottery 17 | -------------------------------------------------------------------------------- /po/POTFILES: -------------------------------------------------------------------------------- 1 | src/Application.vala 2 | src/MainWindow.vala 3 | src/ListBoxRow.vala 4 | src/ListBox.vala 5 | src/EntryManager.vala 6 | src/Constants.vala 7 | src/StackManager.vala 8 | src/ListManager.vala 9 | src/Dialogs/Alert.vala 10 | src/Dialogs/AddEntry.vala 11 | src/Dialogs/DeleteConfirm.vala 12 | src/Dialogs/Cheatsheet.vala 13 | src/Views/ListView.vala 14 | src/Views/NotFoundView.vala 15 | src/Views/WelcomeView.vala 16 | src/Views/WinnerView.vala 17 | src/Components/HeaderBar.vala 18 | src/Components/HeaderLabel.vala 19 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: com.github.bartzaalberg.lottery 2 | Section: utils 3 | Priority: optional 4 | Maintainer: Bart Zaalberg 5 | Build-Depends: meson, 6 | debhelper (>= 10.5.1), 7 | libgranite-dev, 8 | libgtk-3-dev, 9 | valac 10 | 11 | Package: com.github.bartzaalberg.lottery 12 | Architecture: any 13 | Depends: ${misc:Depends}, ${shlibs:Depends} 14 | Pre-Depends: dpkg (>= 1.15.6) 15 | Description: lottery 16 | Determine who will be the winner 17 | -------------------------------------------------------------------------------- /src/Dialogs/Alert.vala: -------------------------------------------------------------------------------- 1 | namespace Application { 2 | public class Alert : Object { 3 | 4 | public Alert (string title, string description) { 5 | var message_dialog = new Granite.MessageDialog.with_image_from_icon_name ( 6 | title, 7 | description, 8 | "dialog-warning", 9 | Gtk.ButtonsType.CANCEL 10 | ); 11 | message_dialog.show_all (); 12 | 13 | if (message_dialog.run () == Gtk.ResponseType.CANCEL) { 14 | message_dialog.destroy (); 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/ListManager.vala: -------------------------------------------------------------------------------- 1 | namespace Application { 2 | public class ListManager : Object { 3 | 4 | static ListManager? instance; 5 | 6 | private ListBox list_box; 7 | 8 | // Private constructor 9 | ListManager () { 10 | list_box = new ListBox (); 11 | } 12 | 13 | // Public constructor 14 | public static ListManager get_instance () { 15 | if (instance == null) { 16 | instance = new ListManager (); 17 | } 18 | return instance; 19 | } 20 | 21 | public ListBox get_list () { 22 | return this.list_box; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | # Enable additional explot mitigation 13 | # (PIE and *full* RELRO at the time of this writing) 14 | #export DEB_BUILD_MAINT_OPTIONS=hardening=+all 15 | 16 | %: 17 | dh $@ 18 | 19 | override_dh_builddeb: 20 | dh_builddeb -- -Zxz 21 | 22 | 23 | override_dh_install: 24 | dh_install --fail-missing 25 | -------------------------------------------------------------------------------- /data/com.github.bartzaalberg.lottery.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | Maximized 6 | Whether the window is maximized 7 | 8 | 9 | (1024, 750) 10 | Window position 11 | Most recent window position (x, y) 12 | 13 | 14 | (-1, -1) 15 | Window size 16 | Most recent window size (width, height) 17 | 18 | 19 | false 20 | Dark Theme 21 | Prefer Dark Theme 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/EntryManager.vala: -------------------------------------------------------------------------------- 1 | using Granite.Widgets; 2 | 3 | namespace Application { 4 | public class EntryManager : Gtk.ListBox { 5 | 6 | static EntryManager? instance; 7 | string[] entries = new string[0]; 8 | 9 | EntryManager () { 10 | } 11 | 12 | public static EntryManager get_instance () { 13 | if (instance == null) { 14 | instance = new EntryManager (); 15 | } 16 | return instance; 17 | } 18 | 19 | public string[] get_entries () { 20 | return entries; 21 | } 22 | 23 | public void add_entry (string entry) { 24 | entries += entry; 25 | } 26 | 27 | public void remove_entry (string removed_entry) { 28 | string[] new_list = new string[0]; 29 | 30 | foreach (string entry in entries) { 31 | if (entry != removed_entry) { 32 | new_list += entry; 33 | } 34 | } 35 | 36 | entries = new_list; 37 | } 38 | 39 | public string get_winner () { 40 | int random_index = GLib.Random.int_range (0, entries.length); 41 | return entries[random_index]; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Upstream Author(s): 2 | 3 | Bart Zaalberg 4 | 5 | 6 | Copyright: 7 | 8 | Copyright (C) 2017 Bart Zaalberg 9 | 10 | License: 11 | 12 | This program is free software: you can redistribute it and/or modify 13 | it under the terms of the GNU General Public License as published by 14 | the Free Software Foundation, either version 3 of the License, or 15 | (at your option) any later version. 16 | 17 | This package is distributed in the hope that it will be useful, 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | GNU General Public License for more details. 21 | 22 | You should have received a copy of the GNU General Public License 23 | along with this program. If not, see . 24 | 25 | On Debian systems, the complete text of the GNU General 26 | Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". 27 | 28 | The Debian packaging is: 29 | 30 | Copyright (C) 2014 Cody Garver 31 | 32 | and is licensed under the GPL version 3, see above. 33 | -------------------------------------------------------------------------------- /data/meson.build: -------------------------------------------------------------------------------- 1 | icon_sizes = ['16', '24', '32', '48', '64', '128'] 2 | 3 | foreach i : icon_sizes 4 | install_data( 5 | join_paths('icons', i, meson.project_name() + '.svg'), 6 | install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps') 7 | ) 8 | install_data( 9 | join_paths('icons', i, meson.project_name() + '.svg'), 10 | install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i + '@2', 'apps') 11 | ) 12 | endforeach 13 | 14 | install_data( 15 | join_paths(meson.project_name() + '.gschema.xml'), 16 | install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas') 17 | ) 18 | 19 | i18n.merge_file( 20 | input: meson.project_name() + '.desktop.in', 21 | output: meson.project_name() + '.desktop', 22 | po_dir: join_paths(meson.source_root(), 'po', 'extra'), 23 | type: 'desktop', 24 | install: true, 25 | install_dir: join_paths(get_option('datadir'), 'applications') 26 | ) 27 | 28 | i18n.merge_file( 29 | input: meson.project_name() + '.appdata.xml.in', 30 | output: meson.project_name() + '.appdata.xml', 31 | po_dir: join_paths(meson.source_root(), 'po', 'extra'), 32 | install: true, 33 | install_dir: join_paths(get_option('datadir'), 'metainfo') 34 | ) 35 | -------------------------------------------------------------------------------- /meson.build: -------------------------------------------------------------------------------- 1 | project('com.github.bartzaalberg.lottery', 'vala', 'c') 2 | 3 | gnome = import('gnome') 4 | i18n = import('i18n') 5 | 6 | add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c') 7 | 8 | asresources = gnome.compile_resources( 9 | 'as-resources', 'data/icons/icons.gresource.xml', 10 | source_dir: 'data/icons', 11 | c_name: 'as' 12 | ) 13 | 14 | executable( 15 | meson.project_name(), 16 | 'src/Application.vala', 17 | 'src/MainWindow.vala', 18 | 'src/ListBoxRow.vala', 19 | 'src/ListBox.vala', 20 | 'src/EntryManager.vala', 21 | 'src/Constants.vala', 22 | 'src/StackManager.vala', 23 | 'src/ListManager.vala', 24 | 'src/Dialogs/Alert.vala', 25 | 'src/Dialogs/AddEntry.vala', 26 | 'src/Dialogs/DeleteConfirm.vala', 27 | 'src/Views/ListView.vala', 28 | 'src/Views/NotFoundView.vala', 29 | 'src/Views/WelcomeView.vala', 30 | 'src/Views/WinnerView.vala', 31 | 'src/Components/HeaderBar.vala', 32 | 'src/Components/HeaderLabel.vala', 33 | asresources, 34 | dependencies: [ 35 | dependency('gtk+-3.0'), 36 | dependency('granite') 37 | ], 38 | install: true 39 | ) 40 | 41 | subdir('data') 42 | subdir('po') 43 | 44 | python3 = import('python3').find_python() 45 | run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")') 46 | -------------------------------------------------------------------------------- /src/ListBoxRow.vala: -------------------------------------------------------------------------------- 1 | using Granite.Widgets; 2 | 3 | namespace Application { 4 | public class ListBoxRow : Gtk.ListBoxRow { 5 | 6 | private Gtk.Image delete_image = new Gtk.Image.from_icon_name ("edit-delete-symbolic", Gtk.IconSize.SMALL_TOOLBAR); 7 | private Gtk.Image icon = new Gtk.Image.from_icon_name ("avatar-default-symbolic", Gtk.IconSize.DND); 8 | private EntryManager entry_manager = EntryManager.get_instance (); 9 | private ListManager list_manager = ListManager.get_instance (); 10 | 11 | public ListBoxRow (string entry) { 12 | 13 | var delete_button = generate_delete_button (entry); 14 | 15 | var label = new Gtk.Label (entry); 16 | var row = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 12); 17 | row.margin = 12; 18 | row.add (icon); 19 | row.add (label); 20 | row.pack_end (delete_button, false, false); 21 | this.add (row); 22 | } 23 | 24 | public Gtk.EventBox generate_delete_button (string entry) { 25 | var delete_button = new Gtk.EventBox (); 26 | delete_button.add (delete_image); 27 | delete_button.set_tooltip_text (_("Remove this name")); 28 | delete_button.button_press_event.connect (() => { 29 | entry_manager.remove_entry (entry); 30 | list_manager.get_list ().get_repositories (""); 31 | return true; 32 | }); 33 | 34 | return delete_button; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/ListBox.vala: -------------------------------------------------------------------------------- 1 | using Granite.Widgets; 2 | 3 | namespace Application { 4 | public class ListBox : Gtk.ListBox { 5 | 6 | private EntryManager entry_manager = EntryManager.get_instance (); 7 | private StackManager stack_manager = StackManager.get_instance (); 8 | 9 | public void empty () { 10 | this.foreach ((ListBoxRow) => { 11 | this.remove (ListBoxRow); 12 | }); 13 | } 14 | 15 | public void get_repositories (string search_word = "") { 16 | this.empty (); 17 | 18 | stack_manager.get_stack ().visible_child_name = "list-view"; 19 | 20 | var entries = entry_manager.get_entries (); 21 | 22 | if (searchword_does_not_match_any_in_list (search_word, entries)) { 23 | stack_manager.get_stack ().visible_child_name = "not-found-view"; 24 | return; 25 | } 26 | 27 | foreach (string entry in entries) { 28 | if (search_word == "") { 29 | this.add (new ListBoxRow (entry)); 30 | continue; 31 | } 32 | 33 | if (search_word in entry) { 34 | this.add (new ListBoxRow (entry)); 35 | } 36 | } 37 | 38 | this.show_all (); 39 | } 40 | 41 | private bool searchword_does_not_match_any_in_list (string search_word, string[] entries) { 42 | int match_count = 0; 43 | 44 | if (search_word == "") { 45 | return false; 46 | } 47 | 48 | foreach (string entry in entries) { 49 | if (search_word in entry) { 50 | match_count++; 51 | } 52 | } 53 | return match_count == 0; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # Archived 5 | This repository is not maintained anymore and will not be updated to Elementary OS 6.0. You have my blessing to create a fork and update the application to post publish it in Elementary 6.0 under your own name. 6 | 7 | # Lottery 8 | Determine who will be the winner 9 | 10 |

11 | 12 | 13 | Get it on AppCenter 14 | 15 |

16 | 17 |

18 | 20 |

21 | 22 | ### lottery for elementary OS 23 | 24 | An application which will randomly choose a winner from a list names. 25 | 26 | ## Installation 27 | 28 | First you will need to install elementary SDK 29 | 30 | `sudo apt install elementary-sdk` 31 | 32 | ### Dependencies 33 | 34 | These dependencies must be present before building 35 | - `valac` 36 | - `gtk+-3.0` 37 | - `granite` 38 | 39 | You can install these on a Ubuntu-based system by executing this command: 40 | 41 | `sudo apt install valac libgtk-3-dev libgranite-dev` 42 | 43 | ### Building 44 | ``` 45 | meson build --prefix=/usr 46 | cd build 47 | ninja 48 | ``` 49 | 50 | ### Installing 51 | `sudo ninja install` 52 | 53 | ### Recompile the schema after installation 54 | `sudo glib-compile-schemas /usr/share/glib-2.0/schemas` 55 | 56 | ### Update .pot file 57 | Call the following command from the build folder: 58 | 59 | `ninja com.github.bartzaalberg.lottery-pot` 60 | -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: lottery 2 | version: '1.3.2' 3 | summary: Determine who will be the winner 4 | description: | 5 | An application which will randomly choose a winner from a list names. 6 | 7 | icon: snap/gui/lottery.png 8 | grade: devel # must be 'stable' to release into candidate/stable channels 9 | confinement: strict # use 'strict' once you have the right plugs and slots 10 | 11 | slots: 12 | dbus-daemon: 13 | interface: dbus 14 | bus: session 15 | name: com.github.bartzaalberg.lottery.desktop 16 | 17 | apps: 18 | lottery: 19 | command: desktop-launch com.github.bartzaalberg.lottery 20 | slots: [ dbus-daemon ] 21 | desktop: usr/share/applications/com.github.bartzaalberg.lottery.desktop 22 | plugs: [home, x11, unity7, gsettings] 23 | 24 | parts: 25 | granite: 26 | plugin: cmake 27 | source: https://github.com/elementary/granite.git 28 | source-tag: '0.5' 29 | configflags: [-DCMAKE_BUILD_TYPE=Release, -DCMAKE_INSTALL_PREFIX=/usr, -DCMAKE_INSTALL_LIBDIR=/usr/lib] 30 | build-packages: 31 | - build-essential 32 | - valac 33 | stage-packages: 34 | - valac-0.30-vapi 35 | lottery: 36 | after: [granite, desktop-gtk3] 37 | source: https://github.com/bartzaalberg/lottery.git 38 | plugin: cmake 39 | configflags: [-DCMAKE_INSTALL_PREFIX=/usr] 40 | build-packages: 41 | - build-essential 42 | - valac 43 | - intltool 44 | - libgee-0.8-dev 45 | - debhelper 46 | - libgtk-3-dev 47 | - libgranite-dev 48 | - libgtksourceview-3.0-dev 49 | stage-packages: 50 | - gnome-keyring 51 | - gobject-introspection 52 | - libgdk-pixbuf2.0-0 53 | - libgee-0.8-2 54 | - libgtk-3-0 55 | -------------------------------------------------------------------------------- /src/Application.vala: -------------------------------------------------------------------------------- 1 | using Granite.Widgets; 2 | 3 | namespace Application { 4 | public class App:Granite.Application { 5 | 6 | public static MainWindow window = null; 7 | public static GLib.Settings settings; 8 | 9 | construct { 10 | application_id = Constants.APPLICATION_NAME; 11 | program_name = Constants.APPLICATION_NAME; 12 | settings = new GLib.Settings (Constants.APPLICATION_NAME); 13 | } 14 | 15 | protected override void activate () { 16 | new_window (); 17 | } 18 | 19 | public void new_window () { 20 | var stack_manager = StackManager.get_instance (); 21 | 22 | if (window != null) { 23 | window.present (); 24 | return; 25 | } 26 | 27 | weak Gtk.IconTheme default_theme = Gtk.IconTheme.get_default (); 28 | default_theme.add_resource_path ("/com/github/bartzaalberg/lottery"); 29 | 30 | window = new MainWindow (this); 31 | go_to_last_saved_position (window); 32 | go_to_last_saved_size (window); 33 | 34 | window.show_all (); 35 | stack_manager.get_stack ().visible_child_name = "welcome-view"; 36 | } 37 | 38 | public static int main (string[] args) { 39 | var app = new Application.App (); 40 | return app.run (args); 41 | } 42 | 43 | private void go_to_last_saved_position (MainWindow main_window) { 44 | int window_x, window_y; 45 | settings.get ("window-position", "(ii)", out window_x, out window_y); 46 | if (window_x != -1 || window_y != -1) { 47 | window.move (window_x, window_y); 48 | } 49 | } 50 | 51 | private void go_to_last_saved_size (MainWindow main_window) { 52 | var rect = Gtk.Allocation (); 53 | 54 | settings.get ("window-size", "(ii)", out rect.width, out rect.height); 55 | window.set_allocation (rect); 56 | 57 | if (settings.get_boolean ("window-maximized")) { 58 | window.maximize (); 59 | } 60 | } 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /po/extra/nl.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: extra\n" 4 | "Language: nl\n" 5 | "MIME-Version: 1.0\n" 6 | "Content-Type: text/plain; charset=UTF-8\n" 7 | "Content-Transfer-Encoding: 8bit\n" 8 | 9 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:6 10 | #: data/com.github.bartzaalberg.lottery.desktop.in:3 11 | msgid "Lottery" 12 | msgstr "Loterij" 13 | 14 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:7 15 | #: data/com.github.bartzaalberg.lottery.desktop.in:4 16 | msgid "Who will be the winner?" 17 | msgstr "Wie zal er winnen?" 18 | 19 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:9 20 | msgid "A tool to determine who will be the winner." 21 | msgstr "Een tool om te bepalen wie er gewonnen heeft." 22 | 23 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:10 24 | msgid "Features:" 25 | msgstr "Kenmerken:" 26 | 27 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:12 28 | msgid "Add and remove names!" 29 | msgstr "Voeg namen toe en verwijder ze!" 30 | 31 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:13 32 | msgid "Randomly generate a winner!" 33 | msgstr "Genereer een willekeurige winner!" 34 | 35 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:14 36 | msgid "Use cool shortcuts to make it easier!" 37 | msgstr "Gebruik leuke shortcuts om het makkelijk te maken!" 38 | 39 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:15 40 | msgid "Import CSV files" 41 | msgstr "Importeer CSV bestanden" 42 | 43 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:16 44 | msgid "Choose between light and dark with dark mode" 45 | msgstr "Kies tussen donker en licht met donkere modus" 46 | 47 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:30 48 | msgid "Bart Zaalberg" 49 | msgstr "Bart Zaalberg" 50 | 51 | #: data/com.github.bartzaalberg.lottery.desktop.in:6 52 | msgid "com.github.bartzaalberg.lottery" 53 | msgstr "com.github.bartzaalberg.lottery" 54 | 55 | #: data/com.github.bartzaalberg.lottery.desktop.in:11 56 | msgid "guess;lottery;" 57 | msgstr "guess;lottery;" 58 | 59 | #: data/com.github.bartzaalberg.lottery.desktop.in:16 60 | msgid "About Lottery" 61 | msgstr "Over Lottery" 62 | -------------------------------------------------------------------------------- /po/extra/extra.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.bartzaalberg.alias package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: extra\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2019-01-24 19:02+0100\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=CHARSET\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:6 21 | #: data/com.github.bartzaalberg.lottery.desktop.in:3 22 | msgid "Lottery" 23 | msgstr "" 24 | 25 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:7 26 | #: data/com.github.bartzaalberg.lottery.desktop.in:4 27 | msgid "Who will be the winner?" 28 | msgstr "" 29 | 30 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:9 31 | msgid "A tool to determine who will be the winner." 32 | msgstr "" 33 | 34 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:10 35 | msgid "Features:" 36 | msgstr "" 37 | 38 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:12 39 | msgid "Add and remove names!" 40 | msgstr "" 41 | 42 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:13 43 | msgid "Randomly generate a winner!" 44 | msgstr "" 45 | 46 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:14 47 | msgid "Use cool shortcuts to make it easier!" 48 | msgstr "" 49 | 50 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:15 51 | msgid "Import CSV files" 52 | msgstr "" 53 | 54 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:16 55 | msgid "Choose between light and dark with dark mode" 56 | msgstr "" 57 | 58 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:30 59 | msgid "Bart Zaalberg" 60 | msgstr "" 61 | 62 | #: data/com.github.bartzaalberg.lottery.desktop.in:6 63 | msgid "com.github.bartzaalberg.lottery" 64 | msgstr "" 65 | 66 | #: data/com.github.bartzaalberg.lottery.desktop.in:11 67 | msgid "guess;lottery;" 68 | msgstr "" 69 | 70 | #: data/com.github.bartzaalberg.lottery.desktop.in:16 71 | msgid "About Lottery" 72 | msgstr "" 73 | -------------------------------------------------------------------------------- /po/extra/fr.po: -------------------------------------------------------------------------------- 1 | # French translations for extra package. 2 | # Copyright (C) 2019 THE extra'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.bartzaalberg.alias package. 4 | # NathanBnm, 2019. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: extra\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2019-01-24 19:02+0100\n" 12 | "PO-Revision-Date: 2019-01-30 22:00+0100\n" 13 | "Last-Translator: NathanBnm\n" 14 | "Language-Team: Français\n" 15 | "Language: fr\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:6 21 | #: data/com.github.bartzaalberg.lottery.desktop.in:3 22 | msgid "Lottery" 23 | msgstr "Lottery" 24 | 25 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:7 26 | #: data/com.github.bartzaalberg.lottery.desktop.in:4 27 | msgid "Who will be the winner?" 28 | msgstr "Qui sera le gagnant ?" 29 | 30 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:9 31 | msgid "A tool to determine who will be the winner." 32 | msgstr "Un outil pour déterminer lequel sera le gagnant." 33 | 34 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:10 35 | msgid "Features:" 36 | msgstr "Fonctionnalités :" 37 | 38 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:12 39 | msgid "Add and remove names!" 40 | msgstr "Ajoutez et supprimez des noms !" 41 | 42 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:13 43 | msgid "Randomly generate a winner!" 44 | msgstr "Générez aléatoirement un gagnant !" 45 | 46 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:14 47 | msgid "Use cool shortcuts to make it easier!" 48 | msgstr "Utilisez des raccourcis cools pour plus de facilité !" 49 | 50 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:15 51 | msgid "Import CSV files" 52 | msgstr "Importez des fichiers CSV" 53 | 54 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:16 55 | msgid "Choose between light and dark with dark mode" 56 | msgstr "" 57 | 58 | #: data/com.github.bartzaalberg.lottery.appdata.xml.in:30 59 | msgid "Bart Zaalberg" 60 | msgstr "Bart Zaalberg" 61 | 62 | #: data/com.github.bartzaalberg.lottery.desktop.in:6 63 | msgid "com.github.bartzaalberg.lottery" 64 | msgstr "com.github.bartzaalberg.lottery" 65 | 66 | #: data/com.github.bartzaalberg.lottery.desktop.in:11 67 | msgid "guess;lottery;" 68 | msgstr "deviner;loterie;" 69 | 70 | #: data/com.github.bartzaalberg.lottery.desktop.in:16 71 | msgid "About Lottery" 72 | msgstr "À propos de Lottery" 73 | -------------------------------------------------------------------------------- /src/Dialogs/DeleteConfirm.vala: -------------------------------------------------------------------------------- 1 | namespace Application { 2 | public class DeleteConfirm : Gtk.Dialog { 3 | 4 | ListManager list_manager = ListManager.get_instance (); 5 | 6 | public DeleteConfirm (string repository) { 7 | if (repository == "") { 8 | new Alert (_("No person was selected"), _("Please select a person and try again.")); 9 | return; 10 | } 11 | 12 | var image = new Gtk.Image.from_icon_name ("dialog-warning", Gtk.IconSize.DIALOG); 13 | image.valign = Gtk.Align.START; 14 | 15 | var primary_label = new Gtk.Label (_("Are you sure?")); 16 | primary_label.selectable = true; 17 | primary_label.max_width_chars = 50; 18 | primary_label.wrap = true; 19 | primary_label.xalign = 0; 20 | 21 | var secondary_label = new Gtk.Label (_("You are about to remove this person from the list. Are you sure?")); 22 | secondary_label.use_markup = true; 23 | secondary_label.selectable = true; 24 | secondary_label.max_width_chars = 50; 25 | secondary_label.wrap = true; 26 | secondary_label.xalign = 0; 27 | 28 | var message_grid = new Gtk.Grid (); 29 | message_grid.column_spacing = 12; 30 | message_grid.row_spacing = 6; 31 | message_grid.margin_start = message_grid.margin_end = 12; 32 | message_grid.attach (image, 0, 0, 1, 2); 33 | message_grid.attach (primary_label, 1, 0, 1, 1); 34 | message_grid.attach (secondary_label, 1, 1, 1, 1); 35 | message_grid.show_all (); 36 | 37 | get_content_area ().add (message_grid); 38 | 39 | resizable = false; 40 | deletable = false; 41 | skip_taskbar_hint = true; 42 | transient_for = null; 43 | 44 | var close_button = new Gtk.Button.with_label (_("Cancel")); 45 | close_button.margin_end = 12; 46 | close_button.clicked.connect (() => { 47 | this.destroy (); 48 | }); 49 | 50 | var delete_button = new Gtk.Button.with_label (_("Delete")); 51 | delete_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); 52 | delete_button.clicked.connect (() => { 53 | list_manager.get_list ().get_repositories (""); 54 | this.destroy (); 55 | }); 56 | 57 | var button_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL); 58 | button_box.set_layout (Gtk.ButtonBoxStyle.END); 59 | button_box.pack_start (close_button); 60 | button_box.pack_start (delete_button); 61 | button_box.margin = 12; 62 | button_box.margin_bottom = 0; 63 | 64 | get_content_area ().add (button_box); 65 | this.show_all (); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/StackManager.vala: -------------------------------------------------------------------------------- 1 | namespace Application { 2 | public class StackManager : Object { 3 | 4 | static StackManager? instance; 5 | EntryManager entry_manager = EntryManager.get_instance (); 6 | 7 | private Gtk.Stack stack; 8 | private const string LIST_VIEW_ID = "list-view"; 9 | private const string NOT_FOUND_VIEW_ID = "not-found-view"; 10 | private const string WELCOME_VIEW_ID = "welcome-view"; 11 | private const string WINNER_VIEW_ID = "winner-view"; 12 | 13 | WinnerView winner_view; 14 | 15 | // Private constructor 16 | StackManager () { 17 | stack = new Gtk.Stack (); 18 | stack.transition_type = Gtk.StackTransitionType.SLIDE_LEFT_RIGHT; 19 | } 20 | 21 | // Public constructor 22 | public static StackManager get_instance () { 23 | if (instance == null) { 24 | instance = new StackManager (); 25 | } 26 | return instance; 27 | } 28 | 29 | public Gtk.Stack get_stack () { 30 | return this.stack; 31 | } 32 | 33 | public void load_views (Gtk.Window window) { 34 | winner_view = new WinnerView (); 35 | 36 | stack.add_named (new ListView (), LIST_VIEW_ID); 37 | stack.add_named (new NotFoundView (), NOT_FOUND_VIEW_ID); 38 | stack.add_named (new WelcomeView (), WELCOME_VIEW_ID); 39 | stack.add_named (winner_view, WINNER_VIEW_ID); 40 | 41 | stack.notify["visible-child"].connect (() => { 42 | var header_bar = HeaderBar.get_instance (); 43 | 44 | if (stack.get_visible_child_name () == WELCOME_VIEW_ID) { 45 | header_bar.show_return_button (false); 46 | header_bar.show_buttons (true); 47 | } 48 | 49 | if (stack.get_visible_child_name () == NOT_FOUND_VIEW_ID) { 50 | header_bar.show_return_button (false); 51 | header_bar.show_buttons (true); 52 | } 53 | 54 | if (stack.get_visible_child_name () == LIST_VIEW_ID) { 55 | header_bar.show_return_button (false); 56 | header_bar.show_buttons (true); 57 | } 58 | if (stack.get_visible_child_name () == WINNER_VIEW_ID) { 59 | header_bar.show_return_button (true); 60 | header_bar.show_buttons (false); 61 | } 62 | }); 63 | 64 | window.add (stack); 65 | } 66 | 67 | public void show_winner_view () { 68 | if (entry_manager.get_entries ().length == 0) { 69 | new Alert (_("Cannot choose a winner yet"), _("No names have been added yet")); 70 | return; 71 | } 72 | winner_view.set_winner (entry_manager.get_winner ()); 73 | this.get_stack ().visible_child_name = "winner-view"; 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/MainWindow.vala: -------------------------------------------------------------------------------- 1 | using Granite.Widgets; 2 | 3 | namespace Application { 4 | public class MainWindow : Gtk.Window { 5 | 6 | private ListManager list_manager = ListManager.get_instance (); 7 | private StackManager stack_manager = StackManager.get_instance (); 8 | private HeaderBar header_bar = HeaderBar.get_instance (); 9 | private uint configure_id; 10 | 11 | public MainWindow (Gtk.Application application) { 12 | Object (application: application, 13 | icon_name: Constants.APPLICATION_NAME, 14 | height_request: Constants.APPLICATION_HEIGHT, 15 | width_request: Constants.APPLICATION_WIDTH); 16 | } 17 | 18 | construct { 19 | set_titlebar (header_bar); 20 | 21 | stack_manager.load_views (this); 22 | list_manager.get_list ().get_repositories (""); 23 | 24 | add_shortcuts (); 25 | } 26 | 27 | private void add_shortcuts () { 28 | key_press_event.connect ((e) => { 29 | switch (e.keyval) { 30 | case Gdk.Key.a: 31 | if ((e.state & Gdk.ModifierType.CONTROL_MASK) != 0) { 32 | new AddEntry (); 33 | } 34 | break; 35 | case Gdk.Key.i: 36 | if ((e.state & Gdk.ModifierType.CONTROL_MASK) != 0) { 37 | header_bar.import_names (); 38 | } 39 | break; 40 | case Gdk.Key.w: 41 | if ((e.state & Gdk.ModifierType.CONTROL_MASK) != 0) { 42 | stack_manager.show_winner_view (); 43 | } 44 | break; 45 | case Gdk.Key.f: 46 | if ((e.state & Gdk.ModifierType.CONTROL_MASK) != 0) { 47 | header_bar.search_entry.grab_focus (); 48 | } 49 | break; 50 | case Gdk.Key.q: 51 | if ((e.state & Gdk.ModifierType.CONTROL_MASK) != 0) { 52 | this.destroy (); 53 | } 54 | break; 55 | } 56 | 57 | return false; 58 | }); 59 | } 60 | 61 | public override bool configure_event (Gdk.EventConfigure event) { 62 | var settings = new GLib.Settings (Constants.APPLICATION_NAME); 63 | 64 | if (configure_id != 0) { 65 | GLib.Source.remove (configure_id); 66 | } 67 | 68 | configure_id = Timeout.add (100, () => { 69 | configure_id = 0; 70 | 71 | if (is_maximized) { 72 | settings.set_boolean ("window-maximized", true); 73 | } else { 74 | settings.set_boolean ("window-maximized", false); 75 | 76 | Gdk.Rectangle rect; 77 | get_allocation (out rect); 78 | settings.set ("window-size", "(ii)", rect.width, rect.height); 79 | 80 | int root_x, root_y; 81 | get_position (out root_x, out root_y); 82 | settings.set ("window-position", "(ii)", root_x, root_y); 83 | } 84 | 85 | return false; 86 | }); 87 | 88 | return base.configure_event (event); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/Dialogs/AddEntry.vala: -------------------------------------------------------------------------------- 1 | namespace Application { 2 | public class AddEntry : Gtk.Dialog { 3 | 4 | private EntryManager entry_manager = EntryManager.get_instance (); 5 | ListManager list_manager = ListManager.get_instance (); 6 | Gtk.Entry apt_entry; 7 | 8 | public AddEntry () { 9 | title = _("Enter a name"); 10 | var description = _("Please enter a unique name"); 11 | resizable = false; 12 | 13 | var image = new Gtk.Image.from_icon_name ("contact-new", Gtk.IconSize.DIALOG); 14 | image.valign = Gtk.Align.START; 15 | 16 | apt_entry = new Gtk.Entry (); 17 | apt_entry.set_placeholder_text (_("Sam Johnson")); 18 | apt_entry.set_tooltip_text (_("Please enter the name here.")); 19 | 20 | var primary_label = new Gtk.Label ("%s".printf (title)); 21 | primary_label.use_markup = true; 22 | primary_label.selectable = true; 23 | primary_label.max_width_chars = 50; 24 | primary_label.wrap = true; 25 | primary_label.xalign = 0; 26 | 27 | var secondary_label = new Gtk.Label (description); 28 | secondary_label.use_markup = true; 29 | secondary_label.selectable = true; 30 | secondary_label.max_width_chars = 50; 31 | secondary_label.wrap = true; 32 | secondary_label.xalign = 0; 33 | 34 | var message_grid = new Gtk.Grid (); 35 | message_grid.column_spacing = 12; 36 | message_grid.row_spacing = 6; 37 | message_grid.margin_end = 12; 38 | message_grid.attach (image, 0, 0, 1, 2); 39 | message_grid.attach (primary_label, 1, 0, 1, 1); 40 | message_grid.attach (secondary_label, 1, 1, 1, 1); 41 | message_grid.attach (apt_entry, 1, 2, 1, 1); 42 | message_grid.show_all (); 43 | 44 | get_content_area ().add (message_grid); 45 | 46 | resizable = false; 47 | deletable = false; 48 | skip_taskbar_hint = true; 49 | transient_for = null; 50 | 51 | var close_button = new Gtk.Button.with_label (_("Close")); 52 | close_button.set_margin_end (12); 53 | close_button.clicked.connect (() => { 54 | this.destroy (); 55 | }); 56 | 57 | var create_button = new Gtk.Button.with_label (_("Create")); 58 | create_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); 59 | create_button.clicked.connect (() => { 60 | create_new_person (); 61 | }); 62 | 63 | var button_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL); 64 | button_box.set_layout (Gtk.ButtonBoxStyle.END); 65 | button_box.pack_start (close_button); 66 | button_box.pack_end (create_button); 67 | button_box.margin = 12; 68 | button_box.margin_bottom = 0; 69 | 70 | get_content_area ().add (button_box); 71 | this.show_all (); 72 | 73 | key_press_event.connect ((e) => { 74 | switch (e.keyval) { 75 | case Gdk.Key.Return: 76 | create_new_person (); 77 | break; 78 | } 79 | 80 | return false; 81 | }); 82 | 83 | } 84 | 85 | public void create_new_person () { 86 | var entries = entry_manager.get_entries (); 87 | 88 | if (is_not_valid (apt_entry.text)) { 89 | new Alert (_("Please enter a name"), _("You didn't enter a name. Please do so to continue!")); 90 | return; 91 | } 92 | 93 | if (already_exists (apt_entry.text, entries)) { 94 | new Alert (_("This person is already in the list"), _("Please choose a different name")); 95 | return; 96 | } 97 | 98 | entry_manager.add_entry (apt_entry.text); 99 | 100 | list_manager.get_list ().get_repositories (""); 101 | this.destroy (); 102 | } 103 | 104 | public bool is_not_valid (string input_field) { 105 | if (input_field == "") { 106 | return true; 107 | } 108 | return false; 109 | } 110 | 111 | public bool already_exists (string new_entry, string[] entries) { 112 | foreach (string entry in entries) { 113 | if (entry == new_entry) { 114 | return true; 115 | } 116 | } 117 | return false; 118 | } 119 | 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /po/com.github.bartzaalberg.lottery.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the com.github.bartzaalberg.lottery package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: com.github.bartzaalberg.lottery\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2019-01-27 10:59+0100\n" 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=CHARSET\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: src/ListBoxRow.vala:27 21 | msgid "Remove this name" 22 | msgstr "" 23 | 24 | #: src/StackManager.vala:70 25 | msgid "Cannot choose a winner yet" 26 | msgstr "" 27 | 28 | #: src/StackManager.vala:70 29 | msgid "No names have been added yet" 30 | msgstr "" 31 | 32 | #: src/Dialogs/AddEntry.vala:9 33 | msgid "Enter a name" 34 | msgstr "" 35 | 36 | #: src/Dialogs/AddEntry.vala:10 37 | msgid "Please enter a unique name" 38 | msgstr "" 39 | 40 | #: src/Dialogs/AddEntry.vala:18 41 | msgid "Sam Johnson" 42 | msgstr "" 43 | 44 | #: src/Dialogs/AddEntry.vala:19 45 | msgid "Please enter the name here." 46 | msgstr "" 47 | 48 | #: src/Dialogs/AddEntry.vala:52 src/Dialogs/Cheatsheet.vala:29 49 | msgid "Close" 50 | msgstr "" 51 | 52 | #: src/Dialogs/AddEntry.vala:58 53 | msgid "Create" 54 | msgstr "" 55 | 56 | #: src/Dialogs/AddEntry.vala:90 57 | msgid "Please enter a name" 58 | msgstr "" 59 | 60 | #: src/Dialogs/AddEntry.vala:90 61 | msgid "You didn't enter a name. Please do so to continue!" 62 | msgstr "" 63 | 64 | #: src/Dialogs/AddEntry.vala:95 65 | msgid "This person is already in the list" 66 | msgstr "" 67 | 68 | #: src/Dialogs/AddEntry.vala:95 69 | msgid "Please choose a different name" 70 | msgstr "" 71 | 72 | #: src/Dialogs/DeleteConfirm.vala:8 73 | msgid "No person was selected" 74 | msgstr "" 75 | 76 | #: src/Dialogs/DeleteConfirm.vala:8 77 | msgid "Please select a person and try again." 78 | msgstr "" 79 | 80 | #: src/Dialogs/DeleteConfirm.vala:15 81 | msgid "Are you sure?" 82 | msgstr "" 83 | 84 | #: src/Dialogs/DeleteConfirm.vala:21 85 | msgid "You are about to remove this person from the list. Are you sure?" 86 | msgstr "" 87 | 88 | #: src/Dialogs/DeleteConfirm.vala:44 89 | msgid "Cancel" 90 | msgstr "" 91 | 92 | #: src/Dialogs/DeleteConfirm.vala:50 93 | msgid "Delete" 94 | msgstr "" 95 | 96 | #: src/Dialogs/Cheatsheet.vala:7 97 | msgid "Cheatsheet" 98 | msgstr "" 99 | 100 | #: src/Dialogs/Cheatsheet.vala:14 src/Components/HeaderBar.vala:74 101 | msgid "Add a new name" 102 | msgstr "" 103 | 104 | #: src/Dialogs/Cheatsheet.vala:17 105 | msgid "Randomly choose a winner" 106 | msgstr "" 107 | 108 | #: src/Dialogs/Cheatsheet.vala:20 109 | msgid "Search" 110 | msgstr "" 111 | 112 | #: src/Dialogs/Cheatsheet.vala:23 113 | msgid "Open the cheatsheet" 114 | msgstr "" 115 | 116 | #: src/Dialogs/Cheatsheet.vala:26 src/Components/HeaderBar.vala:81 117 | msgid "Import names from CSV" 118 | msgstr "" 119 | 120 | #: src/Views/NotFoundView.vala:7 121 | msgid "Nothing was found" 122 | msgstr "" 123 | 124 | #: src/Views/NotFoundView.vala:7 125 | msgid "Try searching for something else" 126 | msgstr "" 127 | 128 | #: src/Views/WelcomeView.vala:7 129 | msgid "Add some names!" 130 | msgstr "" 131 | 132 | #: src/Views/WelcomeView.vala:7 133 | msgid "Click the upper left button" 134 | msgstr "" 135 | 136 | #: src/Views/WinnerView.vala:6 137 | msgid "The winner is" 138 | msgstr "" 139 | 140 | #: src/Views/WinnerView.vala:6 141 | msgid "him" 142 | msgstr "" 143 | 144 | #: src/Components/HeaderBar.vala:49 145 | msgid "A list of available shortcuts" 146 | msgstr "" 147 | 148 | #: src/Components/HeaderBar.vala:56 149 | msgid "Search names" 150 | msgstr "" 151 | 152 | #: src/Components/HeaderBar.vala:57 153 | msgid "Search for names" 154 | msgstr "" 155 | 156 | #: src/Components/HeaderBar.vala:66 157 | msgid "Randomly generate a winner" 158 | msgstr "" 159 | 160 | #: src/Components/HeaderBar.vala:94 161 | msgid "File doesnt exist" 162 | msgstr "" 163 | 164 | #: src/Components/HeaderBar.vala:94 165 | msgid "File " 166 | msgstr "" 167 | 168 | #: src/Components/HeaderBar.vala:94 169 | msgid " doesn't exist" 170 | msgstr "" 171 | 172 | #: src/Components/HeaderBar.vala:123 173 | msgid "Back" 174 | msgstr "" 175 | -------------------------------------------------------------------------------- /po/pl.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | 7 | #: ../src/Components/HeaderBar.vala:49 8 | msgid "A list of available shortcuts" 9 | msgstr "Lista dostępnych skrótów" 10 | 11 | #: ../src/Components/HeaderBar.vala:56 12 | msgid "Search names" 13 | msgstr "Szukaj nazw" 14 | 15 | #: ../src/Components/HeaderBar.vala:57 16 | msgid "Search for names" 17 | msgstr "Szukaj nazw" 18 | 19 | #: ../src/Components/HeaderBar.vala:66 20 | msgid "Randomly generate a winner" 21 | msgstr "Wybierz losowo zwycięzcę" 22 | 23 | #: ../src/Components/HeaderBar.vala:74 ../src/Dialogs/Cheatsheet.vala:14 24 | msgid "Add a new name" 25 | msgstr "Dodaj nową nazwę" 26 | 27 | #: ../src/Components/HeaderBar.vala:81 28 | msgid "Import names from CSV" 29 | msgstr "Importuj nazwy z pliku CSV" 30 | 31 | #: ../src/Components/HeaderBar.vala:94 32 | msgid "File doesnt exist" 33 | msgstr "Plik nie istnieje" 34 | 35 | #: ../src/Components/HeaderBar.vala:94 36 | msgid "File " 37 | msgstr "Plik " 38 | 39 | #: ../src/Components/HeaderBar.vala:94 40 | msgid " doesn't exist" 41 | msgstr " nie istnieje" 42 | 43 | #: ../src/Components/HeaderBar.vala:123 44 | msgid "Back" 45 | msgstr "Wstecz" 46 | 47 | #: ../src/Views/WelcomeView.vala:7 48 | msgid "Add some names!" 49 | msgstr "Dodaj jakieś nazwy!" 50 | 51 | #: ../src/Views/WelcomeView.vala:7 52 | msgid "Click the upper left button" 53 | msgstr "Kliknij lewy górny przycisk" 54 | 55 | #: ../src/Views/NotFoundView.vala:7 56 | msgid "Nothing was found" 57 | msgstr "Nic nie znaleziono" 58 | 59 | #: ../src/Views/NotFoundView.vala:7 60 | msgid "Try searching for something else" 61 | msgstr "Spróbuj poszukać czegoś innego" 62 | 63 | #: ../src/Views/WinnerView.vala:6 64 | msgid "The winner is" 65 | msgstr "Zwycięzcą zostaje..." 66 | 67 | #: ../src/Views/WinnerView.vala:6 68 | msgid "him" 69 | msgstr "osoba" 70 | 71 | #: ../src/Dialogs/AddEntry.vala:9 72 | msgid "Enter a name" 73 | msgstr "Dodaj nazwę" 74 | 75 | #: ../src/Views/NotFoundView.vala:19 76 | msgid "Please enter a unique name" 77 | msgstr "Nazwa powinna być unikatowa" 78 | 79 | #: ../src/Dialogs/AddEntry.vala:18 80 | msgid "Sam Johnson" 81 | msgstr "Jan Kowalski" 82 | 83 | #: ../src/Dialogs/AddEntry.vala:19 84 | msgid "Please enter the name here." 85 | msgstr "Tutaj wprowadź nazwę." 86 | 87 | #: ../src/Dialogs/AddEntry.vala:52 ../src/Dialogs/Cheatsheet.vala:26 88 | msgid "Close" 89 | msgstr "Zamknij" 90 | 91 | #: ../src/Dialogs/AddEntry.vala:58 92 | msgid "Create" 93 | msgstr "Utwórz" 94 | 95 | #: ../src/Dialogs/AddEntry.vala:90 96 | msgid "Please enter a name" 97 | msgstr "Dodawanie nazwy" 98 | 99 | #: ../src/Dialogs/AddEntry.vala:90 100 | msgid "You didn't enter a name. Please do so to continue!" 101 | msgstr "Nie wpisano nazwy. Dodaj ją by kontynuować!" 102 | 103 | #: ../src/Dialogs/AddEntry.vala:95 104 | msgid "This person is already in the list" 105 | msgstr "Ta nazwa jest już na liście" 106 | 107 | #: ../src/Dialogs/AddEntry.vala:95 108 | msgid "Please choose a different name" 109 | msgstr "Wybierz inną nazwę" 110 | 111 | #: ../src/Dialogs/Cheatsheet.vala:7 112 | msgid "Cheatsheet" 113 | msgstr "Ściągawka" 114 | 115 | #: ../src/Dialogs/Cheatsheet.vala:17 116 | msgid "Randomly choose a winner" 117 | msgstr "Wybierz losowo zwycięzcę" 118 | 119 | #: ../src/Dialogs/Cheatsheet.vala:20 120 | msgid "Search" 121 | msgstr "Szukaj" 122 | 123 | #: ../src/Dialogs/Cheatsheet.vala:23 124 | msgid "Open the cheatsheet" 125 | msgstr "Otwórz ściągawkę" 126 | 127 | #: ../src/Dialogs/DeleteConfirm.vala:8 128 | msgid "No person was selected" 129 | msgstr "Nie wybrano żadnej nazwy" 130 | 131 | #: ../src/Dialogs/DeleteConfirm.vala:8 132 | msgid "Please select a person and try again." 133 | msgstr "Wybierz nazwę i spróbuj ponownie." 134 | 135 | #: ../src/Dialogs/DeleteConfirm.vala:15 136 | msgid "Are you sure?" 137 | msgstr "Jesteś pewien?" 138 | 139 | #: ../src/Dialogs/DeleteConfirm.vala:21 140 | msgid "You are about to remove this person from the list. Are you sure?" 141 | msgstr "Usuniesz tą nazwę z listy. Jesteś pewien?" 142 | 143 | #: ../src/Dialogs/DeleteConfirm.vala:44 144 | msgid "Cancel" 145 | msgstr "Anuluj" 146 | 147 | #: ../src/Dialogs/DeleteConfirm.vala:50 148 | msgid "Delete" 149 | msgstr "Usuń" 150 | 151 | #: ../src/ListBoxRow.vala:27 152 | msgid "Remove this name" 153 | msgstr "Usuń tą nazwę" 154 | 155 | #: ../src/StackManager.vala:71 156 | msgid "Cannot choose a winner yet" 157 | msgstr "Nie można aktualnie wybrać zwycięzcy" 158 | 159 | #: ../src/StackManager.vala:71 160 | msgid "No names have been added yet" 161 | msgstr "Nie dodano jeszcze nazw" 162 | -------------------------------------------------------------------------------- /po/nl.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | 7 | #: ../src/Components/HeaderBar.vala:49 8 | msgid "A list of available shortcuts" 9 | msgstr "Een lijst van shortcuts" 10 | 11 | #: ../src/Components/HeaderBar.vala:56 12 | msgid "Search names" 13 | msgstr "Zoek namen" 14 | 15 | #: ../src/Components/HeaderBar.vala:57 16 | msgid "Search for names" 17 | msgstr "Zoek op namen" 18 | 19 | #: ../src/Components/HeaderBar.vala:66 20 | msgid "Randomly generate a winner" 21 | msgstr "Bekijk wie er heeft gewonnen!" 22 | 23 | #: ../src/Components/HeaderBar.vala:74 ../src/Dialogs/Cheatsheet.vala:14 24 | msgid "Add a new name" 25 | msgstr "Voeg een nieuwe naam toe" 26 | 27 | #: ../src/Components/HeaderBar.vala:81 28 | msgid "Import names from CSV" 29 | msgstr "Importeer namen van een CSV bestand" 30 | 31 | #: ../src/Components/HeaderBar.vala:94 32 | msgid "File doesnt exist" 33 | msgstr "Bestand bestaat niet" 34 | 35 | #: ../src/Components/HeaderBar.vala:94 36 | msgid "File " 37 | msgstr "Bestand " 38 | 39 | #: ../src/Components/HeaderBar.vala:94 40 | msgid " doesn't exist" 41 | msgstr " bestaat niet" 42 | 43 | #: ../src/Components/HeaderBar.vala:123 44 | msgid "Back" 45 | msgstr "Terug" 46 | 47 | #: ../src/Views/WelcomeView.vala:7 48 | msgid "Add some names!" 49 | msgstr "Voeg een paar namen toe!" 50 | 51 | #: ../src/Views/WelcomeView.vala:7 52 | msgid "Click the upper left button" 53 | msgstr "Klik op de knop in de linker hoek" 54 | 55 | #: ../src/Views/NotFoundView.vala:7 56 | msgid "Nothing was found" 57 | msgstr "Er zijn geen namen gevonden gevonden" 58 | 59 | #: ../src/Views/NotFoundView.vala:7 60 | msgid "Try searching for something else" 61 | msgstr "Zoek naar wat iemand anders" 62 | 63 | #: ../src/Views/WinnerView.vala:6 64 | msgid "The winner is" 65 | msgstr "De winnaar is..." 66 | 67 | #: ../src/Views/WinnerView.vala:6 68 | msgid "him" 69 | msgstr "hij" 70 | 71 | #: ../src/Dialogs/AddEntry.vala:9 72 | msgid "Enter a name" 73 | msgstr "Voer de naam in" 74 | 75 | #: ../src/Views/NotFoundView.vala:19 76 | msgid "Please enter a unique name" 77 | msgstr "Voer alsjebleift een unieke naam in" 78 | 79 | #: ../src/Dialogs/AddEntry.vala:18 80 | msgid "Sam Johnson" 81 | msgstr "Sam Johnson" 82 | 83 | #: ../src/Dialogs/AddEntry.vala:19 84 | msgid "Please enter the name here." 85 | msgstr "Voerg aub een naam in." 86 | 87 | #: ../src/Dialogs/AddEntry.vala:52 ../src/Dialogs/Cheatsheet.vala:26 88 | msgid "Close" 89 | msgstr "Sluiten" 90 | 91 | #: ../src/Dialogs/AddEntry.vala:58 92 | msgid "Create" 93 | msgstr "Toevoegen" 94 | 95 | #: ../src/Dialogs/AddEntry.vala:90 96 | msgid "Please enter a name" 97 | msgstr "Voer alsjebileft een naam in" 98 | 99 | #: ../src/Dialogs/AddEntry.vala:90 100 | msgid "You didn't enter a name. Please do so to continue!" 101 | msgstr "U heeft geen naam ingevoerd. Voer aub een naam in." 102 | 103 | #: ../src/Dialogs/AddEntry.vala:95 104 | msgid "This person is already in the list" 105 | msgstr "Deze persoon staat al in de lijst" 106 | 107 | #: ../src/Dialogs/AddEntry.vala:95 108 | msgid "Please choose a different name" 109 | msgstr "Probeer naar iets anders te zoeken" 110 | 111 | #: ../src/Dialogs/Cheatsheet.vala:7 112 | msgid "Cheatsheet" 113 | msgstr "Spiekbrief" 114 | 115 | #: ../src/Dialogs/Cheatsheet.vala:17 116 | msgid "Randomly choose a winner" 117 | msgstr "Bekijk wie er heeft gewonnen!" 118 | 119 | #: ../src/Dialogs/Cheatsheet.vala:20 120 | msgid "Search" 121 | msgstr "Zoeken" 122 | 123 | #: ../src/Dialogs/Cheatsheet.vala:23 124 | msgid "Open the cheatsheet" 125 | msgstr "Open de spiekbrief" 126 | 127 | #: ../src/Dialogs/DeleteConfirm.vala:8 128 | msgid "No person was selected" 129 | msgstr "Er is geen persoon geselecteerd" 130 | 131 | #: ../src/Dialogs/DeleteConfirm.vala:8 132 | msgid "Please select a person and try again." 133 | msgstr "Kies aub een persoon en probeer het opnieuw." 134 | 135 | #: ../src/Dialogs/DeleteConfirm.vala:15 136 | msgid "Are you sure?" 137 | msgstr "Weet u het zeker?" 138 | 139 | #: ../src/Dialogs/DeleteConfirm.vala:21 140 | msgid "You are about to remove this person from the list. Are you sure?" 141 | msgstr "Weet u zeker dat u deze persoon wilt verwijderen?" 142 | 143 | #: ../src/Dialogs/DeleteConfirm.vala:44 144 | msgid "Cancel" 145 | msgstr "Annuleren" 146 | 147 | #: ../src/Dialogs/DeleteConfirm.vala:50 148 | msgid "Delete" 149 | msgstr "Verwijderen" 150 | 151 | #: ../src/ListBoxRow.vala:27 152 | msgid "Remove this name" 153 | msgstr "Verwijder deze naam" 154 | 155 | #: ../src/StackManager.vala:71 156 | msgid "Cannot choose a winner yet" 157 | msgstr "Er kan nog geen winnaar worden gekozen" 158 | 159 | #: ../src/StackManager.vala:71 160 | msgid "No names have been added yet" 161 | msgstr "Er zijn nog geen namen toegevoegd" 162 | -------------------------------------------------------------------------------- /po/fr.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n>1;\n" 6 | 7 | #: ../src/Components/HeaderBar.vala:49 8 | msgid "A list of available shortcuts" 9 | msgstr "Une liste des raccourcis disponibles" 10 | 11 | #: ../src/Components/HeaderBar.vala:56 12 | msgid "Search names" 13 | msgstr "Rechercher des noms" 14 | 15 | #: ../src/Components/HeaderBar.vala:57 16 | msgid "Search for names" 17 | msgstr "Rechercher des nom" 18 | 19 | #: ../src/Components/HeaderBar.vala:66 20 | msgid "Randomly generate a winner" 21 | msgstr "Générer un gagnant au hasard" 22 | 23 | #: ../src/Components/HeaderBar.vala:74 ../src/Dialogs/Cheatsheet.vala:14 24 | msgid "Add a new name" 25 | msgstr "Ajouter un nouveau nom" 26 | 27 | #: ../src/Components/HeaderBar.vala:81 ../src/Dialogs/Cheatsheet.vala:26 28 | msgid "Import names from CSV" 29 | msgstr "Importer des noms depuis un fichier CSV" 30 | 31 | #: ../src/Components/HeaderBar.vala:94 32 | msgid "File doesnt exist" 33 | msgstr "Le fichier n'existe pas" 34 | 35 | #: ../src/Components/HeaderBar.vala:94 36 | msgid "File " 37 | msgstr "Le fichier " 38 | 39 | #: ../src/Components/HeaderBar.vala:94 40 | msgid " doesn't exist" 41 | msgstr " n'existe pas" 42 | 43 | #: ../src/Components/HeaderBar.vala:123 44 | msgid "Back" 45 | msgstr "Retour" 46 | 47 | #: ../src/Views/WelcomeView.vala:7 48 | msgid "Add some names!" 49 | msgstr "Ajoutez quelques noms !" 50 | 51 | #: ../src/Views/WelcomeView.vala:7 52 | msgid "Click the upper left button" 53 | msgstr "Cliquez sur le bouton supérieur gauche" 54 | 55 | #: ../src/Views/NotFoundView.vala:7 56 | msgid "Nothing was found" 57 | msgstr "Rien n'a été trouvé" 58 | 59 | #: ../src/Views/NotFoundView.vala:7 60 | msgid "Try searching for something else" 61 | msgstr "Essayez de chercher autre chose" 62 | 63 | #: ../src/Views/WinnerView.vala:6 64 | msgid "The winner is" 65 | msgstr "Le gagnant est..." 66 | 67 | #: ../src/Views/WinnerView.vala:6 68 | msgid "him" 69 | msgstr "lui" 70 | 71 | #: ../src/Dialogs/AddEntry.vala:9 72 | msgid "Enter a name" 73 | msgstr "Entrez un nom" 74 | 75 | #: ../src/Dialogs/AddEntry.vala:10 76 | msgid "Please enter a unique name" 77 | msgstr "Veuillez entrer un nom unique" 78 | 79 | #: ../src/Dialogs/AddEntry.vala:18 80 | msgid "Sam Johnson" 81 | msgstr "Jean Dupont" 82 | 83 | #: ../src/Dialogs/AddEntry.vala:19 84 | msgid "Please enter the name here." 85 | msgstr "Veuillez entrer le nom ici." 86 | 87 | #: ../src/Dialogs/AddEntry.vala:52 ../src/Dialogs/Cheatsheet.vala:26 88 | msgid "Close" 89 | msgstr "Fermer" 90 | 91 | #: ../src/Dialogs/AddEntry.vala:58 92 | msgid "Create" 93 | msgstr "Créer" 94 | 95 | #: ../src/Dialogs/AddEntry.vala:90 96 | msgid "Please enter a name" 97 | msgstr "Veuillez entrer un nom" 98 | 99 | #: ../src/Dialogs/AddEntry.vala:90 100 | msgid "You didn't enter a name. Please do so to continue!" 101 | msgstr "Vous n'avez pas entré de nom. Veuillez le faire pour continuer !" 102 | 103 | #: ../src/Dialogs/AddEntry.vala:95 104 | msgid "This person is already in the list" 105 | msgstr "Cette personne est déjà dans la liste" 106 | 107 | #: ../src/Dialogs/AddEntry.vala:95 108 | msgid "Please choose a different name" 109 | msgstr "Veuillez chosir un nom différent" 110 | 111 | #: ../src/Dialogs/Cheatsheet.vala:7 112 | msgid "Cheatsheet" 113 | msgstr "Raccourcis clavier" 114 | 115 | #: ../src/Dialogs/Cheatsheet.vala:17 116 | msgid "Randomly choose a winner" 117 | msgstr "Générer un gagnant au hasard" 118 | 119 | #: ../src/Dialogs/Cheatsheet.vala:20 120 | msgid "Search" 121 | msgstr "Rechercher" 122 | 123 | #: ../src/Dialogs/Cheatsheet.vala:23 124 | msgid "Open the cheatsheet" 125 | msgstr "Ouvrir les raccourcis claviers" 126 | 127 | #: ../src/Dialogs/DeleteConfirm.vala:8 128 | msgid "No person was selected" 129 | msgstr "Personne n'a été sélectionné" 130 | 131 | #: ../src/Dialogs/DeleteConfirm.vala:8 132 | msgid "Please select a person and try again." 133 | msgstr "Veuillez sélectionner une personne est recommencer." 134 | 135 | #: ../src/Dialogs/DeleteConfirm.vala:15 136 | msgid "Are you sure?" 137 | msgstr "Êtes-vous sûr ?" 138 | 139 | #: ../src/Dialogs/DeleteConfirm.vala:21 140 | msgid "You are about to remove this person from the list. Are you sure?" 141 | msgstr "Vous êtes sur le point de retirer cette personne de la liste. Êtes-vous sûr ?" 142 | 143 | #: ../src/Dialogs/DeleteConfirm.vala:44 144 | msgid "Cancel" 145 | msgstr "Annuler" 146 | 147 | #: ../src/Dialogs/DeleteConfirm.vala:50 148 | msgid "Delete" 149 | msgstr "Supprimer" 150 | 151 | #: ../src/ListBoxRow.vala:27 152 | msgid "Remove this name" 153 | msgstr "Retirer ce nom" 154 | 155 | #: ../src/StackManager.vala:71 156 | msgid "Cannot choose a winner yet" 157 | msgstr "Impossible de choisir un gagnant pour le moment" 158 | 159 | #: ../src/StackManager.vala:71 160 | msgid "No names have been added yet" 161 | msgstr "Aucun nom n'a été ajouté pour le moment" 162 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | com.github.bartzaalberg.lottery (1.6.0) STABLE; urgency=low 2 | 3 | * Added dark mode 4 | * Fixed dialog size 5 | 6 | -- Bart Zaalberg Thu, 19 Mar 2019 18:12:00 +0200 7 | 8 | com.github.bartzaalberg.lottery (1.5.0) STABLE; urgency=low 9 | 10 | * Fixed Dutch app name 11 | * Removed cheatsheet 12 | * Added shortcut labels 13 | 14 | -- Bart Zaalberg Thu, 07 Mar 2019 08:32:00 +0200 15 | 16 | com.github.bartzaalberg.lottery (1.4.2) STABLE; urgency=low 17 | 18 | * Added French metadata translation 19 | 20 | -- Bart Zaalberg Thu, 31 Jan 2019 08:32:00 +0200 21 | 22 | com.github.bartzaalberg.lottery (1.4.1) STABLE; urgency=low 23 | 24 | * Fixed Dutch metadata translation 25 | * Added provides tag for metadata 26 | 27 | -- Bart Zaalberg Wed, 30 Jan 2019 02:42:00 +0200 28 | 29 | com.github.bartzaalberg.lottery (1.4.0) STABLE; urgency=low 30 | 31 | * Added metadata translation 32 | * Remember size and position 33 | * Fixed about shortcut 34 | 35 | -- Bart Zaalberg Sun, 27 Jan 2019 12:01:00 +0200 36 | 37 | com.github.bartzaalberg.lottery (1.3.7) STABLE; urgency=low 38 | 39 | * Added OARS rating 40 | * Added linter as githook 41 | * Linted project 42 | 43 | -- Bart Zaalberg Tue, 22 Jan 2019 18:40:00 +0200 44 | 45 | com.github.bartzaalberg.lottery (1.3.6) STABLE; urgency=low 46 | 47 | * Fixed translations 48 | * Added French translation 49 | * Application is now single-instance 50 | 51 | -- Bart Zaalberg Thu, 17 Jan 2019 20:20:00 +0200 52 | 53 | com.github.bartzaalberg.lottery (1.3.5) STABLE; urgency=low 54 | 55 | * Migrated to Meson 56 | 57 | -- Bart Zaalberg Sat, 22 Sep 2018 09:15:00 +0200 58 | 59 | com.github.bartzaalberg.lottery (1.3.4) STABLE; urgency=low 60 | 61 | * Added Houston CI 62 | 63 | -- Bart Zaalberg Fri, 21 Sep 2018 11:46:00 +0200 64 | 65 | com.github.bartzaalberg.lottery (1.3.3) UNSTABLE; urgency=low 66 | 67 | * Added shortcut for quitting 68 | * Updated Polish translation 69 | 70 | -- Bart Zaalberg Sun, 27 May 2018 10:59:00 +0200 71 | 72 | com.github.bartzaalberg.lottery (1.3.2) UNSTABLE; urgency=low 73 | 74 | * Added polish translation 75 | * Added import shortcut to cheatsheet 76 | 77 | -- Bart Zaalberg Sat, 10 Feb 2018 21:56:00 +0200 78 | 79 | com.github.bartzaalberg.lottery (1.3.1) UNSTABLE; urgency=low 80 | 81 | * Updated app logo icons 82 | * Updated app icons 83 | * Added translations support 84 | * Added dutch translation 85 | 86 | -- Bart Zaalberg Fri, 09 Feb 2018 15:28:00 +0200 87 | 88 | com.github.bartzaalberg.lottery (1.3.0) UNSTABLE; urgency=low 89 | 90 | * Refactored some code 91 | * Added CSV import 92 | * Updated to granite 5.0 93 | * Image now uses gresource 94 | * Updated appcenter colors 95 | 96 | -- Bart Zaalberg Thu, 08 Feb 2018 20:52:00 +0200 97 | 98 | com.github.bartzaalberg.lottery (1.2.2) UNSTABLE; urgency=low 99 | 100 | * Fixed icon shadows 101 | 102 | -- Bart Zaalberg Wed, 01 Nov 2017 16:45:00 +0200 103 | 104 | com.github.bartzaalberg.lottery (1.2.1) UNSTABLE; urgency=low 105 | 106 | * Refactored alot of code 107 | * Added search shortcut with ctrl + f 108 | 109 | -- Bart Zaalberg Fri, 27 Oct 2017 16:42:00 +0200 110 | 111 | com.github.bartzaalberg.lottery (1.2.0) UNSTABLE; urgency=low 112 | 113 | * Added the new awesome icon created by kosijer 114 | * Changed the theme colour to red 115 | * Added an about action which redirects to the appcenter 116 | 117 | -- Bart Zaalberg Tue, 24 Oct 2017 21:29:00 +0200 118 | 119 | com.github.bartzaalberg.lottery (1.1.1) UNSTABLE; urgency=low 120 | 121 | * Updated the win dialog with a seperate headerbar 122 | 123 | -- Bart Zaalberg Wed, 18 Oct 2017 09:39:00 +0200 124 | 125 | com.github.bartzaalberg.lottery (1.1.0) UNSTABLE; urgency=low 126 | 127 | * Updated the win dialog to a screen instead of a dialog! 128 | 129 | -- Bart Zaalberg Mon, 16 Oct 2017 16:12:00 +0200 130 | 131 | com.github.bartzaalberg.lottery (1.0.0) UNSTABLE; urgency=low 132 | 133 | * Added icons for the buttons 134 | * Added a cheatsheet 135 | 136 | -- Bart Zaalberg Mon, 16 Oct 2017 12:26:00 +0200 137 | 138 | com.github.bartzaalberg.lottery (0.0.2) UNSTABLE; urgency=low 139 | 140 | * Added shortcut for adding a person(ctrl + a) 141 | * Added shortcut for choosing a random winner(ctrl + w) 142 | 143 | -- Bart Zaalberg Mon, 16 Oct 2017 10:53:00 +0200 144 | 145 | com.github.bartzaalberg.lottery (0.0.1) UNSTABLE; urgency=low 146 | 147 | * First release 148 | 149 | -- Bart Zaalberg Sat, 14 Oct 2017 15:03:00 +0200 150 | -------------------------------------------------------------------------------- /data/icons/lottery-crown.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml -------------------------------------------------------------------------------- /src/Components/HeaderBar.vala: -------------------------------------------------------------------------------- 1 | using Granite.Widgets; 2 | 3 | namespace Application { 4 | public class HeaderBar : Gtk.HeaderBar { 5 | 6 | static HeaderBar? instance; 7 | 8 | ListManager list_manager = ListManager.get_instance (); 9 | StackManager stack_manager = StackManager.get_instance (); 10 | EntryManager entry_manager = EntryManager.get_instance (); 11 | 12 | public Gtk.SearchEntry search_entry = new Gtk.SearchEntry (); 13 | Gtk.Button create_button = new Gtk.Button.from_icon_name ("contact-new", Gtk.IconSize.LARGE_TOOLBAR); 14 | Gtk.Button import_button = new Gtk.Button.from_icon_name ("document-import", Gtk.IconSize.LARGE_TOOLBAR); 15 | Gtk.Button return_button = new Gtk.Button (); 16 | Gtk.Button lottery_button = new Gtk.Button (); 17 | public static GLib.Settings settings; 18 | 19 | HeaderBar () { 20 | settings = new GLib.Settings (Constants.APPLICATION_NAME); 21 | Granite.Widgets.Utils.set_color_primary (this, Constants.BRAND_COLOR); 22 | 23 | var gtk_settings = Gtk.Settings.get_default (); 24 | var dark_mode_switch = new Granite.ModeSwitch.from_icon_name ( 25 | "display-brightness-symbolic", "weather-clear-night-symbolic" 26 | ); 27 | dark_mode_switch.primary_icon_tooltip_text = _("Light mode"); 28 | dark_mode_switch.secondary_icon_tooltip_text = _("Dark mode"); 29 | dark_mode_switch.valign = Gtk.Align.CENTER; 30 | dark_mode_switch.bind_property ("active", gtk_settings, "gtk_application_prefer_dark_theme"); 31 | settings.bind ("use-dark-theme", dark_mode_switch, "active", GLib.SettingsBindFlags.DEFAULT); 32 | 33 | generate_search_entry (); 34 | generate_create_button (); 35 | generate_import_button (); 36 | generate_return_button (); 37 | generate_choose_winner_button (); 38 | 39 | this.show_close_button = true; 40 | 41 | this.pack_start (return_button); 42 | this.pack_start (create_button); 43 | this.pack_start (import_button); 44 | this.pack_start (dark_mode_switch); 45 | this.pack_start (search_entry); 46 | 47 | this.pack_end (lottery_button); 48 | } 49 | 50 | public static HeaderBar get_instance () { 51 | if (instance == null) { 52 | instance = new HeaderBar (); 53 | } 54 | return instance; 55 | } 56 | 57 | private void generate_search_entry () { 58 | search_entry.set_placeholder_text (_("Search names")); 59 | search_entry.tooltip_markup = Granite.markup_accel_tooltip ({"F"}, _("Search for names")); 60 | search_entry.search_changed.connect (() => { 61 | list_manager.get_list ().get_repositories (search_entry.text); 62 | }); 63 | } 64 | 65 | private void generate_choose_winner_button () { 66 | var icon = new Gtk.Image.from_icon_name ("lottery-crown", Gtk.IconSize.LARGE_TOOLBAR); 67 | lottery_button.set_image (icon); 68 | lottery_button.tooltip_markup = Granite.markup_accel_tooltip ({"W"}, _("Randomly generate a winner")); 69 | lottery_button.clicked.connect (() => { 70 | stack_manager.show_winner_view (); 71 | }); 72 | 73 | } 74 | 75 | private void generate_create_button () { 76 | create_button.tooltip_markup = Granite.markup_accel_tooltip ({"A"}, _("Add a new name")); 77 | create_button.clicked.connect (() => { 78 | new AddEntry (); 79 | }); 80 | } 81 | 82 | private void generate_import_button () { 83 | import_button.tooltip_markup = Granite.markup_accel_tooltip ({"I"}, _("Import names from CSV")); 84 | import_button.clicked.connect (import_names); 85 | } 86 | 87 | public void import_names () { 88 | var path = get_file_path (); 89 | 90 | if (path == "") { 91 | return; 92 | } 93 | 94 | var file = File.new_for_path (path); 95 | if (!file.query_exists ()) { 96 | new Alert (_("File doesnt exist"), _("File ") + file.get_path () + _(" doesn't exist")); 97 | return; 98 | } 99 | 100 | import_names_from_csv (file); 101 | } 102 | 103 | public void import_names_from_csv (File file) { 104 | try { 105 | var dis = new DataInputStream (file.read ()); 106 | string line; 107 | // Read lines until end of file (null) is reached 108 | while ((line = dis.read_line (null)) != null) { 109 | string[] names = line.split (","); 110 | foreach (string name in names) { 111 | if (name.strip () == "") { 112 | continue; 113 | } 114 | entry_manager.add_entry (name); 115 | } 116 | } 117 | } catch (Error e) { 118 | error ("%s", e.message); 119 | } 120 | 121 | list_manager.get_list ().get_repositories (""); 122 | } 123 | 124 | private void generate_return_button () { 125 | return_button.label = _("Back"); 126 | return_button.no_show_all = true; 127 | return_button.get_style_context ().add_class ("back-button"); 128 | return_button.visible = false; 129 | return_button.clicked.connect (() => { 130 | stack_manager.get_stack ().visible_child_name = "list-view"; 131 | }); 132 | } 133 | 134 | public void show_buttons (bool answer) { 135 | search_entry.visible = answer; 136 | create_button.visible = answer; 137 | import_button.visible = answer; 138 | lottery_button.visible = answer; 139 | } 140 | 141 | public void show_return_button (bool answer) { 142 | return_button.visible = answer; 143 | } 144 | 145 | public string get_file_path () { 146 | 147 | // The FileChooserDialog: 148 | Gtk.FileChooserDialog chooser = new Gtk.FileChooserDialog ( 149 | "Select your favorite file", null, Gtk.FileChooserAction.OPEN, 150 | "_Cancel", 151 | Gtk.ResponseType.CANCEL, 152 | "_Open", 153 | Gtk.ResponseType.ACCEPT); 154 | 155 | // Multiple files can be selected: 156 | chooser.select_multiple = false; 157 | 158 | // We are only interested in .snap files: 159 | Gtk.FileFilter filter = new Gtk.FileFilter (); 160 | chooser.set_filter (filter); 161 | filter.add_mime_type ("text/csv"); 162 | 163 | // Add a preview widget: 164 | Gtk.Image preview_area = new Gtk.Image (); 165 | chooser.set_preview_widget (preview_area); 166 | chooser.update_preview.connect (() => { 167 | string uri = chooser.get_preview_uri (); 168 | // We only display local files: 169 | if (uri != null && uri.has_prefix ("file://") == true) { 170 | try { 171 | Gdk.Pixbuf pixbuf = new Gdk.Pixbuf.from_file_at_scale (uri.substring (7), 150, 150, true); 172 | preview_area.set_from_pixbuf (pixbuf); 173 | preview_area.show (); 174 | } catch (Error e) { 175 | preview_area.hide (); 176 | } 177 | } else { 178 | preview_area.hide (); 179 | } 180 | }); 181 | 182 | string filePath = ""; 183 | 184 | // Process response: 185 | if (chooser.run () == Gtk.ResponseType.ACCEPT) { 186 | SList uris = chooser.get_uris (); 187 | 188 | foreach (unowned string uri in uris) { 189 | filePath = uri.replace ("file://", ""); 190 | } 191 | } 192 | 193 | // Close the FileChooserDialog: 194 | chooser.close (); 195 | 196 | return filePath; 197 | } 198 | } 199 | } 200 | -------------------------------------------------------------------------------- /data/icons/128/com.github.bartzaalberg.lottery.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 38 | 40 | 42 | 46 | 50 | 51 | 53 | 57 | 61 | 65 | 66 | 68 | 72 | 76 | 80 | 84 | 85 | 94 | 104 | 112 | 113 | 115 | 116 | 118 | image/svg+xml 119 | 121 | 122 | 123 | 124 | 125 | 130 | 137 | 142 | 154 | 158 | 164 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /data/icons/16/com.github.bartzaalberg.lottery.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 38 | 40 | 42 | 46 | 50 | 51 | 53 | 57 | 61 | 65 | 66 | 68 | 72 | 76 | 80 | 84 | 85 | 94 | 104 | 112 | 113 | 115 | 116 | 118 | image/svg+xml 119 | 121 | 122 | 123 | 124 | 125 | 130 | 137 | 142 | 154 | 158 | 164 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /data/icons/24/com.github.bartzaalberg.lottery.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 38 | 40 | 42 | 46 | 50 | 51 | 53 | 57 | 61 | 65 | 66 | 68 | 72 | 76 | 80 | 84 | 85 | 94 | 104 | 112 | 113 | 115 | 116 | 118 | image/svg+xml 119 | 121 | 122 | 123 | 124 | 125 | 130 | 137 | 142 | 154 | 158 | 164 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /data/icons/32/com.github.bartzaalberg.lottery.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 38 | 40 | 42 | 46 | 50 | 51 | 53 | 57 | 61 | 65 | 66 | 68 | 72 | 76 | 80 | 84 | 85 | 94 | 104 | 112 | 113 | 115 | 116 | 118 | image/svg+xml 119 | 121 | 122 | 123 | 124 | 125 | 130 | 137 | 142 | 154 | 158 | 164 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /data/icons/48/com.github.bartzaalberg.lottery.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 38 | 40 | 42 | 46 | 50 | 51 | 53 | 57 | 61 | 65 | 66 | 68 | 72 | 76 | 80 | 84 | 85 | 94 | 104 | 112 | 113 | 115 | 116 | 118 | image/svg+xml 119 | 121 | 122 | 123 | 124 | 125 | 130 | 137 | 142 | 154 | 158 | 164 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /data/icons/64/com.github.bartzaalberg.lottery.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 38 | 40 | 42 | 46 | 50 | 51 | 53 | 57 | 61 | 65 | 66 | 68 | 72 | 76 | 80 | 84 | 85 | 94 | 104 | 112 | 113 | 115 | 116 | 118 | image/svg+xml 119 | 121 | 122 | 123 | 124 | 125 | 130 | 137 | 142 | 154 | 158 | 164 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /data/com.github.bartzaalberg.lottery.appdata.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.github.bartzaalberg.lottery 4 | CC0 5 | GPL-3.0+ 6 | Lottery 7 | Who will be the winner? 8 | 9 |

A tool to determine who will be the winner.

10 |

Features:

11 |
    12 |
  • Add and remove names!
  • 13 |
  • Randomly generate a winner!
  • 14 |
  • Use cool shortcuts to make it easier!
  • 15 |
  • Import CSV files
  • 16 |
  • Choose between light and dark with dark mode
  • 17 |
18 |
19 | 20 | com.github.bartzaalberg.lottery 21 | 22 | 23 | none 24 | none 25 | none 26 | none 27 | none 28 | none 29 | none 30 | none 31 | none 32 | none 33 | none 34 | none 35 | none 36 | none 37 | none 38 | none 39 | none 40 | none 41 | none 42 | none 43 | none 44 | none 45 | none 46 | none 47 | none 48 | none 49 | none 50 | 51 | 52 | 53 | 54 |

Added dark mode

55 |
    56 |
  • Added dark mode
  • 57 |
  • Fixed dialog size
  • 58 |
59 |
60 |
61 | 62 | 63 |

Removed the cheatsheet

64 |
    65 |
  • Added shortcut labels everywhere
  • 66 |
  • Removed cheatsheet
  • 67 |
  • Fixed Dutch app name
  • 68 |
69 |
70 |
71 | 72 | 73 |

Added French metadata translation

74 |
    75 |
  • Added French metadata translation
  • 76 |
77 |
78 |
79 | 80 | 81 |

Fixed Dutch metadata translation

82 |
    83 |
  • Fixed Dutch metadata translation
  • 84 |
  • Added provides tag for appdata
  • 85 |
86 |
87 |
88 | 89 | 90 |

Remember size and position, metadata translations

91 |
    92 |
  • Added metadata translations
  • 93 |
  • Application now remembers position and size
  • 94 |
  • Fixed the about link
  • 95 |
96 |
97 |
98 | 99 | 100 |

Added OARS rating

101 |
    102 |
  • Added OARS rating
  • 103 |
104 |
105 |
106 | 107 | 108 |

Single-instance, fixed translations

109 |
    110 |
  • Fixed translations
  • 111 |
  • Added French translation
  • 112 |
  • Application is now single-instance
  • 113 |
114 |
115 |
116 | 117 | 118 |

Updated release for Juno

119 |
    120 |
  • Migrated to Meson
  • 121 |
122 |
123 |
124 | 125 | 126 |

Updated release for Juno

127 |
    128 |
  • Added Houston CI
  • 129 |
130 |
131 |
132 | 133 | 134 |

Updated polish translation and a new shortcut

135 |
    136 |
  • Updated Polish translation
  • 137 |
  • Added quitting shortcut
  • 138 |
139 |
140 |
141 | 142 | 143 |

The polish translation

144 |
    145 |
  • Added Polish translation
  • 146 |
  • Added import shortcut to cheatsheet
  • 147 |
148 |
149 |
150 | 151 | 152 |

Updated icons, translations support

153 |
    154 |
  • Updated app logo icons
  • 155 |
  • Updated icons inside the app
  • 156 |
  • Added translations support
  • 157 |
  • Added dutch translation
  • 158 |
159 |
160 |
161 | 162 | 163 |

Added CSV import, code refactors

164 |
    165 |
  • Refactored some code
  • 166 |
  • Added CSV import
  • 167 |
  • Updated to granite 5.0
  • 168 |
  • Image now uses gresource
  • 169 |
  • Updated appcenter colors
  • 170 |
171 |
172 |
173 | 174 | 175 |

Fixed the icon shadows!

176 |
    177 |
  • Fixed icon shadows
  • 178 |
179 |
180 |
181 | 182 | 183 |

A nice shortcut for searching!

184 |
    185 |
  • Refactored alot of code
  • 186 |
  • Added search shortcut with ctrl + f
  • 187 |
188 |
189 |
190 | 191 | 192 |

Icon theme and colour

193 |
    194 |
  • Added the new awesome icon created by kosijer
  • 195 |
  • Changed the theme colour to red
  • 196 |
  • Added an about action which redirects to the appcenter
  • 197 |
198 |
199 |
200 | 201 | 202 |

1.1.1

203 |
    204 |
  • Updated the win dialog with a seperate headerbar
  • 205 |
206 |
207 |
208 | 209 | 210 |

1.1.0

211 |
    212 |
  • Updated the win dialog to a screen instead of a dialog!
  • 213 |
214 |
215 |
216 | 217 | 218 |

1.0.0

219 |
    220 |
  • Added icons for the buttons
  • 221 |
  • Added a cheatsheet
  • 222 |
223 |
224 |
225 | 226 | 227 |

0.0.2

228 |
    229 |
  • Added shortcut for adding a person(ctrl + a)
  • 230 |
  • Added shortcut for choosing a random winner(ctrl + w)
  • 231 |
232 |
233 |
234 | 235 | 236 |

0.0.1

237 |
    238 |
  • First release
  • 239 |
240 |
241 |
242 |
243 | 244 | 245 | https://raw.githubusercontent.com/bartzaalberg/lottery/master/screenshot.png 246 | 247 | 248 | https://raw.githubusercontent.com/bartzaalberg/lottery/master/screenshot2.png 249 | 250 | 251 | https://raw.githubusercontent.com/bartzaalberg/lottery/master/screenshot3.png 252 | 253 | 254 | https://raw.githubusercontent.com/bartzaalberg/lottery/master/screenshot4.png 255 | 256 | 257 | Bart Zaalberg 258 | 259 | rgba(245, 245, 245, 1) 260 | #fe2e56 261 | 262 | https://github.com/bartzaalberg/lottery 263 | https://github.com/bartzaalberg/lottery/issues 264 | https://github.com/bartzaalberg/lottery/issues 265 |
266 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | 676 | --------------------------------------------------------------------------------