Changeset 38a721a


Ignore:
Timestamp:
03/04/12 00:32:25 (2 years ago)
Author:
xkolman2 <xkolman2@…>
Branches:
master
Children:
c5f8db1
Parents:
e6683d6
git-author:
xkolman2 <xkolman2@…> (03/04/12 00:32:25)
git-committer:
xkolman2 <xkolman2@…> (03/04/12 00:32:25)
Message:

add initial icon grid
initial fullscreen handling in QML
fullscreen state detection GUI API

git-svn-id: https://nlp.fi.muni.cz/svn/gps_navigace/trunk@668 0858a4d0-ffff-46e5-938e-62b5ecb34222

Location:
modules
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • modules/device_modules/base_device_module.py

    rd43e221 r38a721a  
    132132 
    133133  def handlesLocation(self): 
    134     """report wheter the device module handles position updates by itself""" 
     134    """report whether the device module handles position updates by itself""" 
    135135    return False 
    136136 
  • modules/device_modules/device_n900.py

    re6683d6 r38a721a  
    127127 
    128128  def startInFullscreen(self): 
    129     True 
     129    return True 
    130130 
    131131  def getLocationType(self): 
  • modules/gui_modules/base_gui_module.py

    r30bff6f1 r38a721a  
    6060    pass 
    6161 
     62  def isFullscreen(self): 
     63    """report if the application is in fullscreen mode""" 
     64    pass 
     65 
    6266  def toggleFullscreen(self): 
    6367    """ 
     
    7377    """ 
    7478    pass 
    75  
    7679 
    7780  def enableDefaultDrag(self): 
  • modules/gui_modules/gui_qml/gui_qml.py

    r4b20ffa r38a721a  
    9393    self.view.engine().addImageProvider("icons",self.iconProvider) 
    9494    rc = self.view.rootContext() 
    95     # make the reading state accessible from QML 
    96     #readingState = ReadingState(self) 
    97     #rc.setContextProperty("readingState", readingState) 
    98     # make stats accessible from QML 
    99     #stats = Stats(self.mieru.stats) 
    100     #rc.setContextProperty("stats", stats) 
    10195    # make options accessible from QML 
    10296    options = Options(self.modrana) 
     
    10599    gps = GPSDataWrapper(self.modrana) 
    106100    rc.setContextProperty("gps", gps) 
    107  
    108  
     101    # make the platform accessible from QML 
     102    platform = Platform(self.modrana) 
     103    rc.setContextProperty("platform", platform) 
    109104 
    110105    # ** history list handling ** 
     
    148143    return "QML" 
    149144 
     145  def isFullscreen(self): 
     146    return self.window.isFullScreen() 
     147 
    150148  def toggleFullscreen(self): 
    151149    if self.window.isFullScreen(): 
     
    154152      self.window.showFullScreen() 
    155153 
     154  def setFullscreen(self, value): 
     155    if value == True: 
     156      self.window.showFullScreen() 
     157    else: 
     158      self.window.showNormal() 
    156159 
    157160  def setCDDragThreshold(self, threshold): 
     
    195198    text = newlines2brs(text) 
    196199    self.rootObject.notify(text) 
     200 
     201class Platform(QtCore.QObject): 
     202  """make stats available to QML and integrable as a property""" 
     203  def __init__(self, modrana): 
     204    QtCore.QObject.__init__(self) 
     205    self.modrana = modrana 
     206 
     207  @QtCore.Slot(result=bool) 
     208  def isFullscreen(self): 
     209    return self.modrana.gui.isFullscreen() 
     210 
     211  @QtCore.Slot() 
     212  def toggleFullscreen(self): 
     213    self.modrana.gui.toggleFullscreen() 
     214 
     215  @QtCore.Slot(bool) 
     216  def setFullscreen(self, value): 
     217    self.modrana.gui.setFullscreen(value) 
     218 
     219  #  @QtCore.Slot() 
     220  #  def minimise(self): 
     221  #    return self.mieru.platform.minimise() 
     222 
     223  #  @QtCore.Slot(result=bool) 
     224  #  def showMinimiseButton(self): 
     225  #    """ 
     226  #    Harmattan handles this by the Swype UI and 
     227  #    on PC this should be handled by window decorator 
     228  #    """ 
     229  #    return self.mieru.platform.showMinimiseButton() 
     230 
     231  @QtCore.Slot(result=bool) 
     232  def showQuitButton(self): 
     233    """ 
     234    Harmattan handles this by the Swype UI and 
     235    on PC it is a custom to have the quit action in the main menu 
     236    """ 
     237    return self.modrana.dmod.needsQuitButton() 
     238 
     239  @QtCore.Slot(result=bool) 
     240  def incompleteTheme(self): 
     241    """ 
     242    The "base" theme is incomplete at the moment (March 2012), 
     243    use fail-safe or local icons. 
     244    Hopefully, this can be removed once the themes are in better shape. 
     245    """ 
     246    # the Fremantle theme is incomplete 
     247    return self.modrana.dmod.getDeviceIDString() == "n900" 
     248 
    197249 
    198250class IconImageProvider(QDeclarativeImageProvider): 
  • modules/gui_modules/gui_qml/qml/MenuPage.qml

    re6683d6 r38a721a  
    22import com.nokia.meego 1.0 
    33 
    4 Page { 
    5     id : menuPage 
    6     Text { 
    7         text : "TEST" 
    8         anchors.fill : parent 
    9     } 
     4IconGridPage { 
    105} 
Note: See TracChangeset for help on using the changeset viewer.