Commit 02c8a664 authored by Björn Daase's avatar Björn Daase
Browse files

Initial commit

parents
build
_build
*~
This diff is collapsed.
Building & Installing Journable
===============================
Building
--------
Journable uses the Meson <http://mesonbuild.com> and Ninja
<https://ninja-build.org> build systems. To build Journable, run the
following commands from the top-level directory of the source code
repository:
meson build
ninja -C build
A convenience Makefile for development only is also provided. To use
it, simply invoke make from the top-level directory.
Dependencies
------------
Building Journable requires the following major libraries and tools:
* GTK+ 3
See the `meson.build` file in the top-level directory for the complete
list of required dependencies and minimum versions.
All required libraries and tools are available from major Linux
distribution's package repositories:
Installing dependencies on Fedora
---------------------------------
Install them by running this command:
sudo dnf install meson python3 gtk3-devel
Installing dependencies on Ubuntu/Debian
----------------------------------------
Install them by running this command:
sudo apt-get install meson python3 libgtk-3-dev
Installation
------------
After Journable has built, install it by invoking the install target:
ninja -C build install
After installation, it can be uninstalled in the same way:
ninja -C build uninstall
By default, Journable will install under /usr/local. To install to a
different directory, set pass the --prefix to meson when performing
the initial configuration step:
meson --prefix=/usr -C build
Journable
=========
A simple bullet journal
Installation & Licensing
------------------------
Please consult the [INSTALL](./INSTALL.md) and [COPYING](./COPYING) files
for more information.
#!/usr/bin/env python3
from os import environ, path
from subprocess import call
prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
datadir = path.join(prefix, 'share')
destdir = environ.get('DESTDIR', '')
# Package managers set this so we don't need to run
if not destdir:
print('Updating icon cache...')
call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
print('Updating desktop database...')
call(['update-desktop-database', '-q', path.join(datadir, 'applications')])
print('Compiling GSettings schemas...')
call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')])
desktop_file = i18n.merge_file(
input: 'net.daase.journable.desktop.in',
output: 'net.daase.journable.desktop',
type: 'desktop',
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)
desktop_utils = find_program('desktop-file-validate', required: false)
if desktop_utils.found()
test('Validate desktop file', desktop_utils,
args: [desktop_file]
)
endif
appstream_file = i18n.merge_file(
input: 'net.daase.journable.appdata.xml.in',
output: 'net.daase.journable.appdata.xml',
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'appdata')
)
appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
test('Validate appstream file', appstream_util,
args: ['validate', appstream_file]
)
endif
install_data('net.daase.journable.gschema.xml',
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
)
compile_schemas = find_program('glib-compile-schemas', required: false)
if compile_schemas.found()
test('Validate schema file', compile_schemas,
args: ['--strict', '--dry-run', meson.current_source_dir()]
)
endif
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>net.daase.journable.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<description>
</description>
</component>
[Desktop Entry]
Name=journable
Exec=journable
Terminal=false
Type=Application
Categories=GTK;
StartupNotify=true
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="journable">
<schema id="net.daase.journable" path="/net/daase/journable/">
</schema>
</schemalist>
project('journable',
version: '0.1.0',
meson_version: '>= 0.50.0',
license: 'GPL3'
)
description = 'A simple bullet journal'
prettyname = 'Journable'
prettylicense = 'GPL-3.0+'
author = 'BjoernDaase'
authorfullname = 'Björn Daase'
authoremail = 'bjoern@daase.net'
domain = 'net'
# app_id built as: domain.author.project_name
gitrepo = 'https://gitlab.com/'+author+'/'+meson.project_name()
contributors = '\n'.join([
'Björn Daase (BjoernDaase) &lt;bjoern@daase.net&gt;'
])
i18n = import('i18n')
subdir('data')
subdir('src')
subdir('po')
meson.add_install_script('build-aux/meson/postinstall.py')
{
"app-id" : "net.daase.journable",
"runtime" : "org.gnome.Platform",
"runtime-version" : "3.36",
"sdk" : "org.gnome.Sdk",
"command" : "journable",
"finish-args" : [
"--share=network",
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland"
],
"cleanup" : [
"/include",
"/lib/pkgconfig",
"/man",
"/share/doc",
"/share/gtk-doc",
"/share/man",
"/share/pkgconfig",
"*.la",
"*.a"
],
"modules" : [
{
"name" : "journable",
"builddir" : true,
"buildsystem" : "meson",
"sources" : [
{
"type" : "git",
"url" : "file:///home/bjoern/Projects/journable"
}
]
}
],
"build-options" : {
"env" : {
}
}
}
data/net.daase.journable.desktop.in
data/net.daase.journable.appdata.xml.in
data/net.daase.journable.gschema.xml
src/window.ui
src/main.py
src/window.py
i18n.gettext('journable', preset: 'glib')
# clear_confirmation_dialog.py
#
# Copyright 2020 Björn Daase
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from gi.repository import Gtk
@Gtk.Template(resource_path='/net/daase/journable/clear_confirmation_dialog.ui')
class ClearConfirmationDialog(Gtk.MessageDialog):
__gtype_name__ = 'ClearConfirmationDialog'
def __init__(self, **kwargs):
super().__init__(**kwargs)
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.2 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="ClearConfirmationDialog" parent="GtkMessageDialog">
<property name="can_focus">False</property>
<property name="type">popup</property>
<property name="type_hint">dialog</property>
<property name="text" translatable="yes">Do you really want to clear the journal?</property>
<property name="secondary_text" translatable="yes">All unsaved changes wil be lost.</property>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">15</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="homogeneous">True</property>
<property name="layout_style">expand</property>
<child>
<object class="GtkButton" id="button1">
<property name="label">gtk-yes</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<style>
<class name="destructive-action"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button2">
<property name="label">gtk-no</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-8">button1</action-widget>
<action-widget response="-9">button2</action-widget>
</action-widgets>
</template>
</interface>
# exit_confirmation_dialog.py
#
# Copyright 2020 Björn Daase
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from gi.repository import Gtk
@Gtk.Template(resource_path='/net/daase/journable/exit_confirmation_dialog.ui')
class ExitConfirmationDialog(Gtk.MessageDialog):
__gtype_name__ = 'ExitConfirmationDialog'
def __init__(self, **kwargs):
super().__init__(**kwargs)
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.2 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="ExitConfirmationDialog" parent="GtkMessageDialog">
<property name="can_focus">False</property>
<property name="type">popup</property>
<property name="type_hint">dialog</property>
<property name="text" translatable="yes">Save changes before closing?</property>
<property name="secondary_text" translatable="yes">All unsaved changes wil be lost.</property>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">15</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="homogeneous">True</property>
<property name="layout_style">expand</property>
<child>
<object class="GtkButton" id="button1">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<style>
<class name="destructive-action"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button2">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button3">
<property name="label">gtk-save-as</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-7">button1</action-widget>
<action-widget response="-6">button2</action-widget>
<action-widget response="-3">button3</action-widget>
</action-widgets>
</template>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/net/daase/journable">
<file>window.ui</file>
<file>clear_confirmation_dialog.ui</file>
<file>exit_confirmation_dialog.ui</file>
</gresource>
</gresources>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment