Merge lp:~janez-troha/nuvola-player/8tracks into lp:nuvola-player/2.5.x

Proposed by dz0ny
Status: Merged
Approved by: Jiří Janoušek
Approved revision: 109
Merged at revision: 113
Proposed branch: lp:~janez-troha/nuvola-player/8tracks
Merge into: lp:nuvola-player/2.5.x
Diff against target: 169 lines (+87/-4) (has conflicts)
4 files modified
data/google-music-frame/scripts/eighttracks.js (+2/-2)
src/application.vala (+1/-1)
src/settings.vala (+9/-1)
src/window.vala (+75/-0)
Text conflict in src/window.vala
To merge this branch: bzr merge lp:~janez-troha/nuvola-player/8tracks
Reviewer Review Type Date Requested Status
Jiří Janoušek Pending
Review via email: mp+82830@code.launchpad.net

Description of the change

Global menu

To post a comment you must log in.
Revision history for this message
Jiří Janoušek (fenryxo) wrote :

I've already started to transform toolbar to menu, but I wil definitely combine my and your code. Thanks.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/google-music-frame/scripts/eighttracks.js'
--- data/google-music-frame/scripts/eighttracks.js 2011-11-19 17:31:18 +0000
+++ data/google-music-frame/scripts/eighttracks.js 2011-11-20 21:53:25 +0000
@@ -208,7 +208,7 @@
208208
209 $GMF.prototype.thumbsUp = function(){209 $GMF.prototype.thumbsUp = function(){
210 try{210 try{
211 window.Grooveshark.voteCurrentSong(1);211
212 }212 }
213 catch(e){213 catch(e){
214 $throw_exception(e.message);214 $throw_exception(e.message);
@@ -217,7 +217,7 @@
217217
218 $GMF.prototype.thumbsDown = function(){218 $GMF.prototype.thumbsDown = function(){
219 try{219 try{
220 window.Grooveshark.voteCurrentSong(-1);220
221 }221 }
222 catch(e){222 catch(e){
223 $throw_exception(e.message);223 $throw_exception(e.message);
224224
=== modified file 'src/application.vala'
--- src/application.vala 2011-11-19 23:27:27 +0000
+++ src/application.vala 2011-11-20 21:53:25 +0000
@@ -274,7 +274,7 @@
274 this.media_keys.handle_multimedia_keys();274 this.media_keys.handle_multimedia_keys();
275 else275 else
276 this.media_keys.release_multimedia_keys();276 this.media_keys.release_multimedia_keys();
277 277 //TODO: handle change for toolbar
278 }278 }
279 279
280 /**280 /**
281281
=== modified file 'src/settings.vala'
--- src/settings.vala 2011-11-08 20:52:13 +0000
+++ src/settings.vala 2011-11-20 21:53:25 +0000
@@ -70,6 +70,8 @@
70 box.pack_start(this.create_bool_entry("pause_key", _("Use Pause (break) key to toggle play/pause"), false), false, false);70 box.pack_start(this.create_bool_entry("pause_key", _("Use Pause (break) key to toggle play/pause"), false), false, false);
71 /// Settings dialog - tab General71 /// Settings dialog - tab General
72 box.pack_start(this.create_bool_entry("hide_when_playing", _("Hide window if close button is clicked while playing."), true), false, false);72 box.pack_start(this.create_bool_entry("hide_when_playing", _("Hide window if close button is clicked while playing."), true), false, false);
73 /// Settings dialog - tab General
74 box.pack_start(this.tool_bar("show_control_toolbar", _("Show controll bar in main window."), true), false, false);
73 // TODO: option "Show tray icon or sound menu entry"75 // TODO: option "Show tray icon or sound menu entry"
74 76
75 77
@@ -151,7 +153,13 @@
151 entry.toggled.connect(() => { this.set_bool(key, entry.active); });153 entry.toggled.connect(() => { this.set_bool(key, entry.active); });
152 return entry;154 return entry;
153 }155 }
154 156
157 private CheckButton tool_bar(string key, string label, bool default){
158 var entry = new CheckButton.with_label(label);
159 entry.active = this.app.config.bool(key, default);
160 entry.toggled.connect(() => { this.set_bool(key, entry.active); });
161 return entry;
162 }
155 163
156 private void proxy_toggled(ToggleButton button){164 private void proxy_toggled(ToggleButton button){
157 log_debug("Proxy button toggled");165 log_debug("Proxy button toggled");
158166
=== modified file 'src/window.vala'
--- src/window.vala 2011-11-19 23:27:27 +0000
+++ src/window.vala 2011-11-20 21:53:25 +0000
@@ -27,6 +27,7 @@
27 public class MainWindow : Gtk.Window{27 public class MainWindow : Gtk.Window{
28 private Application app;28 private Application app;
29 private Toolbar bar;29 private Toolbar bar;
30 private MenuBar menubar;
30 private Box box;31 private Box box;
31 private ScrolledWindow win;32 private ScrolledWindow win;
32 33
@@ -53,6 +54,70 @@
53 log_warning("Unable to load application icon.");54 log_warning("Unable to load application icon.");
54 }55 }
55 56
57 //Globalmenu
58 this.menubar = new MenuBar();
59
60
61 //Nuvola
62 var nuvola_group = new Menu();
63 var nuvola = new MenuItem.with_mnemonic("_Nuvola");
64 nuvola.set_submenu(nuvola_group);
65 this.menubar.add(nuvola);
66
67 //actions for nuvola group
68 var go_home_action = new Gtk.Action("home",null,null,Gtk.Stock.HOME);
69 go_home_action.activate.connect(() => { this.go_home_action(); });
70 nuvola_group.add(go_home_action.create_menu_item());
71
72 var refresh_action = new Gtk.Action("refresh",null,null,Gtk.Stock.REFRESH);
73 refresh_action.activate.connect(() => { this.refresh_action(); });
74 nuvola_group.add(refresh_action.create_menu_item());
75
76 var quit_action = new Gtk.Action("quit", null, null, Gtk.Stock.QUIT);
77 quit_action.activate.connect(() => {
78 try{
79 this.hide();
80 this.app.quit();
81 }
82 catch(Fenryxo.AppError e){
83 log_critical("Unable to quit: %s", e.message);
84 }
85 });
86 nuvola_group.add(quit_action.create_menu_item());
87
88 //Options
89 var options_group = new Menu();
90 var options = new MenuItem.with_mnemonic("_Options");
91 options.set_submenu(options_group);
92 this.menubar.add(options);
93
94 var troubleshooting_action = new Gtk.Action("istrouble",_("Troubleshooting"),null,null);
95 troubleshooting_action.activate.connect(() => { this.troubleshooting_action(); });
96 options_group.add(troubleshooting_action.create_menu_item());
97
98 var settings_action = new Gtk.Action("pref", null, null, Gtk.Stock.PREFERENCES);
99 settings_action.activate.connect(() => { this.settings_action(); });
100 options_group.add(settings_action.create_menu_item());
101
102 var switch_service_action = new Gtk.Action("switch",_("Switch service"),null,null);
103 switch_service_action.activate.connect(() => { this.switch_service_action(); });
104 options_group.add(switch_service_action.create_menu_item());
105
106 //Help
107 var help_group = new Menu();
108 var help = new MenuItem.with_mnemonic("_Help");
109 help.set_submenu(help_group);
110 this.menubar.add(help);
111
112 var visit_action = new Gtk.Action("help",_("Visit site"),null,Gtk.Stock.HELP);
113 visit_action.activate.connect(() => { });
114 help_group.add(visit_action.create_menu_item());
115
116 var show_about_dialog = new Gtk.Action("about", null, null, Gtk.Stock.ABOUT);
117 show_about_dialog.activate.connect(() => { this.show_about_dialog(); });
118 help_group.add(show_about_dialog.create_menu_item());
119
120 //other menu
56 this.bar = new Toolbar();121 this.bar = new Toolbar();
57 this.bar.toolbar_style = ToolbarStyle.TEXT;122 this.bar.toolbar_style = ToolbarStyle.TEXT;
58 ToolButton item;123 ToolButton item;
@@ -97,13 +162,23 @@
97 this.bar.add(item);162 this.bar.add(item);
98 163
99 this.box = new Gtk.VBox(false, 2);164 this.box = new Gtk.VBox(false, 2);
165<<<<<<< TREE
100 this.box.pack_start(this.bar, false);166 this.box.pack_start(this.bar, false);
101 this.win = new ScrolledWindow(null, null);167 this.win = new ScrolledWindow(null, null);
102 this.win.set_policy (PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);168 this.win.set_policy (PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
103 this.box.pack_start(this.win);169 this.box.pack_start(this.win);
104 this.add(this.box);170 this.add(this.box);
171=======
172 this.box.pack_start(this.menubar, false);
173 if(this.app.config.bool("show_control_toolbar", true)){
174 this.box.pack_start(this.bar, false);
175 }
176 base.add(this.box);
177>>>>>>> MERGE-SOURCE
105 this.box.show_all();178 this.box.show_all();
106 179
180
181
107 182
108 /* Restore last window dimensions */183 /* Restore last window dimensions */
109 int w = 0;184 int w = 0;

Subscribers

People subscribed via source and target branches