5 |
5 |
6 """ |
6 """ |
7 Module implementing the URL bar widget. |
7 Module implementing the URL bar widget. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt4.QtCore import pyqtSlot, Qt, QPointF, QUrl |
10 from PyQt4.QtCore import pyqtSlot, Qt, QPointF, QUrl, QDateTime |
11 from PyQt4.QtGui import QColor, QPalette, QApplication, QLinearGradient, QIcon, QDialog |
11 from PyQt4.QtGui import QColor, QPalette, QApplication, QLinearGradient, QIcon, QDialog |
12 try: |
12 try: |
13 from PyQt4.QtNetwork import QSslCertificate # __IGNORE_EXCEPTION__ |
13 from PyQt4.QtNetwork import QSslCertificate # __IGNORE_EXCEPTION__ |
14 except ImportError: |
14 except ImportError: |
15 QSslCertificate = None # __IGNORE_WARNING__ |
15 QSslCertificate = None # __IGNORE_WARNING__ |
24 from .SslLabel import SslLabel |
24 from .SslLabel import SslLabel |
25 from .BookmarkInfoDialog import BookmarkInfoDialog |
25 from .BookmarkInfoDialog import BookmarkInfoDialog |
26 from .BookmarkActionSelectionDialog import BookmarkActionSelectionDialog |
26 from .BookmarkActionSelectionDialog import BookmarkActionSelectionDialog |
27 |
27 |
28 from Helpviewer.Feeds.FeedsDialog import FeedsDialog |
28 from Helpviewer.Feeds.FeedsDialog import FeedsDialog |
|
29 from Helpviewer.Bookmarks.BookmarkNode import BookmarkNode |
29 |
30 |
30 import UI.PixmapCache |
31 import UI.PixmapCache |
31 import Preferences |
32 import Preferences |
32 import Utilities |
33 import Utilities |
33 |
34 |
142 |
143 |
143 def __checkBookmark(self): |
144 def __checkBookmark(self): |
144 """ |
145 """ |
145 Private slot to check the current URL for the bookmarked state. |
146 Private slot to check the current URL for the bookmarked state. |
146 """ |
147 """ |
147 if Helpviewer.HelpWindow.HelpWindow.bookmarksManager()\ |
148 manager = Helpviewer.HelpWindow.HelpWindow.bookmarksManager() |
148 .bookmarkForUrl(self.__browser.url()) is None and \ |
149 if manager.bookmarkForUrl(self.__browser.url()) is not None: |
149 Helpviewer.HelpWindow.HelpWindow.speedDial()\ |
150 self.__bookmarkButton.setIcon(self.__bmActiveIcon) |
150 .pageForUrl(self.__browser.url()).url == "": |
151 bookmark = manager.bookmarkForUrl(self.__browser.url()) |
|
152 manager.setTimestamp(bookmark, BookmarkNode.TsVisited, |
|
153 QDateTime.currentDateTime()) |
|
154 elif Helpviewer.HelpWindow.HelpWindow.speedDial()\ |
|
155 .pageForUrl(self.__browser.url()).url != "": |
|
156 self.__bookmarkButton.setIcon(self.__bmActiveIcon) |
|
157 else: |
151 self.__bookmarkButton.setIcon(self.__bmInactiveIcon) |
158 self.__bookmarkButton.setIcon(self.__bmInactiveIcon) |
152 else: |
|
153 self.__bookmarkButton.setIcon(self.__bmActiveIcon) |
|
154 |
159 |
155 def __loadFinished(self, ok): |
160 def __loadFinished(self, ok): |
156 """ |
161 """ |
157 Private slot to set some data after the page was loaded. |
162 Private slot to set some data after the page was loaded. |
158 |
163 |