Added some fixes

More work on update window.


git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@700 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
coppro
2007-09-15 03:38:54 +00:00
parent 420e95ba1f
commit 99d385eb00
13 changed files with 90 additions and 32 deletions
+2 -1
View File
@@ -32,6 +32,7 @@ String card_rarity_code(const String& rarity);
class WithProgress {
public:
virtual void onProgress(float progress, const String& message) = 0;
virtual ~WithProgress () {}
};
/// Exception thrown to indicate exporting should be aborted
@@ -64,7 +65,7 @@ void ExportProgressDialog::onProgress(float progress, const String& message) {
class ApprDatabase {
public:
ApprDatabase(WithProgress* progress_target, const String& name);
~ApprDatabase();
virtual ~ApprDatabase();
/// Read the database
void read();
+14
View File
@@ -9,9 +9,23 @@
// ----------------------------------------------------------------------------- : Includes
#include <data/settings.hpp>
#include <util/prec.hpp>
#include <util/io/package.hpp>
// ----------------------------------------------------------------------------- : InstallType
// Platform default install directory.
#ifdef __WXMSW__
#define DEFAULT_INSTALL_LOCAL false
#else
#define DEFAULT_INSTALL_LOCAL true
#endif
inline bool isInstallLocal(const InstallType& type)
{
return type == INSTALL_DEFAULT ? DEFAULT_INSTALL_LOCAL : type == INSTALL_LOCAL;
}
// ----------------------------------------------------------------------------- : Installer
/// A package that contains other packages that can be installed
+9
View File
@@ -7,6 +7,7 @@
// ----------------------------------------------------------------------------- : Includes
#include <data/settings.hpp>
#include <data/installer.hpp>
#include <data/game.hpp>
#include <data/stylesheet.hpp>
#include <data/field.hpp>
@@ -31,6 +32,12 @@ IMPLEMENT_REFLECTION_ENUM(CheckUpdates) {
VALUE_N("never", CHECK_NEVER);
}
IMPLEMENT_REFLECTION_ENUM(InstallType) {
VALUE_N("default", INSTALL_DEFAULT); //default
VALUE_N("local", INSTALL_LOCAL);
VALUE_N("global", INSTALL_GLOBAL);
}
IMPLEMENT_REFLECTION_ENUM(FilenameConflicts) {
VALUE_N("keep old", CONFLICT_KEEP_OLD);
VALUE_N("overwrite", CONFLICT_OVERWRITE);
@@ -135,6 +142,7 @@ Settings::Settings()
, symbol_grid_snap (false)
, updates_url (_("http://magicseteditor.sourceforge.net/updates"))
, check_updates (CHECK_IF_CONNECTED)
, install_type (INSTALL_DEFAULT)
, website_url (_("http://magicseteditor.sourceforge.net/"))
{}
@@ -212,6 +220,7 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(Settings) {
REFLECT(apprentice_location);
REFLECT(updates_url);
REFLECT(check_updates);
REFLECT(install_type);
REFLECT(website_url);
REFLECT(game_settings);
REFLECT(stylesheet_settings);
+12
View File
@@ -33,6 +33,15 @@ enum CheckUpdates
, CHECK_NEVER
};
/// Where to install to?
enum InstallType
{ INSTALL_DEFAULT // the platform default.
, INSTALL_LOCAL // install to the user's files
, INSTALL_GLOBAL // install to the global files
};
bool parse_enum(const String&, InstallType&);
/// How to handle filename conflicts
enum FilenameConflicts
{ CONFLICT_KEEP_OLD // always keep old file
@@ -161,6 +170,9 @@ class Settings {
CheckUpdates check_updates;
String website_url;
// --------------------------------------------------- : Installation settings
InstallType install_type;
// --------------------------------------------------- : The io
/// Read the settings file from the standard location