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, 'addZeroSpace': False,
'alternativeTheme': False, 'alternativeTheme': False,
'checkForUpdates': True, 'checkForUpdates': True,
'colourTimes': True,
'created': time.time(), 'created': time.time(),
'deckBrowserNameLength': 30, 'deckBrowserNameLength': 30,
'deckBrowserOrder': 0, 'deckBrowserOrder': 0,

View file

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

View file

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

View file

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