colour times by default, add another mac build script

This commit is contained in:
Damien Elmes 2010-07-11 16:43:24 +09:00
parent e3ab11213d
commit 014c993688
5 changed files with 45 additions and 12 deletions

View file

@ -44,6 +44,7 @@ class Config(dict):
'addZeroSpace': False,
'alternativeTheme': False,
'checkForUpdates': True,
'colourTimes': True,
'created': time.time(),
'deckBrowserNameLength': 30,
'deckBrowserOrder': 0,

View file

@ -2,7 +2,6 @@
# -*- coding: utf-8 -*-
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
import os, sys, re, types, gettext, stat, traceback, inspect, signal
import shutil, time, glob, tempfile, datetime, zipfile, locale
from operator import itemgetter
@ -672,10 +671,17 @@ new:
if self.config['suppressEstimates']:
l.setText("")
elif i == 1:
l.setText(_("Soon"))
txt = _("Soon")
if self.config['colourTimes']:
txt = '<span style="color: #700"><b>%s</b></span>' % txt
l.setText(txt)
else:
l.setText("<b>" + self.deck.nextIntervalStr(
self.currentCard, i) + "</b>")
txt = self.deck.nextIntervalStr(
self.currentCard, i)
txt = "<b>" + txt + "</b>"
if i == self.defaultEaseButton() and self.config['colourTimes']:
txt = '<span style="color: #070">' + txt + '</span>'
l.setText(txt)
# Deck loading & saving: backend
##########################################################################

View file

@ -149,6 +149,7 @@ class Preferences(QDialog):
self.config['numBackups'] = self.dialog.numBackups.value()
def setupAdvanced(self):
self.dialog.colourTimes.setChecked(self.config['colourTimes'])
self.dialog.showEstimates.setChecked(not self.config['suppressEstimates'])
self.dialog.showStudyOptions.setChecked(self.config['showStudyScreen'])
self.dialog.showTray.setChecked(self.config['showTrayIcon'])
@ -164,6 +165,7 @@ class Preferences(QDialog):
self.dialog.deckBrowserLen.setValue(self.config['deckBrowserNameLength'])
def updateAdvanced(self):
self.config['colourTimes'] = self.dialog.colourTimes.isChecked()
self.config['showTrayIcon'] = self.dialog.showTray.isChecked()
self.config['showTimer'] = self.dialog.showTimer.isChecked()
self.config['suppressEstimates'] = not self.dialog.showEstimates.isChecked()

View file

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>332</width>
<width>365</width>
<height>467</height>
</rect>
</property>
@ -513,7 +513,7 @@
</property>
</widget>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QCheckBox" name="showTimer">
<property name="text">
<string>Show timer</string>
@ -543,48 +543,55 @@
</property>
</widget>
</item>
<item row="7" column="0">
<item row="8" column="0">
<widget class="QCheckBox" name="showStudyOptions">
<property name="text">
<string>Show study options on deck load</string>
</property>
</widget>
</item>
<item row="6" column="0">
<item row="7" column="0">
<widget class="QCheckBox" name="showTray">
<property name="text">
<string>Show tray icon</string>
</property>
</widget>
</item>
<item row="11" column="0">
<item row="12" column="0">
<widget class="QCheckBox" name="addZeroSpace">
<property name="text">
<string>Add hidden char to text (fixes Thai on OSX)</string>
</property>
</widget>
</item>
<item row="8" column="0">
<item row="9" column="0">
<widget class="QCheckBox" name="openLastDeck">
<property name="text">
<string>Always open last deck on startup</string>
</property>
</widget>
</item>
<item row="9" column="0">
<item row="10" column="0">
<widget class="QCheckBox" name="deckBrowserOrder">
<property name="text">
<string>Show decks with cards due first in browser</string>
</property>
</widget>
</item>
<item row="10" column="0">
<item row="11" column="0">
<widget class="QCheckBox" name="deleteMedia">
<property name="text">
<string>Delete original media on add</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="colourTimes">
<property name="text">
<string>Colour next times</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -693,6 +700,7 @@
<tabstop>saveWhenClosing</tabstop>
<tabstop>numBackups</tabstop>
<tabstop>alternativeTheme</tabstop>
<tabstop>colourTimes</tabstop>
<tabstop>showTimer</tabstop>
<tabstop>showTray</tabstop>
<tabstop>showStudyOptions</tabstop>

16
mac/make_local.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
PYTHON=/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
if [ "x$debug" = "x" ]; then
echo "cleaning up..."
rm -rf build dist
fi
find . -name '*.pyc' -exec rm {} \;
echo "adding image formats..."
rm -rf ankiqt/imageformats
mkdir ankiqt/imageformats
cp -Rvf /Developer/Applications/Qt/plugins/imageformats/libq{gif,jpeg,svg,tiff}* ankiqt/imageformats
echo "building..."
PYTHONPATH=ankiqt:libanki $PYTHON ankiqt/mac/setup.py bdist_dmg