815 |
815 |
816 @param ok flag indicating the result (boolean) |
816 @param ok flag indicating the result (boolean) |
817 """ |
817 """ |
818 self.__isLoading = False |
818 self.__isLoading = False |
819 self.mw.progressBar().hide() |
819 self.mw.progressBar().hide() |
820 self.mw.resetLoading(self) |
820 self.mw.resetLoading(self, ok) |
821 |
821 |
822 self.__iconChanged() |
822 self.__iconChanged() |
823 |
823 |
824 self.mw.passwordManager().fill(self.page()) |
824 if ok: |
|
825 self.mw.passwordManager().fill(self.page()) |
825 |
826 |
826 def isLoading(self): |
827 def isLoading(self): |
827 """ |
828 """ |
828 Public method to get the loading state. |
829 Public method to get the loading state. |
829 |
830 |
862 return |
863 return |
863 |
864 |
864 if reply.error() == QNetworkReply.NoError: |
865 if reply.error() == QNetworkReply.NoError: |
865 if reply.url().isEmpty(): |
866 if reply.url().isEmpty(): |
866 return |
867 return |
867 header = reply.header(QNetworkRequest.ContentLengthHeader) |
868 size = reply.header(QNetworkRequest.ContentLengthHeader) |
868 size = header |
|
869 if size == 0: |
869 if size == 0: |
870 return |
870 return |
871 |
871 |
872 if requestFilename is None: |
872 if requestFilename is None: |
873 requestFilename = Preferences.getUI("RequestDownloadFilename") |
873 requestFilename = Preferences.getUI("RequestDownloadFilename") |
874 dlg = DownloadDialog(reply, requestFilename, self.page(), download) |
874 dlg = DownloadDialog(reply, requestFilename, self.page(), download) |
875 self.connect(dlg, SIGNAL("done()"), self.__downloadDone) |
875 if dlg.initialize(): |
876 self.__downloadWindows.append(dlg) |
876 self.connect(dlg, SIGNAL("done()"), self.__downloadDone) |
877 dlg.show() |
877 self.__downloadWindows.append(dlg) |
|
878 dlg.show() |
878 else: |
879 else: |
879 replyUrl = reply.url() |
880 replyUrl = reply.url() |
880 if replyUrl.isEmpty(): |
881 if replyUrl.isEmpty(): |
881 return |
882 return |
882 |
883 |
912 Private slot to handle the done signal of the download dialogs. |
913 Private slot to handle the done signal of the download dialogs. |
913 """ |
914 """ |
914 dlg = self.sender() |
915 dlg = self.sender() |
915 if dlg in self.__downloadWindows: |
916 if dlg in self.__downloadWindows: |
916 self.disconnect(dlg, SIGNAL("done()"), self.__downloadDone) |
917 self.disconnect(dlg, SIGNAL("done()"), self.__downloadDone) |
917 self.__downloadWindows.remove(dlg) |
|
918 |
918 |
919 def __downloadRequested(self, request): |
919 def __downloadRequested(self, request): |
920 """ |
920 """ |
921 Private slot to handle a download request. |
921 Private slot to handle a download request. |
922 |
922 |