Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

Commit

Permalink
Renamed org name
Browse files Browse the repository at this point in the history
  • Loading branch information
adhadse committed Sep 17, 2022
1 parent 1d5ddda commit 034cb59
Show file tree
Hide file tree
Showing 29 changed files with 82 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ jobs:
- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
with:
bundle: bookx.flatpak
manifest-path: build-aux/com.anuragdhadse.Bookx.Devel.json
manifest-path: build-aux/com.adhadse.Bookx.Devel.json
run-tests: true
cache-key: flatpak-builder-${{ github.sha }}
12 changes: 11 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bookx"
version = "0.1.0"
authors = ["Anurag Dhadse <hi@anuragdhadse.com>"]
authors = ["Anurag Dhadse <hello@adhadse.com>"]
edition = "2021"

[dependencies]
Expand Down Expand Up @@ -31,3 +31,13 @@ version = "0.1.1"
[dependencies.gettext-rs]
version = "0.7.0"
features = ["gettext-system"]

[dependencies.diesel]
package = "diesel"
version = "1.4"
features = ["sqlite", "r2d2", "chrono"]

[dependencies.diesel_migrations]
package = "diesel_migrations"
version = "1.4"
features = ["sqlite"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ Building the project

```bash
flatpak install org.gnome.Sdk//41 org.freedesktop.Sdk.Extension.rust-stable//21.08 org.gnome.Platform//41
flatpak-builder --user flatpak_app build-aux/com.anuragdhadse.Bookx.Devel.json
flatpak-builder --user flatpak_app build-aux/com.adhadse.Bookx.Devel.json
```

To run the project

```bash
flatpak-builder --run flatpak_app build-aux/com.anuragdhadse.Bookx.Devel.json bookx
flatpak-builder --run flatpak_app build-aux/com.adhadse.Bookx.Devel.json bookx
```
> Please note that these commands are just for demonstration purposes. Normally this would be handled by your IDE, such as GNOME Builder or VS Code with the Flatpak extension.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "com.anuragdhadse.bookx.Devel",
"id": "com.adhadse.bookx.Devel",
"runtime": "org.gnome.Platform",
"runtime-version": "42",
"sdk": "org.gnome.Sdk",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/com/anuragdhadse/Bookx/">
<gresource prefix="/com/adhadse/Bookx/">
<!-- see https://gtk-rs.org/gtk4-rs/git/docs/gtk4/struct.Application.html#automatic-resources -->
<file compressed="true" preprocess="xml-stripblanks" alias="gtk/help-overlay.ui">ui/shortcuts.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/window.ui</file>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<schemalist>
<schema path="/com/anuragdhadse/Bookx/" id="@APP_ID@" gettext-domain="@PKGNAME@">
<schema path="/com/adhadse/Bookx/" id="@APP_ID@" gettext-domain="@PKGNAME@">
<key name="window-width" type="i">
<default>950</default>
<summary>Window width</summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Anurag Dhadse 2022 <hi@anuragdhadse.com> -->
<!-- Anurag Dhadse 2022 <hello@adhadse.com> -->
<component type="desktop-application">
<id>@APP_ID@</id>
<metadata_license>CC0</metadata_license>
Expand Down Expand Up @@ -31,7 +31,7 @@
<kudo>HiDpiIcon</kudo>
</kudos>
<developer_name>Anurag Dhadse</developer_name>
<update_contact>hi@anuragdhadse.com</update_contact>
<update_contact>hello@adhadse.com</update_contact>
<translation type="gettext">@PKGNAME@</translation>
<launchable type="desktop-id">@[email protected]</launchable>
</component>
15 changes: 0 additions & 15 deletions data/ui/window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,6 @@
</item>
</section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_View</attribute>
<section>
<item>
<attribute name="label" translatable="yes">_Thumbnails</attribute>
<attribute name="action">win.view-thumbnails</attribute>
<attribute name="target">Thumbnails</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_List</attribute>
<attribute name="action">win.view-list</attribute>
<attribute name="target">List</attribute>
</item>
</section>
</submenu>
</section>
<section>
<item>
Expand Down
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ gnome = import('gnome')
prefix = get_option('prefix')

name = 'Bookx'
base_id = 'com.anuragdhadse.Bookx'
app_id = 'com.anuragdhadse.Bookx'
base_id = 'com.adhadse.Bookx'
app_id = 'com.adhadse.Bookx'
pkgname = meson.project_name()
datadir = prefix / get_option('datadir')
iconsdir = datadir / 'icons'
Expand Down
6 changes: 3 additions & 3 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
data/com.anuragdhadse.bookx.desktop.in.in
data/com.anuragdhadse.bookx.gschema.xml.in
data/com.anuragdhadse.bookx.metainfo.xml.in.in
data/com.adhadse.bookx.desktop.in.in
data/com.adhadse.bookx.gschema.xml.in
data/com.adhadse.bookx.metainfo.xml.in.in
data/resources/ui/shortcuts.ui
data/resources/ui/window.ui
src/application.rs
17 changes: 3 additions & 14 deletions src/application.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bookx - application.rs
// Copyright (C) 2022 Anurag Dhadse <hi@anuragdhadse.com>
// Copyright (C) 2022 Anurag Dhadse <hello@adhadse.com>
//
// 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
Expand Down Expand Up @@ -85,17 +85,6 @@ mod imp {

// Overrides GObject vfuncs
impl ObjectImpl for BookxApplication {
// fn constructed(&self, obj: &Self::Type) {
// self.parent_constructed(obj);

// Force dark theme
// obj.style_manager()
// .set_color_scheme(adw::ColorScheme::PreferDark);

// Set up the actions
// obj.setup_gactions();
// }

fn properties() -> &'static [ParamSpec] {
static PROPERTIES: Lazy<Vec<ParamSpec>> = Lazy::new(|| {
vec![ParamSpecObject::new(
Expand Down Expand Up @@ -198,7 +187,7 @@ impl BookxApplication {
let app = glib::Object::new::<BookxApplication>(&[
("application-id", &Some(config::APP_ID)),
("flags", &gio::ApplicationFlags::empty()),
("resource-base-path", &Some("/com/anuragdhadse/Bookx")),
("resource-base-path", &Some("/com/adhadse/Bookx")),
])
.expect("Application initialization failed...");

Expand Down Expand Up @@ -327,7 +316,7 @@ impl BookxApplication {
// .application_icon("Bookx")
// .application_icon(config::APP_ID)
// .license_type(gtk::License::Gpl30)
// .website("https://bookx.anuragdhadse.com/")
// .website("https://bookx.adhadse.com/")
// .issue_url("https://github.com/adhadse/Bookx/issues/")
// .version(config::VERSION)
// .translator_credits(String::from("translator-credits"))
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub const NAME: &str = "Bookx";
pub const APP_ID: &str = "com.anuragdhadse.Bookx";
pub const APP_ID: &str = "com.adhadse.Bookx";
pub const PKGNAME: &str = "bookx";
pub const LOCALEDIR: &str = "/app/share/locale";
pub const PROFILE: &str = "Devel";
Expand Down
9 changes: 6 additions & 3 deletions src/library/library.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bookx - library.rs
// Copyright (C) 2022 Anurag Dhadse <hi@anuragdhadse.com>
// Copyright (C) 2022 Anurag Dhadse <hello@adhadse.com>
//
// 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
Expand All @@ -16,6 +16,7 @@

use crate::application::Action;
use crate::library::utils;
use crate::library::utils::*;
use crate::settings::{settings_manager, Key};
use crate::ui::BookxWindow;

Expand Down Expand Up @@ -152,8 +153,10 @@ impl BookxLibrary {
match info.file_type() {
gio::FileType::Regular => {
if let Some(content_type) = info.content_type() {
if gio::content_type_is_mime_type(&content_type, "application/epub+zip")
{
if gio::content_type_is_mime_type(
&content_type,
&get_ebook_mime(EBook::Epub),
) {
debug!("Adding file '{}' to the list", file.uri());
list.push(file);
}
Expand Down
2 changes: 1 addition & 1 deletion src/library/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bookx - mod.rs
// Copyright (C) 2022 Anurag Dhadse <hi@anuragdhadse.com>
// Copyright (C) 2022 Anurag Dhadse <hello@adhadse.com>
//
// 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
Expand Down
14 changes: 13 additions & 1 deletion src/library/utils.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bookx - utils.rs
// Copyright (C) 2022 Anurag Dhadse <hi@anuragdhadse.com>
// Copyright (C) 2022 Anurag Dhadse <hello@adhadse.com>
//
// 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
Expand All @@ -17,9 +17,21 @@
use core::cmp::Ordering;
use std::path::PathBuf;

use enum_map::{enum_map, Enum, EnumArray, EnumMap};
use gtk::{gdk, gio, glib, prelude::*};
use log::{debug, warn};

#[derive(Debug, Enum)]
pub enum EBook {
Epub,
}

pub fn get_ebook_mime(ebook: EBook) -> String {
match ebook {
EBook::Epub => String::from("application/epub+zip"),
}
}

pub fn load_files_from_folder(folder: &gio::File, recursive: bool) -> Vec<gio::File> {
use std::time::Instant;

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bookx - main.rs
// Copyright (C) 2022 Anurag Dhadse <hi@anuragdhadse.com>
// Copyright (C) 2022 Anurag Dhadse <hello@adhadse.com>
//
// 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
Expand Down
22 changes: 22 additions & 0 deletions src/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Bookx - schema.rs
// Copyright (C) 2022 Anurag Dhadse <[email protected]>
//
// 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 <https://www.gnu.org/licenses/>.

// table! {
// book (id) {
// id -> Integer,

// }
// }
2 changes: 1 addition & 1 deletion src/settings/key.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bookx - key.rs
// Copyright (C) 2022 Anurag Dhadse <hi@anuragdhadse.com>
// Copyright (C) 2022 Anurag Dhadse <hello@adhadse.com>
//
// 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
Expand Down
2 changes: 1 addition & 1 deletion src/settings/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bookx - mod.rs
// Copyright (C) 2022 Anurag Dhadse <hi@anuragdhadse.com>
// Copyright (C) 2022 Anurag Dhadse <hello@adhadse.com>
//
// 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
Expand Down
2 changes: 1 addition & 1 deletion src/settings/settings_manager.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bookx - settings_manager.rs
// Copyright (C) 2022 Anurag Dhadse <hi@anuragdhadse.com>
// Copyright (C) 2022 Anurag Dhadse <hello@adhadse.com>
//
// 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
Expand Down
2 changes: 1 addition & 1 deletion src/ui/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bookx - mod.rs
// Copyright (C) 2022 Anurag Dhadse <hi@anuragdhadse.com>
// Copyright (C) 2022 Anurag Dhadse <hello@adhadse.com>
//
// 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
Expand Down
4 changes: 2 additions & 2 deletions src/ui/pages/library.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bookx - library.rs
// Copyright (C) 2022 Anurag Dhadse <hi@anuragdhadse.com>
// Copyright (C) 2022 Anurag Dhadse <hello@adhadse.com>
//
// 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
Expand Down Expand Up @@ -32,7 +32,7 @@ mod imp {
use super::*;

#[derive(Debug, CompositeTemplate)]
#[template(resource = "/com/anuragdhadse/Bookx/ui/library.ui")]
#[template(resource = "/com/adhadse/Bookx/ui/library.ui")]
pub struct BookxLibraryPage {
#[template_child]
pub library_empty_status_page: TemplateChild<adw::StatusPage>,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/pages/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bookx - mod.rs
// Copyright (C) 2022 Anurag Dhadse <hi@anuragdhadse.com>
// Copyright (C) 2022 Anurag Dhadse <hello@adhadse.com>
//
// 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
Expand Down
4 changes: 2 additions & 2 deletions src/ui/preferences.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bookx - preferences.rs
// Copyright (C) 2022 Anurag Dhadse <hi@anuragdhadse.com>
// Copyright (C) 2022 Anurag Dhadse <hello@adhadse.com>
//
// 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
Expand Down Expand Up @@ -32,7 +32,7 @@ pub struct BookxPreferencesWindow {

impl BookxPreferencesWindow {
pub fn new(window: &gtk::Window) -> Self {
let builder = gtk::Builder::from_resource("/com/anuragdhadse/Bookx/ui/preferences.ui");
let builder = gtk::Builder::from_resource("/com/adhadse/Bookx/ui/preferences.ui");
get_widget!(builder, PreferencesWindow, preferences_window);
preferences_window.set_transient_for(Some(window));

Expand Down
4 changes: 2 additions & 2 deletions src/ui/window.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bookx - window.rs
// Copyright (C) 2022 Anurag Dhadse <hi@anuragdhadse.com>
// Copyright (C) 2022 Anurag Dhadse <hello@adhadse.com>
//
// 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
Expand Down Expand Up @@ -80,7 +80,7 @@ mod imp {
// we'd need to have a `new()` function in the
// `impl ObjectSubclass for $TYPE` section.
#[derive(Default, Debug, CompositeTemplate)]
#[template(resource = "/com/anuragdhadse/Bookx/ui/window.ui")]
#[template(resource = "/com/adhadse/Bookx/ui/window.ui")]
pub struct BookxWindow {
// Template children are used with the
// TemplateChild<T> wrapper, where T is the
Expand Down

0 comments on commit 034cb59

Please sign in to comment.