[systemd-commits] 7 commits - configure.ac Makefile.am src/systemadm.desktop src/systemadm.vala

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Thu Dec 19 17:20:40 PST 2013


 Makefile.am           |    3 
 configure.ac          |    2 
 src/systemadm.desktop |    6 -
 src/systemadm.vala    |  176 +++++++++++++++++++++++++++++++++++++++-----------
 4 files changed, 143 insertions(+), 44 deletions(-)

New commits:
commit bd1d89779b749587c1b3b0a73e2f25c468227ccb
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Dec 19 20:09:00 2013 -0500

    version 3

diff --git a/Makefile.am b/Makefile.am
index be93f08..ee82e12 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -117,8 +117,7 @@ uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
 install-data-hook: $(INSTALL_DATA_HOOKS)
 
 upload: all distcheck
-	cp -v systemd-ui-$(VERSION).tar.xz /home/lennart/git.fedora/systemd-ui/
-	scp systemd-ui-$(VERSION).tar.xz fdo:/srv/www.freedesktop.org/www/software/systemd/
+	scp systemd-ui-$(VERSION).tar.xz www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd/
 
 git-tag:
 	git tag "v$(VERSION)" -m "systemd-ui $(VERSION)"
diff --git a/configure.ac b/configure.ac
index 50589fc..a3d3042 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,7 +17,7 @@
 
 AC_PREREQ(2.63)
 
-AC_INIT([systemd-ui],[2],[systemd-devel at lists.freedesktop.org])
+AC_INIT([systemd-ui],[3],[systemd-devel at lists.freedesktop.org])
 AC_CONFIG_SRCDIR([src/systemadm.vala])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS([config.h])

commit ad24c2ba018047cac028712595e41ab8e69cecd5
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Dec 19 19:12:54 2013 -0500

    Make name in desktop entry less generic

diff --git a/src/systemadm.desktop b/src/systemadm.desktop
index 9abe954..a8c71a0 100644
--- a/src/systemadm.desktop
+++ b/src/systemadm.desktop
@@ -1,6 +1,6 @@
 [Desktop Entry]
-Name=Services
-Comment=Manage System Services
+Name=systemadm
+Comment=Manage Systemd Units
 Exec=systemadm
 Icon=applications-system
 Terminal=false

commit ccccc264891baf630f5ee30b2cdb08be177c81c5
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Dec 19 18:52:40 2013 -0500

    Use strerror in error dialog
    
    https://bugzilla.redhat.com/show_bug.cgi?id=980204

diff --git a/src/systemadm.vala b/src/systemadm.vala
index dd75d72..19faadb 100644
--- a/src/systemadm.vala
+++ b/src/systemadm.vala
@@ -669,7 +669,7 @@ public class MainWindow : Window {
                 try {
                         u.start("replace");
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
         }
 
@@ -682,7 +682,7 @@ public class MainWindow : Window {
                 try {
                         u.stop("replace");
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
         }
 
@@ -695,7 +695,7 @@ public class MainWindow : Window {
                 try {
                         u.reload("replace");
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
         }
 
@@ -708,7 +708,7 @@ public class MainWindow : Window {
                 try {
                         u.restart("replace");
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
         }
 
@@ -721,7 +721,7 @@ public class MainWindow : Window {
                 try {
                         j.cancel();
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
         }
 
@@ -749,7 +749,7 @@ public class MainWindow : Window {
                                        5, t != "" ? "→ %s".printf(t) : "",
                                        6, u);
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
         }
 
@@ -775,7 +775,7 @@ public class MainWindow : Window {
 
                         update_unit_iter(iter, id, u);
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
         }
 
@@ -811,7 +811,7 @@ public class MainWindow : Window {
                         update_job_iter(iter, id, j);
 
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
         }
 
@@ -893,7 +893,7 @@ public class MainWindow : Window {
                         } while (unit_model.iter_next(ref iter));
 
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
         }
 
@@ -929,7 +929,7 @@ public class MainWindow : Window {
                         } while (job_model.iter_next(ref iter));
 
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
         }
 
@@ -988,7 +988,7 @@ public class MainWindow : Window {
                 try {
                         manager.reload();
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
         }
 
@@ -999,7 +999,7 @@ public class MainWindow : Window {
                         if (unit_type_combo_box.get_active() != 0)
                                 unit_type_combo_box.set_active(12);
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
         }
 
@@ -1028,7 +1028,7 @@ public class MainWindow : Window {
 
                         show_unit(u);
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
         }
 
@@ -1048,22 +1048,107 @@ public class MainWindow : Window {
 
                         show_unit(u);
                 } catch (Error e) {
-                        show_error(e.message);
+                        show_error(e);
                 }
 
                 return true;
         }
 
-        public void show_error(string e) {
+        public void show_error(Error e) {
+				string title, message;
+				if (e is DBusError && DBusError.is_remote_error(e)) {
+						string remote = DBusError.get_remote_error(e);
+						title = "Remote DBus Error: %s".printf(remote);
+						message = strerror(dbus_error_to_errno(remote));
+				} else {
+						title = "Error";
+						message = "Error";
+				}
+
                 var m = new MessageDialog(this,
                                           DialogFlags.DESTROY_WITH_PARENT,
                                           MessageType.ERROR,
-                                          ButtonsType.CLOSE, "%s", e);
-                m.title = "Error";
+                                          ButtonsType.CLOSE, "%s", message);
+				m.title = title;
+				m.format_secondary_text("%s", e.message);
                 m.run();
                 m.destroy();
         }
+}
 
+int dbus_error_to_errno(string error) {
+		switch (error) {
+		case "org.freedesktop.DBus.Error.Failed":
+				return Posix.EACCES;
+		case "org.freedesktop.DBus.Error.NoMemory":
+				return Posix.ENOMEM;
+		case "org.freedesktop.DBus.Error.ServiceUnknown":
+				return Posix.EHOSTUNREACH;
+		case "org.freedesktop.DBus.Error.NameHasNoOwner":
+				return Posix.ENXIO;
+		case "org.freedesktop.DBus.Error.NoReply":
+				return Posix.ETIMEDOUT;
+		case "org.freedesktop.DBus.Error.IOError":
+				return Posix.EIO;
+		case "org.freedesktop.DBus.Error.BadAddress":
+				return Posix.EADDRNOTAVAIL;
+		case "org.freedesktop.DBus.Error.NotSupported":
+				return Posix.ENOTSUP;
+		case "org.freedesktop.DBus.Error.LimitsExceeded":
+				return Posix.ENOBUFS;
+		case "org.freedesktop.DBus.Error.AccessDenied":
+				return Posix.EACCES;
+		case "org.freedesktop.DBus.Error.AuthFailed":
+				return Posix.EACCES;
+		case "org.freedesktop.DBus.Error.NoServer":
+				/* Errno missing from Posix */
+				/* return Posix.EHOSTDOWN; */
+				return Posix.EIO;
+		case "org.freedesktop.DBus.Error.Timeout":
+				return Posix.ETIMEDOUT;
+		case "org.freedesktop.DBus.Error.NoNetwork":
+				/* Errno missing from Posix */
+				/* return Posix.ENONET; */
+				return Posix.EIO;
+		case "org.freedesktop.DBus.Error.AddressInUse":
+				return Posix.EADDRINUSE;
+		case "org.freedesktop.DBus.Error.Disconnected":
+				return Posix.ECONNRESET;
+		case "org.freedesktop.DBus.Error.InvalidArgs":
+				return Posix.EINVAL;
+		case "org.freedesktop.DBus.Error.FileNotFound":
+				return Posix.ENOENT;
+		case "org.freedesktop.DBus.Error.FileExists":
+				return Posix.EEXIST;
+		case "org.freedesktop.DBus.Error.UnknownMethod":
+		case "org.freedesktop.DBus.Error.UnknownObject":
+		case "org.freedesktop.DBus.Error.UnknownInterface":
+		case "org.freedesktop.DBus.Error.UnknownProperty":
+				/* Errno missing from Posix */
+				/* return Posix.EBADR; */
+				return Posix.EIO;
+		case "org.freedesktop.DBus.Error.PropertyReadOnly":
+				return Posix.EROFS;
+		case "org.freedesktop.DBus.Error.UnixProcessIdUnknown":
+				return Posix.ESRCH;
+		case "org.freedesktop.DBus.Error.InvalidSignature":
+				return Posix.EINVAL;
+		case "org.freedesktop.DBus.Error.InconsistentMessage":
+				return Posix.EBADMSG;
+		case "org.freedesktop.DBus.Error.TimedOut":
+				return Posix.ETIMEDOUT;
+		case "org.freedesktop.DBus.Error.MatchRuleInvalid":
+		case "org.freedesktop.DBus.Error.InvalidFileContent":
+				return Posix.EINVAL;
+		case "org.freedesktop.DBus.Error.MatchRuleNotFound":
+				return Posix.ENOENT;
+		case "org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown":
+				return Posix.ESRCH;
+		case "org.freedesktop.DBus.Error.ObjectPathInUse":
+				return Posix.EBUSY;
+		default:
+				return Posix.EIO;
+		}
 }
 
 static const OptionEntry entries[] = {
@@ -1072,8 +1157,8 @@ static const OptionEntry entries[] = {
         { null }
 };
 
-void show_error(string e) {
-        var m = new MessageDialog(null, 0, MessageType.ERROR, ButtonsType.CLOSE, "%s", e);
+void show_error(Error e) {
+        var m = new MessageDialog(null, 0, MessageType.ERROR, ButtonsType.CLOSE, "%s", e.message);
         m.run();
         m.destroy();
 }
@@ -1088,7 +1173,7 @@ int main(string[] args) {
 
                 Gtk.main();
         } catch (IOError e) {
-                show_error(e.message);
+                show_error(e);
         } catch (GLib.Error e) {
                 stderr.printf("%s\n", e.message);
         }

commit 7dc1fcecc0018f68cb1362a44628792947ac74de
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Dec 19 18:41:44 2013 -0500

    Fix index of snapshots in type chooser

diff --git a/src/systemadm.vala b/src/systemadm.vala
index e59770f..dd75d72 100644
--- a/src/systemadm.vala
+++ b/src/systemadm.vala
@@ -163,7 +163,7 @@ public class MainWindow : Window {
                 unit_type_combo_box.append_text("Sockets");
                 unit_type_combo_box.append_text("Paths");
                 unit_type_combo_box.append_text("Timers");
-                unit_type_combo_box.append_text("Snapshots");
+                unit_type_combo_box.append_text("Snapshots"); // adjust index in server_on_snapshot
                 unit_type_combo_box.set_active(0); // Show All
                 unit_type_combo_box.changed.connect(unit_type_changed);
 
@@ -997,8 +997,7 @@ public class MainWindow : Window {
                         manager.create_snapshot();
 
                         if (unit_type_combo_box.get_active() != 0)
-                                unit_type_combo_box.set_active(8);
-
+                                unit_type_combo_box.set_active(12);
                 } catch (Error e) {
                         show_error(e.message);
                 }

commit da4eb23ec64ad36b72bbc7d865d066a4fed3147b
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Dec 16 18:38:34 2013 -0500

    Make various things resizable and scrollable
    
    https://bugzilla.redhat.com/show_bug.cgi?id=980203

diff --git a/src/systemadm.vala b/src/systemadm.vala
index f594a9b..e59770f 100644
--- a/src/systemadm.vala
+++ b/src/systemadm.vala
@@ -73,6 +73,14 @@ public class RightLabel : Label {
         }
 }
 
+public ScrolledWindow new_scrolled_window(Widget widget) {
+       ScrolledWindow scroll = new ScrolledWindow(null, null);
+       scroll.set_policy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
+       scroll.set_shadow_type(ShadowType.IN);
+       scroll.add(widget);
+       return scroll;
+}
+
 public class MainWindow : Window {
 
         private string? current_unit_id;
@@ -213,17 +221,21 @@ public class MainWindow : Window {
                 new_column(job_view, 2, "Type");
                 new_column(job_view, 3, "State");
 
-                ScrolledWindow scroll = new ScrolledWindow(null, null);
-                scroll.set_policy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
-                scroll.set_shadow_type(ShadowType.IN);
-                scroll.add(unit_view);
-                unit_vbox.pack_start(scroll, true, true, 0);
+                Paned paned = new Paned(Orientation.VERTICAL);
+                unit_vbox.pack_start(paned, true, true, 0);
+
+                paned.pack1(new_scrolled_window(unit_view), true, true);
+
+                Box unit_vbox2 = new Box(Orientation.VERTICAL, 12);
+                paned.pack2(new_scrolled_window(unit_vbox2), false, true);
+
+                paned = new Paned(Orientation.VERTICAL);
+                job_vbox.pack_start(paned, true, true, 0);
+
+                paned.pack1(new_scrolled_window(job_view), true, true);
 
-                scroll = new ScrolledWindow(null, null);
-                scroll.set_policy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
-                scroll.set_shadow_type(ShadowType.IN);
-                scroll.add(job_view);
-                job_vbox.pack_start(scroll, true, true, 0);
+                Box job_vbox2 = new Box(Orientation.VERTICAL, 12);
+                paned.pack2(new_scrolled_window(job_vbox2), false, true);
 
                 unit_id_label = new RightLabel();
                 unit_dependency_label = new RightLabel();
@@ -251,12 +263,12 @@ public class MainWindow : Window {
                 Grid unit_grid = new Grid();
                 unit_grid.column_spacing = 6;
                 unit_grid.row_spacing = 6;
-                unit_vbox.pack_start(unit_grid, false, true, 0);
+                unit_vbox2.pack_start(unit_grid, false, true, 0);
 
                 Grid job_grid = new Grid();
                 job_grid.column_spacing = 6;
                 job_grid.column_spacing = 6;
-                job_vbox.pack_start(job_grid, false, true, 0);
+                job_vbox2.pack_start(job_grid, false, true, 0);
 
                 unit_grid.attach(new LeftLabel("Id:"),                     0, 0, 1, 1);
                 unit_grid.attach(unit_id_label,                            1, 0, 5, 1);
@@ -296,7 +308,7 @@ public class MainWindow : Window {
                 ButtonBox bbox = new ButtonBox(Orientation.HORIZONTAL);
                 bbox.set_layout(ButtonBoxStyle.START);
                 bbox.set_spacing(6);
-                unit_vbox.pack_start(bbox, false, true, 0);
+                unit_vbox2.pack_start(bbox, false, true, 0);
 
                 start_button = new Button.with_mnemonic("_Start");
                 stop_button = new Button.with_mnemonic("Sto_p");
@@ -316,7 +328,7 @@ public class MainWindow : Window {
                 bbox = new ButtonBox(Orientation.HORIZONTAL);
                 bbox.set_layout(ButtonBoxStyle.START);
                 bbox.set_spacing(6);
-                job_vbox.pack_start(bbox, false, true, 0);
+                job_vbox2.pack_start(bbox, false, true, 0);
 
                 cancel_button = new Button.with_mnemonic("_Cancel");
 

commit 30f3986dff1422cb262e26bbda157e250ab18cf4
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Dec 16 18:32:06 2013 -0500

    Use black/brown for dead/exited services
    
    https://bugzilla.redhat.com/show_bug.cgi?id=980207

diff --git a/src/systemadm.vala b/src/systemadm.vala
index 3daf1da..f594a9b 100644
--- a/src/systemadm.vala
+++ b/src/systemadm.vala
@@ -467,8 +467,12 @@ public class MainWindow : Window {
                 string color;
                 switch (u.sub_state) {
                 case "active": color = "blue"; break;
-                case "dead": color = "red"; break;
+                case "dead": color = "black"; break;
                 case "running": color = "green"; break;
+                case "plugged": color = "light blue"; break;
+                case "mounted": color = "light green"; break;
+                case "exited": color = "brown"; break;
+                case "failed": color = "red"; break;
                 default: color = "black"; break;
                 }
                 string span = "<span underline='none' color='" + color + "'>"

commit 46ad25f060a93dab18143e813f786e31d088d755
Author: Sergio <ikisham at gmail.com>
Date:   Mon Dec 16 16:18:15 2013 -0500

    Add systemadm to the Settings category
    
    https://bugzilla.redhat.com/show_bug.cgi?id=874988

diff --git a/src/systemadm.desktop b/src/systemadm.desktop
index 9c1da40..9abe954 100644
--- a/src/systemadm.desktop
+++ b/src/systemadm.desktop
@@ -5,4 +5,4 @@ Exec=systemadm
 Icon=applications-system
 Terminal=false
 Type=Application
-Categories=System;
+Categories=System;Settings;



More information about the systemd-commits mailing list