4 # |
4 # |
5 |
5 |
6 """ |
6 """ |
7 Module implementing a dialog to add RSS feeds. |
7 Module implementing a dialog to add RSS feeds. |
8 """ |
8 """ |
|
9 |
|
10 import functools |
9 |
11 |
10 from PyQt5.QtCore import QUrl |
12 from PyQt5.QtCore import QUrl |
11 from PyQt5.QtWidgets import QDialog, QPushButton, QLabel |
13 from PyQt5.QtWidgets import QDialog, QPushButton, QLabel |
12 |
14 |
13 from E5Gui import E5MessageBox |
15 from E5Gui import E5MessageBox |
45 button.feed = feed |
47 button.feed = feed |
46 label = QLabel(self) |
48 label = QLabel(self) |
47 label.setText(feed[0]) |
49 label.setText(feed[0]) |
48 self.feedsLayout.addWidget(label, row, 0) |
50 self.feedsLayout.addWidget(label, row, 0) |
49 self.feedsLayout.addWidget(button, row, 1) |
51 self.feedsLayout.addWidget(button, row, 1) |
50 button.clicked.connect(lambda: self.__addFeed(button)) |
52 button.clicked.connect( |
|
53 functools.partial(self.__addFeed, button)) |
51 |
54 |
52 msh = self.minimumSizeHint() |
55 msh = self.minimumSizeHint() |
53 self.resize(max(self.width(), msh.width()), msh.height()) |
56 self.resize(max(self.width(), msh.width()), msh.height()) |
54 |
57 |
55 def __addFeed(self, button): |
58 def __addFeed(self, button): |