Skip to content

Commit

Permalink
Release 0.7.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ngld committed Jan 4, 2018
2 parents d62d186 + 76af728 commit a752aa9
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 31 deletions.
6 changes: 3 additions & 3 deletions html/templates/kn-details-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ export default {
<span class="btn-text">REPORT</span>
</button>

<popper v-if="mod.status !== 'updating'" trigger="click" @show="updateTools(); open = true" @hide="open = false" class="dropdown dropdown-mod-btn">
<popper v-if="mod.status !== 'updating' && mod.installed" trigger="click" @show="updateTools(); open = true" @hide="open = false" class="dropdown dropdown-mod-btn">
<div class="dropdown-content">
<button v-for="tool in tools" @click="launchTool(tool)">Run {{ tool }}</button>
<button @click="uploadLog">Upload Debug Log</button>
<button v-if="mod.id !== 'FS2' && mod.status !== 'updating' && mod.installed" @click="install">Modify</button>
<button v-if="mod.status !== 'updating' && mod.installed && (mod.type === 'mod' || mod.type == 'tc')" @click="showFsoSettings">FSO Settings</button>
<button v-if="mod.id !== 'FS2' && mod.status !== 'updating'" @click="install">Modify</button>
<button v-if="mod.status !== 'updating' && (mod.type === 'mod' || mod.type == 'tc')" @click="showFsoSettings">FSO Settings</button>
<button v-if="mod.id !== 'FS2' && mod.status !== 'updating' && !mod.dev_mode" @click="uninstallMod">Uninstall</button>
<button v-if="mod.id !== 'FS2' && !mod.dev_mode" @click="verifyIntegrity">Verify file integrity</button>
</div>
Expand Down
4 changes: 4 additions & 0 deletions html/templates/kn-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ export default {
next_tab = mods.length === 0 ? 'explore' : 'home';
fs2mod.showTab(next_tab);
}
} else if(this.page === 'details' && !mod_table[this.detail_mod]) {
// The currently visible mod has been uninstalled thus making displaying this page impossible.
// Switch to the tab instead
this.exitDetails();
}
},
Expand Down
2 changes: 1 addition & 1 deletion knossos/center.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# The version should follow the http://semver.org guidelines.
# Only remove the -dev tag if you're making a release!
VERSION = '0.7.7'
VERSION = '0.7.8'
UPDATE_LINK = 'https://fsnebula.org/knossos'
INNOEXTRACT_LINK = 'https://dev.tproxy.de/knossos/innoextract.txt'
DEBUG = os.getenv('KN_DEBUG', '0').strip() == '1'
Expand Down
3 changes: 2 additions & 1 deletion knossos/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,9 @@ def work(self, arg):
self._work_lock.acquire()

# Just to make sure (the lock might have caused a short delay)
if self.abort:
if self.aborted:
logging.warning('Task aborted during step switch!')
self._work_lock.release()
return

if (self._pending == 1 and self._running == 1 and len(self._work) == 0) or self._cur_step < 0:
Expand Down
37 changes: 20 additions & 17 deletions knossos/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,12 @@ class CheckFilesTask(progress.MultistepTask):
_check_results = None
_steps = 2

def __init__(self, pkgs):
def __init__(self, pkgs, mod=None):
super(CheckFilesTask, self).__init__()

self.title = 'Checking %d packages...' % len(pkgs)
self.pkgs = pkgs
self._mod = mod

self.done.connect(self.finish)
self._threads = 1
Expand Down Expand Up @@ -239,9 +240,14 @@ def finish(self):
msg = "An error was detected while validating the game file integrity. The following packages are invalid:"
for pkg in bad_packages:
msg += "\n - Package %s of mod %s" % (pkg.name, pkg.get_mod().title)
msg += "\n\nThese mods are invalid and need to be redownloaded before they can be played without errors."
msg += "\n\nThese mods are invalid and need to be redownloaded before they can be played without errors.\n"
msg += "Do that now?"

QtWidgets.QMessageBox.critical(None, 'Knossos', msg)
res = QtWidgets.QMessageBox.question(None, 'Knossos', msg)
if res == QtWidgets.QMessageBox.Yes:
run_task(InstallTask(bad_packages, self._mod))
else:
QtWidgets.QMessageBox.information(None, 'Knossos', 'No problems were detected.')



Expand Down Expand Up @@ -290,10 +296,6 @@ def __init__(self, pkgs, mod=None, check_after=True):
for item in ins_pkg.files.values():
self._slot_prog[id(item)] = ('%s: %s' % (pmod.title, item['filename']), 0, 'Checking...')

for m in self._mods:
if m not in self.mods:
self.mods.append(m)

center.signals.repo_updated.emit()
self.done.connect(self.finish)
self.title = 'Installing mods...'
Expand Down Expand Up @@ -718,17 +720,18 @@ def __init__(self, pkgs, mods=[]):
self._pkgs = []
self._mods = []

for pkg in pkgs:
try:
self._pkgs.append(center.installed.query(pkg))
except repo.ModNotFound:
logging.exception('Someone tried to uninstall a non-existant package (%s, %s)! Skipping it...', pkg.get_mod().mid, pkg.name)
if len(pkgs) > 0:
for pkg in pkgs:
try:
self._pkgs.append(center.installed.query(pkg))
except repo.ModNotFound:
logging.exception('Someone tried to uninstall a non-existant package (%s, %s)! Skipping it...', pkg.get_mod().mid, pkg.name)

for mod in mods:
try:
self._mods.append(center.installed.query(mod))
except repo.ModNotFound:
logging.exception('Someone tried to uninstall a non-existant %s!', mod)
for mod in mods:
try:
self._mods.append(center.installed.query(mod))
except repo.ModNotFound:
logging.exception('Someone tried to uninstall a non-existant %s!', mod)

self.done.connect(self.finish)
self.title = 'Uninstalling mods...'
Expand Down
4 changes: 3 additions & 1 deletion knossos/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,8 @@ def saveUserFsoDetails(self, mid, version, build, cmdline):
mod.user_cmdline = cmdline
mod.save_user()

center.main_win.update_mod_list()

@QtCore.Slot(str, str, list)
def saveModFlag(self, mid, version, mod_flag):
mod = self._get_mod(mid, version)
Expand Down Expand Up @@ -1346,7 +1348,7 @@ def verifyModIntegrity(self, mid, version):
if mod in (-1, -2):
return

tasks.run_task(tasks.CheckFilesTask(mod.packages))
tasks.run_task(tasks.CheckFilesTask(mod.packages, mod))

@QtCore.Slot()
def openScreenshotFolder(self):
Expand Down
25 changes: 17 additions & 8 deletions knossos/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,17 @@ def search_mods(self):

mod = mvs[0]

item = mod.get()
item['progress'] = 0
item['progress_info'] = {}

installed_versions = {}
for m in center.installed.mods.get(mid, []):
installed_versions[str(m.version)] = m.dev_mode
installed_versions[str(m.version)] = m

if str(mod.version) in installed_versions:
item = installed_versions[str(mod.version)].get()
else:
item = mod.get()

item['progress'] = 0
item['progress_info'] = {}

rmod = center.mods.mods.get(mid, [])
if mod.mtype == 'engine':
Expand Down Expand Up @@ -268,9 +272,14 @@ def search_mods(self):
item['installed'] = len(installed_versions) > 0
item['versions'] = []
for mod in mvs:
mv = mod.get()
mv['installed'] = mv['version'] in installed_versions
mv['dev_mode'] = installed_versions.get(mv['version'], False)
if str(mod.version) in installed_versions:
mv = installed_versions[str(mod.version)].get()
mv['installed'] = True
else:
mv = mod.get()
mv['installed'] = False
mv['dev_mode'] = False

item['versions'].append(mv)

result.append(item)
Expand Down

0 comments on commit a752aa9

Please sign in to comment.