From f619b8c01c3ddcd798d04f0b014304730541ea67 Mon Sep 17 00:00:00 2001
From: Nico Alt <nicoalt@posteo.org>
Date: Thu, 21 Feb 2019 20:00:50 +0100
Subject: [PATCH] Change name to briar-gtk or BriarGtk where possible

Modules can't contain slashes and class names seem to follow CamelCase
style.
---
 app.briar.gtk.json                                       | 6 +++---
 data/app.briar.gtk.desktop.in                            | 2 +-
 meson.build                                              | 2 +-
 po/meson.build                                           | 2 +-
 src/{briar_gtk.gresource.xml => briar-gtk.gresource.xml} | 0
 src/{briar_gtk.in => briar-gtk.in}                       | 6 +++---
 src/main.py                                              | 4 ++--
 src/meson.build                                          | 8 ++++----
 src/window.py                                            | 4 ++--
 src/window.ui                                            | 3 ++-
 10 files changed, 19 insertions(+), 18 deletions(-)
 rename src/{briar_gtk.gresource.xml => briar-gtk.gresource.xml} (100%)
 rename src/{briar_gtk.in => briar-gtk.in} (93%)

diff --git a/app.briar.gtk.json b/app.briar.gtk.json
index 03f7395..bd1a595 100644
--- a/app.briar.gtk.json
+++ b/app.briar.gtk.json
@@ -6,7 +6,7 @@
     "sdk-extensions": [
         "org.freedesktop.Sdk.Extension.openjdk10"
     ],
-    "command": "briar_gtk",
+    "command": "briar-gtk",
     "finish-args": [
         "--share=network",
         "--share=ipc",
@@ -63,14 +63,14 @@
             ]
         },
         {
-            "name": "briar_gtk",
+            "name": "briar-gtk",
             "buildsystem": "meson",
             "config-opts": [ "--libdir=lib" ],
             "builddir": true,
             "sources": [
                 {
                     "type": "git",
-                    "url": "file:///home/nico/Work/Current/Briar/briar_gtk"
+                    "url": "file:///home/nico/Work/Current/Briar/briar-gtk"
                 }
             ]
         }
diff --git a/data/app.briar.gtk.desktop.in b/data/app.briar.gtk.desktop.in
index 1ec917a..f7db2e4 100644
--- a/data/app.briar.gtk.desktop.in
+++ b/data/app.briar.gtk.desktop.in
@@ -1,6 +1,6 @@
 [Desktop Entry]
 Name=Briar GTK
-Exec=briar_gtk
+Exec=briar-gtk
 Terminal=false
 Type=Application
 Categories=GTK;
diff --git a/meson.build b/meson.build
index c4ac2b7..e60def8 100644
--- a/meson.build
+++ b/meson.build
@@ -1,4 +1,4 @@
-project('briar_gtk',         version: '0.1.0',
+project('briar-gtk',         version: '0.1.0',
   meson_version: '>= 0.40.0',
 )
 
diff --git a/po/meson.build b/po/meson.build
index 0f9438c..f7a303a 100644
--- a/po/meson.build
+++ b/po/meson.build
@@ -1 +1 @@
-i18n.gettext('briar_gtk', preset: 'glib')
+i18n.gettext('briar-gtk', preset: 'glib')
\ No newline at end of file
diff --git a/src/briar_gtk.gresource.xml b/src/briar-gtk.gresource.xml
similarity index 100%
rename from src/briar_gtk.gresource.xml
rename to src/briar-gtk.gresource.xml
diff --git a/src/briar_gtk.in b/src/briar-gtk.in
similarity index 93%
rename from src/briar_gtk.in
rename to src/briar-gtk.in
index 550ea6a..b64d27e 100755
--- a/src/briar_gtk.in
+++ b/src/briar-gtk.in
@@ -1,6 +1,6 @@
 #!@PYTHON@
 
-# briar_gtk.in
+# briar-gtk.in
 #
 # Copyright 2019 Nico Alt
 #
@@ -28,13 +28,13 @@ localedir = '@localedir@'
 
 sys.path.insert(1, pkgdatadir)
 signal.signal(signal.SIGINT, signal.SIG_DFL)
-gettext.install('briar_gtk', localedir)
+gettext.install('briar-gtk', localedir)
 
 if __name__ == '__main__':
     import gi
 
     from gi.repository import Gio
-    resource = Gio.Resource.load(os.path.join(pkgdatadir, 'briar_gtk.gresource'))
+    resource = Gio.Resource.load(os.path.join(pkgdatadir, 'briar-gtk.gresource'))
     resource._register()
 
     from briar_gtk import main
diff --git a/src/main.py b/src/main.py
index dbfb27b..a2b5ec2 100644
--- a/src/main.py
+++ b/src/main.py
@@ -22,7 +22,7 @@ gi.require_version('Gtk', '3.0')
 
 from gi.repository import Gtk, Gio
 
-from .window import Briar_gtkWindow
+from .window import BriarGtkWindow
 
 
 class Application(Gtk.Application):
@@ -33,7 +33,7 @@ class Application(Gtk.Application):
     def do_activate(self):
         win = self.props.active_window
         if not win:
-            win = Briar_gtkWindow(application=self)
+            win = BriarGtkWindow(application=self)
         win.present()
 
 
diff --git a/src/meson.build b/src/meson.build
index db7f610..1551bbb 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -2,8 +2,8 @@ pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.proje
 moduledir = join_paths(pkgdatadir, 'briar_gtk')
 gnome = import('gnome')
 
-gnome.compile_resources('briar_gtk',
-  'briar_gtk.gresource.xml',
+gnome.compile_resources('briar-gtk',
+  'briar-gtk.gresource.xml',
   gresource_bundle: true,
   install: true,
   install_dir: pkgdatadir,
@@ -18,8 +18,8 @@ conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir')))
 conf.set('pkgdatadir', pkgdatadir)
 
 configure_file(
-  input: 'briar_gtk.in',
-  output: 'briar_gtk',
+  input: 'briar-gtk.in',
+  output: 'briar-gtk',
   configuration: conf,
   install: true,
   install_dir: get_option('bindir')
diff --git a/src/window.py b/src/window.py
index 5d7bf65..84b6943 100644
--- a/src/window.py
+++ b/src/window.py
@@ -20,8 +20,8 @@ from .gi_composites import GtkTemplate
 
 
 @GtkTemplate(ui='/app/briar/gtk/window.ui')
-class Briar_gtkWindow(Gtk.ApplicationWindow):
-    __gtype_name__ = 'Briar_gtkWindow'
+class BriarGtkWindow(Gtk.ApplicationWindow):
+    __gtype_name__ = 'BriarGtkWindow'
 
     label = GtkTemplate.Child()
 
diff --git a/src/window.ui b/src/window.ui
index 5a1ca3d..713cc8c 100644
--- a/src/window.ui
+++ b/src/window.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="3.20"/>
-  <template class="Briar_gtkWindow" parent="GtkApplicationWindow">
+  <template class="BriarGtkWindow" parent="GtkApplicationWindow">
     <property name="default-width">600</property>
     <property name="default-height">300</property>
     <child type="titlebar">
@@ -24,3 +24,4 @@
   </template>
 </interface>
 
+
-- 
GitLab