def triggered(self, _action): try: if _action.objectName() == "Edit Bookmarks": getMainWindow().FileManager.bookmarks.makeRefresh() getMainWindow().FileManager.bookmarks.show() return for info in BookmarksOfDirectories.fetchAll(): if info[1] == str(_action.objectName()): if fu.isDir(str(info[2])): getMainWindow().FileManager.goTo(str(info[2])) return else: answer = Dialogs.ask( translate("BookmarksMenu", "Cannot Find Folder"), str( translate( "BookmarksMenu", "\"%s\" cannot be found.<br>Delete this folder from the bookmarks?" )) % Organizer.getLink(info[1])) if answer == Dialogs.Yes: BookmarksOfDirectories.delete(str(info[0])) self.makeRefresh() getMainWindow().FileManager.bookmarks.makeRefresh() getMainWindow().FileManager.makeRefreshOnlyFileList() getMainWindow().FileManager.makeRefreshOnlyFileListByTree() except: ReportBug.ReportBug()
def saveBookmark(self): try: info = BookmarksOfDirectories.fetchAll()[self.cbBookmarks.currentIndex()] BookmarksOfDirectories.update(info[0], str(self.cbBookmarks.currentText()), str(self.pathOfBookmark.text())) self.makeRefresh() getMainWindow().FileManager.bookmarksMenu.makeRefresh() except: ReportBug.ReportBug()
def addBookmark(self): try: currentPath = getMainWindow().FileManager.getCurrentDirectoryPath() BookmarksOfDirectories.insert(fu.splitPath(currentPath)[-1], currentPath) getMainWindow().FileManager.bookmarksMenu.makeRefresh() self.makeRefresh() except: ReportBug.ReportBug()
def addBookmark(self): try: currentPath = getMainWindow().FileManager.getCurrentDirectoryPath() BookmarksOfDirectories.insert( fu.splitPath(currentPath)[-1], currentPath) getMainWindow().FileManager.bookmarksMenu.makeRefresh() self.makeRefresh() except: ReportBug.ReportBug()
def deleteBookmark(self): try: if self.cbBookmarks.currentIndex() != -1: info = BookmarksOfDirectories.fetchAll()[self.cbBookmarks.currentIndex()] BookmarksOfDirectories.delete(str(info[0])) self.makeRefresh() getMainWindow().FileManager.bookmarksMenu.makeRefresh() except: ReportBug.ReportBug()
def deleteBookmark(self): try: if self.cbBookmarks.currentIndex() != -1: info = BookmarksOfDirectories.fetchAll()[ self.cbBookmarks.currentIndex()] BookmarksOfDirectories.delete(str(info[0])) self.makeRefresh() getMainWindow().FileManager.bookmarksMenu.makeRefresh() except: ReportBug.ReportBug()
def saveBookmark(self): try: info = BookmarksOfDirectories.fetchAll()[ self.cbBookmarks.currentIndex()] BookmarksOfDirectories.update(info[0], str(self.cbBookmarks.currentText()), str(self.pathOfBookmark.text())) self.makeRefresh() getMainWindow().FileManager.bookmarksMenu.makeRefresh() except: ReportBug.ReportBug()
def makeRefresh(self): try: self.cbBookmarks.clear() for fav in BookmarksOfDirectories.fetchAll(): self.cbBookmarks.addItem(str(fav[1])) except: ReportBug.ReportBug()
def bookmarksChanged(self, _index): try: self.pathOfBookmark.setText( str(BookmarksOfDirectories.fetchAll()[ self.cbBookmarks.currentIndex()][2])) except: ReportBug.ReportBug()
def makeRefresh(self): try: self.clear() for fav in BookmarksOfDirectories.fetchAll(): self.addAction(str(fav[1])).setObjectName(str(fav[1])) self.addAction(translate("BookmarksMenu", "Edit Bookmarks")).setObjectName("Edit Bookmarks") except: ReportBug.ReportBug()
def makeRefresh(self): try: self.clear() for fav in BookmarksOfDirectories.fetchAll(): self.addAction(str(fav[1])).setObjectName(str(fav[1])) self.addAction( translate("BookmarksMenu", "Edit Bookmarks")).setObjectName("Edit Bookmarks") except: ReportBug.ReportBug()
def triggered(self, _action): try: if _action.objectName() == "Edit Bookmarks": getMainWindow().FileManager.bookmarks.makeRefresh() getMainWindow().FileManager.bookmarks.show() return for info in BookmarksOfDirectories.fetchAll(): if info[1] == str(_action.objectName()): if fu.isDir(str(info[2])): getMainWindow().FileManager.goTo(str(info[2])) return else: answer = Dialogs.ask(translate("BookmarksMenu", "Cannot Find Folder"), str(translate("BookmarksMenu", "\"%s\" cannot be found.<br>Delete this folder from the bookmarks?")) % Organizer.getLink(info[1])) if answer == Dialogs.Yes: BookmarksOfDirectories.delete(str(info[0])) self.makeRefresh() getMainWindow().FileManager.bookmarks.makeRefresh() getMainWindow().FileManager.makeRefreshOnlyFileList() getMainWindow().FileManager.makeRefreshOnlyFileListByTree() except: ReportBug.ReportBug()
def bookmarksChanged(self, _index): try: self.pathOfBookmark.setText( str(BookmarksOfDirectories.fetchAll()[self.cbBookmarks.currentIndex()][2])) except: ReportBug.ReportBug()