def checkInternetConnection(self): msg = RetrieveData.checkInetConn()[0] # return values : inet conn ok or non existent fail = RetrieveData.checkInetConn()[1] if fail: qmessagebox.warning(self, msg) else: self.statusleiste.showMessage(msg) self.connected_to_net = True
def checkEntries(self): if self.autorName.text() != "" and self.titelfeld.text() != "" and self.urlfeld.text() != "": self.btn_new.setEnabled(True) self.btn_addToList.setEnabled(True) self.btn_delete.setEnabled(False) self.btn_delete.setEnabled(False) return True else: qmessagebox.warning(self, u'Nicht alle Felder ausgefüllt, oder Buchformat nicht gewählt')
def checkStatus(self): filelist = os.listdir('data') if 'books.xml' in filelist: try: xmlbooklist = xmlHandler.read("data/books.xml") except: qmessagebox.warning(self, u'books.xml ungültig. Neue Bücher anlegen.') else: startup = ManageBooks() startup.exec() self.readBookData()
def cleanUpURL(self): book_id = "" if not self.urlfeld.text().isdecimal(): try: stripurl = (self.urlfeld.text().rsplit("/", 1))[0] book_id = stripurl.split("/", 3)[3] return book_id except: qmessagebox.warning(self, u"Der Link ist nicht in Ordnung/fehlt. Bitte überprüfen") else: book_id = self.urlfeld.text() return book_id
def checkInitStatus(self): filelist = os.listdir('data') if 'books.xml' in filelist: try: xmlbooklist = xmlHandler.read("data/books.xml") self.readBookList() self.initialSetup = False self.btn_save.setEnabled(False) self.btn_delete.setEnabled(True) self.btn_addToList.setEnabled(False) except: qmessagebox.warning(self, u'books.xml ungültig. Neue Bücher anlegen.') self.initialSetup = True self.btn_save.setEnabled(False) self.btn_delete.setEnabled(False) self.btn_addToList.setEnabled(True) else: self.initialSetup = True self.btn_addToList.setEnabled(False) self.btn_new.setEnabled(False) self.btn_save.setEnabled(False) self.btn_delete.setEnabled(False)