Example #1
0
    def checkSDcard(self):
        mounts = disk.getMountList()
        self.HintLabel.SetForegroundColour("red")
        self.installButton.Show()
        self.tryButton.Hide()

        if len(mounts) == 0:
            self.HintLabel.SetLabel(
                "Insert WikiReader's SD card into a memory card reader\nthat is plugged into this computer."
            )
            self.installButton.Hide()
            self.tryButton.Show()
            self.HintLabel.SetPosition((68 + self.posX, 20 + self.posY))
        elif not disk.enoughSpace(kPackages, checkedItems):
            self.HintLabel.SetLabel(
                "This is microSD card doesn't have enough free space.")
            self.installButton.Hide()
            self.tryButton.Show()
            self.HintLabel.SetPosition((68 + self.posX, 20 + self.posY))
        # elif not disk.getVersion():
        #     self.HintLabel.SetLabel("This is not wikireader microSD card. continue installation?")
        #     self.HintLabel.SetPosition((48+self.posX, 20+self.posY))
        else:
            self.HintLabel.SetLabel("Click install to continue.")
            self.HintLabel.SetForegroundColour("black")
            self.HintLabel.SetPosition((188 + self.posX, 20 + self.posY))
Example #2
0
def checkingVersionDialog(parent, showError=True):
    dlg = wx.ProgressDialog(
        "WikiReader Updater",
        "Checking sdcard ...",
        maximum=100,
        parent=parent,
        style=0
        | wx.PD_APP_MODAL
        | wx.PD_CAN_ABORT
        #| wx.PD_CAN_SKIP
        #| wx.PD_ELAPSED_TIME
        #| wx.PD_ESTIMATED_TIME
        #| wx.PD_REMAINING_TIME
        #| wx.PD_AUTO_HIDE
    )

    version = disk.getVersion()
    if not version:
        version = '0000.00.00'

    #print version
    if len(disk.getMountList()) < 1 and showError:
        wx.MessageBox('We don\'t detected any sdcard on your computer', 'Info',
                      wx.OK | wx.ICON_INFORMATION)

    dlg.Destroy()

    return version
Example #3
0
def checkingVersionDialog(parent, showError=True):
    dlg = wx.ProgressDialog("WikiReader Updater",
                               "Checking sdcard ...",
                               maximum = 100,
                               parent=parent,
                               style = 0
                                | wx.PD_APP_MODAL
                                | wx.PD_CAN_ABORT
                                #| wx.PD_CAN_SKIP
                                #| wx.PD_ELAPSED_TIME
                                #| wx.PD_ESTIMATED_TIME
                                #| wx.PD_REMAINING_TIME
                                #| wx.PD_AUTO_HIDE
                                )

    version = disk.getVersion()
    if not version:
        version = '0000.00.00'

    #print version
    if len(disk.getMountList()) < 1 and showError:
        wx.MessageBox('We don\'t detected any sdcard on your computer', 'Info', wx.OK | wx.ICON_INFORMATION)

    dlg.Destroy()

    return version
Example #4
0
def checkFreeSpace():
    mountDisks = disk.getMountList()
    #if len(mountDisks) > 1:
    #    print "More than one disks"
    #elif len(mountDisks) > 0:
    #    return disk.getFreeSpace(mountDisks[0])

    if len(mountDisks) > 0:
        return disk.getFreeSpace(mountDisks[0])

    return None, None
Example #5
0
def checkFreeSpace():
    mountDisks = disk.getMountList()
    #if len(mountDisks) > 1:
    #    print "More than one disks"
    #elif len(mountDisks) > 0:
    #    return disk.getFreeSpace(mountDisks[0])

    if len(mountDisks) > 0:
        return disk.getFreeSpace(mountDisks[0])

    return None, None
Example #6
0
    def checkSDcard(self):
        mounts = disk.getMountList()
        self.HintLabel.SetForegroundColour("red")
        self.installButton.Show()
        self.tryButton.Hide()

        if len(mounts) == 0:
            self.HintLabel.SetLabel("Insert WikiReader's SD card into a memory card reader\nthat is plugged into this computer.")
            self.installButton.Hide()
            self.tryButton.Show()
            self.HintLabel.SetPosition((68+self.posX, 20+self.posY))
        elif not disk.enoughSpace(kPackages, checkedItems):
            self.HintLabel.SetLabel("This is microSD card doesn't have enough free space.")
            self.installButton.Hide()
            self.tryButton.Show()
            self.HintLabel.SetPosition((68+self.posX, 20+self.posY))
        # elif not disk.getVersion():
        #     self.HintLabel.SetLabel("This is not wikireader microSD card. continue installation?")
        #     self.HintLabel.SetPosition((48+self.posX, 20+self.posY))
        else:
            self.HintLabel.SetLabel("Click install to continue.")
            self.HintLabel.SetForegroundColour("black")
            self.HintLabel.SetPosition((188+self.posX, 20+self.posY))