|
Michal Schmidt |
e43452 |
From d21907af22f1c14445521cb6ae5cabccbe186bcc Mon Sep 17 00:00:00 2001
|
|
Michal Schmidt |
e43452 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Michal Schmidt |
e43452 |
Date: Mon, 19 Sep 2011 08:20:17 +0200
|
|
Michal Schmidt |
f1996e |
Subject: [PATCH] systemadm: use colors for id too, remove color from fragment
|
|
Michal Schmidt |
f1996e |
link (cherry picked from commit
|
|
Michal Schmidt |
e43452 |
79b1e6cb8080e5c88754484f5af591ce74714ff0)
|
|
Michal Schmidt |
e43452 |
|
|
Michal Schmidt |
e43452 |
---
|
|
Michal Schmidt |
e43452 |
src/systemadm.vala | 17 +++++++++++------
|
|
Michal Schmidt |
e43452 |
1 files changed, 11 insertions(+), 6 deletions(-)
|
|
Michal Schmidt |
e43452 |
|
|
Michal Schmidt |
e43452 |
diff --git a/src/systemadm.vala b/src/systemadm.vala
|
|
Michal Schmidt |
e43452 |
index 1118999..5971ac0 100644
|
|
Michal Schmidt |
e43452 |
--- a/src/systemadm.vala
|
|
Michal Schmidt |
e43452 |
+++ b/src/systemadm.vala
|
|
Michal Schmidt |
e43452 |
@@ -452,7 +452,7 @@ public class MainWindow : Window {
|
|
Michal Schmidt |
e43452 |
unit_cgroup_label.set_text_or_na();
|
|
Michal Schmidt |
e43452 |
}
|
|
Michal Schmidt |
e43452 |
|
|
Michal Schmidt |
e43452 |
- public string format_unit_link(string i) {
|
|
Michal Schmidt |
e43452 |
+ public string format_unit_link(string i, bool link) {
|
|
Michal Schmidt |
e43452 |
Unit? u = get_unit(i);
|
|
Michal Schmidt |
e43452 |
if(u == null)
|
|
Michal Schmidt |
e43452 |
return "" + i + "
|
|
Michal Schmidt |
e43452 |
@@ -467,7 +467,10 @@ public class MainWindow : Window {
|
|
Michal Schmidt |
e43452 |
string span = ""
|
|
Michal Schmidt |
e43452 |
+ i + "(" +
|
|
Michal Schmidt |
e43452 |
u.sub_state + ")" + "";
|
|
Michal Schmidt |
e43452 |
- return " " + span + "";
|
|
Michal Schmidt |
e43452 |
+ if(link)
|
|
Michal Schmidt |
e43452 |
+ return " " + span + "";
|
|
Michal Schmidt |
e43452 |
+ else
|
|
Michal Schmidt |
e43452 |
+ return span;
|
|
Michal Schmidt |
e43452 |
}
|
|
Michal Schmidt |
e43452 |
|
|
Michal Schmidt |
e43452 |
|
|
Michal Schmidt |
e43452 |
@@ -493,7 +496,7 @@ public class MainWindow : Window {
|
|
Michal Schmidt |
e43452 |
first = false;
|
|
Michal Schmidt |
e43452 |
}
|
|
Michal Schmidt |
e43452 |
|
|
Michal Schmidt |
e43452 |
- r += format_unit_link(i);
|
|
Michal Schmidt |
e43452 |
+ r += format_unit_link(i, true);
|
|
Michal Schmidt |
e43452 |
}
|
|
Michal Schmidt |
e43452 |
|
|
Michal Schmidt |
e43452 |
return r;
|
|
Michal Schmidt |
e43452 |
@@ -502,7 +505,7 @@ public class MainWindow : Window {
|
|
Michal Schmidt |
e43452 |
public void show_unit(Unit unit) {
|
|
Michal Schmidt |
e43452 |
current_unit_id = unit.id;
|
|
Michal Schmidt |
e43452 |
|
|
Michal Schmidt |
e43452 |
- string id_display = current_unit_id;
|
|
Michal Schmidt |
e43452 |
+ string id_display = format_unit_link(current_unit_id, false);
|
|
Michal Schmidt |
e43452 |
bool has_alias = false;
|
|
Michal Schmidt |
e43452 |
foreach (string i in unit.names) {
|
|
Michal Schmidt |
e43452 |
if (i == current_unit_id)
|
|
Michal Schmidt |
e43452 |
@@ -518,7 +521,7 @@ public class MainWindow : Window {
|
|
Michal Schmidt |
e43452 |
if(has_alias)
|
|
Michal Schmidt |
e43452 |
id_display += ")";
|
|
Michal Schmidt |
e43452 |
|
|
Michal Schmidt |
e43452 |
- unit_id_label.set_text_or_na(id_display);
|
|
Michal Schmidt |
e43452 |
+ unit_id_label.set_markup_or_na(id_display);
|
|
Michal Schmidt |
e43452 |
|
|
Michal Schmidt |
e43452 |
string[]
|
|
Michal Schmidt |
e43452 |
requires = unit.requires,
|
|
Michal Schmidt |
e43452 |
@@ -564,7 +567,9 @@ public class MainWindow : Window {
|
|
Michal Schmidt |
e43452 |
|
|
Michal Schmidt |
e43452 |
string fp = unit.fragment_path;
|
|
Michal Schmidt |
e43452 |
if (fp != "")
|
|
Michal Schmidt |
e43452 |
- unit_fragment_path_label.set_markup_or_na("" + fp + "" );
|
|
Michal Schmidt |
e43452 |
+ unit_fragment_path_label.set_markup_or_na(
|
|
Michal Schmidt |
e43452 |
+ "" +
|
|
Michal Schmidt |
e43452 |
+ "" + fp + "");
|
|
Michal Schmidt |
e43452 |
else
|
|
Michal Schmidt |
e43452 |
unit_fragment_path_label.set_text_or_na();
|
|
Michal Schmidt |
e43452 |
|