WIP move clipboards to memoryManager
This commit is contained in:
1 parent
dec4974fb0
commit
5059013009
13 files changed
+8
-4
No files matched your search
+2
-2
@@ -11,14 +11,14 @@ class command():
|
||||
pass
|
||||
def initialize(self, environment):
|
||||
self.env = environment
|
||||
self.env['runtime']['memoryManager'].addIndexList('clipboardHistory', self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards'))
|
||||
def shutdown(self):
|
||||
pass
|
||||
def getDescription(self):
|
||||
return _('clears the currently selected clipboard')
|
||||
|
||||
def run(self):
|
||||
self.env['commandBuffer']['currClipboard'] = -1
|
||||
del self.env['commandBuffer']['clipboard'][:]
|
||||
self.env['runtime']['memoryManager'].clearCurrentIndexList('clipboardHistory')
|
||||
self.env['runtime']['outputManager'].presentText(_('clipboard cleared'), interrupt=True)
|
||||
return
|
||||
def setCallback(self, callback):
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -14,8 +14,12 @@ class memoryManager():
|
||||
self.env = environment
|
||||
def shutdown(self):
|
||||
pass
|
||||
def addValueToFirstIndex(self, name, value):
|
||||
pass
|
||||
def addValueToFirstIndex(self, name, value, index = 0):
|
||||
if self.listStorage[name]['maxLength'] != None:
|
||||
self.listStorage[name]['list'] = [value] + self.listStorage[name]['list']
|
||||
else:
|
||||
self.listStorage[name]['list'] = [value] + self.listStorage[name]['list'][:self.listStorage[name]['maxLength'] -1]
|
||||
self.listStorage[name]['index'] = index
|
||||
def addIndexList(self, name, maxLength = None, currList = [], currIndex = 0):
|
||||
self.listStorage[name] = {'list': currList, 'index': currIndex, 'maxLength': maxLength}
|
||||
def isLastIndex(self, name):
|
||||
|
||||
Reference in new issue
Block a user