mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
- no longer try to draw fields with huge or negative size
- download icons of packages git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@799 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -456,8 +456,6 @@ label:
|
|||||||
|
|
||||||
# Packages window
|
# Packages window
|
||||||
package name: Package
|
package name: Package
|
||||||
package installed version: Installed version
|
|
||||||
package remote version: Latest version
|
|
||||||
package status: Status
|
package status: Status
|
||||||
package action: Action
|
package action: Action
|
||||||
|
|
||||||
@@ -516,10 +514,7 @@ button:
|
|||||||
keep old: Keep old files
|
keep old: Keep old files
|
||||||
number: Add a number to the filename
|
number: Add a number to the filename
|
||||||
number overwrite: Add a number to the filename, overwrite previous exports
|
number overwrite: Add a number to the filename, overwrite previous exports
|
||||||
|
|
||||||
# Update checker
|
|
||||||
close: &Close
|
|
||||||
|
|
||||||
# Auto replace
|
# Auto replace
|
||||||
use auto replace: Use auto replace
|
use auto replace: Use auto replace
|
||||||
add item: &Add
|
add item: &Add
|
||||||
@@ -549,7 +544,7 @@ title:
|
|||||||
open set: Open Set
|
open set: Open Set
|
||||||
save set: Save Set As
|
save set: Save Set As
|
||||||
save image: Save Image
|
save image: Save Image
|
||||||
updates available: Updates Available
|
#updates available: Updates Available
|
||||||
save changes: Save Changes?
|
save changes: Save Changes?
|
||||||
select stylesheet: Select Stylesheet
|
select stylesheet: Select Stylesheet
|
||||||
#preferences
|
#preferences
|
||||||
@@ -577,11 +572,10 @@ title:
|
|||||||
auto replaces: Auto Replace
|
auto replaces: Auto Replace
|
||||||
|
|
||||||
# Package Update Window
|
# Package Update Window
|
||||||
package list: Package Updates
|
packages window: Package Manager
|
||||||
package type: Package Type
|
installing updates: Installing updates
|
||||||
package name: Package Name
|
|
||||||
package status: Current Status
|
cannot create file: Cannot create file
|
||||||
new status: New Status
|
|
||||||
|
|
||||||
############################################################## Action (undo/redo) names
|
############################################################## Action (undo/redo) names
|
||||||
action:
|
action:
|
||||||
@@ -679,7 +673,7 @@ error:
|
|||||||
images used for blending must have the same size: Images used for blending must have the same size
|
images used for blending must have the same size: Images used for blending must have the same size
|
||||||
|
|
||||||
# Error from files
|
# Error from files
|
||||||
no game specified for the set: No game specified for the set
|
no game specified: No game specified for the %s
|
||||||
no stylesheet specified for the set: No stylesheet specified for the set
|
no stylesheet specified for the set: No stylesheet specified for the set
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
stylesheet and set don't refer to the same game, this is an error in the stylesheet file
|
stylesheet and set don't refer to the same game, this is an error in the stylesheet file
|
||||||
@@ -704,8 +698,7 @@ error:
|
|||||||
dimension not found: There is no statistics dimension '%s'
|
dimension not found: There is no statistics dimension '%s'
|
||||||
|
|
||||||
# Package update window
|
# Package update window
|
||||||
no packages: Found no package updates.
|
# checking updates: Checking for updates.
|
||||||
checking updates: Checking for updates.
|
|
||||||
can't download installer:
|
can't download installer:
|
||||||
Unable to download installer for package %s from %s.
|
Unable to download installer for package %s from %s.
|
||||||
Nothing has been installed.
|
Nothing has been installed.
|
||||||
@@ -742,6 +735,7 @@ type:
|
|||||||
game: game
|
game: game
|
||||||
set: set
|
set: set
|
||||||
stylesheet: stylesheet
|
stylesheet: stylesheet
|
||||||
|
export template:export template
|
||||||
card: card
|
card: card
|
||||||
field: field
|
field: field
|
||||||
style: style
|
style: style
|
||||||
@@ -768,17 +762,6 @@ type:
|
|||||||
point: point
|
point: point
|
||||||
points: points
|
points: points
|
||||||
|
|
||||||
# Package manager
|
|
||||||
installed: installed
|
|
||||||
uninstalled: uninstalled
|
|
||||||
upgradeable: upgradeable
|
|
||||||
|
|
||||||
install: install
|
|
||||||
uninstall: uninstall
|
|
||||||
upgrade: upgrade
|
|
||||||
do nothing: do nothing
|
|
||||||
new mse: MSE outdated
|
|
||||||
|
|
||||||
|
|
||||||
############################################################## Magic
|
############################################################## Magic
|
||||||
game:
|
game:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ String ExportTemplate::typeName() const { return _("export-template"); }
|
|||||||
|
|
||||||
void ExportTemplate::validate(Version) {
|
void ExportTemplate::validate(Version) {
|
||||||
if (!game) {
|
if (!game) {
|
||||||
throw Error(_ERROR_("no game specified for export template"));
|
throw Error(_ERROR_1_("no game specified",_TYPE_("export template")));
|
||||||
}
|
}
|
||||||
// an export template depends on the game it is made for
|
// an export template depends on the game it is made for
|
||||||
requireDependency(game.get());
|
requireDependency(game.get());
|
||||||
|
|||||||
+32
-11
@@ -97,9 +97,9 @@ intrusive_ptr<Field> read_new<Field>(Reader& reader) {
|
|||||||
Style::Style(const FieldP& field)
|
Style::Style(const FieldP& field)
|
||||||
: fieldP(field)
|
: fieldP(field)
|
||||||
, z_index(0)
|
, z_index(0)
|
||||||
, left(-1), top(-1)
|
, left (1000000), top (1000000)
|
||||||
, width(-1), height(-1)
|
, width(0), height(0)
|
||||||
, right(-1), bottom(-1)
|
, right(1000000), bottom(1000000)
|
||||||
, angle(0)
|
, angle(0)
|
||||||
, visible(true)
|
, visible(true)
|
||||||
, automatic_side(AUTO_UNKNOWN)
|
, automatic_side(AUTO_UNKNOWN)
|
||||||
@@ -139,14 +139,14 @@ int Style::update(Context& ctx) {
|
|||||||
| visible.update(ctx);
|
| visible.update(ctx);
|
||||||
// determine automatic_side and attachment of rotation point
|
// determine automatic_side and attachment of rotation point
|
||||||
if (automatic_side == AUTO_UNKNOWN) {
|
if (automatic_side == AUTO_UNKNOWN) {
|
||||||
if (right == -1) automatic_side = (AutomaticSide)(automatic_side | AUTO_RIGHT);
|
if (right == 1000000) automatic_side = (AutomaticSide)(automatic_side | AUTO_RIGHT);
|
||||||
else if (width == -1) automatic_side = (AutomaticSide)(automatic_side | AUTO_WIDTH);
|
else if (width == 0) automatic_side = (AutomaticSide)(automatic_side | AUTO_WIDTH);
|
||||||
else if (left == -1) automatic_side = (AutomaticSide)(automatic_side | AUTO_LEFT);
|
else if (left == 1000000) automatic_side = (AutomaticSide)(automatic_side | AUTO_LEFT);
|
||||||
else automatic_side = (AutomaticSide)(automatic_side | AUTO_LR);
|
else automatic_side = (AutomaticSide)(automatic_side | AUTO_LR);
|
||||||
if (bottom == -1) automatic_side = (AutomaticSide)(automatic_side | AUTO_BOTTOM);
|
if (bottom == 1000000) automatic_side = (AutomaticSide)(automatic_side | AUTO_BOTTOM);
|
||||||
else if (height == -1) automatic_side = (AutomaticSide)(automatic_side | AUTO_HEIGHT);
|
else if (height == 0) automatic_side = (AutomaticSide)(automatic_side | AUTO_HEIGHT);
|
||||||
else if (top == -1) automatic_side = (AutomaticSide)(automatic_side | AUTO_TOP);
|
else if (top == 1000000) automatic_side = (AutomaticSide)(automatic_side | AUTO_TOP);
|
||||||
else automatic_side = (AutomaticSide)(automatic_side | AUTO_TB);
|
else automatic_side = (AutomaticSide)(automatic_side | AUTO_TB);
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
if (!changed) return CHANGE_NONE;
|
if (!changed) return CHANGE_NONE;
|
||||||
@@ -171,10 +171,31 @@ int Style::update(Context& ctx) {
|
|||||||
top = top + height * (1 - c);
|
top = top + height * (1 - c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (width < 0) width = -width;
|
||||||
|
if (height < 0) height = -height;
|
||||||
// done
|
// done
|
||||||
return CHANGE_OTHER;
|
return CHANGE_OTHER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Style::isVisible() const {
|
||||||
|
return visible
|
||||||
|
&& (width) > 0
|
||||||
|
&& abs(left) < 100000
|
||||||
|
&& abs(right) < 100000
|
||||||
|
&& (height) > 0
|
||||||
|
&& abs(top) < 100000
|
||||||
|
&& abs(bottom) < 100000;
|
||||||
|
}
|
||||||
|
bool Style::hasSize() const {
|
||||||
|
int h = (abs(width) > 0 || width .isScripted())
|
||||||
|
+ (abs(left) < 100000 || left .isScripted())
|
||||||
|
+ (abs(right) < 100000 || right .isScripted());
|
||||||
|
int v = (abs(height) > 0 || height.isScripted())
|
||||||
|
+ (abs(top) < 100000 || top .isScripted())
|
||||||
|
+ (abs(bottom) < 100000 || bottom.isScripted());
|
||||||
|
return h >= 2 && v >= 2;
|
||||||
|
}
|
||||||
|
|
||||||
void Style::initDependencies(Context& ctx, const Dependency& dep) const {
|
void Style::initDependencies(Context& ctx, const Dependency& dep) const {
|
||||||
// left .initDependencies(ctx,dep);
|
// left .initDependencies(ctx,dep);
|
||||||
// top .initDependencies(ctx,dep);
|
// top .initDependencies(ctx,dep);
|
||||||
|
|||||||
@@ -115,6 +115,11 @@ class Style : public IntrusivePtrVirtualBase {
|
|||||||
inline RealRect getExternalRect() const { return RealRect (left, top, width, height); }
|
inline RealRect getExternalRect() const { return RealRect (left, top, width, height); }
|
||||||
inline RealRect getInternalRect() const { return RealRect(0, 0, width, height); }
|
inline RealRect getInternalRect() const { return RealRect(0, 0, width, height); }
|
||||||
|
|
||||||
|
/// Does this style have a non-zero size (or is it scripted)?
|
||||||
|
bool hasSize() const;
|
||||||
|
/// Is this style visible, and does it have a sane size
|
||||||
|
bool isVisible() const;
|
||||||
|
|
||||||
/// Get a copy of this style
|
/// Get a copy of this style
|
||||||
virtual StyleP clone() const = 0;
|
virtual StyleP clone() const = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -217,6 +217,10 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(PackageDescription) {
|
|||||||
REFLECT_N("depends ons", dependencies);
|
REFLECT_N("depends ons", dependencies);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PackageDescription::merge(const PackageDescription& p2) {
|
||||||
|
if (!icon.Ok() && !icon_url) icon = p2.icon;
|
||||||
|
}
|
||||||
|
|
||||||
IMPLEMENT_REFLECTION_NO_SCRIPT(InstallerDescription) {
|
IMPLEMENT_REFLECTION_NO_SCRIPT(InstallerDescription) {
|
||||||
REFLECT(packages);
|
REFLECT(packages);
|
||||||
}
|
}
|
||||||
@@ -290,6 +294,7 @@ bool InstallablePackage::has(PackageAction act) const {
|
|||||||
void InstallablePackage::merge(const InstallablePackage& p) {
|
void InstallablePackage::merge(const InstallablePackage& p) {
|
||||||
if (!installed) installed = p.installed;
|
if (!installed) installed = p.installed;
|
||||||
if (!installer) {
|
if (!installer) {
|
||||||
|
p.description->merge(*description);
|
||||||
description = p.description; // installer has new description
|
description = p.description; // installer has new description
|
||||||
installer = p.installer;
|
installer = p.installer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,15 +26,6 @@ class Installer : public Packaged {
|
|||||||
String prefered_filename; ///< What filename should be used (by default)
|
String prefered_filename; ///< What filename should be used (by default)
|
||||||
vector<PackageDescriptionP> packages; ///< Packages to install
|
vector<PackageDescriptionP> packages; ///< Packages to install
|
||||||
|
|
||||||
/*
|
|
||||||
/// Load an installer from a file, and run it
|
|
||||||
static void installFrom(const String& filename, bool message_on_success, bool local);
|
|
||||||
/// Install all the packages
|
|
||||||
void install(bool local, bool check_dependencies = true);
|
|
||||||
/// Install a specific package
|
|
||||||
void install(const String& package);
|
|
||||||
*/
|
|
||||||
|
|
||||||
/// Add a package to the installer (if it is not already added).
|
/// Add a package to the installer (if it is not already added).
|
||||||
/** If the package is named *.mse-installer uses it as the filename instead */
|
/** If the package is named *.mse-installer uses it as the filename instead */
|
||||||
void addPackage(const String& package);
|
void addPackage(const String& package);
|
||||||
@@ -67,6 +58,9 @@ class PackageDescription : public IntrusivePtrBase<PackageDescription> {
|
|||||||
String description; ///< Changelog/description
|
String description; ///< Changelog/description
|
||||||
vector<PackageDependencyP> dependencies; ///< Dependencies of this package
|
vector<PackageDependencyP> dependencies; ///< Dependencies of this package
|
||||||
|
|
||||||
|
/// Merge two descriptions a package. This package takes precedence
|
||||||
|
void merge(const PackageDescription& p2);
|
||||||
|
|
||||||
DECLARE_REFLECTION();
|
DECLARE_REFLECTION();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -134,7 +134,7 @@ void Set::validate(Version file_app_version) {
|
|||||||
Packaged::validate(file_app_version);
|
Packaged::validate(file_app_version);
|
||||||
// are the
|
// are the
|
||||||
if (!game) {
|
if (!game) {
|
||||||
throw Error(_ERROR_("no game specified for the set"));
|
throw Error(_ERROR_1_("no game specified",_TYPE_("set")));
|
||||||
}
|
}
|
||||||
if (!stylesheet) {
|
if (!stylesheet) {
|
||||||
// TODO : Allow user to select a different style
|
// TODO : Allow user to select a different style
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ String StyleSheet::typeName() const { return _("style"); }
|
|||||||
void StyleSheet::validate(Version ver) {
|
void StyleSheet::validate(Version ver) {
|
||||||
Packaged::validate(ver);
|
Packaged::validate(ver);
|
||||||
if (!game) {
|
if (!game) {
|
||||||
throw Error(_ERROR_("no game specified for stylesheet"));
|
throw Error(_ERROR_1_("no game specified",_TYPE_("stylesheet")));
|
||||||
}
|
}
|
||||||
// a stylsheet depends on the game it is made for
|
// a stylsheet depends on the game it is made for
|
||||||
requireDependency(game.get());
|
requireDependency(game.get());
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ void saturate(Image& image, int amount) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void desaturate(Image& image) {
|
void desaturate(Image& image/*, int amount*/) {
|
||||||
Byte* pix = image.GetData();
|
Byte* pix = image.GetData();
|
||||||
Byte* end = pix + image.GetWidth() * image.GetHeight() * 3;
|
Byte* end = pix + image.GetWidth() * image.GetHeight() * 3;
|
||||||
while (pix != end) {
|
while (pix != end) {
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ void DataEditor::createTabIndex() {
|
|||||||
by_tab_index.clear();
|
by_tab_index.clear();
|
||||||
FOR_EACH(v, viewers) {
|
FOR_EACH(v, viewers) {
|
||||||
ValueEditor* e = v->getEditor();
|
ValueEditor* e = v->getEditor();
|
||||||
if (e && v->getField()->editable && v->getStyle()->visible) {
|
if (e && v->getField()->editable && v->getStyle()->isVisible()) {
|
||||||
by_tab_index.push_back(v.get());
|
by_tab_index.push_back(v.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,14 @@
|
|||||||
#include <util/prec.hpp>
|
#include <util/prec.hpp>
|
||||||
#include <gui/packages_window.hpp>
|
#include <gui/packages_window.hpp>
|
||||||
#include <gui/control/tree_list.hpp>
|
#include <gui/control/tree_list.hpp>
|
||||||
//%#include <gui/update_checker.hpp>
|
#include <gui/thumbnail_thread.hpp>
|
||||||
#include <gui/util.hpp>
|
#include <gui/util.hpp>
|
||||||
#include <util/io/package_manager.hpp>
|
#include <util/io/package_manager.hpp>
|
||||||
#include <util/window_id.hpp>
|
#include <util/window_id.hpp>
|
||||||
#include <data/installer.hpp>
|
#include <data/installer.hpp>
|
||||||
#include <data/settings.hpp>
|
#include <data/settings.hpp>
|
||||||
#include <gfx/gfx.hpp>
|
#include <gfx/gfx.hpp>
|
||||||
|
#include <boost/scoped_ptr.hpp>
|
||||||
#include <wx/wfstream.h>
|
#include <wx/wfstream.h>
|
||||||
#include <wx/html/htmlwin.h>
|
#include <wx/html/htmlwin.h>
|
||||||
#include <wx/dialup.h>
|
#include <wx/dialup.h>
|
||||||
@@ -111,6 +112,9 @@ class PackageUpdateList : public TreeList {
|
|||||||
item_height = max(item_height,17);
|
item_height = max(item_height,17);
|
||||||
rebuild();
|
rebuild();
|
||||||
}
|
}
|
||||||
|
~PackageUpdateList() {
|
||||||
|
thumbnail_thread.abort(this);
|
||||||
|
}
|
||||||
|
|
||||||
InstallablePackageP getSelection() const {
|
InstallablePackageP getSelection() const {
|
||||||
return selection == NOTHING ? InstallablePackageP() : get(selection);
|
return selection == NOTHING ? InstallablePackageP() : get(selection);
|
||||||
@@ -130,10 +134,9 @@ class PackageUpdateList : public TreeList {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
PackagesWindow* parent;
|
PackagesWindow* parent;
|
||||||
class TreeItem;
|
|
||||||
public:
|
public:
|
||||||
|
class TreeItem;
|
||||||
typedef intrusive_ptr<TreeItem> TreeItemP;
|
typedef intrusive_ptr<TreeItem> TreeItemP;
|
||||||
private:
|
|
||||||
class TreeItem : public Item {
|
class TreeItem : public Item {
|
||||||
public:
|
public:
|
||||||
String label;
|
String label;
|
||||||
@@ -147,6 +150,8 @@ class PackageUpdateList : public TreeList {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------- : PackageUpdateList::TreeItem
|
||||||
|
|
||||||
DECLARE_TYPEOF_COLLECTION(PackageUpdateList::TreeItemP);
|
DECLARE_TYPEOF_COLLECTION(PackageUpdateList::TreeItemP);
|
||||||
|
|
||||||
|
|
||||||
@@ -209,6 +214,80 @@ bool PackageUpdateList::TreeItem::highlight() const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------- : PackageIconRequest
|
||||||
|
|
||||||
|
/// wx doesn't allow seeking on InputStreams from a wxURL
|
||||||
|
/// The built in buffer class is too stupid to seek, so we must do it ourselfs
|
||||||
|
class SeekAtStartInputStream : public wxFilterInputStream {
|
||||||
|
public:
|
||||||
|
SeekAtStartInputStream(wxInputStream& stream)
|
||||||
|
: wxFilterInputStream(stream)
|
||||||
|
, buffer_pos(0)
|
||||||
|
{
|
||||||
|
m_parent_i_stream->Read(buffer, 1024);
|
||||||
|
buffer_size = m_parent_i_stream->LastRead();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsSeekable() const { return true; }
|
||||||
|
protected:
|
||||||
|
virtual size_t OnSysRead(void *buffer, size_t bufsize) {
|
||||||
|
size_t len = min(buffer_size - buffer_pos, bufsize);
|
||||||
|
memcpy(buffer, this->buffer + buffer_pos, len);
|
||||||
|
buffer_pos += len;
|
||||||
|
m_parent_i_stream->Read((Byte*)buffer + len, bufsize - len);
|
||||||
|
return m_parent_i_stream->LastRead() + len;
|
||||||
|
}
|
||||||
|
virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode) {
|
||||||
|
if (mode == wxFromStart) buffer_pos = seek;
|
||||||
|
else if (mode == wxFromCurrent) buffer_pos += seek;
|
||||||
|
else assert(false);
|
||||||
|
assert(buffer_pos < buffer_size);
|
||||||
|
return buffer_pos;
|
||||||
|
}
|
||||||
|
virtual wxFileOffset OnSysTell() const {
|
||||||
|
assert(buffer_pos < buffer_size);
|
||||||
|
return buffer_pos;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
size_t buffer_size, buffer_pos;
|
||||||
|
Byte buffer[1024];
|
||||||
|
};
|
||||||
|
|
||||||
|
class PackageIconRequest : public ThumbnailRequest {
|
||||||
|
public:
|
||||||
|
PackageIconRequest(PackageUpdateList* list, PackageUpdateList::TreeItem* ti)
|
||||||
|
: ThumbnailRequest(
|
||||||
|
list,
|
||||||
|
_("package_") + ti->package->description->icon_url + _("_") + ti->package->description->version.toString(),
|
||||||
|
wxDateTime(1,wxDateTime::Jan,2000))
|
||||||
|
, list(list), ti(ti)
|
||||||
|
{}
|
||||||
|
|
||||||
|
virtual Image generate() {
|
||||||
|
wxURL url(ti->package->description->icon_url);
|
||||||
|
scoped_ptr<wxInputStream> isP(url.GetInputStream());
|
||||||
|
if (!isP) return wxImage();
|
||||||
|
SeekAtStartInputStream is2(*isP);
|
||||||
|
Image result(is2);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
virtual void store(const Image& image) {
|
||||||
|
if (!image.Ok()) return;
|
||||||
|
ti->package->description->icon = image;
|
||||||
|
Image resampled(16,16,false);
|
||||||
|
resample_preserve_aspect(image,resampled);
|
||||||
|
ti->icon = Bitmap(resampled);
|
||||||
|
desaturate(resampled);
|
||||||
|
set_alpha(resampled,0.5);
|
||||||
|
ti->icon_grey = Bitmap(resampled);
|
||||||
|
list->Refresh(false);
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
PackageUpdateList* list;
|
||||||
|
PackageUpdateList::TreeItem* ti;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------- : PackageUpdateList : implementation
|
||||||
|
|
||||||
void PackageUpdateList::initItems() {
|
void PackageUpdateList::initItems() {
|
||||||
// packages to tree
|
// packages to tree
|
||||||
@@ -242,6 +321,10 @@ void PackageUpdateList::initItems() {
|
|||||||
desaturate(image);
|
desaturate(image);
|
||||||
set_alpha(image, 0.5);
|
set_alpha(image, 0.5);
|
||||||
ti.icon_grey = Bitmap(image);
|
ti.icon_grey = Bitmap(image);
|
||||||
|
if (p && !p->description->icon.Ok() && !p->description->icon_url.empty()) {
|
||||||
|
// download icon
|
||||||
|
thumbnail_thread.request(new_intrusive2<PackageIconRequest>(this,&ti));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,7 +450,7 @@ END_EVENT_TABLE()
|
|||||||
// ----------------------------------------------------------------------------- : PackagesWindow
|
// ----------------------------------------------------------------------------- : PackagesWindow
|
||||||
|
|
||||||
PackagesWindow::PackagesWindow(Window* parent, bool download_package_list)
|
PackagesWindow::PackagesWindow(Window* parent, bool download_package_list)
|
||||||
: wxDialog(parent, wxID_ANY, _TITLE_("package list"), wxDefaultPosition, wxSize(640,480), wxDEFAULT_DIALOG_STYLE | wxCLIP_CHILDREN | wxRESIZE_BORDER)
|
: wxDialog(parent, wxID_ANY, _TITLE_("packages window"), wxDefaultPosition, wxSize(640,480), wxDEFAULT_DIALOG_STYLE | wxCLIP_CHILDREN | wxRESIZE_BORDER)
|
||||||
, where(is_install_local(settings.install_type) ? PACKAGE_LOCAL : PACKAGE_GLOBAL)
|
, where(is_install_local(settings.install_type) ? PACKAGE_LOCAL : PACKAGE_GLOBAL)
|
||||||
, waiting_for_list(download_package_list)
|
, waiting_for_list(download_package_list)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class ThumbnailRequest : public IntrusivePtrVirtualBase {
|
|||||||
virtual void store(const Image&) = 0;
|
virtual void store(const Image&) = 0;
|
||||||
|
|
||||||
/// Can the thumbnail safely be generated from another thread?
|
/// Can the thumbnail safely be generated from another thread?
|
||||||
virtual bool threadSafe() const = 0;
|
virtual bool threadSafe() const { return true; }
|
||||||
|
|
||||||
/// Object that requested the thumbnail
|
/// Object that requested the thumbnail
|
||||||
void* const owner;
|
void* const owner;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ void DataViewer::draw(RotatedDC& dc, const Color& background) {
|
|||||||
// prepare viewers
|
// prepare viewers
|
||||||
bool changed_content_properties = false;
|
bool changed_content_properties = false;
|
||||||
FOR_EACH(v, viewers) { // draw low z index fields first
|
FOR_EACH(v, viewers) { // draw low z index fields first
|
||||||
if (v->getStyle()->visible) {
|
if (v->getStyle()->isVisible()) {
|
||||||
Rotater r(dc, v->getRotation());
|
Rotater r(dc, v->getRotation());
|
||||||
try {
|
try {
|
||||||
if (v->prepare(dc)) {
|
if (v->prepare(dc)) {
|
||||||
@@ -60,7 +60,7 @@ void DataViewer::draw(RotatedDC& dc, const Color& background) {
|
|||||||
}
|
}
|
||||||
// draw viewers
|
// draw viewers
|
||||||
FOR_EACH(v, viewers) { // draw low z index fields first
|
FOR_EACH(v, viewers) { // draw low z index fields first
|
||||||
if (v->getStyle()->visible) {// visible
|
if (v->getStyle()->isVisible()) {// visible
|
||||||
Rotater r(dc, v->getRotation());
|
Rotater r(dc, v->getRotation());
|
||||||
try {
|
try {
|
||||||
drawViewer(dc, *v);
|
drawViewer(dc, *v);
|
||||||
@@ -155,10 +155,7 @@ void DataViewer::setStyles(const StyleSheetP& stylesheet, IndexMap<FieldP,StyleP
|
|||||||
}
|
}
|
||||||
void DataViewer::addStyles(IndexMap<FieldP,StyleP>& styles) {
|
void DataViewer::addStyles(IndexMap<FieldP,StyleP>& styles) {
|
||||||
FOR_EACH(s, styles) {
|
FOR_EACH(s, styles) {
|
||||||
if ((s->visible || s->visible.isScripted()) &&
|
if ((s->visible || s->visible.isScripted()) && (nativeLook() || s->hasSize())) {
|
||||||
(nativeLook() || (
|
|
||||||
(s->width != -1 || s->width .isScripted() || s->right != -1 || s->right .isScripted()) &&
|
|
||||||
(s->height != -1 || s->height .isScripted() || s->bottom != -1 || s->bottom.isScripted())))) {
|
|
||||||
// no need to make a viewer for things that are always invisible
|
// no need to make a viewer for things that are always invisible
|
||||||
ValueViewerP viewer = makeViewer(s);
|
ValueViewerP viewer = makeViewer(s);
|
||||||
if (viewer) viewers.push_back(viewer);
|
if (viewer) viewers.push_back(viewer);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# This file contains the keys expected to be in MSE locales
|
# This file contains the keys expected to be in MSE locales
|
||||||
# It was automatically generated by tools/locale/locale.pl
|
# It was automatically generated by tools/locale/locale.pl
|
||||||
# Generated on Mon Sep 24 22:07:59 2007
|
# Generated on Sat Dec 29 23:09:36 2007
|
||||||
|
|
||||||
action:
|
action:
|
||||||
add control point: 0
|
add control point: 0
|
||||||
@@ -42,9 +42,8 @@ button:
|
|||||||
add item: 0
|
add item: 0
|
||||||
always: 0
|
always: 0
|
||||||
browse: 0
|
browse: 0
|
||||||
check updates: 0
|
|
||||||
check now: 0
|
check now: 0
|
||||||
close: 0
|
check updates: 0
|
||||||
defaults: 0
|
defaults: 0
|
||||||
edit symbol: 0
|
edit symbol: 0
|
||||||
enabled: 0
|
enabled: 0
|
||||||
@@ -52,6 +51,7 @@ button:
|
|||||||
high quality: 0
|
high quality: 0
|
||||||
if internet connection exists: 0
|
if internet connection exists: 0
|
||||||
insert parameter: 0
|
insert parameter: 0
|
||||||
|
install package: 0
|
||||||
keep old: 0
|
keep old: 0
|
||||||
last opened set: 0
|
last opened set: 0
|
||||||
move down: 0
|
move down: 0
|
||||||
@@ -64,6 +64,7 @@ button:
|
|||||||
overwrite: 0
|
overwrite: 0
|
||||||
refer parameter: 0
|
refer parameter: 0
|
||||||
remove item: 0
|
remove item: 0
|
||||||
|
remove package: 0
|
||||||
select: optional, 0
|
select: optional, 0
|
||||||
select all: 0
|
select all: 0
|
||||||
select none: 0
|
select none: 0
|
||||||
@@ -71,6 +72,7 @@ button:
|
|||||||
show editing hints: 0
|
show editing hints: 0
|
||||||
show lines: 0
|
show lines: 0
|
||||||
symbol gallery: optional, 0
|
symbol gallery: optional, 0
|
||||||
|
upgrade package: 0
|
||||||
use auto replace: 0
|
use auto replace: 0
|
||||||
use custom styling options: 0
|
use custom styling options: 0
|
||||||
use for all cards: 0
|
use for all cards: 0
|
||||||
@@ -80,11 +82,13 @@ error:
|
|||||||
aborting parsing: 0
|
aborting parsing: 0
|
||||||
can't convert: 2
|
can't convert: 2
|
||||||
can't convert value: 3
|
can't convert value: 3
|
||||||
checking updates: 0
|
can't download installer: 2
|
||||||
|
cannot create file: 1
|
||||||
checking updates failed: 0
|
checking updates failed: 0
|
||||||
coordinates for blending overlap: 0
|
coordinates for blending overlap: 0
|
||||||
dependency not given: 4
|
dependency not given: 4
|
||||||
dimension not found: 1
|
dimension not found: 1
|
||||||
|
downloading updates: 0
|
||||||
expected key: 1
|
expected key: 1
|
||||||
file not found: 2
|
file not found: 2
|
||||||
file not found package like: 2
|
file not found package like: 2
|
||||||
@@ -94,10 +98,10 @@ error:
|
|||||||
images used for blending must have the same size: 0
|
images used for blending must have the same size: 0
|
||||||
in function: 2
|
in function: 2
|
||||||
in parameter: 2
|
in parameter: 2
|
||||||
|
installing updates: 0
|
||||||
internal error: 1
|
internal error: 1
|
||||||
newer version: 2
|
newer version: 2
|
||||||
no game specified for the set: 0
|
no game specified: 1
|
||||||
no packages: 0
|
|
||||||
no stylesheet specified for the set: 0
|
no stylesheet specified for the set: 0
|
||||||
no updates: 0
|
no updates: 0
|
||||||
package not found: 1
|
package not found: 1
|
||||||
@@ -252,13 +256,24 @@ label:
|
|||||||
game type: 0
|
game type: 0
|
||||||
html export options: 0
|
html export options: 0
|
||||||
html template: 0
|
html template: 0
|
||||||
|
install package: 0
|
||||||
keyword: 0
|
keyword: 0
|
||||||
language: 0
|
language: 0
|
||||||
|
magic set editor package: optional, 0
|
||||||
match: 0
|
match: 0
|
||||||
mode: 0
|
mode: 0
|
||||||
original: 0
|
original: 0
|
||||||
|
package action: 0
|
||||||
|
package conflicts: 0
|
||||||
|
package installable: 0
|
||||||
|
package installed: 0
|
||||||
|
package modified: 0
|
||||||
|
package name: 0
|
||||||
|
package status: 0
|
||||||
|
package updates: 0
|
||||||
percent of normal: 0
|
percent of normal: 0
|
||||||
reminder: 0
|
reminder: 0
|
||||||
|
remove package: 0
|
||||||
result: 0
|
result: 0
|
||||||
save changes: 1
|
save changes: 1
|
||||||
select cards print: 0
|
select cards print: 0
|
||||||
@@ -271,20 +286,17 @@ label:
|
|||||||
style type: 0
|
style type: 0
|
||||||
stylesheet not found: 1
|
stylesheet not found: 1
|
||||||
styling options: 0
|
styling options: 0
|
||||||
|
upgrade package: 0
|
||||||
uses: 0
|
uses: 0
|
||||||
zoom: 0
|
zoom: 0
|
||||||
package name: 0
|
|
||||||
package status: 0
|
|
||||||
menu:
|
menu:
|
||||||
about: 0
|
about: 0
|
||||||
add card: 0
|
add card: 0
|
||||||
add cards: 0
|
add cards: 0
|
||||||
add keyword: 0
|
add keyword: 0
|
||||||
apply changes: 0
|
|
||||||
auto replace: 0
|
auto replace: 0
|
||||||
basic shapes: 0
|
basic shapes: 0
|
||||||
bold: 0
|
bold: 0
|
||||||
cancel changes: 0
|
|
||||||
card list columns: 0
|
card list columns: 0
|
||||||
cards: 0
|
cards: 0
|
||||||
cards tab: 0
|
cards tab: 0
|
||||||
@@ -310,7 +322,6 @@ menu:
|
|||||||
help: 0
|
help: 0
|
||||||
index: 0
|
index: 0
|
||||||
insert symbol: 0
|
insert symbol: 0
|
||||||
install package: 0
|
|
||||||
italic: 0
|
italic: 0
|
||||||
keywords: 0
|
keywords: 0
|
||||||
keywords tab: 0
|
keywords tab: 0
|
||||||
@@ -335,7 +346,6 @@ menu:
|
|||||||
reminder text: 0
|
reminder text: 0
|
||||||
remove card: 0
|
remove card: 0
|
||||||
remove keyword: 0
|
remove keyword: 0
|
||||||
remove package: 0
|
|
||||||
replace: 0
|
replace: 0
|
||||||
rotate: 0
|
rotate: 0
|
||||||
rotate 0: 0
|
rotate 0: 0
|
||||||
@@ -356,28 +366,25 @@ menu:
|
|||||||
tool: 0
|
tool: 0
|
||||||
undo: 1
|
undo: 1
|
||||||
ungroup: 0
|
ungroup: 0
|
||||||
upgrade package: 0
|
|
||||||
website: 0
|
website: 0
|
||||||
window: 0
|
window: 0
|
||||||
title:
|
title:
|
||||||
%s - magic set editor: 1
|
%s - magic set editor: 1
|
||||||
about: 0
|
about: 0
|
||||||
auto replaces: 0
|
auto replaces: 0
|
||||||
|
cannot create file: 0
|
||||||
directories: 0
|
directories: 0
|
||||||
display: 0
|
display: 0
|
||||||
export cancelled: 0
|
export cancelled: 0
|
||||||
export html: 0
|
export html: 0
|
||||||
export images: 0
|
export images: 0
|
||||||
global: 0
|
global: 0
|
||||||
|
installing updates: 0
|
||||||
locate apprentice: 0
|
locate apprentice: 0
|
||||||
magic set editor: 0
|
magic set editor: 0
|
||||||
new set: 0
|
new set: 0
|
||||||
new status: 0
|
|
||||||
open set: 0
|
open set: 0
|
||||||
package list: 0
|
packages window: 0
|
||||||
package name: 0
|
|
||||||
package status: 0
|
|
||||||
package type: 0
|
|
||||||
preferences: 0
|
preferences: 0
|
||||||
print preview: 0
|
print preview: 0
|
||||||
save changes: 0
|
save changes: 0
|
||||||
@@ -393,7 +400,6 @@ title:
|
|||||||
untitled: 0
|
untitled: 0
|
||||||
update check: 0
|
update check: 0
|
||||||
updates: 0
|
updates: 0
|
||||||
updates available: 0
|
|
||||||
tool:
|
tool:
|
||||||
add symmetry: 0
|
add symmetry: 0
|
||||||
basic shapes: 0
|
basic shapes: 0
|
||||||
@@ -491,19 +497,16 @@ type:
|
|||||||
collection: 0
|
collection: 0
|
||||||
collection of: 1
|
collection of: 1
|
||||||
color: 0
|
color: 0
|
||||||
do nothing: 0
|
|
||||||
double: 0
|
double: 0
|
||||||
ellipse: 0
|
ellipse: 0
|
||||||
|
export template: 0
|
||||||
field: 0
|
field: 0
|
||||||
function: 0
|
function: 0
|
||||||
game: 0
|
game: 0
|
||||||
group: 0
|
group: 0
|
||||||
hexagon: 0
|
hexagon: 0
|
||||||
image: 0
|
image: 0
|
||||||
install: 0
|
|
||||||
installed: 0
|
|
||||||
integer: 0
|
integer: 0
|
||||||
new mse: 0
|
|
||||||
nil: 0
|
nil: 0
|
||||||
object: 0
|
object: 0
|
||||||
pentagon: 0
|
pentagon: 0
|
||||||
@@ -523,8 +526,4 @@ type:
|
|||||||
style: 0
|
style: 0
|
||||||
stylesheet: 0
|
stylesheet: 0
|
||||||
triangle: 0
|
triangle: 0
|
||||||
uninstall: 0
|
|
||||||
uninstalled: 0
|
|
||||||
upgrade: 0
|
|
||||||
upgradeable: 0
|
|
||||||
value: 0
|
value: 0
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 682 B |
Reference in New Issue
Block a user