Module phonebook :: Class PhoneWidget
[hide private]
[frames] | no frames]

Class PhoneWidget

source code

     object --+                
              |                
wx._core.Object --+            
                  |            
wx._core.EvtHandler --+        
                      |        
        wx._core.Window --+    
                          |    
          wx._windows.Panel --+
                              |
       widgets.BitPimWidget --+
                              |
                             PhoneWidget

Main phone editing/displaying widget

Nested Classes [hide private]
  ConversionFailed
Instance Methods [hide private]
EvtHandler
__init__(self, mainwindow, parent, config)
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition, ...
source code
 
OnInit(self) source code
 
OnColumnHeaderPaint(self, evt) source code
 
OnGridLabelLeftClick(self, evt) source code
 
OnSashPosChanged(self, _) source code
 
OnPreActivate(self) source code
 
OnPostActivate(self) source code
 
SetColumns(self, columns) source code
 
GetColumns(self) source code
 
OnCategoriesUpdate(self, msg) source code
 
OnGroupWPUpdate(self, msg) source code
 
OnPBLookup(self, msg) source code
 
OnMediaNameChanged(self, msg) source code
 
HasColumnSelector(self) source code
 
OnViewColumnSelector(self) source code
 
HasPreviewPane(self) source code
 
IsPreviewPaneEnabled(self) source code
 
OnViewPreview(self, preview_on) source code
 
HasHistoricalData(self) source code
 
OnHistoricalData(self)
Display current or historical data
source code
 
OnIdle(self, _)
We save out changed data
source code
 
updateserials(self, results)
update the serial numbers after having written to the phone
source code
 
CanSelectAll(self) source code
 
OnSelectAll(self, _) source code
 
OnCellSelect(self, event) source code
 
OnPreviewDClick(self, _) source code
 
OnCellDClick(self, event) source code
 
OnCellRightClick(self, evt) source code
 
OnSetToCurrent(self, _) source code
 
EditEntries(self, row, column) source code
 
SaveData(self, data, key) source code
 
EditEntry(self, row, column) source code
 
GetNextEntry(self, next=True) source code
 
GetDeleteInfo(self) source code
 
GetAddInfo(self) source code
 
CanAdd(self) source code
 
OnAdd(self, _) source code
 
GetSelectedRows(self) source code
 
GetSelectedRowKeys(self) source code
 
CanDelete(self) source code
 
OnDelete(self, _) source code
 
SetPreview(self, entry) source code
 
CanPrint(self) source code
 
OnPrintDialog(self, mainwindow, config) source code
 
getdata(self, dict) source code
 
DeleteBySerial(self, bpserial) source code
 
UpdateSerial(self, bpserial, otherserial) source code
 
versionupgrade(self, dict, version)
Upgrade old data format read from disk
source code
 
clear(self) source code
 
getfromfs(self, dict, timestamp=None) source code
 
_updatecount(self) source code
 
populate(self, dict, savetodb=True) source code
 
_save_db(self, dict) source code
 
populatefs(self, dict) source code
 
_ensure_unicode(self, data) source code
 
importdata(self, importdata, categoriesinfo=[], merge=True, groupwpsinfo=[]) source code
 
converttophone(self, data) source code
 
add_error_message(self, msg, priority=99) source code
 
log(self, msg) source code
 
_getentries(self, list, min, max, name) source code
 
_getfield(self, list, name) source code
 
_truncatefields(self, list, truncateat) source code
 
_findfirst(self, candidates, required, key, default)
Find first match in candidates that meets required and return value of key
source code
 
getfullname(self, names, min, max, truncateat=None)
Return at least min and at most max fullnames from the names list
source code
 
getcategory(self, categories, min, max, truncateat=None)
Return at least min and at most max categories from the categories list
source code
 
getemails(self, emails, min, max, truncateat=None)
Return at least min and at most max emails from the emails list
source code
 
geturls(self, urls, min, max, truncateat=None)
Return at least min and at most max urls from the urls list
source code
 
getmemos(self, memos, min, max, truncateat=None)
Return at least min and at most max memos from the memos list
source code
 
getnumbers(self, numbers, min, max)
Return at least min and at most max numbers from the numbers list
source code
 
getnumber(self, numbers, type, count=1, default='')
Returns phone numbers of the type
source code
 
getserial(self, serials, sourcetype, id, key, default)
Gets a serial if it exists
source code
 
getringtone(self, ringtones, use, default)
Gets a ringtone of type use
source code
 
getwallpaper(self, wallpapers, use, default)
Gets a wallpaper of type use
source code
 
getwallpaperindex(self, wallpapers, use, default)
Gets a wallpaper index of type use
source code
 
getflag(self, flags, name, default)
Gets value of flag named name
source code
 
getmostpopularcategories(self, howmany, entries, reserved=[], truncateat=None, padnames=[])
Returns the most popular categories
source code
 
makeone(self, list, default)
Returns one item long list
source code
 
filllist(self, list, numitems, blank)
makes list numitems long appending blank to get there
source code

Inherited from wx._windows.Panel: Create, SetFocusIgnoringChildren, __repr__

Inherited from wx._core.Window: AcceptsFocus, AcceptsFocusFromKeyboard, AddChild, AdjustForLayoutDirection, AssociateHandle, CacheBestSize, CanSetTransparent, CaptureMouse, Center, CenterOnParent, Centre, CentreOnParent, ClearBackground, ClientToScreen, ClientToScreenXY, ClientToWindowSize, Close, ConvertDialogPointToPixels, ConvertDialogSizeToPixels, ConvertPixelPointToDialog, ConvertPixelSizeToDialog, DLG_PNT, DLG_SZE, Destroy, DestroyChildren, Disable, DissociateHandle, DragAcceptFiles, Enable, FindWindowById, FindWindowByLabel, FindWindowByName, Fit, FitInside, Freeze, GetAcceleratorTable, GetAdjustedBestSize, GetAutoLayout, GetBackgroundColour, GetBackgroundStyle, GetBestFittingSize, GetBestSize, GetBestSizeTuple, GetBestVirtualSize, GetBorder, GetCaret, GetCharHeight, GetCharWidth, GetChildren, GetClientAreaOrigin, GetClientRect, GetClientSize, GetClientSizeTuple, GetConstraints, GetContainingSizer, GetCursor, GetDefaultAttributes, GetDropTarget, GetEffectiveMinSize, GetEventHandler, GetExtraStyle, GetFont, GetForegroundColour, GetFullTextExtent, GetGrandParent, GetGtkWidget, GetHandle, GetHelpText, GetHelpTextAtPoint, GetId, GetLabel, GetLayoutDirection, GetMaxHeight, GetMaxSize, GetMaxWidth, GetMinHeight, GetMinSize, GetMinWidth, GetName, GetParent, GetPosition, GetPositionTuple, GetRect, GetScreenPosition, GetScreenPositionTuple, GetScreenRect, GetScrollPos, GetScrollRange, GetScrollThumb, GetSize, GetSizeTuple, GetSizer, GetTextExtent, GetThemeEnabled, GetToolTip, GetTopLevelParent, GetUpdateClientRect, GetUpdateRegion, GetValidator, GetVirtualSize, GetVirtualSizeTuple, GetWindowBorderSize, GetWindowStyle, GetWindowStyleFlag, GetWindowVariant, HasCapture, HasFlag, HasMultiplePages, HasScrollbar, HasTransparentBackground, Hide, HitTest, HitTestXY, InheritAttributes, InheritsBackgroundColour, InitDialog, InvalidateBestSize, IsBeingDeleted, IsDoubleBuffered, IsEnabled, IsExposed, IsExposedPoint, IsExposedRect, IsFrozen, IsRetained, IsShown, IsShownOnScreen, IsTopLevel, Layout, LineDown, LineUp, Lower, MakeModal, Move, MoveAfterInTabOrder, MoveBeforeInTabOrder, MoveXY, Navigate, OnPaint, PageDown, PageUp, PopEventHandler, PopupMenu, PopupMenuXY, PostCreate, PrepareDC, PushEventHandler, Raise, Refresh, RefreshRect, RegisterHotKey, ReleaseMouse, RemoveChild, RemoveEventHandler, Reparent, ScreenToClient, ScreenToClientXY, ScrollLines, ScrollPages, ScrollWindow, SendSizeEvent, SetAcceleratorTable, SetAutoLayout, SetBackgroundColour, SetBackgroundStyle, SetBestFittingSize, SetCaret, SetClientRect, SetClientSize, SetClientSizeWH, SetConstraints, SetContainingSizer, SetCursor, SetDimensions, SetDoubleBuffered, SetDropTarget, SetEventHandler, SetExtraStyle, SetFocus, SetFocusFromKbd, SetFont, SetForegroundColour, SetHelpText, SetHelpTextForId, SetId, SetInitialSize, SetLabel, SetLayoutDirection, SetMaxSize, SetMinSize, SetName, SetOwnBackgroundColour, SetOwnFont, SetOwnForegroundColour, SetPosition, SetRect, SetScrollPos, SetScrollbar, SetSize, SetSizeHints, SetSizeHintsSz, SetSizeWH, SetSizer, SetSizerAndFit, SetThemeEnabled, SetToolTip, SetToolTipString, SetTransparent, SetValidator, SetVirtualSize, SetVirtualSizeHints, SetVirtualSizeHintsSz, SetVirtualSizeWH, SetWindowStyle, SetWindowStyleFlag, SetWindowVariant, ShouldInheritColours, Show, Thaw, ToggleWindowStyle, TransferDataFromWindow, TransferDataToWindow, UnregisterHotKey, Update, UpdateWindowUI, UseBgCol, Validate, WarpPointer, WindowToClientSize

Inherited from wx._core.EvtHandler: AddPendingEvent, Bind, Connect, Disconnect, GetEvtHandlerEnabled, GetNextHandler, GetPreviousHandler, ProcessEvent, ProcessPendingEvents, SetEvtHandlerEnabled, SetNextHandler, SetPreviousHandler, Unbind

Inherited from wx._core.EvtHandler (private): _setOORInfo

Inherited from wx._core.Object: GetClassName, IsSameAs

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Inherited from widgets.BitPimWidget: ActivateSelf, AddNode, AddSubPage, CanCopy, CanPaste, CanRename, GetHelpID, GetRightClickMenuItems, GetWidgetName, InitialiseWidget, OnCopy, OnKeyDown, OnKeyUp, OnPaste, OnPopupMenu, OnRename, OnRightClickMenuExit, OnSelected

Static Methods [hide private]

Inherited from wx._windows.Panel: GetClassDefaultAttributes

Inherited from wx._core.Window: FindFocus, GetCapture, NewControlId, NextControlId, PrevControlId

Class Variables [hide private]
  CURRENTFILEVERSION = 2
  _Current_Data = 0
  _Historic_Data = 1

Inherited from widgets.BitPimWidget: MENU_CHECK, MENU_NORMAL, MENU_SPACER

Properties [hide private]

Inherited from wx._windows.Panel: thisown

Inherited from wx._core.Window: AcceleratorTable, AutoLayout, BackgroundColour, BackgroundStyle, BestSize, BestVirtualSize, Border, Caret, CharHeight, CharWidth, Children, ClientAreaOrigin, ClientRect, ClientSize, Constraints, ContainingSizer, Cursor, DefaultAttributes, DropTarget, EffectiveMinSize, Enabled, EventHandler, ExtraStyle, Font, ForegroundColour, GrandParent, GtkWidget, Handle, HelpText, Id, Label, LayoutDirection, MaxHeight, MaxSize, MaxWidth, MinHeight, MinSize, MinWidth, Name, Parent, Position, Rect, ScreenPosition, ScreenRect, Shown, Size, Sizer, ThemeEnabled, ToolTip, TopLevel, TopLevelParent, UpdateClientRect, UpdateRegion, Validator, VirtualSize, WindowStyle, WindowStyleFlag, WindowVariant

Inherited from wx._core.EvtHandler: EvtHandlerEnabled, NextHandler, PreviousHandler

Inherited from wx._core.Object: ClassName

Inherited from object: __class__

Method Details [hide private]

__init__(self, mainwindow, parent, config)
(Constructor)

source code 

__init__(self, Window parent, int id=-1, Point pos=DefaultPosition, 
    Size size=DefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, 
    String name=PanelNameStr) -> Panel

Returns: EvtHandler
Overrides: widgets.BitPimWidget.__init__

OnInit(self)

source code 
Overrides: widgets.BitPimWidget.OnInit

OnPreActivate(self)

source code 
Overrides: widgets.BitPimWidget.OnPreActivate

OnPostActivate(self)

source code 
Overrides: widgets.BitPimWidget.OnPostActivate

HasColumnSelector(self)

source code 
Overrides: widgets.BitPimWidget.HasColumnSelector

OnViewColumnSelector(self)

source code 
Overrides: widgets.BitPimWidget.OnViewColumnSelector

HasPreviewPane(self)

source code 
Overrides: widgets.BitPimWidget.HasPreviewPane

IsPreviewPaneEnabled(self)

source code 
Overrides: widgets.BitPimWidget.IsPreviewPaneEnabled

OnViewPreview(self, preview_on)

source code 
Overrides: widgets.BitPimWidget.OnViewPreview

HasHistoricalData(self)

source code 
Overrides: widgets.BitPimWidget.HasHistoricalData

OnHistoricalData(self)

source code 

Display current or historical data

Overrides: widgets.BitPimWidget.OnHistoricalData

CanSelectAll(self)

source code 
Overrides: widgets.BitPimWidget.CanSelectAll

OnSelectAll(self, _)

source code 
Overrides: widgets.BitPimWidget.OnSelectAll

GetDeleteInfo(self)

source code 
Overrides: widgets.BitPimWidget.GetDeleteInfo

GetAddInfo(self)

source code 
Overrides: widgets.BitPimWidget.GetAddInfo

CanAdd(self)

source code 
Overrides: widgets.BitPimWidget.CanAdd

OnAdd(self, _)

source code 
Overrides: widgets.BitPimWidget.OnAdd

CanDelete(self)

source code 
Overrides: widgets.BitPimWidget.CanDelete

OnDelete(self, _)

source code 
Overrides: widgets.BitPimWidget.OnDelete

CanPrint(self)

source code 
Overrides: widgets.BitPimWidget.CanPrint

OnPrintDialog(self, mainwindow, config)

source code 
Overrides: widgets.BitPimWidget.OnPrintDialog

versionupgrade(self, dict, version)

source code 

Upgrade old data format read from disk

Parameters:
  • dict - The dict that was read in
  • version - version number of the data on disk

_findfirst(self, candidates, required, key, default)

source code 

Find first match in candidates that meets required and return value of key

Parameters:
  • candidates - list of dictionaries to search through
  • required - a dict of what key/value pairs must exist in an entry
  • key - for a matching entry, which key's value to return
  • default - what value to return if there is no match

getnumber(self, numbers, type, count=1, default='')

source code 

Returns phone numbers of the type

Parameters:
  • numbers - The list of numbers
  • type - The type, such as cell, home, office
  • count - Which number to return (eg with type=home, count=2 the second home number is returned)
  • default - What is returned if there is no such number

getmostpopularcategories(self, howmany, entries, reserved=[], truncateat=None, padnames=[])

source code 

Returns the most popular categories

Parameters:
  • howmany - How many to return, including the reserved ones
  • entries - A dict of the entries
  • reserved - A list of reserved entries (ie must be present, no matter how popular)
  • truncateat - How long to truncate the category names at
  • padnames - if the list is less than howmany long, then add these on the end providing they are not already in the list
Returns:
A list of the group names. The list starts with the members of reserved followed by the most popular groups