Make GUI not exit when device is busy. Version bump.

This commit is contained in:
Kovid Goyal 2007-01-09 01:07:57 +00:00
parent 3f4f7e7b0b
commit 9cad32e207
2 changed files with 6 additions and 5 deletions

View File

@ -37,6 +37,6 @@ the following rule in C{/etc/udev/rules.d/90-local.rules} ::
You may have to adjust the GROUP and the location of the rules file to You may have to adjust the GROUP and the location of the rules file to
suit your distribution. suit your distribution.
""" """
__version__ = "0.3.0b4" __version__ = "0.3.0b5"
__docformat__ = "epytext" __docformat__ = "epytext"
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>" __author__ = "Kovid Goyal <kovid@kovidgoyal.net>"

View File

@ -520,7 +520,8 @@ class Main(QObject, Ui_MainWindow):
try: try:
info = self.dev.get_device_information(end_session=False) info = self.dev.get_device_information(end_session=False)
except DeviceBusy, err: except DeviceBusy, err:
qFatal(str(err)) Error("Device is in use by another application", None)
self.status("Device busy")
except DeviceError, err: except DeviceError, err:
self.dev.reconnect() self.dev.reconnect()
self.thread().msleep(100) self.thread().msleep(100)
@ -532,14 +533,14 @@ class Main(QObject, Ui_MainWindow):
self.df.setText(self.df_template.arg("Connected: "+info[0])\ self.df.setText(self.df_template.arg("Connected: "+info[0])\
.arg(info[1]).arg(info[2])) .arg(info[1]).arg(info[2]))
self.update_availabe_space(end_session=False) self.update_availabe_space(end_session=False)
self.card = self.dev.card() self.card = self.dev.card()
self.is_connected = True
if self.card: self.device_tree.hide_card(False) if self.card: self.device_tree.hide_card(False)
else: self.device_tree.hide_card(True) else: self.device_tree.hide_card(True)
self.device_tree.hide_reader(False) self.device_tree.hide_reader(False)
self.status("Loading media list from SONY Reader") self.status("Loading media list from SONY Reader")
self.reader_model.set_data(self.dev.books(end_session=False)) self.reader_model.set_data(self.dev.books(end_session=False))
if self.card: self.status("Loading media list from Storage Card") if self.card:
self.status("Loading media list from Storage Card")
self.card_model.set_data(self.dev.books(oncard=True)) self.card_model.set_data(self.dev.books(oncard=True))
self.progress(100) self.progress(100)
self.window.setCursor(Qt.ArrowCursor) self.window.setCursor(Qt.ArrowCursor)