Eagleget For Linux (2024)

def get_data(self): return (self.url_input.text(), self.path_input.text(), self.threads_spin.value()) src/browser_integration.py

def start(self, callback): self.callback = callback self.server = HTTPServer(('localhost', self.port), DownloadHandler) self.server.callback = callback thread = threading.Thread(target=self.server.serve_forever) thread.daemon = True thread.start() eagleget for linux

def init_ui(self): self.setWindowTitle("EagleGet for Linux") self.setGeometry(100, 100, 900, 600) # Create menu bar menubar = self.menuBar() file_menu = menubar.addMenu('File') new_action = QAction('New Download', self) new_action.triggered.connect(self.new_download) new_action.setShortcut('Ctrl+N') file_menu.addAction(new_action) exit_action = QAction('Exit', self) exit_action.triggered.connect(self.close) file_menu.addAction(exit_action) # Toolbar toolbar = self.addToolBar('Tools') toolbar.addAction(QIcon.fromTheme('download'), 'New Download', self.new_download) toolbar.addAction(QIcon.fromTheme('media-playback-start'), 'Start', self.start_download) toolbar.addAction(QIcon.fromTheme('media-playback-pause'), 'Pause', self.pause_download) toolbar.addAction(QIcon.fromTheme('edit-delete'), 'Remove', self.remove_download) # Central widget central_widget = QWidget() self.setCentralWidget(central_widget) layout = QVBoxLayout(central_widget) # URL input bar url_layout = QHBoxLayout() self.url_input = QLineEdit() self.url_input.setPlaceholderText("Enter URL to download...") download_btn = QPushButton("Download") download_btn.clicked.connect(self.new_download) url_layout.addWidget(self.url_input) url_layout.addWidget(download_btn) layout.addLayout(url_layout) # Download table self.table_view = QTableView() self.model = DownloadTableModel(self.manager) self.table_view.setModel(self.model) self.table_view.setSelectionBehavior(QAbstractItemView.SelectRows) self.table_view.horizontalHeader().setStretchLastSection(True) layout.addWidget(self.table_view) # Status bar self.status_label = QLabel("Ready") self.statusBar().addWidget(self.status_label) # Apply stylesheet self.setStyleSheet(""" QMainWindow background-color: #f5f5f5; QTableView background-color: white; alternate-background-color: #f9f9f9; selection-background-color: #3498db; gridline-color: #e0e0e0; QHeaderView::section background-color: #ecf0f1; padding: 8px; border: 1px solid #ddd; QPushButton background-color: #3498db; color: white; border: none; padding: 8px 16px; border-radius: 4px; QPushButton:hover background-color: #2980b9; QLineEdit padding: 8px; border: 1px solid #ddd; border-radius: 4px; """) def new_download(self): dialog = DownloadDialog(self) if dialog.exec_(): url, save_path, threads = dialog.get_data() if url: task_id = self.manager.add_download(url, save_path, threads) self.manager.start_download(task_id) self.model.refresh() def get_data(self): return (self