13 import urllib.request, urllib.parse, urllib.error |
13 import urllib.request, urllib.parse, urllib.error |
14 |
14 |
15 from PyQt4.QtCore import * |
15 from PyQt4.QtCore import * |
16 from PyQt4.QtGui import * |
16 from PyQt4.QtGui import * |
17 |
17 |
18 from E4Gui.E4Application import e4App |
18 from E4Gui.E4Application import e5App |
19 |
19 |
20 from VCS.VersionControl import VersionControl |
20 from VCS.VersionControl import VersionControl |
21 |
21 |
22 from .SvnDialog import SvnDialog |
22 from .SvnDialog import SvnDialog |
23 from .SvnCommitDialog import SvnCommitDialog |
23 from .SvnCommitDialog import SvnCommitDialog |
768 names = name[:] |
768 names = name[:] |
769 else: |
769 else: |
770 names = [name] |
770 names = [name] |
771 for nam in names: |
771 for nam in names: |
772 if os.path.isfile(nam): |
772 if os.path.isfile(nam): |
773 editor = e4App().getObject("ViewManager").getOpenEditor(nam) |
773 editor = e5App().getObject("ViewManager").getOpenEditor(nam) |
774 if editor and not editor.checkDirty() : |
774 if editor and not editor.checkDirty() : |
775 return |
775 return |
776 else: |
776 else: |
777 project = e4App().getObject("Project") |
777 project = e5App().getObject("Project") |
778 if nam == project.ppath and not project.saveAllScripts(): |
778 if nam == project.ppath and not project.saveAllScripts(): |
779 return |
779 return |
780 self.diff = SvnDiffDialog(self) |
780 self.diff = SvnDiffDialog(self) |
781 self.diff.show() |
781 self.diff.show() |
782 QApplication.processEvents() |
782 QApplication.processEvents() |
1502 names = name[:] |
1502 names = name[:] |
1503 else: |
1503 else: |
1504 names = [name] |
1504 names = [name] |
1505 for nam in names: |
1505 for nam in names: |
1506 if os.path.isfile(nam): |
1506 if os.path.isfile(nam): |
1507 editor = e4App().getObject("ViewManager").getOpenEditor(nam) |
1507 editor = e5App().getObject("ViewManager").getOpenEditor(nam) |
1508 if editor and not editor.checkDirty() : |
1508 if editor and not editor.checkDirty() : |
1509 return |
1509 return |
1510 else: |
1510 else: |
1511 project = e4App().getObject("Project") |
1511 project = e5App().getObject("Project") |
1512 if nam == project.ppath and not project.saveAllScripts(): |
1512 if nam == project.ppath and not project.saveAllScripts(): |
1513 return |
1513 return |
1514 dlg = SvnRevisionSelectionDialog() |
1514 dlg = SvnRevisionSelectionDialog() |
1515 if dlg.exec_() == QDialog.Accepted: |
1515 if dlg.exec_() == QDialog.Accepted: |
1516 revisions = dlg.getRevisions() |
1516 revisions = dlg.getRevisions() |
1535 names = name[:] |
1535 names = name[:] |
1536 else: |
1536 else: |
1537 names = [name] |
1537 names = [name] |
1538 for nam in names: |
1538 for nam in names: |
1539 if os.path.isfile(nam): |
1539 if os.path.isfile(nam): |
1540 editor = e4App().getObject("ViewManager").getOpenEditor(nam) |
1540 editor = e5App().getObject("ViewManager").getOpenEditor(nam) |
1541 if editor and not editor.checkDirty() : |
1541 if editor and not editor.checkDirty() : |
1542 return |
1542 return |
1543 else: |
1543 else: |
1544 project = e4App().getObject("Project") |
1544 project = e5App().getObject("Project") |
1545 if nam == project.ppath and not project.saveAllScripts(): |
1545 if nam == project.ppath and not project.saveAllScripts(): |
1546 return |
1546 return |
1547 |
1547 |
1548 dname = self.splitPath(names[0])[0] |
1548 dname = self.splitPath(names[0])[0] |
1549 |
1549 |