Exemplo n.º 1
0
	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
Exemplo n.º 2
0
	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')
Exemplo n.º 3
0
	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()
Exemplo n.º 4
0
	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
Exemplo n.º 5
0
	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)