Mana
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members

The server choice dialog. More...

#include <serverdialog.h>

Inheritance diagram for ServerDialog:
Window

Public Member Functions

 ServerDialog (ServerInfo *serverInfo, const std::string &dir)
 
 ~ServerDialog () override
 
void action (const gcn::ActionEvent &event) override
 Called when receiving actions from the widgets.
 
void keyPressed (gcn::KeyEvent &keyEvent) override
 
void valueChanged (const gcn::SelectionEvent &event) override
 Called when the selected value changed in the servers list box.
 
void mouseClicked (gcn::MouseEvent &mouseEvent) override
 
void logic () override
 
- Public Member Functions inherited from Window
 Window (const std::string &caption="Window", bool modal=false, Window *parent=nullptr)
 Constructor.
 
 Window (SkinType skinType, const std::string &caption="Window", bool modal=false, Window *parent=nullptr)
 Constructor that allows customizing the SkinType used by the window.
 
 ~Window () override
 Destructor.
 
void draw (gcn::Graphics *graphics) override
 Draws the window contents.
 
void drawFrame (gcn::Graphics *graphics) override
 Draws the window frame.
 
void setContentSize (int width, int height)
 Sets the size of this window.
 
void setMinimumContentSize (int width, int height)
 Sets the minimum size of the window content.
 
void setLocationRelativeTo (gcn::Widget *widget)
 Sets the location relative to the given widget.
 
void setResizable (bool resize)
 Sets whether or not the window can be resized.
 
void redraw ()
 
void widgetResized (const gcn::Event &event) override
 Called whenever the widget changes size.
 
void widgetHidden (const gcn::Event &event) override
 Called whenever the widget is hidden.
 
void setCloseButton (bool flag)
 Sets whether or not the window has a close button.
 
bool isResizable () const
 Returns whether the window can be resized.
 
void setMinWidth (int width)
 Sets the minimum width of the window.
 
int getMinWidth () const
 
void setMinHeight (int height)
 Sets the minimum height of the window.
 
int getMinHeight () const
 
void setMaxWidth (int width)
 Sets the maximum width of the window.
 
int getMaxWidth () const
 
void setMaxHeight (int height)
 Sets the minimum height of the window.
 
int getMaxHeight () const
 
void setShowTitle (bool flag)
 Sets flag to show a title or not.
 
void setStickyButton (bool flag)
 Sets whether or not the window has a sticky button.
 
void setSticky (bool sticky)
 Sets whether the window is sticky.
 
bool isSticky () const
 Returns whether the window is sticky.
 
virtual void setVisible (bool visible)
 Overloads window setVisible by Guichan to allow sticky window handling.
 
void setVisible (bool visible, bool forceSticky)
 Overloads window setVisible by Guichan to allow sticky window handling, or not, if you force the sticky state.
 
bool isDefaultVisible () const
 Returns whether the window is visible by default.
 
void setDefaultVisible (bool save)
 Sets whether the window is visible by default.
 
bool willSaveVisible () const
 Returns whether the window will save it's visibility.
 
void setSaveVisible (bool save)
 Sets whether the window will save it's visibility.
 
WindowgetParentWindow () const
 Returns the parent window.
 
void scheduleDelete ()
 Schedule this window for deletion.
 
void mousePressed (gcn::MouseEvent &event) override
 Starts window resizing when appropriate.
 
void mouseDragged (gcn::MouseEvent &event) override
 Implements window resizing and makes sure the window is not dragged/resized outside of the screen.
 
void mouseMoved (gcn::MouseEvent &event) override
 Implements custom cursor image changing context, based on mouse relative position.
 
void mouseReleased (gcn::MouseEvent &event) override
 When the mouse button has been let go, this ensures that the mouse custom cursor is restored back to it's standard image.
 
void mouseExited (gcn::MouseEvent &event) override
 When the mouse leaves the window this ensures that the custom cursor is restored back to it's standard image.
 
void setWindowName (const std::string &name)
 Sets the name of the window.
 
const std::string & getWindowName () const
 Returns the name of the window.
 
void loadWindowState ()
 Reads the position (and the size for resizable windows) in the configuration based on the given string.
 
void saveWindowState () const
 Saves the window state so that when the window is reloaded, it'll maintain its previous state and location.
 
void setDefaultSize (int defaultX, int defaultY, int defaultWidth, int defaultHeight)
 Set the default win pos and size.
 
void setDefaultSize ()
 Set the default win pos and size to the current ones.
 
void setDefaultSize (int defaultWidth, int defaultHeight, WindowAlignment alignment, int offsetx=0, int offsetY=0)
 Set the default win pos and size.
 
virtual void resetToDefaultSize ()
 Reset the win pos and size to default.
 
void adjustPositionAfterResize (int oldScreenWidth, int oldScreenHeight)
 Adjusts the window position after the application window has been resized.
 
LayoutgetLayout ()
 Gets the layout handler for this window.
 
void clearLayout ()
 Clears the window's layout (useful for redesigning the window).
 
void reflowLayout (int w=0, int h=0)
 Computes the position of the widgets according to the current layout.
 
LayoutCellplace (int x, int y, gcn::Widget *, int w=1, int h=1)
 Adds a widget to the window and sets it at given cell.
 
ContainerPlacer getPlacer (int x, int y)
 Returns a proxy for adding widgets in an inner table of the layout.
 
void center ()
 Positions the window in the center of it's parent.
 
virtual void close ()
 Overrideable functionality for when the window is to close.
 
const SkingetSkin () const
 Returns the Skin used by this window.
 

Protected Member Functions

void saveCustomServers (const ServerInfo &currentServer=ServerInfo(), int index=-1)
 Saves the new server entry in the custom server list.
 

Private Member Functions

void downloadServerList ()
 Called to load a list of available server from an online xml file.
 
void loadServers ()
 
void loadServer (XML::Node serverNode)
 
void loadCustomServers ()
 

Private Attributes

LabelmDescription
 
ButtonmQuitButton
 
ButtonmConnectButton
 
ButtonmManualEntryButton
 
ButtonmModifyButton
 
ButtonmDeleteButton
 
ListBoxmServersList
 
std::unique_ptr< ServersListModelmServersListModel
 
const std::string & mDir
 
std::unique_ptr< Net::DownloadmDownload
 
bool mDownloadDone = false
 
LabelmDownloadText
 
ServerInfos mServers
 
ServerInfomServerInfo
 

Friends

class CustomServerDialog
 

Additional Inherited Members

- Static Public Member Functions inherited from Window
static void setWindowContainer (WindowContainer *windowContainer)
 Sets the window container to be used by new windows.
 
static int getGuiAlpha ()
 Gets the alpha value used by the window, in a Guichan usable format.
 
- Static Protected Attributes inherited from Window
static int mouseResize = 0
 Active resize handles.
 

Detailed Description

The server choice dialog.

Definition at line 85 of file serverdialog.h.

Constructor & Destructor Documentation

◆ ServerDialog()

ServerDialog::ServerDialog ( ServerInfo serverInfo,
const std::string &  dir 
)

Definition at line 153 of file serverdialog.cpp.

◆ ~ServerDialog()

ServerDialog::~ServerDialog ( )
overridedefault

Member Function Documentation

◆ action()

void ServerDialog::action ( const gcn::ActionEvent &  event)
override

Called when receiving actions from the widgets.

Definition at line 225 of file serverdialog.cpp.

◆ downloadServerList()

void ServerDialog::downloadServerList ( )
private

Called to load a list of available server from an online xml file.

Definition at line 388 of file serverdialog.cpp.

◆ keyPressed()

void ServerDialog::keyPressed ( gcn::KeyEvent &  keyEvent)
override

Definition at line 307 of file serverdialog.cpp.

◆ loadCustomServers()

void ServerDialog::loadCustomServers ( )
private

Definition at line 513 of file serverdialog.cpp.

◆ loadServer()

void ServerDialog::loadServer ( XML::Node  serverNode)
private

Definition at line 430 of file serverdialog.cpp.

◆ loadServers()

void ServerDialog::loadServers ( )
private

Definition at line 405 of file serverdialog.cpp.

◆ logic()

void ServerDialog::logic ( )
override

Definition at line 348 of file serverdialog.cpp.

◆ mouseClicked()

void ServerDialog::mouseClicked ( gcn::MouseEvent &  mouseEvent)
override

Definition at line 338 of file serverdialog.cpp.

◆ saveCustomServers()

void ServerDialog::saveCustomServers ( const ServerInfo currentServer = ServerInfo(),
int  index = -1 
)
protected

Saves the new server entry in the custom server list.

Removes the given entry when the serverInfo is empty. Modifies the server entry given at index when it's not -1.

Definition at line 520 of file serverdialog.cpp.

◆ valueChanged()

void ServerDialog::valueChanged ( const gcn::SelectionEvent &  event)
override

Called when the selected value changed in the servers list box.

Definition at line 321 of file serverdialog.cpp.

Friends And Related Symbol Documentation

◆ CustomServerDialog

friend class CustomServerDialog
friend

Definition at line 111 of file serverdialog.h.

Member Data Documentation

◆ mConnectButton

Button* ServerDialog::mConnectButton
private

Definition at line 133 of file serverdialog.h.

◆ mDeleteButton

Button* ServerDialog::mDeleteButton
private

Definition at line 136 of file serverdialog.h.

◆ mDescription

Label* ServerDialog::mDescription
private

Definition at line 131 of file serverdialog.h.

◆ mDir

const std::string& ServerDialog::mDir
private

Definition at line 141 of file serverdialog.h.

◆ mDownload

std::unique_ptr<Net::Download> ServerDialog::mDownload
private

Definition at line 143 of file serverdialog.h.

◆ mDownloadDone

bool ServerDialog::mDownloadDone = false
private

Definition at line 144 of file serverdialog.h.

◆ mDownloadText

Label* ServerDialog::mDownloadText
private

Definition at line 145 of file serverdialog.h.

◆ mManualEntryButton

Button* ServerDialog::mManualEntryButton
private

Definition at line 134 of file serverdialog.h.

◆ mModifyButton

Button* ServerDialog::mModifyButton
private

Definition at line 135 of file serverdialog.h.

◆ mQuitButton

Button* ServerDialog::mQuitButton
private

Definition at line 132 of file serverdialog.h.

◆ mServerInfo

ServerInfo* ServerDialog::mServerInfo
private

Definition at line 147 of file serverdialog.h.

◆ mServers

ServerInfos ServerDialog::mServers
private

Definition at line 146 of file serverdialog.h.

◆ mServersList

ListBox* ServerDialog::mServersList
private

Definition at line 138 of file serverdialog.h.

◆ mServersListModel

std::unique_ptr<ServersListModel> ServerDialog::mServersListModel
private

Definition at line 139 of file serverdialog.h.


The documentation for this class was generated from the following files: