Merge lp:~feng-kylin/unity/changeTopLabel into lp:unity

Proposed by handsome_feng
Status: Rejected
Rejected by: Stephen M. Webb
Proposed branch: lp:~feng-kylin/unity/changeTopLabel
Merge into: lp:unity
Diff against target: 74 lines (+27/-3) (has conflicts)
3 files modified
debian/changelog (+9/-0)
panel/PanelMenuView.cpp (+17/-2)
panel/PanelMenuView.h (+1/-1)
Text conflict in debian/changelog
To merge this branch: bzr merge lp:~feng-kylin/unity/changeTopLabel
Reviewer Review Type Date Requested Status
Sebastien Bacher Needs Information
Anthony Wong (community) Needs Fixing
Review via email: mp+223190@code.launchpad.net

Description of the change

The desktop name "Ubuntu Desktop" can not be notified,it is not convenient for us to change it to our Special symbol,so i remove the ”const" attribute of desktop_name_ in PanelManuView.h ,and add a if statement in PanelManuView.cpp to judge witch desktop_name to show .thank you.

To post a comment you must log in.
Revision history for this message
Anthony Wong (anthonywong) wrote :

The string "Ubuntu Desktop" was localized but in your change it is no longer the case. You should use _("Ubuntu Desktop") to take the localized string. The same applies to the "Ubuntu Kylin Desktop" string.

review: Needs Fixing
Revision history for this message
Jack Yu (jackyu) wrote :

Thanks.

lp:~feng-kylin/unity/changeTopLabel updated
3827. By handsome_feng

change the 'Ubuntu Desktop' to _('Ubuntu Desktop')

Revision history for this message
Sebastien Bacher (seb128) wrote :

would it make sense to use /etc/os-release, similar to what has been discussed on https://bugs.launchpad.net/bugs/1331873 ?

review: Needs Information
Revision history for this message
handsome_feng (feng-kylin) wrote :

yes ,i will do that ,thank you very much!

lp:~feng-kylin/unity/changeTopLabel updated
3828. By handsome_feng

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

Revision history for this message
handsome_feng (feng-kylin) wrote :

i have add the support for getting the distro name from /etc/os-release , how about this ?

Revision history for this message
handsome_feng (feng-kylin) wrote :

> would it make sense to use /etc/os-release, similar to what has been discussed
> on https://bugs.launchpad.net/bugs/1331873 ?
i have add the support to /etc/os-release ,and how about this?

Revision history for this message
Stephen M. Webb (bregma) wrote :

This MP has long been superseded by a different one accomplishing the same task. Marking as rejected.

Unmerged revisions

3828. By handsome_feng

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

3827. By handsome_feng

change the 'Ubuntu Desktop' to _('Ubuntu Desktop')

3826. By handsome_feng

change the label on the panel menu

3825. By handsome_feng

add a if statement,just for practice.

3824. By handsome_feng

add a if statement (a novice,make this for practice)

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-07-11 19:59:35 +0000
3+++ debian/changelog 2014-07-30 01:57:45 +0000
4@@ -1,3 +1,4 @@
5+<<<<<<< TREE
6 unity (7.3.0+14.10.20140711-0ubuntu1) utopic; urgency=low
7
8 [ Eleni Maria Stea ]
9@@ -77,6 +78,14 @@
10
11 -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 19 Jun 2014 18:41:55 +0000
12
13+=======
14+unity (7.2.0+14.10.20140607-0ubuntu2) UNRELEASED; urgency=medium
15+
16+ * add a if statement,just for practice.
17+
18+ -- handsome_feng <445865575@qq.com> Fri, 13 Jun 2014 09:36:20 +0800
19+
20+>>>>>>> MERGE-SOURCE
21 unity (7.2.0+14.10.20140607-0ubuntu1) utopic; urgency=low
22
23 [ Chris Townsend ]
24
25=== modified file 'panel/PanelMenuView.cpp'
26--- panel/PanelMenuView.cpp 2014-04-02 21:42:44 +0000
27+++ panel/PanelMenuView.cpp 2014-07-30 01:57:45 +0000
28@@ -20,6 +20,7 @@
29
30 #include <Nux/Nux.h>
31 #include <NuxCore/Logger.h>
32+#include <fstream>
33
34 #include "PanelMenuView.h"
35 #include "unity-shared/AnimationUtils.h"
36@@ -73,9 +74,23 @@
37 , ignore_menu_visibility_(false)
38 , integrated_menus_(decoration::Style::Get()->integrated_menus())
39 , active_xid_(0)
40- , desktop_name_(_("Ubuntu Desktop"))
41 {
42-
43+ std::ifstream fin("/etc/os-release");
44+ std::string temp,os_release_name = _("Ubuntu");
45+ if (fin.is_open())
46+ {
47+ while( getline(fin,temp) )
48+ {
49+ if (temp.substr(0,4) == "NAME")
50+ {
51+ size_t i = temp.find_first_of("\"");
52+ size_t j = temp.find_last_of("\"");
53+ os_release_name = temp.substr(i+1,j-i-1);
54+ break;
55+ }
56+ }
57+ }
58+ desktop_name_ = os_release_name + " " + _("Desktop");
59 BamfWindow* active_win = bamf_matcher_get_active_window(matcher_);
60 if (BAMF_IS_WINDOW(active_win))
61 active_xid_ = bamf_window_get_xid(active_win);
62
63=== modified file 'panel/PanelMenuView.h'
64--- panel/PanelMenuView.h 2014-04-02 21:42:44 +0000
65+++ panel/PanelMenuView.h 2014-07-30 01:57:45 +0000
66@@ -188,7 +188,7 @@
67
68 Window active_xid_;
69 nux::Geometry monitor_geo_;
70- const std::string desktop_name_;
71+ std::string desktop_name_;
72
73 glib::Signal<void, BamfMatcher*, BamfView*> view_opened_signal_;
74 glib::Signal<void, BamfMatcher*, BamfView*> view_closed_signal_;