mirror of https://github.com/deavminet/gustav.git
Added TODO
This commit is contained in:
parent
27bc84da56
commit
015521082e
|
@ -9,6 +9,7 @@ import gtk.Window;
|
||||||
import gtk.Label;
|
import gtk.Label;
|
||||||
import gtk.Image;
|
import gtk.Image;
|
||||||
import std.conv;
|
import std.conv;
|
||||||
|
import gtk.Box;
|
||||||
|
|
||||||
public final class ProfileWindow
|
public final class ProfileWindow
|
||||||
{
|
{
|
||||||
|
@ -25,16 +26,26 @@ public final class ProfileWindow
|
||||||
|
|
||||||
private void showWindow()
|
private void showWindow()
|
||||||
{
|
{
|
||||||
|
/* Create the window with the username as the title */
|
||||||
Window profileWindow = new Window(username);
|
Window profileWindow = new Window(username);
|
||||||
|
|
||||||
|
/* Create a Box for contents */
|
||||||
|
Box profileBox = new Box(GtkOrientation.VERTICAL, 1);
|
||||||
|
|
||||||
|
/* Create the username label */
|
||||||
|
Label usernameTitle = new Label("");
|
||||||
|
usernameTitle.setMarkup("<span size=\"10000\">"~username~"</span>");
|
||||||
|
profileBox.add(usernameTitle);
|
||||||
|
|
||||||
|
|
||||||
Image profileImage = new Image("/home/deavmi/Downloads/5207740.jpg");
|
Image profileImage = new Image("/home/deavmi/Downloads/5207740.jpg");
|
||||||
//profileWindow.add(profileImage);
|
//profileWindow.add(profileImage);
|
||||||
|
|
||||||
|
/* TODO: Fix server to ACTUALLY take in the username as a parameter */
|
||||||
string[] props = connection.getClient().getProperties(username);
|
string[] props = connection.getClient().getProperties(username);
|
||||||
profileWindow.add(new Label(to!(string)(props)));
|
profileBox.add(new Label(to!(string)(props)));
|
||||||
|
|
||||||
|
profileWindow.add(profileBox);
|
||||||
profileWindow.showAll();
|
profileWindow.showAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,6 +9,7 @@ import gtk.Label;
|
||||||
import gtk.Tooltip;
|
import gtk.Tooltip;
|
||||||
import gtk.Widget;
|
import gtk.Widget;
|
||||||
import std.string;
|
import std.string;
|
||||||
|
import ProfileWIndow;
|
||||||
|
|
||||||
public final class UserNode
|
public final class UserNode
|
||||||
{
|
{
|
||||||
|
@ -25,15 +26,42 @@ public final class UserNode
|
||||||
initBox();
|
initBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final class UserButton : Button
|
||||||
|
{
|
||||||
|
private string username;
|
||||||
|
|
||||||
|
this(string username)
|
||||||
|
{
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string getUsername()
|
||||||
|
{
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void userButtonClick(Button e)
|
||||||
|
{
|
||||||
|
/* The Button will only ever be a UserButton */
|
||||||
|
UserButton button = cast(UserButton)e;
|
||||||
|
|
||||||
|
/* Create a new ProfileWindow */
|
||||||
|
ProfileWindow profileWindow = new ProfileWindow(connection, button.getUsername());
|
||||||
|
}
|
||||||
|
|
||||||
private void initBox()
|
private void initBox()
|
||||||
{
|
{
|
||||||
box = new Box(GtkOrientation.HORIZONTAL, 10);
|
box = new Box(GtkOrientation.HORIZONTAL, 10);
|
||||||
|
|
||||||
/* Layout [Button (Prescence Icon)] - Label <username> */
|
/* Layout [Button (Prescence Icon)] - Label <username> */
|
||||||
Button userButton = new Button();
|
UserButton userButton = new UserButton(username);
|
||||||
Image userButtonImg = new Image("user-available", GtkIconSize.BUTTON);
|
Image userButtonImg = new Image("user-available", GtkIconSize.BUTTON);
|
||||||
userButton.setImage(userButtonImg);
|
userButton.setImage(userButtonImg);
|
||||||
|
|
||||||
|
/* Set the handler for on click */
|
||||||
|
userButton.addOnClicked(&userButtonClick);
|
||||||
|
|
||||||
/* Create a label */
|
/* Create a label */
|
||||||
Label userLabel = new Label(username);
|
Label userLabel = new Label(username);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue