Skip to content

Commit

Permalink
Changed location of import button (#1018).
Browse files Browse the repository at this point in the history
Also updated help link in same window to point to a valid anchor.
  • Loading branch information
hssm committed Feb 22, 2014
1 parent 980c9d7 commit 068a632
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
11 changes: 6 additions & 5 deletions aqt/importing.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def __init__(self, mw, importer):
self.updateDelimiterButtonText()
self.frm.allowHTML.setChecked(self.mw.pm.profile.get('allowHTML', True))
self.frm.importMode.setCurrentIndex(self.mw.pm.profile.get('importMode', 1))
# import button
b = QPushButton(_("Import"))
self.frm.buttonBox.addButton(b, QDialogButtonBox.AcceptRole)
self.exec_()

def setupOptions(self):
Expand All @@ -87,8 +90,6 @@ def setupOptions(self):
self.mw, self.frm.modelArea, label=False)
self.deck = aqt.deckchooser.DeckChooser(
self.mw, self.frm.deckArea, label=False)
self.connect(self.frm.importButton, SIGNAL("clicked()"),
self.doImport)

def modelChanged(self):
self.importer.model = self.mw.col.models.current()
Expand Down Expand Up @@ -138,8 +139,8 @@ def updateDelimiterButtonText(self):
d = `d`
txt = _("Fields separated by: %s") % d
self.frm.autoDetect.setText(txt)

def doImport(self, update=False):
def accept(self):
self.importer.mapping = self.mapping
if not self.importer.mappingOk():
showWarning(
Expand Down Expand Up @@ -249,7 +250,7 @@ def reject(self):
QDialog.reject(self)

def helpRequested(self):
openHelp("FileImport")
openHelp("importing")


def showUnicodeWarning():
Expand Down
19 changes: 2 additions & 17 deletions designer/importing.ui
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,6 @@
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="importButton">
<property name="text">
<string>&amp;Import</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QScrollArea" name="mappingArea">
<property name="sizePolicy">
Expand All @@ -133,8 +119,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>402</width>
<height>206</height>
<width>529</width>
<height>251</height>
</rect>
</property>
</widget>
Expand All @@ -158,7 +144,6 @@
</layout>
</widget>
<tabstops>
<tabstop>importButton</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
Expand Down

0 comments on commit 068a632

Please sign in to comment.