24 QTreeWidgetItem, |
24 QTreeWidgetItem, |
25 QMenu, |
25 QMenu, |
26 QStyle, |
26 QStyle, |
27 ) |
27 ) |
28 |
28 |
29 from EricNetwork import EricTldExtractor, EricNetworkUtilities |
29 from eric7.EricNetwork import EricTldExtractor, EricNetworkUtilities |
30 |
30 |
31 from EricWidgets.EricApplication import ericApp |
31 from eric7.EricWidgets.EricApplication import ericApp |
32 from EricWidgets.EricClickableLabel import EricClickableLabel |
32 from eric7.EricWidgets.EricClickableLabel import EricClickableLabel |
33 |
33 |
34 import Utilities |
34 from eric7 import Preferences, Utilities |
35 import UI.PixmapCache |
35 from eric7.EricGui import EricPixmapCache |
36 import Preferences |
|
37 |
36 |
38 |
37 |
39 class TabManagerWidget(QWidget): |
38 class TabManagerWidget(QWidget): |
40 """ |
39 """ |
41 Class implementing a window for managing the web browser tabs. |
40 Class implementing a window for managing the web browser tabs. |
289 font.setBold(True) |
288 font.setBold(True) |
290 tabItem.setFont(0, font) |
289 tabItem.setFont(0, font) |
291 if not browser.isLoading(): |
290 if not browser.isLoading(): |
292 tabItem.setIcon(0, browser.icon()) |
291 tabItem.setIcon(0, browser.icon()) |
293 else: |
292 else: |
294 tabItem.setIcon(0, UI.PixmapCache.getIcon("loading")) |
293 tabItem.setIcon(0, EricPixmapCache.getIcon("loading")) |
295 tabItem.setText(0, browser.title()) |
294 tabItem.setText(0, browser.title()) |
296 tabItem.setToolTip(0, browser.title()) |
295 tabItem.setToolTip(0, browser.title()) |
297 |
296 |
298 tabItem.setData(0, TabManagerWidget.WebBrowserRole, browser) |
297 tabItem.setData(0, TabManagerWidget.WebBrowserRole, browser) |
299 tabItem.setData(0, TabManagerWidget.WebWindowRole, mainWin) |
298 tabItem.setData(0, TabManagerWidget.WebWindowRole, mainWin) |
331 font.setBold(True) |
330 font.setBold(True) |
332 tabItem.setFont(0, font) |
331 tabItem.setFont(0, font) |
333 if not browser.isLoading(): |
332 if not browser.isLoading(): |
334 tabItem.setIcon(0, browser.icon()) |
333 tabItem.setIcon(0, browser.icon()) |
335 else: |
334 else: |
336 tabItem.setIcon(0, UI.PixmapCache.getIcon("loading")) |
335 tabItem.setIcon(0, EricPixmapCache.getIcon("loading")) |
337 tabItem.setText(0, browser.title()) |
336 tabItem.setText(0, browser.title()) |
338 tabItem.setToolTip(0, browser.title()) |
337 tabItem.setToolTip(0, browser.title()) |
339 |
338 |
340 tabItem.setData(0, TabManagerWidget.WebBrowserRole, browser) |
339 tabItem.setData(0, TabManagerWidget.WebBrowserRole, browser) |
341 tabItem.setData(0, TabManagerWidget.WebWindowRole, mainWin) |
340 tabItem.setData(0, TabManagerWidget.WebWindowRole, mainWin) |
526 |
525 |
527 menu.addSeparator() |
526 menu.addSeparator() |
528 |
527 |
529 if self.__isBrowserSelected(): |
528 if self.__isBrowserSelected(): |
530 act1 = menu.addAction( |
529 act1 = menu.addAction( |
531 UI.PixmapCache.getIcon("bookmark22"), self.tr("&Bookmark checked tabs") |
530 EricPixmapCache.getIcon("bookmark22"), self.tr("&Bookmark checked tabs") |
532 ) |
531 ) |
533 act1.setObjectName("bookmarkSelection") |
532 act1.setObjectName("bookmarkSelection") |
534 act1.triggered.connect(lambda: self.__processActions(act1)) |
533 act1.triggered.connect(lambda: self.__processActions(act1)) |
535 act2 = menu.addAction( |
534 act2 = menu.addAction( |
536 UI.PixmapCache.getIcon("tabClose"), self.tr("&Close checked tabs") |
535 EricPixmapCache.getIcon("tabClose"), self.tr("&Close checked tabs") |
537 ) |
536 ) |
538 act2.setObjectName("closeSelection") |
537 act2.setObjectName("closeSelection") |
539 act2.triggered.connect(lambda: self.__processActions(act2)) |
538 act2.triggered.connect(lambda: self.__processActions(act2)) |
540 |
539 |
541 menu.exec(self.__tree.viewport().mapToGlobal(pos)) |
540 menu.exec(self.__tree.viewport().mapToGlobal(pos)) |
562 |
561 |
563 @return generated icon |
562 @return generated icon |
564 @rtype EricClickableLabel |
563 @rtype EricClickableLabel |
565 """ |
564 """ |
566 icon = EricClickableLabel() |
565 icon = EricClickableLabel() |
567 icon.setPixmap(UI.PixmapCache.getPixmap("tabManager").scaled(16, 16)) |
566 icon.setPixmap(EricPixmapCache.getPixmap("tabManager").scaled(16, 16)) |
568 icon.setToolTip(self.tr("Show Tab Manager")) |
567 icon.setToolTip(self.tr("Show Tab Manager")) |
569 icon.clicked.connect(lambda: self.raiseTabManager(icon)) |
568 icon.clicked.connect(lambda: self.raiseTabManager(icon)) |
570 |
569 |
571 return icon |
570 return icon |
572 |
571 |