ManaPlus
|
#include <updaterwindow.h>
Public Member Functions | |
UpdaterWindow (const std::string &updateHost, const std::string &updatesDir, const bool applyUpdates, const UpdateTypeT updateType) | |
~UpdaterWindow () | |
void | postInit () |
void | setProgress (const float p) |
void | setLabel (const std::string &) |
void | enable () |
void | loadNews () |
void | loadPatch () |
void | action (const ActionEvent &event) |
void | keyPressed (KeyEvent &event) |
void | logic () |
void | loadFile (std::string file) |
void | deleteSelf () |
Public Member Functions inherited from Window | |
Window (const std::string &caption, const Modal modal, Window *const parent, std::string skin) | |
~Window () | |
void | draw (Graphics *const graphics) |
void | safeDraw (Graphics *const graphics) |
void | setContentSize (int width, int height) |
void | setLocationRelativeTo (const Widget *const widget) |
void | setLocationHorisontallyRelativeTo (const Widget *const widget) |
void | setLocationRelativeTo (const ImagePosition::Type &position, int offsetX, int offsetY) |
void | setResizable (const bool resize) |
void | redraw () |
void | widgetResized (const Event &event) |
void | widgetMoved (const Event &event) |
void | widgetHidden (const Event &event) |
void | setCloseButton (const bool flag) |
bool | getCloseButton () const |
void | setAllowClose (const bool b) |
bool | getAlowClose () const |
bool | isResizable () const |
void | setMinWidth (const int width) |
int | getMinWidth () const |
void | setMinHeight (const int height) |
int | getMinHeight () const |
void | setMaxWidth (const int width) |
int | getMaxWidth () const |
void | setMaxHeight (const int height) |
int | getMaxHeight () const |
void | setShowTitle (bool flag) |
void | setStickyButton (const bool flag) |
void | setSticky (const bool sticky) |
bool | isSticky () const |
void | setStickyButtonLock (const bool sticky) |
bool | isStickyButtonLock () const |
virtual void | setVisible (Visible visible) |
void | setVisible (const Visible visible, const bool forceSticky) |
bool | isDefaultVisible () const |
void | setDefaultVisible (const bool save) |
bool | willSaveVisible () const |
void | setSaveVisible (const bool save) |
Window * | getParentWindow () const |
virtual void | scheduleDelete () |
void | mousePressed (MouseEvent &event) |
void | mouseDragged (MouseEvent &event) |
void | mouseMoved (MouseEvent &event) |
void | mouseReleased (MouseEvent &event) |
void | mouseExited (MouseEvent &event) |
void | mouseEntered (MouseEvent &event) |
void | updateResizeHandler (MouseEvent &event) |
void | setWindowName (const std::string &name) |
const std::string & | getWindowName () const |
void | loadWindowState () |
void | saveWindowState () |
void | setDefaultSize (const int defaultX, const int defaultY, int defaultWidth, int defaultHeight) |
void | setDefaultSize () |
void | setDefaultSize (const int defaultWidth, const int defaultHeight, const ImagePosition::Type &position, const int offsetx, const int offsetY) |
virtual void | resetToDefaultSize () |
void | adjustPositionAfterResize (const int oldScreenWidth, const int oldScreenHeight) |
Layout & | getLayout () |
void | clearLayout () |
void | reflowLayout (int w, int h) |
LayoutCell & | place (const int x, const int y, Widget *const wg, const int w, const int h) |
ContainerPlacer | getPlacer (const int x, const int y) |
void | center () |
void | centerHorisontally () |
virtual void | close () |
void | setModal (const Modal modal) |
Rect | getWindowArea () const |
bool | isResizeAllowed (const MouseEvent &event) const |
void | setCaptionFont (Font *font) |
void | enableVisibleSound (bool b) |
bool | isWindowVisible () const |
void | setPadding (int padding) |
int | getPadding () const |
void | setTitleBarHeight (unsigned int height) |
unsigned int | getTitleBarHeight () const |
void | setCaption (const std::string &caption) |
const std::string & | getCaption () const |
void | setAlignment (Graphics::Alignment alignment) |
Graphics::Alignment | getAlignment () const |
void | setMovable (Move movable) |
bool | isMovable () const |
Rect | getChildrenArea () |
virtual void | resizeToContent () |
Public Member Functions inherited from BasicContainer2 | |
BasicContainer2 (const Widget2 *const widget) | |
~BasicContainer2 () | |
void | setOpaque (Opaque opaque) |
bool | isOpaque () const |
virtual void | add (Widget *const widget) |
void | addXY (Widget *const widget, const int x, const int y) |
Public Member Functions inherited from BasicContainer | |
BasicContainer (const Widget2 *const widget) | |
~BasicContainer () | |
void | showWidgetPart (Widget *const widget, const Rect &area) |
void | moveToTop (Widget *const widget) |
void | moveToBottom (Widget *const widget) |
void | focusNext () |
void | focusPrevious () |
void | setFocusHandler (FocusHandler *const focusHandler) |
void | setInternalFocusHandler (FocusHandler *const focusHandler) |
Widget * | getWidgetAt (int x, int y) |
void | death (const Event &event) |
Widget * | findFirstWidget (const std::set< Widget * > &list) |
void | add (Widget *const widget) |
virtual void | remove (Widget *const widget) |
virtual void | clear () |
Public Member Functions inherited from Widget | |
Widget (const Widget2 *const widget) | |
~Widget () | |
virtual void | drawFrame (Graphics *graphics) |
virtual void | safeDrawFrame (Graphics *graphics) |
void | setFrameSize (const unsigned int frameSize) |
unsigned int | getFrameSize () const |
Widget * | getParent () const |
void | setWidth (const int width) |
int | getWidth () const |
void | setHeight (const int height) |
int | getHeight () const |
void | setSize (const int width, const int height) |
void | setX (const int x) |
int | getX () const |
void | setY (const int y) |
int | getY () const |
void | setPosition (const int x, const int y) |
void | setDimension (const Rect &dimension) |
const Rect & | getDimension () const |
void | setFocusable (const bool focusable) |
bool | isFocusable () const |
virtual bool | isFocused () const |
void | setEnabled (const bool enabled) |
bool | isEnabled () const |
void | setVisible (Visible visible) |
bool | isVisible () const |
void | setBaseColor (const Color &color) |
const Color & | getBaseColor () const |
void | setForegroundColor (const Color &color) |
const Color & | getForegroundColor () const |
void | setBackgroundColor (const Color &color) |
const Color & | getBackgroundColor () const |
virtual void | requestFocus () |
virtual void | requestMoveToTop () |
virtual void | requestMoveToBottom () |
FocusHandler * | getFocusHandler () |
void | addActionListener (ActionListener *const actionListener) |
void | removeActionListener (ActionListener *const actionListener) |
void | addDeathListener (WidgetDeathListener *const deathListener) |
void | removeDeathListener (WidgetDeathListener *const deathListener) |
void | addMouseListener (MouseListener *const mouseListener) |
void | removeMouseListener (MouseListener *const mouseListener) |
void | addKeyListener (KeyListener *const keyListener) |
void | removeKeyListener (KeyListener *const keyListener) |
void | addFocusListener (FocusListener *const focusListener) |
void | removeFocusListener (FocusListener *const focusListener) |
void | addWidgetListener (WidgetListener *const widgetListener) |
void | removeWidgetListener (WidgetListener *const widgetListener) |
void | setActionEventId (const std::string &actionEventId) |
const std::string & | getActionEventId () const |
virtual void | getAbsolutePosition (int &x, int &y) const |
virtual void | setParent (Widget *parent) |
Font * | getFont () const |
void | setFont (Font *const font) |
virtual void | fontChanged () |
bool | isTabInEnabled () const |
void | setTabInEnabled (const bool enabled) |
bool | isTabOutEnabled () const |
void | setTabOutEnabled (const bool enabled) |
void | requestModalFocus () |
virtual void | requestModalMouseInputFocus () |
virtual void | releaseModalFocus () |
virtual void | releaseModalMouseInputFocus () |
virtual bool | isModalFocused () const |
virtual bool | isModalMouseInputFocused () const |
const std::list< MouseListener * > & | getMouseListeners () const A_CONST |
const std::list< KeyListener * > & | getKeyListeners () const A_CONST |
const std::list< FocusListener * > & | getFocusListeners () const A_CONST |
virtual FocusHandler * | getInternalFocusHandler () |
void | setInternalFocusHandler (FocusHandler *const internalFocusHandler) |
void | setId (const std::string &id) |
const std::string & | getId () const |
virtual void | showPart (const Rect &rectangle) |
bool | isAllowLogic () const |
void | setMouseConsume (const bool b) |
bool | isMouseConsume () const |
void | setRedraw (const bool b) |
virtual bool | isSelectable () const |
void | setSelectable (const bool selectable) |
void | windowResized () |
Public Member Functions inherited from Widget2 | |
virtual | ~Widget2 () |
const Color & | getThemeColor (const ThemeColorIdT type, const unsigned int alpha) const A_INLINE |
const Color & | getThemeCharColor (const signed char c, bool &valid) const A_INLINE |
virtual void | setWidget2 (const Widget2 *const widget) |
void | setPalette (int palette) |
void | checkPalette () |
void | setForegroundColor2 (const Color &color) |
Widget * | getWindow () const |
virtual void | setWindow (Widget *const window) |
Public Member Functions inherited from WidgetDeathListener | |
virtual | ~WidgetDeathListener () |
Public Member Functions inherited from MouseListener | |
virtual | ~MouseListener () |
virtual void | mouseClicked (MouseEvent &event) |
virtual void | mouseWheelMovedUp (MouseEvent &event) |
virtual void | mouseWheelMovedDown (MouseEvent &event) |
Public Member Functions inherited from WidgetListener | |
virtual | ~WidgetListener () |
virtual void | widgetShown (const Event &event) |
Public Member Functions inherited from ActionListener | |
virtual | ~ActionListener () |
Public Member Functions inherited from KeyListener | |
virtual | ~KeyListener () |
virtual void | keyReleased (KeyEvent &event) |
Static Public Member Functions | |
static void | loadLocalUpdates (const std::string &dir) |
static void | unloadUpdates (const std::string &dir) |
static void | addUpdateFile (const std::string &path, const std::string &fixPath, const std::string &file, const Append append) |
static void | removeUpdateFile (const std::string &path, const std::string &fixPath, const std::string &filerestrict) |
static void | loadManaPlusUpdates (const std::string &dir) |
static void | unloadManaPlusUpdates (const std::string &dir) |
static unsigned long | getFileHash (const std::string &filePath) |
static void | loadMods (const std::string &dir, const std::vector< UpdateFile > &updateFiles) |
static void | loadDirMods (const std::string &dir) |
static void | unloadMods (const std::string &dir) |
Static Public Member Functions inherited from Window | |
static void | setWindowContainer (WindowContainer *const windowContainer) |
Static Public Member Functions inherited from Widget | |
static void | setGlobalFont (Font *const font) |
static Font * | getGloablFont () |
static void | cleanGlobalFont () |
static bool | widgetExists (const Widget *const widget) |
static void | distributeWindowResizeEvent () |
static Widget * | callPostInit (Widget *const widget) |
Private Member Functions | |
void | download () |
void | loadUpdates () |
Static Private Member Functions | |
static int | updateProgress (void *ptr, const DownloadStatusT status, size_t dt, const size_t dn) |
static size_t | memoryWrite (void *ptr, size_t size, size_t nmemb, void *stream) |
static bool | validateFile (const std::string &filePath, const unsigned long hash) |
Private Attributes | |
float | mDownloadProgress |
std::string | mUpdateHost |
std::string | mUpdatesDir |
std::string | mUpdatesDirReal |
std::string | mCurrentFile |
std::string | mNewLabelCaption |
Mutex | mDownloadMutex |
unsigned long | mCurrentChecksum |
char * | mMemoryBuffer |
Net::Download * | mDownload |
std::vector< UpdateFile > | mUpdateFiles |
std::vector< UpdateFile > | mTempUpdateFiles |
std::string | mUpdateServerPath |
ItemLinkHandler * | mItemLinkHandler |
Label * | mLabel |
Button * | mCancelButton |
Button * | mPlayButton |
ProgressBar * | mProgressBar |
StaticBrowserBox * | mBrowserBox |
ScrollArea * | mScrollArea |
UpdateDownloadStatusT | mDownloadStatus |
int | mDownloadedBytes |
unsigned int | mUpdateIndex |
unsigned int | mUpdateIndexOffset |
UpdateTypeT | mUpdateType |
bool | mStoreInMemory |
bool | mDownloadComplete |
bool | mUserCancel |
bool | mLoadUpdates |
bool | mValidateXml |
bool | mSkipPatches |
Additional Inherited Members | |
Data Fields inherited from Widget | |
Visible | mVisible |
Protected Types inherited from BasicContainer | |
typedef std::vector< Widget * > | WidgetList |
typedef WidgetList::iterator | WidgetListIterator |
typedef WidgetList::const_iterator | WidgetListConstIterator |
typedef WidgetList::reverse_iterator | WidgetListReverseIterator |
typedef WidgetList::const_reverse_iterator | WidgetListCReverseIterator |
Protected Types inherited from Widget | |
typedef std::list< MouseListener * > | MouseListenerList |
typedef MouseListenerList::iterator | MouseListenerIterator |
typedef std::list< KeyListener * > | KeyListenerList |
typedef KeyListenerList::iterator | KeyListenerIterator |
typedef std::list< ActionListener * > | ActionListenerList |
typedef ActionListenerList::iterator | ActionListenerIterator |
typedef std::list< WidgetDeathListener * > | WidgetDeathListenerList |
typedef WidgetDeathListenerList::iterator | WidgetDeathListenerIterator |
typedef std::list< FocusListener * > | FocusListenerList |
typedef FocusListenerList::iterator | FocusListenerIterator |
typedef std::list< WidgetListener * > | WidgetListenerList |
typedef WidgetListenerList::iterator | WidgetListenerIterator |
Protected Member Functions inherited from Window | |
bool | canMove () const |
int | getOption (const std::string &name, const int def) const |
bool | getOptionBool (const std::string &name, const bool def) const |
void | setTitlePadding (const int p) |
int | getTitlePadding () const |
Protected Member Functions inherited from BasicContainer | |
virtual void | drawChildren (Graphics *const graphics) |
virtual void | safeDrawChildren (Graphics *const graphics) |
virtual void | logicChildren () |
Protected Member Functions inherited from Widget | |
void | distributeActionEvent () |
void | distributeResizedEvent () |
void | distributeMovedEvent () |
void | distributeHiddenEvent () |
void | distributeShownEvent () |
Protected Member Functions inherited from Widget2 | |
Widget2 (const Widget2 *const widget) | |
Protected Member Functions inherited from WidgetDeathListener | |
WidgetDeathListener () | |
Protected Member Functions inherited from MouseListener | |
MouseListener () | |
Protected Member Functions inherited from WidgetListener | |
WidgetListener () | |
Protected Member Functions inherited from ActionListener | |
ActionListener () | |
Protected Member Functions inherited from KeyListener | |
KeyListener () | |
Protected Attributes inherited from Window | |
std::string | mCaption |
Graphics::Alignment | mAlignment |
int | mPadding |
unsigned int | mTitleBarHeight |
Move | mMovable |
int | mDragOffsetX |
int | mDragOffsetY |
bool | mMoved |
Skin * | mSkin |
int | mDefaultX |
int | mDefaultY |
int | mDefaultWidth |
int | mDefaultHeight |
int | mCaptionOffsetX |
int | mCaptionOffsetY |
bool | mShowTitle |
bool | mLastRedraw |
Protected Attributes inherited from BasicContainer2 | |
Opaque | mOpaque |
Protected Attributes inherited from BasicContainer | |
WidgetList | mWidgets |
WidgetList | mLogicWidgets |
Protected Attributes inherited from Widget | |
MouseListenerList | mMouseListeners |
KeyListenerList | mKeyListeners |
ActionListenerList | mActionListeners |
WidgetDeathListenerList | mDeathListeners |
FocusListenerList | mFocusListeners |
WidgetListenerList | mWidgetListeners |
Color | mForegroundColor |
Color | mBackgroundColor |
Color | mBaseColor |
Rect | mDimension |
std::string | mActionEventId |
std::string | mId |
FocusHandler * | mFocusHandler |
FocusHandler * | mInternalFocusHandler |
Widget * | mParent |
Font * | mCurrentFont |
unsigned int | mFrameSize |
bool | mFocusable |
bool | mTabIn |
bool | mTabOut |
bool | mEnabled |
bool | mAllowLogic |
bool | mMouseConsume |
bool | mRedraw |
bool | mSelectable |
Protected Attributes inherited from Widget2 | |
int | mPaletteOffset |
Widget * | mWindow |
Color | mForegroundColor2 |
Static Protected Attributes inherited from Widget | |
static Font * | mGlobalFont = 0 |
Update progress window GUI
Definition at line 60 of file updaterwindow.h.
UpdaterWindow::UpdaterWindow | ( | const std::string & | updateHost, |
const std::string & | updatesDir, | ||
const bool | applyUpdates, | ||
const UpdateTypeT | updateType | ||
) |
Constructor.
updateHost | Host where to get the updated files. |
updatesDir | Directory where to store updates (should be absolute and already created). |
applyUpdates | If true, the update window will pass the updates to teh resource manager. |
Definition at line 170 of file updaterwindow.cpp.
References Widget::addKeyListener(), ImagePosition::CENTER, Window::getLayout(), Window::getPlacer(), Window::loadWindowState(), mBrowserBox, mCancelButton, mItemLinkHandler, mLabel, mPlayButton, mProgressBar, mScrollArea, mSkipPatches, mUpdateHost, Opaque_false, LayoutType::SET, Window::setDefaultSize(), Widget::setEnabled(), StaticBrowserBox::setEnableImages(), StaticBrowserBox::setEnableKeys(), StaticBrowserBox::setEnableTabs(), StaticBrowserBox::setLinkHandler(), Window::setMinHeight(), Window::setMinWidth(), StaticBrowserBox::setOpaque(), StaticBrowserBox::setProcessVars(), Window::setResizable(), LayoutCell::setRowHeight(), ProgressBar::setSmoothProgress(), settings, Window::setWindowName(), and Settings::updateMirrors.
UpdaterWindow::~UpdaterWindow | ( | ) |
Destructor
Definition at line 267 of file updaterwindow.cpp.
References Net::Download::cancel, delete2, loadUpdates(), mDownload, mItemLinkHandler, mLoadUpdates, and mMemoryBuffer.
|
virtual |
Called when an action is recieved from a widget. It is used to be able to recieve a notification that an action has occured.
actionEvent | The event of the action. |
Implements ActionListener.
Definition at line 313 of file updaterwindow.cpp.
References Net::Download::cancel, client, deleteSelf(), State::GAME, Client::getState(), State::LOAD_DATA, mDownload, mDownloadStatus, mUserCancel, Client::setState(), UpdateDownloadStatus::UPDATE_COMPLETE, and UpdateDownloadStatus::UPDATE_ERROR.
Referenced by keyPressed().
|
static |
Definition at line 800 of file updaterwindow.cpp.
References Append_false, Append_true, VirtFs::mountZip(), and pathJoin().
Referenced by loadLocalUpdates(), loadMods(), and loadUpdates().
void UpdaterWindow::deleteSelf | ( | ) |
Definition at line 1220 of file updaterwindow.cpp.
References Window::scheduleDelete(), and updaterWindow.
Referenced by action(), enable(), and keyPressed().
|
private |
Definition at line 581 of file updaterwindow.cpp.
References Net::Download::addMirror(), branding, Net::Download::cancel, FOR_EACH, Configuration::getStringValue(), mCurrentChecksum, mCurrentFile, mDownload, mDownloadComplete, mDownloadStatus, memoryWrite(), mStoreInMemory, mUpdateHost, mUpdatesDir, mUpdateServerPath, mValidateXml, Net::Download::noCache(), pathJoin(), Net::Download::setFile(), setLabel(), settings, Net::Download::setWriteFunction(), Net::Download::start(), Catch::toString(), UpdateDownloadStatus::UPDATE_LIST2, UpdateDownloadStatus::UPDATE_PATCH, UpdateDownloadStatus::UPDATE_RESOURCES, UpdateDownloadStatus::UPDATE_RESOURCES2, Settings::updateMirrors, updateProgress(), updateServer3(), updateServer4(), updateServer5(), Actions::url(), and urlJoin().
Referenced by logic(), and postInit().
void UpdaterWindow::enable | ( | ) |
Enables play button
Definition at line 296 of file updaterwindow.cpp.
References client, UpdateType::Close, deleteSelf(), State::GAME, Client::getState(), State::LOAD_DATA, mCancelButton, mPlayButton, mUpdateType, Widget::requestFocus(), Widget::setEnabled(), and Client::setState().
Referenced by logic().
|
static |
Definition at line 1085 of file updaterwindow.cpp.
References Net::Download::adlerBuffer(), VirtFs::loadFile(), and EmoteDB::size().
Referenced by LocalPlayer::setTestParticle(), and LocalPlayer::slowLogic().
|
virtual |
Called if a key is pressed when the widget has keyboard focus. If a key is held down the widget will generate multiple key presses.
event | Discribes the event. |
Reimplemented from KeyListener.
Definition at line 337 of file updaterwindow.cpp.
References action(), client, deleteSelf(), State::GAME, Widget::getActionEventId(), Client::getState(), InputAction::GUI_CANCEL, InputAction::GUI_SELECT, InputAction::GUI_SELECT2, State::LOGIN, mCancelButton, mDownloadStatus, mPlayButton, Client::setState(), UpdateDownloadStatus::UPDATE_COMPLETE, UpdateDownloadStatus::UPDATE_ERROR, and UpdateDownloadStatus::UPDATE_IDLE.
|
static |
Definition at line 1171 of file updaterwindow.cpp.
References Append_false, FOR_EACH, ModDB::getAll(), ModInfo::getLocalDir(), ConfigurationObject::getValue(), ModDB::load(), VirtFs::mountDir(), pathJoin(), serverConfig, and splitToStringVector().
Referenced by loadMods().
void UpdaterWindow::loadFile | ( | std::string | file | ) |
Definition at line 1096 of file updaterwindow.cpp.
References StaticBrowserBox::addRow(), StaticBrowserBox::clearRows(), Files::loadTextFileLocal(), mBrowserBox, mUpdatesDir, Catch::trim(), and StaticBrowserBox::updateHeight().
|
static |
Definition at line 688 of file updaterwindow.cpp.
References addUpdateFile(), Append_false, CAST_U32, UpdateFile::group, loadManaPlusUpdates(), loadMods(), loadTxtFile(), loadXMLFile(), Logger::log(), logger, UpdateFile::name, pathJoin(), txtUpdateFile(), and xmlUpdateFile().
|
static |
Definition at line 746 of file updaterwindow.cpp.
References Append_false, CAST_U32, fileName, UpdateFile::group, loadXMLFile(), VirtFs::mountZip(), UpdateFile::name, pathJoin(), strStartWith(), and xmlUpdateFile().
Referenced by loadLocalUpdates(), and loadUpdates().
|
static |
Definition at line 1109 of file updaterwindow.cpp.
References addUpdateFile(), Append_false, CAST_U32, fileName, ConfigurationObject::getValue(), UpdateFile::group, ModDB::load(), loadDirMods(), loadXMLFile(), VirtFs::mountZip(), UpdateFile::name, pathJoin(), serverConfig, splitToStringSet(), strStartWith(), and xmlUpdateFile().
Referenced by loadLocalUpdates(), and loadUpdates().
void UpdaterWindow::loadNews | ( | ) |
Loads and display news. Assumes the news file contents have been loaded into the memory buffer.
Definition at line 364 of file updaterwindow.cpp.
References _, StaticBrowserBox::addRow(), StaticBrowserBox::clearRows(), Logger::log1(), logger, mBrowserBox, mDownloadedBytes, mkdir_r(), mMemoryBuffer, mScrollArea, mUpdatesDir, ScrollArea::setVerticalScrollAmount(), and StaticBrowserBox::updateHeight().
Referenced by logic().
void UpdaterWindow::loadPatch | ( | ) |
Definition at line 433 of file updaterwindow.cpp.
References StaticBrowserBox::addRow(), branding, CHECK_VERSION, Configuration::getStringValue(), Logger::log1(), logger, mBrowserBox, mDownloadedBytes, mMemoryBuffer, mScrollArea, serverVersion, ScrollArea::setVerticalScrollAmount(), strprintf(), StaticBrowserBox::updateHeight(), and Actions::url().
Referenced by logic().
|
private |
Loads the updates this window has gotten into the resource manager
Definition at line 656 of file updaterwindow.cpp.
References addUpdateFile(), Append_false, CAST_U32, UpdateFile::group, loadManaPlusUpdates(), loadMods(), loadTxtFile(), loadXMLFile(), Logger::log(), logger, mUpdateFiles, mUpdateIndex, mUpdatesDir, UpdateFile::name, pathJoin(), txtUpdateFile(), and xmlUpdateFile().
Referenced by ~UpdaterWindow().
|
virtual |
Called for all widgets in the gui each time Gui::logic is called. You can do logic stuff here like playing an animation.
Reimplemented from BasicContainer.
Definition at line 829 of file updaterwindow.cpp.
References _, StaticBrowserBox::addRow(), Label::adjustSize(), BLOCK_END, BLOCK_START, CAST_S32, CAST_SIZE, CAST_U32, config, download(), enable(), Configuration::getBoolValue(), Label::getCaption(), Net::Download::getError(), ScrollArea::getVerticalMaxScroll(), UpdateFile::hash, loadNews(), loadPatch(), loadTxtFile(), loadXMLFile(), Logger::log(), logger, ScrollArea::logic(), mBrowserBox, mCurrentChecksum, mCurrentFile, mDownload, mDownloadComplete, mDownloadMutex, mDownloadProgress, mDownloadStatus, mLabel, mNewLabelCaption, mProgressBar, mScrollArea, mSkipPatches, mStoreInMemory, mTempUpdateFiles, mUpdateFiles, mUpdateHost, mUpdateIndex, mUpdateIndexOffset, mUpdatesDir, mUpdatesDirReal, mUpdateServerPath, mValidateXml, UpdateFile::name, pathJoin(), Label::setCaption(), setLabel(), ProgressBar::setProgress(), ProgressBar::setText(), ScrollArea::setVerticalScrollAmount(), strprintf(), Catch::toString(), txtUpdateFile(), UpdateFile::type, UpdateDownloadStatus::UPDATE_COMPLETE, UpdateDownloadStatus::UPDATE_ERROR, UpdateDownloadStatus::UPDATE_IDLE, UpdateDownloadStatus::UPDATE_LIST, UpdateDownloadStatus::UPDATE_LIST2, UpdateDownloadStatus::UPDATE_NEWS, UpdateDownloadStatus::UPDATE_PATCH, UpdateDownloadStatus::UPDATE_RESOURCES, UpdateDownloadStatus::UPDATE_RESOURCES2, StaticBrowserBox::updateHeight(), updateServer2(), validateFile(), and xmlUpdateFile().
|
staticprivate |
A libcurl callback for writing to memory.
Definition at line 563 of file updaterwindow.cpp.
References CAST_S32, CAST_SIZE, mDownloadedBytes, mMemoryBuffer, and EmoteDB::size().
Referenced by download().
|
virtual |
Reimplemented from Window.
Definition at line 257 of file updaterwindow.cpp.
References download(), mCancelButton, mUpdateServerPath, Window::postInit(), removeProtocol(), Widget::requestFocus(), Window::setVisible(), and Visible_true.
|
static |
Definition at line 818 of file updaterwindow.cpp.
References pathJoin(), and VirtFs::unmountZip().
Referenced by unloadUpdates().
void UpdaterWindow::setLabel | ( | const std::string & | str | ) |
Set's label above progress
Definition at line 289 of file updaterwindow.cpp.
References mDownloadMutex, and mNewLabelCaption.
Referenced by download(), logic(), and updateProgress().
void UpdaterWindow::setProgress | ( | const float | p | ) |
Set's progress bar status
Definition at line 282 of file updaterwindow.cpp.
References mDownloadMutex, and mDownloadProgress.
Referenced by updateProgress().
|
static |
Definition at line 776 of file updaterwindow.cpp.
References CAST_U32, loadXMLFile(), pathJoin(), strStartWith(), VirtFs::unmountZip(), and xmlUpdateFile().
Referenced by unloadUpdates().
|
static |
Definition at line 1198 of file updaterwindow.cpp.
References FOR_EACH, ModDB::getAll(), ModInfo::getLocalDir(), ConfigurationObject::getValue(), pathJoin(), serverConfig, splitToStringVector(), and VirtFs::unmountDir().
|
static |
Definition at line 721 of file updaterwindow.cpp.
References CAST_U32, loadTxtFile(), loadXMLFile(), pathJoin(), removeUpdateFile(), txtUpdateFile(), unloadManaPlusUpdates(), and xmlUpdateFile().
Referenced by Client::unloadData().
|
staticprivate |
A download callback for progress updates.
Definition at line 503 of file updaterwindow.cpp.
References DownloadStatus::Cancelled, CAST_S32, client, DownloadStatus::Complete, DownloadStatus::Error, State::GAME, Client::getState(), mCurrentFile, mDownloadComplete, mDownloadStatus, mMemoryBuffer, setLabel(), setProgress(), Catch::toString(), State::UPDATE, UpdateDownloadStatus::UPDATE_COMPLETE, UpdateDownloadStatus::UPDATE_ERROR, and UpdateDownloadStatus::UPDATE_NEWS.
Referenced by download().
|
staticprivate |
Definition at line 1073 of file updaterwindow.cpp.
References Net::Download::fadler32().
Referenced by logic().
|
private |
Definition at line 215 of file updaterwindow.h.
Referenced by loadFile(), loadNews(), loadPatch(), logic(), and UpdaterWindow().
|
private |
Definition at line 212 of file updaterwindow.h.
Referenced by enable(), keyPressed(), postInit(), and UpdaterWindow().
|
private |
The Adler32 checksum of the file currently downloading.
Definition at line 194 of file updaterwindow.h.
Referenced by download(), and logic().
|
private |
The file currently downloading.
Definition at line 184 of file updaterwindow.h.
Referenced by download(), logic(), and updateProgress().
|
private |
Download handle.
Definition at line 200 of file updaterwindow.h.
Referenced by action(), download(), logic(), and ~UpdaterWindow().
|
private |
Flag that show if current download is complete.
Definition at line 238 of file updaterwindow.h.
Referenced by download(), logic(), and updateProgress().
|
private |
Byte count currently downloaded in mMemoryBuffer.
Definition at line 222 of file updaterwindow.h.
Referenced by loadNews(), loadPatch(), and memoryWrite().
|
private |
Definition at line 191 of file updaterwindow.h.
Referenced by logic(), setLabel(), and setProgress().
|
private |
The new progress value to be set in the logic method.
Definition at line 173 of file updaterwindow.h.
Referenced by logic(), and setProgress().
|
private |
Status of the current download.
Definition at line 219 of file updaterwindow.h.
Referenced by action(), download(), keyPressed(), logic(), and updateProgress().
|
private |
Definition at line 210 of file updaterwindow.h.
Referenced by UpdaterWindow(), and ~UpdaterWindow().
|
private |
Definition at line 211 of file updaterwindow.h.
Referenced by logic(), and UpdaterWindow().
|
private |
Tells ~UpdaterWindow() if it should load updates
Definition at line 244 of file updaterwindow.h.
Referenced by ~UpdaterWindow().
|
private |
Buffer for files downloaded to memory.
Definition at line 197 of file updaterwindow.h.
Referenced by loadNews(), loadPatch(), memoryWrite(), updateProgress(), and ~UpdaterWindow().
|
private |
The new label caption to be set in the logic method.
Definition at line 187 of file updaterwindow.h.
Referenced by logic(), and setLabel().
|
private |
Definition at line 213 of file updaterwindow.h.
Referenced by enable(), keyPressed(), and UpdaterWindow().
|
private |
Definition at line 214 of file updaterwindow.h.
Referenced by logic(), and UpdaterWindow().
|
private |
Definition at line 216 of file updaterwindow.h.
Referenced by loadNews(), loadPatch(), logic(), and UpdaterWindow().
|
private |
Definition at line 248 of file updaterwindow.h.
Referenced by logic(), and UpdaterWindow().
|
private |
A flag to indicate whether to use a memory buffer or a regular file.
Definition at line 235 of file updaterwindow.h.
Referenced by download(), and logic().
|
private |
List of temp files to download.
Definition at line 206 of file updaterwindow.h.
Referenced by logic().
|
private |
List of files to download.
Definition at line 203 of file updaterwindow.h.
Referenced by loadUpdates(), and logic().
|
private |
Host where we get the updated files.
Definition at line 176 of file updaterwindow.h.
Referenced by download(), logic(), and UpdaterWindow().
|
private |
Index of the file to be downloaded.
Definition at line 225 of file updaterwindow.h.
Referenced by loadUpdates(), and logic().
|
private |
Index offset for disaplay downloaded file.
Definition at line 228 of file updaterwindow.h.
Referenced by logic().
|
private |
Place where the updates are stored (absolute path).
Definition at line 179 of file updaterwindow.h.
Referenced by download(), loadFile(), loadNews(), loadUpdates(), and logic().
|
private |
Definition at line 181 of file updaterwindow.h.
Referenced by logic().
|
private |
Definition at line 208 of file updaterwindow.h.
Referenced by download(), logic(), and postInit().
|
private |
Definition at line 230 of file updaterwindow.h.
Referenced by enable().
|
private |
Flag that show if the user has canceled the update.
Definition at line 241 of file updaterwindow.h.
Referenced by action().
|
private |
Definition at line 246 of file updaterwindow.h.
Referenced by download(), and logic().