diff options
author | Xisco Fauli <anistenis@gmail.com> | 2011-07-31 23:41:25 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-08-18 02:57:44 +0200 |
commit | 304055f233e52c977717a0ddbc759e59b6c93756 (patch) | |
tree | d924d42b596f1cbe33f75adf1a8e165ba05b8775 /wizards | |
parent | 1a77ddefae20680f69d9c4842eabc9bc8ab633d5 (diff) |
more cleaning
Diffstat (limited to 'wizards')
5 files changed, 2 insertions, 186 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py index 6fda41906d5e..9bae395b3880 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py +++ b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py @@ -138,7 +138,6 @@ class AgendaTemplate(TextDocument): self.redrawTitle("txtDate") self.redrawTitle("txtTime") self.redrawTitle("cbLocation") - Topics.writeAll(topicsData) if AgendaTemplate.agenda.cp_TemplateName is None: AgendaTemplate.agenda.cp_TemplateName = "" self.setTemplateTitle(AgendaTemplate.agenda.cp_TemplateName) @@ -644,17 +643,6 @@ class AgendaTemplate(TextDocument): v.append(i) return v - '''convenience method, for removing a number of cells from a table. - @param table - @param start - @param count - ''' - - @classmethod - def removeTableRows(self, table, start, count): - rows = table.Rows - rows.removeByIndex(start, count) - '''Convenience method for inserting some cells into a table. @param table @param start @@ -808,10 +796,6 @@ class ItemsTable(object): does not disappear, because it will crash office. ''' cursor.gotoStart(False) - if rowsCount >= rowIndex: - pass - #COMMENTED - #removeTableRows(table, rowIndex - 1, (rowsCount - rowIndex) + 1) ''' This class handles the preview of the topics table. @@ -853,7 +837,6 @@ class Topics(object): timeCell = -1 rowsPerTopic = None topicCells = [] - topicCellFormats = [] def __init__(self): self.topicItems = {} @@ -910,14 +893,12 @@ class Topics(object): pass Topics.topicCells.append(ae) - # and store the format of the cell. - Topics.topicCellFormats.append( TableCellFormatter( - Topics.table.getCellByName(cursor.RangeName))) # goto next cell. cursor.goRight(1, False) ''' now - in which cell is every fillin? ''' + Topics.numCell = Topics.topicCells.index( self.topicItems[FILLIN_TOPIC_NUMBER]) Topics.topicCell = Topics.topicCells.index( @@ -926,28 +907,6 @@ class Topics(object): self.topicItems[FILLIN_TOPIC_RESPONSIBLE]) Topics.timeCell = Topics.topicCells.index( self.topicItems[FILLIN_TOPIC_TIME]) - '''now that we know how the topics look like, - we get the format of the first and last rows. - ''' - # format of first row - cursor.gotoStart(False) - tmp_do_var1 = True - while tmp_do_var1: - self.firstRowFormat.append(TableCellFormatter ( - Topics.table.getCellByName(cursor.RangeName))) - cursor.goRight(1, False) - tmp_do_var1 = not cursor.RangeName.startswith("A") - # format of the last row - cursor.gotoEnd(False) - while not cursor.RangeName.startswith("A"): - Topics.lastRowFormat.append(TableCellFormatter ( - Topics.table.getCellByName(cursor.RangeName))) - cursor.goLeft(1, False) - # we missed the A cell - so we have to add it also.. - Topics.lastRowFormat.append(TableCellFormatter ( - Topics.table.getCellByName(cursor.RangeName))) - #COMMENTED - #AgendaTemplate.removeTableRows(Topics.table, 1 + Topics.rowsPerTopic, rows - Topics.rowsPerTopic - 1) '''@param topic the topic number to write @param data the data of the topic. @@ -981,7 +940,6 @@ class Topics(object): cursor.goRight(1, False) # now format ! cursor.gotoCellByName("A" + str(firstRow), False) - self.formatTable(cursor, Topics.topicCellFormats, False) return diff '''check if the topic with the given index is written to the table. @@ -1039,7 +997,6 @@ class Topics(object): xc = Topics.table.getCellByName(cursor.RangeName) # and write it ! te.write(xc) - Topics.topicCellFormats[cursorMoves].format(xc) '''writes the given topic. if the first topic was involved, reformat the @@ -1067,19 +1024,6 @@ class Topics(object): if diff > 0: self.formatLastRow() - '''Writes all the topics to thetopics table. - @param topicsData a List containing all Topic's Data. - ''' - - @classmethod - def writeAll(self, topicsData): - try: - for i in xrange(len(topicsData) - 1): - self.write2(i, topicsData[i]) - self.formatLastRow() - except Exception, ex: - traceback.print_exc() - '''removes obsolete rows, reducing the topics table to the given number of topics. Note this method does only reducing - if @@ -1251,25 +1195,3 @@ class AgendaItem(object): if self.field is not None: self.field.write(ItemsTable.table.getCellByName( tableCursor.RangeName)) - -''' -reads/write a table cell format from/to a table cell or a group of cells. -''' -class TableCellFormatter(object): - properties = ("BackColor", "BackTransparent", "BorderDistance", - "BottomBorderDistance", "LeftBorder", - "LeftBorderDistance", "RightBorder", "RightBorderDistance", - "TopBorder", "TopBorderDistance") - - def __init__(self, tableCell): - self.values = [] - for i in TableCellFormatter.properties: - pass - #COMMENTED - #self.values.append( Helper.getUnoPropertyValue(tableCell, i) ) - - def format(self, tableCell): - pass - #COMMENTED - #Helper.setUnoPropertyValues( - # tableCell, TableCellFormatter.properties, tuple(self.values)) diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py index d27bd5b3cc9c..22ed320229d4 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py +++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py @@ -208,7 +208,6 @@ class AgendaWizardDialogImpl(AgendaWizardDialog): (self.optCreateAgenda, self.optMakeChanges), True).updateUI() def saveConfiguration(self): - self.topicsControl.saveTopics(self.agenda) root = Configuration.getConfigurationRoot( self.xMSF, "/org.openoffice.Office.Writer/Wizards/Agenda", True) self.agenda.writeConfiguration(root, "cp_") diff --git a/wizards/com/sun/star/wizards/agenda/TopicsControl.py b/wizards/com/sun/star/wizards/agenda/TopicsControl.py index 7ede309050bb..d1fe2cac9979 100644 --- a/wizards/com/sun/star/wizards/agenda/TopicsControl.py +++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.py @@ -100,8 +100,7 @@ class TopicsControl(ControlScroller): super(TopicsControl, self).__init__( dialog, xmsf, 5, 92, 38, 212, 5, 18, LAST_HID) self.initializeScrollFields(agenda) - self.initialize(agenda.cp_Topics.getSize() + 1) - # set some focus listeners for TAB scroll down and up... + # set some focus listeners for TAB scroll down and up... # prepare scroll down on tab press... self.lastTime = \ self.ControlGroupVector[self.nblockincrement - 1].timebox @@ -151,17 +150,6 @@ class TopicsControl(ControlScroller): setEnabled(True) ''' - The Topics Set in the CGAgenda object is synchronized to - the current content of the topics. - @param agenda - ''' - - def saveTopics(self, agenda): - agenda.cp_Topics.clear() - for i in xrange(len(ControlScroller.scrollfields) - 1): - agenda.cp_Topics.add(i, CGTopic(ControlScroller.scrollfields[i])) - - ''' remove the last row ''' diff --git a/wizards/com/sun/star/wizards/common/ConfigSet.py b/wizards/com/sun/star/wizards/common/ConfigSet.py index 4ce2059db3c7..ca3a2da1d4dd 100644 --- a/wizards/com/sun/star/wizards/common/ConfigSet.py +++ b/wizards/com/sun/star/wizards/common/ConfigSet.py @@ -23,8 +23,6 @@ class ConfigSet(ConfigNode): if isinstance(name, int): i = name self.childrenList.insert(i, o) - #COMMENTED - #self.fireListDataListenerIntervalAdded(i, i) else: i = o.cp_Index oldSize = self.getSize() @@ -37,62 +35,6 @@ class ConfigSet(ConfigNode): self.childrenList.insert(i, o); if oldSize > i: oldSize = i - #COMMENTED - #self.fireListDataListenerIntervalAdded(oldSize, i) - - def writeConfiguration(self, configView, param): - names = self.childrenMap.keys() - if isinstance(self.childClass, ConfigNode): - #first I remove all the children from the configuration. - children = configView.ElementNames - if children: - for i in children: - try: - Configuration.removeNode(configView, i) - except Exception: - traceback.print_exc() - - # and add them new. - for i in names: - try: - child = self.getElement(i) - childView = configView.getByName(i) - child.writeConfiguration(childView, param) - except Exception: - traceback.print_exc() - else: - raise AttributeError ( - "Unable to write primitive sets to configuration (not implemented)") - - def readConfiguration(self, configurationView, param): - names = configurationView.ElementNames - if isinstance(self.childClass, ConfigNode): - if names: - for i in names: - try: - child = type(self.childClass)() - child.setRoot(self.root) - child.readConfiguration( - configurationView.getByName(i), param) - self.add(i, child) - except Exception, ex: - traceback.print_exc() - #remove any nulls from the list - if self.noNulls: - i = 0 - while i < len(self.childrenList): - if self.childrenList[i] is None: - del self.childrenList[i] - i -= 1 - i += 1 - - else: - for i in names: - try: - child = configurationView.getByName(i) - self.add(i, child) - except Exception, ex: - traceback.print_exc() def remove(self, obj): key = getKey(obj) @@ -109,9 +51,6 @@ class ConfigSet(ConfigNode): self.childrenMap.clear() del self.childrenList[:] - def update(self, i): - fireListDataListenerContentsChanged(i, i) - def createDOM(self, parent): items = items() i = 0 diff --git a/wizards/com/sun/star/wizards/ui/ControlScroller.py b/wizards/com/sun/star/wizards/ui/ControlScroller.py index 0a55b55daf25..9601400d3237 100644 --- a/wizards/com/sun/star/wizards/ui/ControlScroller.py +++ b/wizards/com/sun/star/wizards/ui/ControlScroller.py @@ -80,38 +80,6 @@ class ControlScroller(object): Helper.setUnoPropertyValue( ControlScroller.xScrollBar, "Orientation", HORIZONTAL) - ''' - @author bc93774 - @param _ntotfieldcount: The number of fields that are - to be administered by the ControlScroller - ''' - - def initialize(self, _ntotfieldcount): - try: - self.ntotfieldcount = _ntotfieldcount - self.setCurFieldCount() - ControlScroller.nscrollvalue = 0 - Helper.setUnoPropertyValue( - ControlScroller.xScrollBar.Model, "ScrollValue", - ControlScroller.nscrollvalue) - if self.ntotfieldcount > ControlScroller.nblockincrement: - Helper.setUnoPropertyValues( - ControlScroller.xScrollBar.Model, (PropertyNames.PROPERTY_ENABLED, - "BlockIncrement", "LineIncrement", - "ScrollValue", "ScrollValueMax"), - (True, ControlScroller.nblockincrement, self.nlineincrement, - ControlScroller.nscrollvalue, - self.ntotfieldcount - ControlScroller.nblockincrement)) - else: - Helper.setUnoPropertyValues( - ControlScroller.xScrollBar.Model, - (PropertyNames.PROPERTY_ENABLED, "ScrollValue"), - (False, ControlScroller.nscrollvalue)) - - self.fillupControls(True) - except Exception: - traceback.print_exc() - @classmethod def fillupControls(self, binitialize): for i in xrange(ControlScroller.nblockincrement): |