Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Close All and some cleanup #58

Merged
merged 6 commits into from Sep 23, 2014
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Add Close All function

  • Loading branch information...
aikeru committed Sep 22, 2014
commit c0c13ad92e1631ff1c90357311f897c299e00260
@@ -565,6 +565,7 @@ AppGroup.prototype = {
},

_windowAdded: function (metaWorkspace, metaWindow) {
//This is called when a new app is opened (a new icon is added to taskbar)
let tracker = Cinnamon.WindowTracker.get_default();
if (tracker.get_window_app(metaWindow) == this.app && !this.metaWindows[metaWindow] && tracker.is_window_interesting(metaWindow)) {
let button = null;
@@ -759,9 +760,9 @@ AppGroup.prototype = {
// that callbacks depend on

for(let i in this.metaWindows){
let metewindow = this.metaWindows[i];
metewindow.data.signals.forEach(function(s) {
metewindow.win.disconnect(s);
let metawindow = this.metaWindows[i];
metawindow.data.signals.forEach(function(s) {
metawindow.win.disconnect(s);
});
}
this.unwatchWorkspace(null);
@@ -21,6 +21,10 @@ msgstr ""
msgid "Close"
msgstr ""

#: specialMenus.js
msgid "Close All"
msgstr ""

#: specialMenus.js:66 specialMenus.js:198
msgid "Minimize"
msgstr ""
@@ -22,6 +22,10 @@ msgstr ""
msgid "Close"
msgstr "Cerrar"

#: specialMenus.js
msgid "Close All"
msgstr "Cerrar Todo"

#: specialMenus.js:66 specialMenus.js:198
msgid "Minimize"
msgstr "Minimizar"
@@ -62,6 +62,9 @@ AppMenuButtonRightClickMenu.prototype = {
this._applet.recentManager.connect('changed', Lang.bind(this, function(){Mainloop.timeout_add(15, Lang.bind(this, this._recent_items_changed))}));
this._applet.settings.connect('changed::pinned-recent', Lang.bind(this, this._recent_items_changed));

this.itemCloseAllWindow = new SpecialMenuItems.IconNameMenuItem(_("Close All"), "window-close");
this.itemCloseAllWindow.connect('activate', Lang.bind(this, this._onCloseAllActivate));

this.itemCloseWindow = new SpecialMenuItems.IconNameMenuItem(_("Close"), "window-close");
this.itemCloseWindow.connect('activate', Lang.bind(this, this._onCloseWindowActivate));

@@ -173,7 +176,7 @@ AppMenuButtonRightClickMenu.prototype = {
this.RecentMenuItems.push(item);
}
return;
}else if(this.app.get_id() == 'firefox.desktop' || this.app.get_id() == 'firefox web browser.desktop'){
} else if(this.app.get_id() == 'firefox.desktop' || this.app.get_id() == 'firefox web browser.desktop'){
let historys = FireFox.getFirefoxHistory(this._applet);

if (historys === null) {
@@ -182,8 +185,8 @@ AppMenuButtonRightClickMenu.prototype = {
Util.spawnCommandLine('gnome-terminal -x bash -c "sudo apt-get install gir1.2-gda-5.0; echo "press enter and restart cinnamon"; read n1"');
}));
this.addMenuItem(install);
}else if(historys.length){
try{
} else if(historys.length){
try {
historys.length = historys.length - pinnedLength;
for(let i = 0; i < historys.length; i++){
let history = historys[i];
@@ -193,7 +196,7 @@ AppMenuButtonRightClickMenu.prototype = {
this.specialSection.actor.add(item.actor);
this.RecentMenuItems.push(item);
}
}catch(e){}
} catch(e){}
}
this._loadActions();
return;
@@ -326,9 +329,11 @@ AppMenuButtonRightClickMenu.prototype = {
//this.addMenuItem(this.itemMinimizeWindow);
//this.addMenuItem(this.itemMaximizeWindow);
this.addMenuItem(this.itemCloseWindow);
this.addMenuItem(this.itemCloseAllWindow);
this.isFavapp = false;
} else {
this.addMenuItem(this.itemCloseWindow);
this.addMenuItem(this.itemCloseAllWindow);
//this.addMenuItem(this.itemMaximizeWindow);
//this.addMenuItem(this.itemMinimizeWindow);
//this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
@@ -386,6 +391,14 @@ AppMenuButtonRightClickMenu.prototype = {

_onWindowMinimized: function (actor, event) {},

_onCloseAllActivate: function (actor, event) {
var workspace = this.metaWindow.get_workspace();
var windows = this.app.get_windows();
for(var i = 0; i < windows.length; i++) {
windows[i].delete(global.get_current_time());
}
},

_onCloseWindowActivate: function (actor, event) {
this.metaWindow.delete(global.get_current_time());
//this.destroy();
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.