mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
queue manager - can remove items now - #30
This commit is contained in:
@@ -1301,6 +1301,8 @@ class abogen(QWidget):
|
||||
use_gpu=self.gpu_ok
|
||||
)
|
||||
self.enqueue(item)
|
||||
# Clear input after adding to queue
|
||||
self.input_box.clear_input()
|
||||
|
||||
def manage_queue(self):
|
||||
if not self.queued_items:
|
||||
|
||||
@@ -57,13 +57,23 @@ class QueueManager(QDialog):
|
||||
if not self.queue:
|
||||
return
|
||||
for item in self.queue:
|
||||
# TODO take just the file name from the item, no directories
|
||||
self.listwidget.addItem(item.file_name)
|
||||
|
||||
# self.listwidget.clicked.connect(self.clicked)
|
||||
|
||||
def remove_item(self):
|
||||
item = self.listwidget.currentItem()
|
||||
if not item:
|
||||
return
|
||||
found_item = [q for q in self.queue if q.file_name==item.text()][0]
|
||||
self.queue.remove(found_item)
|
||||
# rebind the queue to the listwidget
|
||||
self.listwidget.clear()
|
||||
self.process_queue()
|
||||
pass
|
||||
|
||||
def clear_queue(self):
|
||||
self.queue.clear()
|
||||
self.listwidget.clear()
|
||||
self.listwidget.clear()
|
||||
|
||||
def get_queue(self):
|
||||
return self.queue
|
||||
Reference in New Issue
Block a user