mirror of
https://github.com/deavminet/gustav.git
synced 2025-03-11 06:17:35 +00:00
Set the tab's title to that of the channel's name
This commit is contained in:
parent
5da6691c4a
commit
b442c36101
@ -11,9 +11,13 @@ import gtk.Box;
|
||||
import gtk.ListBox;
|
||||
import gtk.Label;
|
||||
import gtk.TextView;
|
||||
import libdnet.dclient;
|
||||
import gtk.Label;
|
||||
|
||||
public final class Channel
|
||||
{
|
||||
private DClient client;
|
||||
|
||||
/**
|
||||
* Channel details
|
||||
*/
|
||||
@ -35,8 +39,9 @@ public final class Channel
|
||||
private ListBox textArea;
|
||||
private TextView textInput;
|
||||
|
||||
this(string channelName)
|
||||
this(DClient client, string channelName)
|
||||
{
|
||||
this.client = client;
|
||||
this.channelName = channelName;
|
||||
|
||||
initializeBox();
|
||||
@ -92,4 +97,14 @@ public final class Channel
|
||||
{
|
||||
return channelName;
|
||||
}
|
||||
|
||||
public void populateUsersList()
|
||||
{
|
||||
string[] memberList = client.getMembers(channelName);
|
||||
|
||||
foreach(string member; memberList)
|
||||
{
|
||||
users.add(new Label(member));
|
||||
}
|
||||
}
|
||||
}
|
@ -254,7 +254,7 @@ public final class Connection : Thread
|
||||
client.join(channelSelected);
|
||||
|
||||
/* Create the Channel object */
|
||||
Channel newChannel = new Channel(channelSelected);
|
||||
Channel newChannel = new Channel(client, channelSelected);
|
||||
|
||||
/* Add the channel */
|
||||
addChannel(newChannel);
|
||||
@ -264,10 +264,14 @@ public final class Connection : Thread
|
||||
|
||||
/* Get the Widgets container for this channel and add a tab for it */
|
||||
notebookSwitcher.add(newChannel.getBox());
|
||||
notebookSwitcher.setTabLabelText(newChannel.getBox(), newChannel.getName());
|
||||
|
||||
writeln("hdsjghjsd");
|
||||
|
||||
writeln("first time: "~channelSelected);
|
||||
|
||||
/* Get the user's list */
|
||||
newChannel.populateUsersList();
|
||||
}
|
||||
|
||||
/* Switch to the channel's pane */
|
||||
|
Loading…
Reference in New Issue
Block a user