[qcineoob] thumbnails resize, showThumbnailCheck state saved in config

This commit is contained in:
Julien Veyssier 2013-03-26 16:21:30 +01:00
commit 971ea3346a
5 changed files with 9 additions and 4 deletions

View file

@ -72,6 +72,9 @@ class MainWindow(QtMainWindow):
count = self.config.get('settings', 'maxresultsnumber')
self.ui.countSpin.setValue(int(count))
showT = self.config.get('settings', 'showthumbnails')
print showT
self.ui.showTCheck.setChecked(showT == '1')
self.connect(self.ui.actionBackends, SIGNAL("triggered()"), self.backendsConfig)
self.connect(self.ui.actionQuit, SIGNAL("triggered()"), self.close)
@ -443,6 +446,7 @@ class MainWindow(QtMainWindow):
self.ui.backendEdit.currentIndex()).toString()))
self.saveSearchHistory()
self.config.set('settings', 'maxresultsnumber', self.ui.countSpin.value())
self.config.set('settings', 'showthumbnails', '1' if self.ui.showTCheck.isChecked() else '0')
self.config.save()
ev.accept()

View file

@ -49,7 +49,7 @@ class MiniMovie(QFrame):
if not empty(self.movie.thumbnail_url):
data = urllib.urlopen(self.movie.thumbnail_url).read()
img = QImage.fromData(data)
self.ui.imageLabel.setPixmap(QPixmap.fromImage(img))
self.ui.imageLabel.setPixmap(QPixmap.fromImage(img).scaledToHeight(100,Qt.SmoothTransformation))
def enterEvent(self, event):
self.setFrameShadow(self.Sunken)

View file

@ -54,7 +54,7 @@ class MiniPerson(QFrame):
if not empty(self.person.thumbnail_url):
data = urllib.urlopen(self.person.thumbnail_url).read()
img = QImage.fromData(data)
self.ui.imageLabel.setPixmap(QPixmap.fromImage(img))
self.ui.imageLabel.setPixmap(QPixmap.fromImage(img).scaledToHeight(100,Qt.SmoothTransformation))
def enterEvent(self, event):
self.setFrameShadow(self.Sunken)

View file

@ -34,7 +34,8 @@ class QCineoob(QtApplication):
SHORT_DESCRIPTION = "search movies, people, torrent and subtitles"
CAPS = ICapCinema, ICapTorrent, ICapSubtitle
CONFIG = {'settings': {'backend': '',
'maxresultsnumber': '10'
'maxresultsnumber': '10',
'showthumbnails': '0'
}
}

View file

@ -145,7 +145,7 @@
<item>
<widget class="QCheckBox" name="showTCheck">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;may slow search process&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;might slow search process&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Show thumbnails</string>