53
55
uic.loadUi(APPDIR + "/" + "settings.ui", self)
57
self.connect(self.sendButton, SIGNAL("clicked()"), self.send)
58
self.connect(self.grabButton, SIGNAL("clicked()"), self.grab)
61
home = os.environ.get("HOME")
62
cwd = home + "/.kde/share/"
66
user = self.launchpadUser.text()
68
QMessageBox.warning(self, "No User", "Please add a launchpad user.")
71
if not QFile.exists("/usr/bin/bzr"):
72
QMessageBox.warning(self, "No Bazaar", "Please install Bazaar (bzr).")
78
QMessageBox.warning(self, "No Home", "$HOME not set.")
80
if not QFile.exists(cwd + ".bzr"):
81
subprocess.call(["bzr", "init"], cwd=cwd)
84
if self.bookmarksTickbox.isChecked():
85
subprocess.call(["bzr", "add", "apps/konqueror/bookmarks.xml"], cwd=cwd)
86
print "bzr add apps/konqueror/bookmarks.xml"
88
subprocess.call(["bzr", "commit", "-m", "save settings"], cwd=cwd)
91
subprocess.call(["bzr", "push", "bzr+ssh://jr@bazaar.launchpad.net/~" + user + "/+junk/savedsettings"], cwd=cwd)
92
print "bzr push bzr+ssh://jr@bazaar.launchpad.net/~" + user + "/+junk/savedsettings"
94
QMessageBox.information(self, "Settings Sent", "<qt>Settings have been sent to Launchpad, run Grab on another machine to get them.<br />See them at <a href=\"https://code.launchpad.net/~" + user +"/+junk/savedsettings\">Launchpad Code</a>.</qt>")
100
user = self.launchpadUser.text()
102
QMessageBox.warning(self, "No User", "Please add a launchpad user.")
105
if not QFile.exists(cwd + ".bzr"):
106
subprocess.call(["bzr", "co", "bzr+ssh://jr@bazaar.launchpad.net/~" + user + "/+junk/savedsettings"], cwd=cwd)
107
print "bzr co bzr+ssh://jr@bazaar.launchpad.net/~" + user + "/+junk/savedsettings"
109
subprocess.call(["bzr", "update"], cwd=cwd)
111
QMessageBox.information(self, "Updated", "Settings updated, restart Konqueror for new bookmarks.")
56
113
if __name__ == "__main__":
57
114
"""start the application. TODO, gtk frontend does clever things here to not start the GUI until it has to"""