Difference between revisions of "Patch Launcher Add or Delete Pages"

From WebOS Internals
Jump to navigation Jump to search
(added method for patching)
Line 28: Line 28:
 
<hr />
 
<hr />
 
<p>The credit to this goes to someone in the forums, at the time this was written I wasn't able to find out who exactly was it who wrote about it first (purely I don't have the time to look.) Pyrognome tested and confirmed the new page and delete page functionality.</p>
 
<p>The credit to this goes to someone in the forums, at the time this was written I wasn't able to find out who exactly was it who wrote about it first (purely I don't have the time to look.) Pyrognome tested and confirmed the new page and delete page functionality.</p>
 +
 +
= Add/Delete Pages Patch =
 +
 +
== Procedure ==
 +
 +
Run the following commands:
 +
 +
''In this example, I have the patch file located in my home directory under '''patches'''''
 +
<source lang="bash">
 +
cd /
 +
sudo patch -p0 --backup-if-mismatch < ~/patches/adddelpages.patch
 +
</source>
 +
 +
This is what you should see if it ran properly:
 +
<source lang="text">
 +
patching file /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js
 +
</source>
 +
 +
These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command:
 +
<source lang="bash">
 +
pkill LunaSysMgr
 +
</source>
 +
 +
== adddelpages.patch ==
 +
 +
<source lang="diff">
 +
diff -ur /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js
 +
--- /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-18 00:21:37.000000000 -0500
 +
+++ /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-24 11:03:32.000000000 -0500
 +
@@ -30,8 +30,8 @@
 +
visible: true,
 +
label: $L('Launcher'),
 +
        items: [
 +
- /*{ label: $L('New page'), command: 'newpage' },
 +
- { label: $L('Delete page'), command: 'deletepage' },*/
 +
+ { label: $L('New page'), command: 'newpage' },
 +
+ { label: $L('Delete page'), command: 'deletepage' },
 +
Mojo.Menu.editItem,
 +
{ label: $L('List Apps...'), command: 'listapps' },
 +
Mojo.Menu.helpItem
 +
@@ -124,7 +124,6 @@
 +
case 'listapps':
 +
ApplicationService.launch(this.deviceInfo.id, this.deviceInfo.params);
 +
break;
 +
- /*
 +
case 'newpage':
 +
if (this.pageDivs.length < 10) {
 +
this.insertPage(this.activePageIndex, true);
 +
@@ -138,7 +137,6 @@
 +
}
 +
}
 +
break;
 +
- */
 +
}
 +
}
 +
},
 +
</source>

Revision as of 18:11, 24 July 2009

Someone in the forum talked about being able to add and delete pages in the Launcher app and I thought I would look into it further. They stated that they were able to add new pages and delete existing pages.

Upon further investigation, they were correct. There is existing code in a particular js file that has been commented out that will allow you to create a new page and delete the current page you are on in the Launcher. There is a variable that stores the max number of pages to 10. This value can probably be increased, but I don't recommend it and seriously, who would need more that 10 pages anyway, right?

After I uncommented these said lines and rebooted, I was able to perform these functions. So I tested the new page function.

The new page and delete page functions will appear in the launcher app menu.

Creating/adding a page:

This will create a new page and move whatever page you were on to the right. There is nothing special to this page besides the fact that you now have a new page. I was able to drag icons to it just like any other page. To test this new page out I added a contact to that page.

Deleting/Removing a page:

The code is already set up to automagically move any icons to the page to the left of the page you are deleting. What I mean is if the page you delete is in the middle of other pages it will toss whatever was on your current page to the page to the left of it.

When I deleted a page that was to the left of the apps page that had web app defaulted to it, it tossed the icons to that page because there is no page to the left of the one I just deleted.

Creating/adding multiple pages:

So I was on page 1 and created a new page. Then I moved over to the page where device info, backup, screen & lock was at and created a new page there. It tossed the page to the right and made a new page.


Uncomment the Following

/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js

Look for "appMenuModel" (line 27) a few lines below you will see a line that has "newpage" in it.
On the line that remove the "/*" and on the line that has "deletepage" remove the "*/"

Next look further in the file (line 119) for "switch" again remove the "/* and "*/" that surrounds the cases for newpage and deletepage.

reboot and now you'll have new page and delete page in the launcher app menu.

Note that you can download a patch for this at http://gitorious.org/webos-internals/modifications/blobs/raw/master/applauncher/add-delete-pages-in-the-launcher.patch

You can see a picture of the new menu here: http://img195.imageshack.us/img195/7636/unknown20091306141631.png

-PS I moved the location of the edit menu down…

-Enjoy


The credit to this goes to someone in the forums, at the time this was written I wasn't able to find out who exactly was it who wrote about it first (purely I don't have the time to look.) Pyrognome tested and confirmed the new page and delete page functionality.

Add/Delete Pages Patch

Procedure

Run the following commands:

In this example, I have the patch file located in my home directory under patches <source lang="bash"> cd / sudo patch -p0 --backup-if-mismatch < ~/patches/adddelpages.patch </source>

This is what you should see if it ran properly: <source lang="text"> patching file /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js </source>

These modifications will require LunaSysMgr to be restarted. A rescan will not work. After you've run the commands above, run one more command: <source lang="bash"> pkill LunaSysMgr </source>

adddelpages.patch

<source lang="diff"> diff -ur /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js --- /usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-18 00:21:37.000000000 -0500 +++ /usr/lib/luna/sysmod/luna-applauncher/app/controllers/launcher-assistant.js 2009-07-24 11:03:32.000000000 -0500 @@ -30,8 +30,8 @@

		visible: true,
		label: $L('Launcher'),
        items: [

- /*{ label: $L('New page'), command: 'newpage' }, - { label: $L('Delete page'), command: 'deletepage' },*/ + { label: $L('New page'), command: 'newpage' }, + { label: $L('Delete page'), command: 'deletepage' },

			Mojo.Menu.editItem,
			{ label: $L('List Apps...'), command: 'listapps' },
			Mojo.Menu.helpItem

@@ -124,7 +124,6 @@

				case 'listapps':
					ApplicationService.launch(this.deviceInfo.id, this.deviceInfo.params);
					break;

- /*

				case 'newpage':
					if (this.pageDivs.length < 10) {
						this.insertPage(this.activePageIndex, true);

@@ -138,7 +137,6 @@

						}
					}
					break;

- */

			}
		}
	},

</source>