5 from PyQt4
import QtGui
8 from ugit
import qtutils
9 from ugit
.qobserver
import QObserver
10 from ugit
.ugitrc
import SettingsModel
11 from ugit
.views
import BookmarkView
14 model
= SettingsModel()
15 bookmark
= os
.getcwd()
16 if bookmark
not in model
.bookmarks
:
17 model
.add_bookmarks(bookmark
)
18 model
.save_all_settings()
19 qtutils
.information("Bookmark Saved")
21 def manage_bookmarks():
22 model
= SettingsModel()
23 view
= BookmarkView(QtGui
.qApp
.activeWindow())
24 ctl
= BookmarkController(model
, view
)
26 if view
.exec_() == QtGui
.QDialog
.Accepted
:
27 model
.save_all_settings()
29 class BookmarkController(QObserver
):
30 def init(self
, model
, view
):
31 self
.add_observables( 'bookmarks' )
34 button_open
= self
.open,
35 button_delete
= self
.delete
,
40 selection
= qtutils
.get_selection_list(
45 for item
in selection
:
46 utils
.fork("git", "ugit", item
)
49 selection
= qtutils
.get_selection_list(
54 for item
in selection
:
55 self
.model
.bookmarks
.remove(item
)