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:
coppro
2007-09-25 02:02:53 +00:00
parent a57c20aa4f
commit 3ea0a4abd7
10 changed files with 153 additions and 27 deletions
+21 -9
View File
@@ -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) {