Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install Dependencies
run: |
apt update
apt install -y libgranite-dev libpolkit-gobject-1-dev meson policykit-1 valac
apt install -y libgranite-dev libpolkit-gobject-1-dev libswitchboard-2.0-dev meson policykit-1 valac
- name: Build
env:
DESTDIR: out
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ You'll need the following dependencies:
- libgranite-dev
- libgtk-3-dev
- libpolkit-gobject-1-dev
- libswitchboard-2.0-dev
- valac

Run `meson build` to configure the build environment. Change to the build directory and run `ninja test` to build and run automated tests.
Expand Down
9 changes: 0 additions & 9 deletions data/io.elementary.upgrade.desktop.in

This file was deleted.

9 changes: 0 additions & 9 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ i18n.merge_file(
install: true
)

i18n.merge_file(
input: meson.project_name() + '.desktop.in',
output: meson.project_name() + '.desktop',
po_dir: join_paths(meson.source_root (), 'po', 'extra'),
type: 'desktop',
install_dir: join_paths(get_option('datadir'), 'applications'),
install: true
)

install_data(
meson.project_name() + '.daemon.desktop',
install_dir: join_paths(get_option('sysconfdir'), 'xdg', 'autostart')
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Build-Depends: debhelper (>= 10.5.1),
libgranite-dev,
libgtk-3-dev,
libpolkit-gobject-1-dev,
libswitchboard-2.0-dev,
meson,
valac
Standards-Version: 4.1.1
Expand Down
12 changes: 8 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,28 @@ gettext_name = meson.project_name()
prefix = get_option('prefix')
datadir = join_paths(prefix, get_option('datadir'))
pkgdatadir = join_paths(datadir, meson.project_name())
libdir = join_paths(prefix, get_option('libdir'))

granite_dep = dependency('granite')
gtk_dep = dependency('gtk+-3.0')
polkit_dep = dependency('polkit-gobject-1')
posix_dep = meson.get_compiler('vala').find_library('posix')
switchboard_dep = dependency('switchboard-2.0')

polkit_actiondir = polkit_dep.get_pkgconfig_variable('actiondir', define_variable: ['prefix', prefix])
switchboard_plugsdir = switchboard_dep.get_pkgconfig_variable('plugsdir', define_variable: ['libdir', libdir])

app_dependencies = [
granite_dep,
gtk_dep,
daemon_dependencies = [
polkit_dep,
posix_dep,
]

daemon_dependencies = [
plug_dependencies = [
granite_dep,
gtk_dep,
polkit_dep,
posix_dep,
switchboard_dep,
]

configuration_data = configuration_data()
Expand Down
3 changes: 0 additions & 3 deletions po/POTFILES
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
src/Application.vala
src/Helpers/Inhibitor.vala
src/MainWindow.vala
src/Upgrade.vala
src/Utils.vala
src/Views/AbstractUpgradeView.vala
Expand All @@ -10,4 +8,3 @@ src/Views/SuccessView.vala
src/Views/UpToDateView.vala
src/Views/WarningView.vala
src/Views/WelcomeView.vala
src/Widgets/Terminal.vala
1 change: 0 additions & 1 deletion po/extra/POTFILES
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
data/io.elementary.upgrade.appdata.xml.in
data/io.elementary.upgrade.desktop.in
data/io.elementary.upgrade.policy.in.in
58 changes: 58 additions & 0 deletions src/Clients/UpgradeClient.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2021 elementary, Inc. (https://elementary.io)
*
* 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, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* Authored by: Marius Meisenzahl <[email protected]>
*/

public class UpgradeClient : Object {
public signal void on_status (Upgrade.Status status);
public signal void on_error ();

private UpgradeInterface interface;

static UpgradeClient? instance = null;
public static UpgradeClient get_instance () {
if (instance == null) {
instance = new UpgradeClient ();
}

return instance;
}

public void upgrade () throws Error {
interface.upgrade ();
}

private UpgradeClient () {}

construct {
try {
interface = Bus.get_proxy_sync (BusType.SESSION, "io.elementary.update.daemon", "/io/elementary/update.daemon", DBusProxyFlags.NONE);

interface.status_changed.connect ((step, percent) => {
on_status (new Upgrade.Status () {
step = Upgrade.Step.from_string (step),
percent = percent
});
});
interface.error.connect (() => { on_error (); });
} catch (Error e) {
warning ("Could not connect to prefers color scheme settings: %s", e.message);
}
}
}
2 changes: 1 addition & 1 deletion src/Daemon.vala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class Upgrade.Daemon : GLib.Application {
base.dbus_register (connection, object_path);

try {
registration_id = connection.register_object ("/io/elementary/upgrade/daemon", DBusServer.get_default ());
registration_id = connection.register_object ("/io/elementary/upgrade/daemon", UpgradeService.get_default ());
} catch (Error e) {
warning (e.message);
}
Expand Down
29 changes: 5 additions & 24 deletions src/Application.vala → src/Interfaces/UpgradeInterface.vala
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,10 @@
* Authored by: Marius Meisenzahl <[email protected]>
*/

public class Upgrade.App : Gtk.Application {
public const OptionEntry[] UPGRADE_OPTIONS = {
{ "test", 't', 0, OptionArg.NONE, out Config.test_mode, "Non-destructive test mode", null},
{ null }
};
[DBus (name="io.elementary.upgrade")]
public interface UpgradeInterface : Object {
public signal void status_changed (string step, int percent);
public signal void error ();

construct {
application_id = "io.elementary.upgrade";
flags = ApplicationFlags.FLAGS_NONE;
Intl.setlocale (LocaleCategory.ALL, "");
add_main_option_entries (UPGRADE_OPTIONS);
}

public override void activate () {
var window = new MainWindow ();
window.show_all ();
this.add_window (window);

Inhibitor.get_instance ().inhibit ();
}
}

public static int main (string[] args) {
var application = new Upgrade.App ();
return application.run (args);
public abstract void upgrade () throws Error;
}
131 changes: 0 additions & 131 deletions src/MainWindow.vala

This file was deleted.

Loading