mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
add warning to forget, add scrolling to deck browser, use as much space as possible
This commit is contained in:
parent
bafa267c7c
commit
6e7c258b6a
2 changed files with 78 additions and 18 deletions
|
@ -1059,7 +1059,8 @@ your deck."""))
|
||||||
if "QLabel" in repr(obj.widget()):
|
if "QLabel" in repr(obj.widget()):
|
||||||
sip.delete(obj.widget())
|
sip.delete(obj.widget())
|
||||||
else:
|
else:
|
||||||
obj.widget().deleteLater()
|
if obj.widget():
|
||||||
|
obj.widget().deleteLater()
|
||||||
sip.delete(obj)
|
sip.delete(obj)
|
||||||
sip.delete(self.mainWin.decksFrame.layout())
|
sip.delete(self.mainWin.decksFrame.layout())
|
||||||
# build new layout
|
# build new layout
|
||||||
|
@ -1143,7 +1144,11 @@ your deck."""))
|
||||||
refresh.setShortcut(_("Ctrl+Shift+r"))
|
refresh.setShortcut(_("Ctrl+Shift+r"))
|
||||||
self.connect(refresh, SIGNAL("clicked()"),
|
self.connect(refresh, SIGNAL("clicked()"),
|
||||||
self.forceBrowserRefresh)
|
self.forceBrowserRefresh)
|
||||||
layout.addWidget(refresh, c+2, 4)
|
layout.addWidget(refresh, c+2, 3)
|
||||||
|
# make sure top labels don't expand
|
||||||
|
layout.addItem(QSpacerItem(1,1, QSizePolicy.Expanding,
|
||||||
|
QSizePolicy.Expanding),
|
||||||
|
c+3, 4)
|
||||||
else:
|
else:
|
||||||
l = QLabel(_("""\
|
l = QLabel(_("""\
|
||||||
<br>
|
<br>
|
||||||
|
@ -1156,7 +1161,6 @@ later by clicking on the left-pointing arrow on the toolbar.
|
||||||
l.setWordWrap(True)
|
l.setWordWrap(True)
|
||||||
layout.addWidget(l, 0, 0)
|
layout.addWidget(l, 0, 0)
|
||||||
self.mainWin.decksFrame.setLayout(layout)
|
self.mainWin.decksFrame.setLayout(layout)
|
||||||
self.app.processEvents()
|
|
||||||
if focusButton:
|
if focusButton:
|
||||||
focusButton.setFocus()
|
focusButton.setFocus()
|
||||||
|
|
||||||
|
@ -1165,13 +1169,14 @@ later by clicking on the left-pointing arrow on the toolbar.
|
||||||
return
|
return
|
||||||
elif idx == 1:
|
elif idx == 1:
|
||||||
# forget
|
# forget
|
||||||
self.config['recentDeckPaths'].remove(self.browserDecks[c]['path'])
|
if ui.utils.askUser(_("Forget %s?") % self.browserDecks[c]['name']):
|
||||||
del self.browserDecks[c]
|
self.config['recentDeckPaths'].remove(self.browserDecks[c]['path'])
|
||||||
|
del self.browserDecks[c]
|
||||||
self.showDeckBrowser()
|
self.showDeckBrowser()
|
||||||
elif idx == 2:
|
elif idx == 2:
|
||||||
# delete
|
# delete
|
||||||
deck = self.browserDecks[c]['path']
|
deck = self.browserDecks[c]['path']
|
||||||
if ui.utils.askUser(_("Delete %s?") % os.path.basename(deck)):
|
if ui.utils.askUser(_("Delete %s?") % self.browserDecks[c]['name']):
|
||||||
del self.browserDecks[c]
|
del self.browserDecks[c]
|
||||||
os.unlink(deck)
|
os.unlink(deck)
|
||||||
self.config['recentDeckPaths'].remove(deck)
|
self.config['recentDeckPaths'].remove(deck)
|
||||||
|
@ -2692,7 +2697,7 @@ Consider backing up your media directory first."""))
|
||||||
self.setUnifiedTitleAndToolBarOnMac(True)
|
self.setUnifiedTitleAndToolBarOnMac(True)
|
||||||
self.mainWin.actionMarkCard.setShortcut(_("Alt+m"))
|
self.mainWin.actionMarkCard.setShortcut(_("Alt+m"))
|
||||||
if sys.platform.startswith("win32"):
|
if sys.platform.startswith("win32"):
|
||||||
self.mainWin.frame_3.setFrameStyle(QFrame.Panel)
|
self.mainWin.deckBrowserOuterFrame.setFrameStyle(QFrame.Panel)
|
||||||
self.mainWin.frame_2.setFrameStyle(QFrame.Panel)
|
self.mainWin.frame_2.setFrameStyle(QFrame.Panel)
|
||||||
self.mainWin.studyOptionsFrame.setFrameStyle(QFrame.Panel)
|
self.mainWin.studyOptionsFrame.setFrameStyle(QFrame.Panel)
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>707</width>
|
<width>912</width>
|
||||||
<height>646</height>
|
<height>728</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -386,7 +386,7 @@
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="blankPage"/>
|
<widget class="QWidget" name="blankPage"/>
|
||||||
<widget class="QWidget" name="welcomePage">
|
<widget class="QWidget" name="welcomePage">
|
||||||
|
@ -1089,10 +1089,13 @@
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Preferred</enum>
|
||||||
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>150</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
|
@ -1113,10 +1116,22 @@
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="frame_3">
|
<widget class="QFrame" name="deckBrowserOuterFrame">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>10</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>550</width>
|
||||||
|
<height>350</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>500</width>
|
<width>550</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
@ -1147,13 +1162,50 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="decksFrame">
|
<widget class="QScrollArea" name="decksScrollArea">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
<property name="horizontalScrollBarPolicy">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="widgetResizable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>516</width>
|
||||||
|
<height>412</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_18">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="decksFrame">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -1255,10 +1307,13 @@
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Preferred</enum>
|
||||||
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>150</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
|
@ -1464,7 +1519,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>707</width>
|
<width>912</width>
|
||||||
<height>23</height>
|
<height>23</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Reference in a new issue