aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Häggqvist <[email protected]>2014-11-18 11:43:09 +0100
committerVictor Häggqvist <[email protected]>2014-11-18 11:43:09 +0100
commitac79fb2dacd0e6af14006bf25773b52b055d6676 (patch)
treeb18bd0cbd2b49c3b4be847d3753a478c021fe221
parent1b5357bcb678556b33e12b28ebc55f616b33fc0f (diff)
fix index out of range
-rwxr-xr-x[-rw-r--r--]AndroidResR/AndroidResR.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/AndroidResR/AndroidResR.py b/AndroidResR/AndroidResR.py
index f652d35..6fd31f3 100644..100755
--- a/AndroidResR/AndroidResR.py
+++ b/AndroidResR/AndroidResR.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
# coding=utf-8
import os
from os import listdir, remove
@@ -127,8 +128,9 @@ class Window(QtGui.QMainWindow, Ui_MainWindow):
# On selection change in src list
def srcSelectionChange(self):
- self.currentIndex = self.srcListWidget.selectedIndexes()[0].row()
- self.previewIcon()
+ if len(self.srcListWidget.selectedIndexes())>0:
+ self.currentIndex = self.srcListWidget.selectedIndexes()[0].row()
+ self.previewIcon()
# On color checkbox clicked
def colorClick(self):