1
0
mirror of https://github.com/gryf/pygtktalog.git synced 2025-12-17 19:40:21 +01:00

* Added dialog in case where there is ann error in CD/DVD mount in

addCD method.
This commit is contained in:
2006-11-26 10:58:37 +00:00
parent c7b948f1e8
commit 1b77a49958

View File

@@ -1,5 +1,4 @@
#!/usr/bin/python # This Python file uses the following encoding: utf-8
# -*- coding: utf-8 -*-
""" """
GUI, main window class and correspondig methods for pyGTKtalog app. GUI, main window class and correspondig methods for pyGTKtalog app.
""" """
@@ -11,7 +10,10 @@ import popen2
import pygtk import pygtk
import gtk import gtk
import gtk.glade import gtk.glade
from config import Config from config import Config
import deviceHelper
import dialogs
class PyGTKtalog: class PyGTKtalog:
def __init__(self): def __init__(self):
@@ -83,7 +85,8 @@ class PyGTKtalog:
def newDB(self,widget): def newDB(self,widget):
"""create database in temporary place""" """create database in temporary place"""
self.window.set_title("untitled - pyGTKtalog") self.window.set_title("żażółć gęślą jaźń")
#self.window.set_title("untitled - pyGTKtalog")
for w in self.widgets: for w in self.widgets:
try: try:
a = self.pygtkcat.get_widget(w) a = self.pygtkcat.get_widget(w)
@@ -114,7 +117,12 @@ class PyGTKtalog:
gtk.main() gtk.main()
def addCD(self,widget): def addCD(self,widget):
mount = deviceHelper.volmount(self.conf.confd['cd'])
if mount == 'ok':
self.scan(self.conf.confd['cd']) self.scan(self.conf.confd['cd'])
deviceHelper.eject_cd()
else:
msg = dialogs.Wrn(self.window, "error mounting device - pyGTKtalog","Cannot mount device pointed to %s.\nLast mount message:\n<tt>%s</tt>" % (self.conf.confd['cd'],mount))
def scan(self,path): def scan(self,path):
mime = mimetypes.MimeTypes() mime = mimetypes.MimeTypes()