<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,7 +2,6 @@ ACTIONS_DIR:=$$(kde4-config --install data)/solid/actions
 
 all:
 	pyuic4 importdialog.ui -o ui_importdialog.py
-	pyuic4 progresspage.ui -o ui_progresspage.py
 
 clean:
 	-rm *.pyc ui_*.py</diff>
      <filename>Makefile</filename>
    </modified>
    <modified>
      <diff>@@ -5,50 +5,31 @@ from PyQt4.QtGui import *
 from PyKDE4.kdecore import *
 from PyKDE4.kdeui import *
 
-from ui_progresspage import Ui_ProgressPage
 from ui_importdialog import Ui_ImportDialog
 
 
-class ImportDialog(KAssistantDialog):
+class ImportDialog(KDialog):
     def __init__(self, dstUrl):
-        KAssistantDialog.__init__(self)
+        KDialog.__init__(self)
 
         self.dstBaseUrl = KUrl(dstUrl)
         year = str(time.gmtime().tm_year)
         self.dstBaseUrl.addPath(year)
 
         # Destination
-        self.destinationPage = QWidget(self)
-        self.destinationUi = Ui_ImportDialog()
-        self.destinationUi.setupUi(self.destinationPage)
-        self.destinationPage.layout().setMargin(0)
-        self.destinationPageItem = self.addPage(self.destinationPage, i18n(&quot;Destination&quot;))
-
-        # Progress
-        self.progressPage = QWidget(self)
-        self.progressUi = Ui_ProgressPage()
-        self.progressUi.setupUi(self.progressPage)
-        self.progressPage.layout().setMargin(0)
-        self.progressPageItem = self.addPage(self.progressPage, i18n(&quot;Progress&quot;))
-
-        QObject.connect(self.destinationUi.eventComboBox, SIGNAL(&quot;editTextChanged(QString)&quot;), \
+        widget = QWidget(self)
+        self.ui = Ui_ImportDialog()
+        self.ui.setupUi(widget)
+        widget.layout().setMargin(0)
+        self.setMainWidget(widget)
+
+        QObject.connect(self.ui.eventComboBox, SIGNAL(&quot;editTextChanged(QString)&quot;), \
             self.updateDstLabel)
 
-        self.destinationUi.eventComboBox.setFocus()
+        self.ui.eventComboBox.setFocus()
         self.updateDstLabel()
 
 
-    def showProgressPage(self, count):
-        self.progressUi.progressBar.setRange(0, count)
-        self.progressUi.progressBar.setValue(0)
-        self.setCurrentPage(self.progressPageItem)
-
-
-    def increaseProgressValue(self):
-        bar = self.progressUi.progressBar
-        bar.setValue(bar.value() + 1)
-
-
     def sizeHint(self):
         sh = KDialog.sizeHint(self)
         sh.setWidth(400)
@@ -57,12 +38,12 @@ class ImportDialog(KAssistantDialog):
 
     def updateDstLabel(self):
         url = self.dstUrl()
-        self.destinationUi.dstLabel.setText(url.pathOrUrl())
+        self.ui.dstLabel.setText(url.pathOrUrl())
 
 
     def dstUrl(self):
         url = KUrl(self.dstBaseUrl)
-        url.addPath(self.destinationUi.eventComboBox.currentText())
+        url.addPath(self.ui.eventComboBox.currentText())
         return url
 
 </diff>
      <filename>importdialog.py</filename>
    </modified>
    <modified>
      <diff>@@ -68,29 +68,31 @@ class Controller(QObject):
         QObject.__init__(self)
         self.src = src
         self.dlg = ImportDialog(KUrl(baseDst))
-        QObject.connect(self.dlg, \
-            SIGNAL(&quot;currentPageChanged(KPageWidgetItem*, KPageWidgetItem*)&quot;), \
-            self.slotCurrentPageChanged)
 
 
     def run(self):
-        self.dlg.show()
+        if not self.dlg.exec_():
+            return False
 
-
-    def slotCurrentPageChanged(self, newItem, oldItem):
         self.dstDirUrl = self.dlg.dstUrl()
 
+        self.progressDlg = KProgressDialog()
+        self.progressDlg.setLabelText(i18n(&quot;Initializing...&quot;))
+        self.progressDlg.setMinimumDuration(0)
+        qApp.processEvents()
+
         dir = unicode(self.dstDirUrl.path())
         if not os.path.exists(dir):
             os.makedirs(dir)
 
+        self.progressDlg.setLabelText(i18n(&quot;Importing pictures...&quot;))
         self.urlList = listImages(self.src)
         if not self.urlList:
-            self.dlg.close()
             KMessageBox.information(None, i18n(&quot;No picture to import.&quot;))
-            return
-        self.dlg.showProgressPage(len(self.urlList))
+            return False
+        self.progressDlg.progressBar().setRange(0, len(self.urlList))
         self.copyOneUrl()
+        return True
 
 
     def copyOneUrl(self):
@@ -105,14 +107,15 @@ class Controller(QObject):
     def slotJobResult(self, job):
         if job.error() != 0:
             job.uiDelegate().showErrorMessage()
-            self.dlg.close()
+            self.progressDlg.close()
             return
 
-        self.dlg.increaseProgressValue()
+        bar = self.progressDlg.progressBar()
+        bar.setValue(bar.value() + 1)
         if self.urlList:
             self.copyOneUrl()
         else:
-            self.dlg.close()
+            self.progressDlg.close()
             self.deleteFromCard()
 
 
@@ -156,7 +159,8 @@ def main():
 
     baseDst = os.path.expanduser(options.baseDst)
     controller = Controller(src, baseDst)
-    controller.run()
+    if not controller.run():
+        return 1
     app.exec_()
     return 0
 </diff>
      <filename>main.py</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>progresspage.ui</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>6d589d68bbaadacecaf98492bff1ce78b03ff580</id>
    </parent>
  </parents>
  <author>
    <name>Aur&#233;lien G&#226;teau</name>
    <email>agateau@kde.org</email>
  </author>
  <url>http://github.com/agateau/gwenview-importer/commit/71d2b0066f046e6eae43c4e276a3df80b3341744</url>
  <id>71d2b0066f046e6eae43c4e276a3df80b3341744</id>
  <committed-date>2009-05-27T14:01:34-07:00</committed-date>
  <authored-date>2009-05-27T14:01:34-07:00</authored-date>
  <message>Wizard is not that nice. Let's just a simple progress dialog.</message>
  <tree>2b7d79053a295c5f677bb37da951df75969736e0</tree>
  <committer>
    <name>Aur&#233;lien G&#226;teau</name>
    <email>agateau@kde.org</email>
  </committer>
</commit>
