Commit ba5a0b66 authored by Felix Häcker's avatar Felix Häcker

Rewrite the rust code from scratch.

parent 5387c761
[package]
name = "gradio"
version = "0.8.0"
version = "0.1.0"
authors = ["Felix Häcker <haecker.felix1207@gmail.com>"]
build = "build.rs"
[dependencies]
gio = "0.5"
glib = "0.6"
gdk = "0.9.0"
log = "0.4"
pretty_env_logger = "0.2"
gio = "0.4.0"
rusqlite = "0.13.0"
glib = "0.5.0"
gdk = "0.8.0"
reqwest = "0.8.5"
gdk-pixbuf = "0.4.0"
url = "1.7.0"
gstreamer = "0.11.1"
dbus = "0.6.1"
dbus-macros = "0.2.3"
mdl = "1.0.2"
serde_derive = "1.0.70"
serde = "1.0.70"
rustio = { git = "https://github.com/haecker-felix/Rustio" }
simplelog = "0.5"
rustio = { git="https://github.com/haecker-felix/Rustio.git" }
libhandy = { git = "https://gitlab.gnome.org/jsparber/libhandy-rs" }
gstreamer = "0.12"
mpris-player = "0.1"
rusqlite = "0.13"
[dependencies.gtk]
version = "0.4.0"
version = "0.5"
features = ["v3_22"]
\ No newline at end of file
......@@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
\ No newline at end of file
......@@ -3,14 +3,15 @@
export CARGO_HOME=$1/target/cargo-home
export LOCALEDIR="$3"
export APP_ID="$4"
export VERSION="$5"
export PROFILE="$6"
export NAME_SUFFIX="$5"
export VERSION="$6"
export PROFILE="$7"
if [[ "$PROFILE" == "Devel" ]]
then
if [ "$PROFILE" = "Devel" ]
then
echo "DEBUG MODE"
cargo build -p gradio && cp $1/target/debug/gradio $2
cargo build --manifest-path $1/Cargo.toml -p gradio && cp $1/target/debug/gradio $2
else
echo "RELEASE MODE"
cargo build --release -p gradio && cp $1/target/release/gradio $2
cargo build --manifest-path $1/Cargo.toml --release -p gradio && cp $1/target/release/gradio $2
fi
#!/usr/bin/env python3
import os
import subprocess
schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')
if not os.environ.get('DESTDIR'):
print('Compiling gsettings schemas...')
subprocess.call(['glib-compile-schemas', schemadir])
#!/bin/sh
find src
find src/widgets
find data/gtk
find data
\ No newline at end of file
#!/usr/bin/env python3
import os
import subprocess
install_prefix = os.environ['MESON_INSTALL_PREFIX']
icondir = os.path.join(install_prefix, 'share', 'icons', 'hicolor')
schemadir = os.path.join(install_prefix, 'share', 'glib-2.0', 'schemas')
if not os.environ.get('DESTDIR'):
print('Update icon cache...')
subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
print('Compiling gsettings schemas...')
subprocess.call(['glib-compile-schemas', schemadir])
#!/bin/sh
VERSION=$1
DEST=${MESON_BUILD_ROOT}
DIST=$DEST/dist/$VERSION
cd "${MESON_SOURCE_ROOT}"
mkdir -p $DIST
# copying files
cp -rf build-aux $DIST
cp -rf data $DIST
cp -rf po $DIST
cp -rf src $DIST
cp Cargo.toml $DIST
cp Cargo.lock $DIST
cp meson.build $DIST
cp meson_options.txt $DIST
cp gradio.doap $DIST
cp LICENSE $DIST
cp README.md $DIST
#cargo vendor
mkdir $DIST/.cargo
cargo vendor | sed 's/^directory = ".*"/directory = "vendor"/g' > $DIST/.cargo/config
cp -rf vendor $DIST/
# packaging
cd $DEST/dist
tar -cJvf $VERSION.tar.xz $VERSION
# TODO
\ No newline at end of file
use std::process::Command;
fn main() {
// Rerun the build script when files in the resources folder are changed.
println!("cargo:rerun-if-changed=data");
println!("cargo:rerun-if-changed=data/*");
println!("Run glib-compile-resources...");
let out = Command::new("glib-compile-resources")
.args(&["--generate", "resources.xml"])
.current_dir("data")
.status()
.expect("failed to generate resources");
assert!(out.success());
}
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>de.haeckerfelix.gradio.desktop</id>
<id>@appid@.desktop</id>
<name>Gradio</name>
<summary>Find and listen to internet radio stations</summary>
<translation type="gettext">gradio</translation>
......@@ -40,13 +40,12 @@
<kudo>HiDpiIcon</kudo>
<kudo>ModernToolkit</kudo>
<kudo>Notifications</kudo>
<kudo>SearchProvider</kudo>
</kudos>
<releases>
<release version="8.0" date="2018-06-20">
<description>
<p>rust development version</p>
<p>Rust development version</p>
</description>
</release>
<release version="7.1" date="2018-01-20">
......@@ -90,5 +89,5 @@
</description>
</release>
</releases>
</component>
</component>
\ No newline at end of file
[Desktop Entry]
Name=Gradio
Comment=Find and listen to internet radio stations
Exec=gradio
Icon=de.haeckerfelix.gradio
Terminal=false
Type=Application
Categories=AudioVideo;Audio;Player;GNOME;
Keywords=gradio;internet;radio;
StartupNotify=true
\ No newline at end of file
[Desktop Entry]
Name=Gradio
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=@icon@
Exec=gradio
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Audio;
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords=Radio;Stream;
DBusActivatable=true
<?xml version="1.0" encoding="utf-8"?>
<schemalist>
<schema path="/de/haeckerfelix/Gradio/" id="de.haeckerfelix.Gradio" gettext-domain="gradio">
</schema>
</schemalist>
[D-BUS Service]
Name=de.haeckerfelix.gradio
Exec=@bindir@/gradio --gapplication-service
\ No newline at end of file
Name=@appid@
Exec=@bindir@/gradio --gapplication-service
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.0 -->
<interface>
<requires lib="gtk+" version="3.22"/>
<object class="GtkListBox" id="collection_listbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="selection_mode">none</property>
<property name="activate_on_single_click">False</property>
<style>
<class name="transparent"/>
</style>
</object>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkBox" id="library_page">
<requires lib="gtk+" version="3.22"/>
<object class="GtkBox" id="library">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkBox" id="library_box">
<object class="GtkBox" id="content_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<placeholder/>
</child>
......@@ -36,7 +34,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
</object>
......
<?xml version="1.0"?>
<interface>
<menu id="menu">
<section>
<item>
<attribute name="label" translatable="yes">_Import library</attribute>
<attribute name="action">app.import-library</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Preferences</attribute>
<attribute name="action">app.preferences</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
<attribute name="action">app.shortcuts</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About</attribute>
<attribute name="action">app.about</attribute>
</item>
</section>
</menu>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkActionBar" id="player">
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkStack" id="playback_button_stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkButton" id="start_playback_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">media-playback-start-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="name">start_playback</property>
</packing>
</child>
<child>
<object class="GtkButton" id="stop_playback_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">media-playback-stop-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="name">stop_playback</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="loading_button">
<property name="width_request">40</property>
<property name="height_request">40</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkSpinner">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active">True</property>
</object>
</child>
</object>
<packing>
<property name="name">loading</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEventBox" id="eventbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkImage" id="favicon_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="pixel_size">40</property>
<property name="icon_name">emblem-music-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="info_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="title_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">label</property>
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="selectable">True</property>
<property name="ellipsize">end</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkRevealer" id="subtitle_revealer">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="reveal_child">True</property>
<child>
<object class="GtkLabel" id="subtitle_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">subtitle</property>
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="selectable">True</property>
<property name="ellipsize">end</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
</object>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<!-- Generated with glade 3.22.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkActionBar" id="playerbar">
<requires lib="gtk+" version="3.22"/>
<object class="GtkBox" id="search">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="playbutton_box">
<property name="width_request">40</property>
<property name="height_request">40</property>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<child>
<placeholder/>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkBox" id="content_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkImage" id="favicon_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="pixel_size">40</property>
<property name="icon_name">emblem-music-symbolic</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<object class="GtkBox" id="stack_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
<object class="GtkStack" id="test_stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="title_label">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">label</property>
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="selectable">True</property>
<property name="ellipsize">end</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
<property name="label" translatable="yes">page 1</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="name">page0</property>
<property name="title" translatable="yes">Page 1</property>
</packing>
</child>
<child>
<object class="GtkRevealer" id="subtitle_revealer">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="reveal_child">True</property>
<child>
<object class="GtkLabel" id="subtitle_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">subtitle</property>
<property name="wrap">True</property>
<property name="wrap_mode">char</property>
<property name="selectable">True</property>
<property name="ellipsize">end</property>
</object>
</child>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="label" translatable="yes">Page 2</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="name">page1</property>
<property name="title" translatable="yes">Page 2</property>
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">2</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<object class="GtkBox" id="sidebar_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkStackSidebar" id="stack_sidebar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stack">test_stack</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkShortcutsWindow" id="shortcuts">
<property name="modal">True</property>
<child>
<object class="GtkShortcutsSection">
<property name="section-name">shortcuts</property>
<property name="max-height">12</property>
<property name="visible">True</property>
<child>
<object class="GtkShortcutsGroup">
<property name="title" translatable="yes">General</property>
<property name="visible">True</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="accelerator">&lt;primary&gt;q</property>
<property name="title" translatable="yes" context="shortcut window">Quit the application</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="accelerator">&lt;primary&gt;r</property>
<property name="title" translatable="yes" context="shortcut window">Refresh view</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="gtk+" version="3.22"/>
<object class="GtkBox" id="station_listbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="column">
<object class="GtkBox" id="header">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
<object class="GtkLabel" id="title_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="title_label">
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">label</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>