Closed Bug 270237 Opened 20 years ago Closed 15 years ago

Add current open servers and channels to main menu

Categories

(Other Applications :: ChatZilla, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: per, Assigned: bugzilla-mozilla-20000923)

References

Details

(Whiteboard: [cz-0.9.86])

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.7.5) Gecko/20041109 Firefox/1.0
Build Identifier: Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.7.5) Gecko/20041109 Firefox/1.0

The tab area at the bottom of the main window fills up quickly with open servers
channels.
I would like to have one or two new menus where I can see and select open
channels and servers. Effect of menu item would be same as selecting the tab
with the same name. Example:

File  Edit  Servers           Channels
            irc.du.se         #delphi
            irc.netlabs.org   #40+  


Reproducible: Always
Steps to Reproduce:
Product: Core → Other Applications
Status: UNCONFIRMED → NEW
Ever confirmed: true
Could also nest the menu items, e.g.:

  Servers > irc.mozilla.org > #chatzilla
                            > #mozillazine
Assignee: rginda → silver
Status: NEW → ASSIGNED
QA Contact: samuel → chatzilla
A few things in here to get the final result (which can be seen at http://twpol.dyndns.org/temp/cz_48.png):
 - Menu Manager now supports "repeatgroup" to automatically provide separators.
 - DCC URIs how have the format "x-irc-dcc-chat:<dccid>" (file respectively) so that /goto-url can handle them at all.
 - New context function to get the list of views and sort them.
Attachment #404464 - Flags: review?(gijskruitbosch+bugs)
Comment on attachment 404464 [details] [diff] [review]
Add IRC > Views submenu

>Index: js/lib/menu-manager.js
>===================================================================
>RCS file: /cvsroot/mozilla/extensions/irc/js/lib/menu-manager.js,v
>retrieving revision 1.12
>diff -u -r1.12 menu-manager.js
>--- js/lib/menu-manager.js	2 Oct 2009 16:13:32 -0000	1.12
>+++ js/lib/menu-manager.js	3 Oct 2009 23:26:54 -0000
>@@ -386,8 +386,26 @@
>                 props[name] = menuitem.getAttribute(name);
>         }
> 
>+        var lastGroup = "";
>         for (i = 0; i < limit; i++)
>         {
>+            /* Check for groupings. For each item we add, if "repeatgroup" gives
>+             * a different value, we insert a separator.
>+             */
>+            if (menuitem.getAttribute("repeatgroup"))
>+            {
>+                cx.index = i;
>+                ary = cx.repeatList[menuitem.getAttribute("repeatid")];
>+                var item = ary[i];

As discussed on IRC, please add a comment here about how |item| is (/may be) used by the evalAttribute calls, maybe with the examples of the Views usage you're pioneering here... :-)

<snip>

>Index: xul/content/static.js

> <snip addView + sorting>

>+
>+    if (!cx)
>+        cx = new Object();
>+    cx.__proto__ = getObjectDetails(client.currentObject);
>+
>+    cx.views = new Array();
>+    var urls = new Object();
>+

Please add a comment about how we're traversing both the object hierarchy and the view list to catch any stray double user views, and maybe also how that doesn't actually make them selectable, with a reference to a new bug about how our object hierarchy is suboptimal. Pretty please? :-)

>+    for (var i in client.viewsArray)
>+        addView(client.viewsArray[i].source);
>+
>+    addView(client);
>+    for (var n in client.networks)
>+    {
>+        addView(client.networks[n]);
>+        for (var s in client.networks[n].servers) {
>+            var server = client.networks[n].servers[s];
>+            for (var c in server.channels)
>+                addView(server.channels[c]);
>+            for (var u in server.users)
>+                addView(server.users[u]);
>+        }
>+    }
>+
>+    for (var u in client.dcc.users)
>+        addView(client.dcc.users[u]);
>+    for (var i = 0; i < client.dcc.chats.length; i++)
>+        addView(client.dcc.chats[i]);
>+    for (var i = 0; i < client.dcc.files.length; i++)
>+        addView(client.dcc.files[i]);
>+
>+    cx.views.sort(sortViews);
>+
>+    return cx;
>+}
>+
> function getSelectedNicknames(tree)
> {
>     var rv = [];
>


With the comments and bug filed, r=me, thanks!
Attachment #404464 - Flags: review?(gijskruitbosch+bugs) → review+
Checked in with lots of comments --> FIXED.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.86]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: