mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Made it so that update window and set window can't be open simultaneously (don't explode the set by deleting the style, say).
Made update window enforce dependencies Added update button to welcome window (need icon still) git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@756 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+21
-9
@@ -65,7 +65,6 @@ const String& Package::absoluteFilename() const {
|
||||
return filename;
|
||||
}
|
||||
|
||||
|
||||
void Package::open(const String& n) {
|
||||
assert(!isOpened()); // not already opened
|
||||
// get absolute path
|
||||
@@ -86,6 +85,17 @@ void Package::open(const String& n) {
|
||||
}
|
||||
}
|
||||
|
||||
void Package::openZipStream(wxZipInputStream* input) {
|
||||
// close old streams
|
||||
delete fileStream; fileStream = nullptr;
|
||||
delete zipStream;
|
||||
|
||||
zipStream = input;
|
||||
if (!zipStream->IsOk()) throw InternalError(_("Error opening package!"));
|
||||
|
||||
loadZipStream();
|
||||
}
|
||||
|
||||
void Package::save(bool remove_unused) {
|
||||
assert(!needSaveAs());
|
||||
saveAs(filename, remove_unused);
|
||||
@@ -304,6 +314,15 @@ Package::FileInfo::~FileInfo() {
|
||||
delete zipEntry;
|
||||
}
|
||||
|
||||
void Package::loadZipStream() {
|
||||
while (true) {
|
||||
wxZipEntry* entry = zipStream->GetNextEntry();
|
||||
if (!entry) break;
|
||||
String name = toStandardName(entry->GetName());
|
||||
files[name].zipEntry = entry;
|
||||
}
|
||||
zipStream->CloseEntry();
|
||||
}
|
||||
|
||||
void Package::openDirectory() {
|
||||
openSubdir(wxEmptyString);
|
||||
@@ -341,16 +360,9 @@ void Package::openZipfile() {
|
||||
zipStream = new wxZipInputStream(*fileStream);
|
||||
if (!zipStream->IsOk()) throw PackageError(_ERROR_1_("package not found", filename));
|
||||
// read zip entries
|
||||
while (true) {
|
||||
wxZipEntry* entry = zipStream->GetNextEntry();
|
||||
if (!entry) break;
|
||||
String name = toStandardName(entry->GetName());
|
||||
files[name].zipEntry = entry;
|
||||
}
|
||||
zipStream->CloseEntry();
|
||||
loadZipStream();
|
||||
}
|
||||
|
||||
|
||||
void Package::saveToDirectory(const String& saveAs, bool remove_unused) {
|
||||
// write to a directory
|
||||
FOR_EACH(f, files) {
|
||||
|
||||
Reference in New Issue
Block a user