Esempio n. 1
6
 def __init__(self, nombre, parent=None):
     QVBox.__init__(self, parent)
     self.caja = WidgetSeleccionCaja(nombre, self).caja
     from Driza.iuqt3.widgetsqt import WidgetListaComboBox
     self.combo1 = WidgetListaComboBox(self)
     self.combo2 = WidgetListaComboBox(self)
Esempio n. 2
0
 def __init__(self, *args):
     QVBox.__init__(self, *args)
     self.slider = QSlider(QSlider.Horizontal, self, "slider")
     self.slider.setRange(0, 999)
     self.slider.setValue(0)
     QObject.connect(self.slider, SIGNAL("valueChanged(int)"), self.valueChanged)
     self.setFocusProxy(self.slider)
Esempio n. 3
0
 def __init__(self, listaopciones = None):
     QVBox.__init__(self, None, "Widget opciones")
     ContenedorElementoWidgetOpciones.__init__(self)
     self.clearWState(Qt.WState_Polished)
     self.setCaption("WidgetOpciones")
     if listaopciones == None:
         listaopciones = []
     for opcion in listaopciones:
         self.procesar(opcion)
Esempio n. 4
0
	def _initWidgets(self):
		"""Initialises all of the main widgets in the window."""
		global appRoot
		
		appIconPath = os.path.join(appRoot, "images/miniicon.png")
		self.setIcon(QPixmap(appIconPath))
		
		self.mainBox = QHBox(self)
		self.mainSplitter = QSplitter(self.mainBox)
		
		self.bmarksListBox = QVBox(self.mainSplitter)
		self.bmarksListBox.setMaximumWidth(250)
		
		self.bmarksList = KTVBookmarksListView.KTVBookmarksListView(self.bmarksListBox, self)
		QObject.connect(self.bmarksList, SIGNAL(str(u'doubleClicked(QListViewItem *)')), self._bookmarkChosen)
		
		self.browserBox = QVBox(self.mainSplitter)
		self.browser = KTVHTMLPart.KTVHTMLPart(self.browserBox, self)
		
		self.setCentralWidget(self.mainBox)
		
		self._buttonBox = QHBox(self.bmarksListBox)
		self._addButton = QPushButton(u"&Add", self._buttonBox, str(u""))
		QObject.connect(self._addButton, SIGNAL(str(u'clicked()')), self._addItem)
		
		self._deleteButton = QPushButton(u"&Delete", self._buttonBox, str(u""))
		QObject.connect(self._deleteButton, SIGNAL(str(u'clicked()')), self._deleteItem)
		
		self._backButton = QPushButton(u"&Back", self.bmarksListBox, str(u""))
		QObject.connect(self._backButton, SIGNAL(str(u'clicked()')), self._back)
		
		self._helpButton = QPushButton(u"&Help", self.bmarksListBox, str(u""))
		QObject.connect(self._helpButton, SIGNAL(str(u'clicked()')), self._help)
		
		self.statusBar().message(u"KatchTV is now ready for use.")
Esempio n. 5
0
 def __init__(self, nombre1, nombre2, parent = None):
     QVBox.__init__(self, parent)
     self.caja1 = WidgetSeleccionCaja(nombre1, self).caja
     self.caja2 = WidgetSeleccionCaja(nombre2, self).caja
Esempio n. 6
0
 def __init__(self, nombre, parent = None):
     from Driza.iuqt3.widgetsqt import WidgetListaListBox
     QVBox.__init__(self, parent)
     self.label = QLabel(self)
     self.label.setText(nombre)
     self.caja = WidgetListaListBox(self)
Esempio n. 7
-1
class KTVMainWindow(KParts.MainWindow):
	"""Implements the main KatchTV application window."""

	def __init__(self, title):
		"""Initialises a new window object."""
		self._stopped = True
		
		KParts.MainWindow.__init__(self, None, str(title))
		self.setCaption(config.appFullVersion)
		
		self._initWidgets()
		
		self.__mediaManager = Media.Manager()
		
		self.__downloadTimer = QTimer()
		self.__downloadTimer.connect(self.__downloadTimer,SIGNAL(str(u"timeout()")), self.__updateDownloads)
		
		self.browser.goToURL(u'katchtv:welcome:')

	def saveAll(self):
		self.__mediaManager._saveItems()
	
	def __updateDownloads(self):
		self.__mediaManager.beginNewDownloads()
	
	def enableThreads(self):
		# start everything, and mark as running
		self.__downloadTimer.start(config.updateDownloadsTimerMillisecs)
		self.bmarksList.enableThreads()
		self._stopped = False
	
	def disableThreads(self):
		# stop in the order of slowest to fastest, hoping it'll
		# all finish around the same time
		self.bmarksList.disableThreads()
		self.__mediaManager.stop()
		self.__downloadTimer.stop()
		self._stopped = True
	
	def getMediaManager(self):
		return self.__mediaManager
	
	def isStopped(self):
		"""Returns True if the application should not run yet (ie, if
		it has not been fully initialised)."""
		return self._stopped

	def _initWidgets(self):
		"""Initialises all of the main widgets in the window."""
		global appRoot
		
		appIconPath = os.path.join(appRoot, "images/miniicon.png")
		self.setIcon(QPixmap(appIconPath))
		
		self.mainBox = QHBox(self)
		self.mainSplitter = QSplitter(self.mainBox)
		
		self.bmarksListBox = QVBox(self.mainSplitter)
		self.bmarksListBox.setMaximumWidth(250)
		
		self.bmarksList = KTVBookmarksListView.KTVBookmarksListView(self.bmarksListBox, self)
		QObject.connect(self.bmarksList, SIGNAL(str(u'doubleClicked(QListViewItem *)')), self._bookmarkChosen)
		
		self.browserBox = QVBox(self.mainSplitter)
		self.browser = KTVHTMLPart.KTVHTMLPart(self.browserBox, self)
		
		self.setCentralWidget(self.mainBox)
		
		self._buttonBox = QHBox(self.bmarksListBox)
		self._addButton = QPushButton(u"&Add", self._buttonBox, str(u""))
		QObject.connect(self._addButton, SIGNAL(str(u'clicked()')), self._addItem)
		
		self._deleteButton = QPushButton(u"&Delete", self._buttonBox, str(u""))
		QObject.connect(self._deleteButton, SIGNAL(str(u'clicked()')), self._deleteItem)
		
		self._backButton = QPushButton(u"&Back", self.bmarksListBox, str(u""))
		QObject.connect(self._backButton, SIGNAL(str(u'clicked()')), self._back)
		
		self._helpButton = QPushButton(u"&Help", self.bmarksListBox, str(u""))
		QObject.connect(self._helpButton, SIGNAL(str(u'clicked()')), self._help)
		
		self.statusBar().message(u"KatchTV is now ready for use.")

	def _help(self):
		"""A hook (a Qt signal slot, actually) which is called when the user
		clicks the "Help" button.  Loads the manual into the browser."""
		self.browser.goToURL(u'katchtv:help:')
	
	def _back(self):
		"""A hook (a Qt signal slot) which is called when the user clicks the
		"Back" button.  Navigates one step back through the browser history."""
		self.browser.loadPreviousPage()
	
	def _addItem(self):
		"""A hook (Qt signal slot) which is called when the user clicks
		the "Add" button.  Presents a dialog, asking the user for the
		feed URI to add."""
		validURI = False
		firstTry = True
		while not validURI:
			if firstTry:
				uri, confirmed = KInputDialog.text(u"Add Feed Bookmark", QString(u"Please enter the channel's feed URI (or URL) here."))
				uri = unicode(uri)
			else:
				uri, confirmed = KInputDialog.text(u"Add Feed Bookmark", u"The URI you entered was invalid.  Please try again, or cancel.", QString(uri))
				uri = unicode(uri)
			firstTry = False
			if confirmed:
				validURI = utils.isAFeed(uri)
			else:
				# user cancelled the input
				return
		feed = Feed.FeedCache.getFeedFromURINoLock(uri)
		self.bmarksList.addChannel(feed)
	
	def _deleteItem(self):
		"""A hook (Qt signal slot) which is called when the user
		clicks the Delete button.  Deletes the selected item,
		if that item is a subscribed channel.  Otherwise, informs
		the user that they cannot delete the item."""
		self.bmarksList.delCurrentItem()

	def _bookmarkChosen(self, item):
		"""A hook (Qt signal slot) which is called when the user double-clicks
		on an item in the listview.  Checks if the item has a URI column entry,
		and if so, navigates to it."""
		title = item.text(KTVBookmarksListView.COL_NAME)
		uri = item.text(KTVBookmarksListView.COL_URI)
		if title != u'' and uri != u'':
			self.browser.goToURL(uri)

	def getBookmarksList(self):
		return self.bmarksList