mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 23:42:23 -04:00
add support for exporting original files, tidy up whitespace
This commit is contained in:
parent
ed6a16f014
commit
2249f18913
2 changed files with 1249 additions and 1236 deletions
|
@ -2238,6 +2238,7 @@ it to your friends.
|
||||||
self.connect(m.actionDonate, s, self.onDonate)
|
self.connect(m.actionDonate, s, self.onDonate)
|
||||||
self.connect(m.actionRecordNoiseProfile, s, self.onRecordNoiseProfile)
|
self.connect(m.actionRecordNoiseProfile, s, self.onRecordNoiseProfile)
|
||||||
self.connect(m.actionBuryFact, s, self.onBuryFact)
|
self.connect(m.actionBuryFact, s, self.onBuryFact)
|
||||||
|
self.connect(m.actionExportOriginalFiles, s, self.onExportOriginal)
|
||||||
|
|
||||||
def enableDeckMenuItems(self, enabled=True):
|
def enableDeckMenuItems(self, enabled=True):
|
||||||
"setEnabled deck-related items."
|
"setEnabled deck-related items."
|
||||||
|
@ -2682,8 +2683,7 @@ Consider backing up your media directory first."""))
|
||||||
help="MediaSupport")
|
help="MediaSupport")
|
||||||
return
|
return
|
||||||
ui.utils.showInfo(ngettext("%d missing file found.<br>",
|
ui.utils.showInfo(ngettext("%d missing file found.<br>",
|
||||||
"%d missing files found.<br>",
|
"%d missing files found.<br>", res[0]) +
|
||||||
res[0]) +
|
|
||||||
_("%d successfully retrieved.")
|
_("%d successfully retrieved.")
|
||||||
% res[1], parent=self)
|
% res[1], parent=self)
|
||||||
|
|
||||||
|
@ -2696,6 +2696,11 @@ Consider backing up your media directory first."""))
|
||||||
def onUncacheLatex(self):
|
def onUncacheLatex(self):
|
||||||
anki.latex.deleteAllLatexImages(self.deck)
|
anki.latex.deleteAllLatexImages(self.deck)
|
||||||
|
|
||||||
|
def onExportOriginal(self):
|
||||||
|
cnt = anki.media.exportOriginalFiles(self.deck)
|
||||||
|
ui.utils.showInfo(_("%(a)d files exported to %(b)s.originals folder") %
|
||||||
|
{'a': cnt, 'b': self.deck.name()})
|
||||||
|
|
||||||
# System specific misc
|
# System specific misc
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0" >
|
<ui version="4.0" >
|
||||||
<class>MainWindow</class>
|
<class>MainWindow</class>
|
||||||
<widget class="QMainWindow" name="MainWindow" >
|
<widget class="QMainWindow" name="MainWindow" >
|
||||||
|
@ -6,12 +5,12 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>538</width>
|
<width>550</width>
|
||||||
<height>537</height>
|
<height>563</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -25,7 +24,7 @@
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget" >
|
<widget class="QWidget" name="centralwidget" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||||
<horstretch>1</horstretch>
|
<horstretch>1</horstretch>
|
||||||
<verstretch>1</verstretch>
|
<verstretch>1</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -497,7 +496,7 @@
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QLabel" name="noticeLabel" >
|
<widget class="QLabel" name="noticeLabel" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -524,7 +523,7 @@
|
||||||
<item row="0" column="1" >
|
<item row="0" column="1" >
|
||||||
<widget class="QPushButton" name="noticeButton" >
|
<widget class="QPushButton" name="noticeButton" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -546,7 +545,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="mainStack" >
|
<widget class="QStackedWidget" name="mainStack" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>100</verstretch>
|
<verstretch>100</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -714,7 +713,7 @@
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="fieldsArea" native="true"/>
|
<widget class="QWidget" native="1" name="fieldsArea" />
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="saveEditorButton" >
|
<widget class="QPushButton" name="saveEditorButton" >
|
||||||
|
@ -847,10 +846,10 @@
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip" >
|
<property name="toolTip" >
|
||||||
<string>The <b>number of minutes in a session</b>. When a session is finished, this screen will be shown again, allowing you to start another session. Choose 0 for no limit.</string>
|
<string>The <b>number of minutes in a session</b>. When a session is finished, this screen will be shown again, allowing you to start another session. Choose 0 for no limit.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string><b>Session limit (minutes):</b></string>
|
<string><b>Session limit (minutes):</b></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin" >
|
<property name="margin" >
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
|
@ -860,7 +859,7 @@
|
||||||
<item row="1" column="1" >
|
<item row="1" column="1" >
|
||||||
<widget class="QLineEdit" name="minuteLimit" >
|
<widget class="QLineEdit" name="minuteLimit" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -882,10 +881,10 @@
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip" >
|
<property name="toolTip" >
|
||||||
<string>The maximum number of <b>new cards shown per day</b>. The default is 20, to ensure you don't get overwhelmed with reviews after a few days.</string>
|
<string>The maximum number of <b>new cards shown per day</b>. The default is 20, to ensure you don't get overwhelmed with reviews after a few days.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string><b>New cards per day:</b></string>
|
<string><b>New cards per day:</b></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin" >
|
<property name="margin" >
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
|
@ -895,7 +894,7 @@
|
||||||
<item row="0" column="1" >
|
<item row="0" column="1" >
|
||||||
<widget class="QLineEdit" name="newPerDay" >
|
<widget class="QLineEdit" name="newPerDay" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -924,7 +923,7 @@
|
||||||
<item row="2" column="1" >
|
<item row="2" column="1" >
|
||||||
<widget class="QLineEdit" name="questionLimit" >
|
<widget class="QLineEdit" name="questionLimit" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -940,10 +939,10 @@
|
||||||
<item row="2" column="0" >
|
<item row="2" column="0" >
|
||||||
<widget class="QLabel" name="label" >
|
<widget class="QLabel" name="label" >
|
||||||
<property name="toolTip" >
|
<property name="toolTip" >
|
||||||
<string>The <b>number of questions in a session</b>. When a session is finished, this screen will be shown again, allowing you to start another session. Choose 0 for no limit.</string>
|
<string>The <b>number of questions in a session</b>. When a session is finished, this screen will be shown again, allowing you to start another session. Choose 0 for no limit.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string><b>Session limit (questions):</string>
|
<string><b>Session limit (questions):</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin" >
|
<property name="margin" >
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
|
@ -955,7 +954,7 @@
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_12" >
|
<layout class="QVBoxLayout" name="verticalLayout_12" >
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="optionsBox" native="true">
|
<widget class="QWidget" native="1" name="optionsBox" >
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_7" >
|
<layout class="QVBoxLayout" name="verticalLayout_7" >
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>10</number>
|
<number>10</number>
|
||||||
|
@ -998,7 +997,7 @@
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QPushButton" name="startReviewingButton" >
|
<widget class="QPushButton" name="startReviewingButton" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -1300,7 +1299,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="deckBrowserOuterFrame" >
|
<widget class="QFrame" name="deckBrowserOuterFrame" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -1326,7 +1325,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2" >
|
<widget class="QLabel" name="label_2" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string><h1>Decks</h1></string>
|
<string><h1>Decks</h1></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -1467,7 +1466,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="buttonStack" >
|
<widget class="QStackedWidget" name="buttonStack" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>1</verstretch>
|
<verstretch>1</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -1604,7 +1603,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="showAnswerButton" >
|
<widget class="QPushButton" name="showAnswerButton" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -1811,7 +1810,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="innerHelpFrame" >
|
<widget class="QFrame" name="innerHelpFrame" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -2253,7 +2252,7 @@
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -2712,8 +2711,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>538</width>
|
<width>550</width>
|
||||||
<height>23</height>
|
<height>25</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuHelp" >
|
<widget class="QMenu" name="menuHelp" >
|
||||||
|
@ -2793,6 +2792,7 @@
|
||||||
<addaction name="actionCacheLatex" />
|
<addaction name="actionCacheLatex" />
|
||||||
<addaction name="actionUncacheLatex" />
|
<addaction name="actionUncacheLatex" />
|
||||||
<addaction name="actionDownloadMissingMedia" />
|
<addaction name="actionDownloadMissingMedia" />
|
||||||
|
<addaction name="actionExportOriginalFiles" />
|
||||||
<addaction name="separator" />
|
<addaction name="separator" />
|
||||||
<addaction name="actionRecordNoiseProfile" />
|
<addaction name="actionRecordNoiseProfile" />
|
||||||
<addaction name="separator" />
|
<addaction name="separator" />
|
||||||
|
@ -3461,6 +3461,14 @@
|
||||||
<string>Download Missing Media</string>
|
<string>Download Missing Media</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionExportOriginalFiles" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Export Original Files</string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip" >
|
||||||
|
<string>Save media files using original file names</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>newPerDay</tabstop>
|
<tabstop>newPerDay</tabstop>
|
||||||
|
|
Loading…
Reference in a new issue