Merge lp:~unity-team/unity/trusty-1329584 into lp:unity/7.2

Proposed by Stephen M. Webb on 2014-12-09
Status: Rejected
Rejected by: Stephen M. Webb on 2014-12-15
Proposed branch: lp:~unity-team/unity/trusty-1329584
Merge into: lp:unity/7.2
Diff against target: 70 lines (+35/-2)
2 files modified
debian/changelog (+7/-0)
panel/PanelMenuView.cpp (+28/-2)
To merge this branch: bzr merge lp:~unity-team/unity/trusty-1329584
Reviewer Review Type Date Requested Status
Unity Team 2014-12-09 Pending
Review via email: mp+244074@code.launchpad.net

Commit Message

added support for getting the distro name from /etc/os-release

Description of the Change

Adds support for getting the distro name from /etc/os-release (lp: #1329584).

This change is cherry-picked from trunk for SRUing into Ubunti 14.04 LTS.

To post a comment you must log in.
lp:~unity-team/unity/trusty-1329584 updated on 2014-12-09
3806. By Stephen M. Webb on 2014-12-09

added support for getting the distro name from /etc/os-release
(lp: #1329584)

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-08-26 13:49:00 +0000
3+++ debian/changelog 2014-12-09 00:46:37 +0000
4@@ -1,3 +1,10 @@
5+unity (7.2.3+14.04.20140826-0ubuntu2) UNRELEASED; urgency=medium
6+
7+ * added support for getting the distro name from /etc/os-release
8+ (lp: #1329584)
9+
10+ -- handsome_feng <445865575@qq.com> Mon, 08 Dec 2014 19:40:46 -0500
11+
12 unity (7.2.3+14.04.20140826-0ubuntu1) trusty; urgency=medium
13
14 [ Andrea Azzarone ]
15
16=== modified file 'panel/PanelMenuView.cpp'
17--- panel/PanelMenuView.cpp 2014-04-02 21:42:44 +0000
18+++ panel/PanelMenuView.cpp 2014-12-09 00:46:37 +0000
19@@ -20,6 +20,7 @@
20
21 #include <Nux/Nux.h>
22 #include <NuxCore/Logger.h>
23+#include <boost/algorithm/string/erase.hpp>
24
25 #include "PanelMenuView.h"
26 #include "unity-shared/AnimationUtils.h"
27@@ -53,6 +54,32 @@
28 const std::string WINDOW_ACTIVATED_TIMEOUT = "window-activated-timeout";
29 const std::string UPDATE_SHOW_NOW_TIMEOUT = "update-show-now-timeout";
30 const std::string INTEGRATED_MENUS_DOUBLE_CLICK_TIMEOUT = "integrated-menus-double-click-timeout";
31+
32+std::string get_current_desktop()
33+{
34+ std::ifstream fin("/etc/os-release");
35+ std::string temp;
36+ std::string os_release_name("Ubuntu");
37+
38+ if (fin.is_open())
39+ {
40+ while (getline(fin, temp))
41+ {
42+ if (temp.substr(0,4) == "NAME")
43+ {
44+ os_release_name = boost::erase_all_copy(temp.substr(temp.find_last_of('=')+1), "\"");
45+ break;
46+ }
47+ }
48+ fin.close();
49+ }
50+
51+ //this is done to avoid breaking translation before 14.10.
52+ if (os_release_name.empty() || os_release_name == "Ubuntu")
53+ return _("Ubuntu Desktop");
54+ else
55+ return glib::String(g_strdup_printf(_("%s Desktop"), os_release_name.c_str())).Str();
56+}
57 }
58
59 PanelMenuView::PanelMenuView(menu::Manager::Ptr const& menus)
60@@ -73,9 +100,8 @@
61 , ignore_menu_visibility_(false)
62 , integrated_menus_(decoration::Style::Get()->integrated_menus())
63 , active_xid_(0)
64- , desktop_name_(_("Ubuntu Desktop"))
65+ , desktop_name_(get_current_desktop())
66 {
67-
68 BamfWindow* active_win = bamf_matcher_get_active_window(matcher_);
69 if (BAMF_IS_WINDOW(active_win))
70 active_xid_ = bamf_window_get_xid(active_win);

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: