summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2009-12-19 17:54:03 -0500
committerChuck Miller <shadowmil@gmail.com>2009-12-19 17:54:03 -0500
commitd93d83cec0e4232924a098b11f391abcf903075e (patch)
treeba848c6273295ffec244adde569ea7eb64d08786 /src
parentcbc14c8a3c6614987d2331057e114d92336cbac0 (diff)
downloadmana-client-d93d83cec0e4232924a098b11f391abcf903075e.tar.gz
mana-client-d93d83cec0e4232924a098b11f391abcf903075e.tar.bz2
mana-client-d93d83cec0e4232924a098b11f391abcf903075e.tar.xz
mana-client-d93d83cec0e4232924a098b11f391abcf903075e.zip
Fixes functionality change broke in cbc14c8a3c6614987d2331057e114d92336cbac0, where updates are loaded even if the -d option is given
Diffstat (limited to 'src')
-rw-r--r--src/gui/updatewindow.cpp10
-rw-r--r--src/gui/updatewindow.h8
-rw-r--r--src/main.cpp2
3 files changed, 15 insertions, 5 deletions
diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp
index 600c0bfd..394db9cf 100644
--- a/src/gui/updatewindow.cpp
+++ b/src/gui/updatewindow.cpp
@@ -119,7 +119,8 @@ std::vector<updateFile> loadTxtFile(const std::string &fileName)
}
UpdaterWindow::UpdaterWindow(const std::string &updateHost,
- const std::string &updatesDir):
+ const std::string &updatesDir,
+ bool applyUpdates):
Window(_("Updating...")),
mDownloadStatus(UPDATE_NEWS),
mUpdateHost(updateHost),
@@ -133,7 +134,8 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost,
mDownloadedBytes(0),
mMemoryBuffer(NULL),
mDownload(NULL),
- mUpdateIndex(0)
+ mUpdateIndex(0),
+ mLoadUpdates(applyUpdates)
{
mBrowserBox = new BrowserBox;
mScrollArea = new ScrollArea(mBrowserBox);
@@ -172,7 +174,9 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost,
UpdaterWindow::~UpdaterWindow()
{
- loadUpdates();
+ if (mLoadUpdates)
+ loadUpdates();
+
if (mDownload)
{
mDownload->cancel();
diff --git a/src/gui/updatewindow.h b/src/gui/updatewindow.h
index 55415938..e0712d61 100644
--- a/src/gui/updatewindow.h
+++ b/src/gui/updatewindow.h
@@ -64,9 +64,12 @@ class UpdaterWindow : public Window, public gcn::ActionListener,
* @param updateHost Host where to get the updated files.
* @param updatesDir Directory where to store updates (should be absolute
* and already created).
+ * @param applyUpdates If true, the update window will pass the updates to teh
+ * resource manager
*/
UpdaterWindow(const std::string &updateHost,
- const std::string &updatesDir);
+ const std::string &updatesDir,
+ bool applyUpdates);
/**
* Destructor
@@ -181,6 +184,9 @@ private:
/** Index of the file to be downloaded. */
unsigned int mUpdateIndex;
+ /** Tells ~UpdaterWindow() if it should load updates */
+ bool mLoadUpdates;
+
gcn::Label *mLabel; /**< Progress bar caption. */
Button *mCancelButton; /**< Button to stop the update process. */
Button *mPlayButton; /**< Button to start playing. */
diff --git a/src/main.cpp b/src/main.cpp
index cd5e7ba3..016dfe9e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1009,7 +1009,7 @@ int main(int argc, char *argv[])
{
logger->log("State: UPDATE");
currentDialog = new UpdaterWindow(updateHost,
- homeDir + "/" + updatesDir);
+ homeDir + "/" + updatesDir,options.dataPath.empty());
}
break;