Skip to content

Commit

Permalink
Merge branch 'unstable'
Browse files Browse the repository at this point in the history
  • Loading branch information
stsdc committed Jan 31, 2019
2 parents a037d65 + 9b4c1e1 commit 92b51ec
Show file tree
Hide file tree
Showing 30 changed files with 2,113 additions and 172 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ You'll need the following dependencies to build:
* libbamf3-dev
* libwnck-3-dev
* libgtop2-dev
* meson

## How To Build

Expand Down
8 changes: 6 additions & 2 deletions data/com.github.stsdc.monitor.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@
<url type="help">https://github.com/stsdc/monitor/issues</url>

<releases>
<release version="0.3.7" date="2019-01-23">
<release version="0.4.0" date="2019-01-31">
​ <description>
​ <ul>
<li>Update French translation</li>
<li>Add Monitor indicator</li>
<li>Add missing extra French translations</li>
<li>Fix: if icon missing for the process, icon is taken from previous process</li>
<li>Fix: search erases my input while I'm typing</li>
<li>Fix POTFILES</li>
</ul>
​ </description>
​ </release>
Expand Down
14 changes: 9 additions & 5 deletions data/com.github.stsdc.monitor.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<value value="1" nick="maximized"/>
</enum>
<schema path="/com/github/stsdc/monitor/settings/" id="com.github.stsdc.monitor.settings">
<key enum="com.github.stsdc.monitor.windowstate" name="window-state">
<default>'normal'</default>
<summary>The saved state of the window</summary>
<description>The saved state of the window</description>
<key type='b' name="is-maximized">
<default>false</default>
<summary>Is window maximized or not</summary>
<description>Is window maximized or not</description>
</key>
<key type="i" name="window-width">
<default>800</default>
Expand All @@ -20,6 +20,10 @@
<summary>Window height</summary>
<description>Window height</description>
</key>
<key type='b' name="indicator-state">
<default>false</default>
<summary>To show Monitor Indicator or not</summary>
<description>To show Monitor Indicator or not</description>
</key>
</schema>
</schemalist>

10 changes: 10 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
com.github.stsdc.monitor (0.4.0) bionic; urgency=low

* Add Monitor indicator
* Add missing extra French translations
* Fix: if icon missing for the process, icon is taken from previous process
* Fix: search erases my input while I'm typing
* Fix POTFILES

-- Stanisław Dac <[email protected]> Thu, 31 Jan 2019 23:24:10 +0100

com.github.stsdc.monitor (0.3.7) xenial; urgency=low

* Update French translation
Expand Down
3 changes: 2 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Build-Depends: meson,
libgranite-dev,
libbamf3-dev,
libwnck-3-dev,
libgtop2-dev
libgtop2-dev,
libwingpanel-2.0-dev
Standards-Version: 4.1.1

Package: com.github.stsdc.monitor
Expand Down
79 changes: 66 additions & 13 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@

project('com.github.stsdc.monitor', 'vala', 'c', version: '0.3.5')
project('com.github.stsdc.monitor', 'vala', 'c', version: '0.4.0')

# these are Meson modules
gnome = import('gnome')
i18n = import('i18n')

# and these are project dependencies
glib = dependency('glib-2.0')
granite = dependency('granite')
gtk = dependency('gtk+-3.0')
gee = dependency('gee-0.8')
gio = dependency('gio-2.0')
gobject = dependency('gobject-2.0')
bamf = dependency('libbamf3')
gtop = dependency('libgtop-2.0')
wnck = dependency('libwnck-3.0')
wingpanel = dependency('wingpanel-2.0')

conf = configuration_data()
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
configure_file(output: 'config.h', configuration: conf)
Expand All @@ -19,41 +32,81 @@ executable(
meson.project_name(),
'src/Monitor.vala',
'src/MainWindow.vala',
'src/Utils.vala',

'src/Widgets/OverallView.vala',
'src/Widgets/Search.vala',
'src/Widgets/Headerbar.vala',
'src/Widgets/Statusbar.vala',

'src/Models/GenericModel.vala',
'src/Models/ModelHelper.vala',

'src/Managers/AppManager.vala',
'src/Managers/ProcessManager.vala',
'src/Managers/Process.vala',

'src/Services/Settings.vala',
'src/Services/Shortcuts.vala',
'src/Services/Resources.vala',
'src/Services/DBusServer.vala',
'src/Services/Updater.vala',

'src/Resources/CPU.vala',
'src/Resources/Core.vala',
'src/Resources/Memory.vala',
c_args: c_args,
dependencies: [
dependency('glib-2.0'),
dependency('granite'),
dependency('gtk+-3.0'),
dependency('gee-0.8'),
dependency('gio-2.0'),
dependency('gobject-2.0'),
dependency('libbamf3'),
dependency('libbamf3'),
dependency('libgtop-2.0'),
dependency('libwnck-3.0'),
glib,
granite,
gtk,
gee,
gio,
gobject,
bamf,
gtop,
wnck,
meson.get_compiler('c').find_library('m', required : false),
meson.get_compiler('vala').find_library('posix')
],
vala_args: [
'--vapidir=' + meson.source_root() + '/vapi/',
],
install: true
install: true,
)

shared_module(
'monitor',
'src/Indicator/Indicator.vala',
'src/Utils.vala',

'src/Indicator/Widgets/DisplayWidget.vala',
'src/Indicator/Widgets/PopoverWidget.vala',
'src/Indicator/Widgets/CPUWidget.vala',
'src/Indicator/Widgets/MemoryWidget.vala',

'src/Indicator/Services/DBusClient.vala',
'src/Services/Settings.vala',
# 'src/Widgets/RevealerSwitch.vala',
# asresources,
c_args: c_args,
dependencies: [
glib,
granite,
gobject,
gtk,
wingpanel
],
install: true,
# install_dir : wingpanel.get_pkgconfig_variable('indicatorsdir'), <- installs to /usr/local/
install_dir : '/usr/lib/x86_64-linux-gnu/wingpanel/'

)

# Add in a post install script
meson.add_install_script('meson/post_install.py')

subdir('data')
subdir('po')

# shows size of binary
# meson.add_postconf_script('du', '-h', meson.project_name())
5 changes: 3 additions & 2 deletions po/POTFILES
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
src/Monitor.vala
src/MainWindow.vala
src/Widgets/Headerbar.vala
src/Widgets/OverallView.vala
src/Widgets/Search.vala
src/Widgets/Statusbar.vala
src/Models/ApplicationProcessModel.vala
src/Managers/AppManager.vala
src/Managers/ProcessManager.vala
src/Managers/Process.vala
src/Models/GenericModel.vala
src/Services/Settings.vala
src/Services/Shortcuts.vala
src/Services/Resources.vala
src/Services/Resources.vala
26 changes: 13 additions & 13 deletions po/extra/fr.po
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# French translations for extra package.
# Copyright (C) 2018 THE extra'S COPYRIGHT HOLDER
# Copyright (C) 2019 THE extra'S COPYRIGHT HOLDER
# This file is distributed under the same license as the extra package.
# Automatically generated, 2018.
# NathanBnm, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: extra\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-10-20 22:25+0900\n"
"PO-Revision-Date: 2018-10-20 22:25+0900\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"PO-Revision-Date: 2019-01-25 16:00+0100\n"
"Last-Translator: NathanBnm\n"
"Language-Team: Français\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand All @@ -20,32 +20,32 @@ msgstr ""
#: data/com.github.stsdc.monitor.appdata.xml.in:7
#: data/com.github.stsdc.monitor.desktop.in:3
msgid "Monitor"
msgstr ""
msgstr "Monitor"

#: data/com.github.stsdc.monitor.appdata.xml.in:8
msgid "Manage processes and monitor system resources"
msgstr ""
msgstr "Gérez les processus et surveillez les ressources du système"

#: data/com.github.stsdc.monitor.appdata.xml.in:10
msgid "Display usage of system resources, filter and manage processes."
msgstr ""
msgstr "Visualisez l'utilisation des ressources du système, filtrez et gérez les processus."

#: data/com.github.stsdc.monitor.appdata.xml.in:22
msgid "Stanisław Dac"
msgstr ""
msgstr "Stanisław Dac"

#: data/com.github.stsdc.monitor.desktop.in:4
msgid "System Monitor"
msgstr ""
msgstr "Moniteur système"

#: data/com.github.stsdc.monitor.desktop.in:6
msgid "Manage processes and monitor resource usage of the system"
msgstr ""
msgstr "Gérez les processus et surveillez l'utilisation des ressources du système"

#: data/com.github.stsdc.monitor.desktop.in:10
msgid "com.github.stsdc.monitor"
msgstr ""
msgstr "com.github.stsdc.monitor"

#: data/com.github.stsdc.monitor.desktop.in:14
msgid "System monitor;System usage;Task manager;"
msgstr ""
msgstr "Moniteur système; Utilisation du système; Gestionnaire des tâches;"
116 changes: 116 additions & 0 deletions src/Indicator/Indicator.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// TODO: Change namespace
public class Monitor.Indicator : Wingpanel.Indicator {

private Widgets.DisplayWidget? display_widget = null;
private Widgets.PopoverWidget? popover_widget = null;
public Settings saved_state;
private DBusClient dbusclient;

construct {
saved_state = Settings.get_default ();
this.visible = false;
display_widget = new Widgets.DisplayWidget ();
popover_widget = new Widgets.PopoverWidget ();

dbusclient = DBusClient.get_default ();

dbusclient.monitor_vanished.connect (() => this.visible = false);
dbusclient.monitor_appeared.connect (() => this.visible = saved_state.indicator_state);

dbusclient.interface.indicator_state.connect((state) => this.visible = state);

dbusclient.interface.update.connect((sysres) => {
display_widget.cpu_widget.percentage = sysres.cpu_percentage;
display_widget.memory_widget.percentage = sysres.memory_percentage;
});

popover_widget.quit_monitor.connect (() => {
dbusclient.interface.quit_monitor ();
this.visible = false;
});

popover_widget.show_monitor.connect (() => {
close ();
dbusclient.interface.show_monitor ();
});

}

/* Constructor */
public Indicator () {
/* Some information about the indicator */
Object (code_name : "monitor", /* Unique name */
display_name : _("Monitor Indicator"), /* Localised name */
description: _("Show system resources")); /* Short description */
}

/* This method is called to get the widget that is displayed in the top bar */
public override Gtk.Widget get_display_widget () {
return display_widget;
}

/* This method is called to get the widget that is displayed in the popover */
public override Gtk.Widget? get_widget () {
return popover_widget;
}

/* This method is called when the indicator popover opened */
public override void opened () {
/* Use this method to get some extra information while displaying the indicator */
}

/* This method is called when the indicator popover closed */
public override void closed () {
}

/* Method to connect the signals */
private void connect_signals () {
/* Connect to the click signal of the hide button */
// hide_button.clicked.connect (hide_me);

/* Connect to the switch signal of the compositing switch */
// compositing_switch.switched.connect (update_compositing);
}

/* Method to hide the indicator for a short time */
// private void hide_me () {
// /* Hide the indicator */
// this.visible = false;
//
// /* Show the indicator after two seconds */
// Timeout.add (2000, () => {
// /* Show it */
// this.visible = true;
//
// /* Don't run this timer in an endless loop */
// return false;
// });
// }

/* Method to check the status of the compositing switch and update the indicator */
private void update_compositing () {
/* If the switch is enabled set the icon name of the icon that should be drawn on top of the other one, if not hide the top icon. */
// display_widget.set_overlay_icon_name (compositing_switch.get_active () ? "nm-vpn-active-lock" : "");
}
}

/*
* This method is called once after your plugin has been loaded.
* Create and return your indicator here if it should be displayed on the current server.
*/
public Wingpanel.Indicator? get_indicator (Module module, Wingpanel.IndicatorManager.ServerType server_type) {
/* A small message for debugging reasons */
debug ("Activating Monitor Indicator");

/* Check which server has loaded the plugin */
if (server_type != Wingpanel.IndicatorManager.ServerType.SESSION) {
/* We want to display our monitor indicator only in the "normal" session, not on the login screen, so stop here! */
return null;
}

/* Create the indicator */
var indicator = new Monitor.Indicator ();

/* Return the newly created indicator */
return indicator;
}
Loading

0 comments on commit 92b51ec

Please sign in to comment.