[Digikam-devel] extragear/graphics/digikam/digikam

Gilles Caulier caulier.gilles at free.fr
Tue Apr 25 12:16:58 BST 2006


SVN commit 533608 by cgilles:

digikam from trunk : fix first time ui widget

- removing ui file (sometime, compilation is broken about ui compiler and automake)
- Rewrite from scratch first run ui.

CCMAIL: digikam-devel at kde.org

 M  +1 -1      Makefile.am  
 M  +28 -25    digikamfirstrun.cpp  
 M  +17 -18    digikamfirstrun.h  
 A             firstrun.cpp   [License: GPL]
 A             firstrun.h   [License: GPL]
 D             firstrunUI.ui  


--- trunk/extragear/graphics/digikam/digikam/Makefile.am #533607:533608
@@ -27,7 +27,7 @@
        
 lib_LTLIBRARIES = libdigikam.la
 
-libdigikam_la_SOURCES = firstrunUI.ui albummanager.cpp album.cpp \
+libdigikam_la_SOURCES = firstrun.cpp albummanager.cpp album.cpp \
 			albumitemhandler.cpp albumdb.cpp albumdb_sqlite2.cpp \
 			albumlister.cpp dragobjects.cpp \
 			iconview.cpp icongroupitem.cpp iconitem.cpp \
--- trunk/extragear/graphics/digikam/digikam/digikamfirstrun.cpp #533607:533608
@@ -1,10 +1,11 @@
 /* ============================================================
- * Author: Renchi Raju <renchi at pooh.tam.uiuc.edu>
+ * Authors: Renchi Raju <renchi at pooh.tam.uiuc.edu>
  *         Gilles Caulier <caulier dot gilles at kdemail dot net>
- * Date  : 2003-02-01
- * Description :
+ * Date   : 2003-02-01
+ * Description : dialog displayed at the first digiKam run
  *
- * Copyright 2003-2004 by Renchi Raju
+ * Copyright 2003-2005 by Renchi Raju
+ * Copyright 2006 by Gilles Caulier
  *
  * This program is free software; you can redistribute it
  * and/or modify it under the terms of the GNU General
@@ -61,32 +62,31 @@
 
 #include "digikamfirstrun.h"
 #include "version.h"
-#include "firstrunUI.h"
+#include "firstrun.h"
 
 namespace Digikam
 {
 
 using namespace std;
 
-DigikamFirstRun::DigikamFirstRun( KConfig* config,
-                                  QWidget* parent,
-                                  const char* name, bool modal,
-                                  WFlags fl )
-    : KDialogBase( parent, name, modal, i18n( "Album Library Path" ), Help|Ok|Cancel, Ok, true )
+DigikamFirstRun::DigikamFirstRun( KConfig* config, QWidget* parent,
+                                  const char* name, bool modal, WFlags fl )
+               : KDialogBase( parent, name, modal, i18n( "Album Library Path" ), Help|Ok|Cancel, Ok, true )
 
 {
     setHelp("firstrundialog.anchor", "digikam");
     setWFlags(fl);
-    config_ = config;
-    ui = new DigikamFirstFirstRunWidget(this);
-    setMainWidget(ui);
-    ui->path->setURL(QDir::homeDirPath() + i18n("This is a path name so you should "
-                     "include the slash in the translation","/Pictures"));
-    ui->path->setMode(KFile::Directory | KFile::LocalOnly);
+    
+    m_config = config;
+    m_ui     = new FirstRunWidget(this);
+    setMainWidget(m_ui);
+    m_ui->m_path->setURL(QDir::homeDirPath() + i18n("This is a path name so you should "
+                       "include the slash in the translation","/Pictures"));
+    m_ui->m_path->setMode(KFile::Directory | KFile::LocalOnly);
 
     KIconLoader* iconLoader = KApplication::kApplication()->iconLoader();
-    ui->pixLabel->setPixmap(iconLoader->loadIcon("digikam", KIcon::NoGroup, 128, KIcon::DefaultState, 0, true));
-    ui->setMinimumSize(450, ui->sizeHint().height());
+    m_ui->m_pixLabel->setPixmap(iconLoader->loadIcon("digikam", KIcon::NoGroup, 128, KIcon::DefaultState, 0, true));
+    m_ui->setMinimumSize(450, m_ui->sizeHint().height());
 }
 
 DigikamFirstRun::~DigikamFirstRun()
@@ -95,7 +95,8 @@
 
 void DigikamFirstRun::slotOk()
 {
-    QString albumLibraryFolder = ui->path->url();
+    QString albumLibraryFolder = m_ui->m_path->url();
+    
     if (albumLibraryFolder.isEmpty())
     {
         KMessageBox::sorry(this, i18n("You must select a folder for digiKam to "
@@ -115,13 +116,14 @@
     }
 
     QDir targetPath(albumLibraryFolder);
+    
     if (!targetPath.exists())
     {
         int rc = KMessageBox::questionYesNo(this,
                                    i18n("<qt>The folder you selected does not exist: "
 
                                         "<p><b>%1</b></p>"
-                                        "Would you like Digikam to make it for you now?</qt>")
+                                        "Would you like digiKam to make it for you now?</qt>")
                                         .arg(albumLibraryFolder),
                                    i18n("Create Folder?"));
 
@@ -142,6 +144,7 @@
     }
 
     QFileInfo path(albumLibraryFolder);
+    
     if (!path.isWritable()) 
     {
         KMessageBox::information(this, i18n("No write access for this path.\n"
@@ -149,12 +152,12 @@
         return;
     }
 
-    config_->setGroup("General Settings");
-    config_->writeEntry("Version", digikam_version);
+    m_config->setGroup("General Settings");
+    m_config->writeEntry("Version", digikam_version);
 
-    config_->setGroup("Album Settings");
-    config_->writePathEntry("Album Path", albumLibraryFolder);
-    config_->sync();
+    m_config->setGroup("Album Settings");
+    m_config->writePathEntry("Album Path", albumLibraryFolder);
+    m_config->sync();
 
     KDialogBase::accept();
 
--- trunk/extragear/graphics/digikam/digikam/digikamfirstrun.h #533607:533608
@@ -1,22 +1,23 @@
 /* ============================================================
- * Author: Renchi Raju <renchi at pooh.tam.uiuc.edu>
+ * Authors: Renchi Raju <renchi at pooh.tam.uiuc.edu>
  *         Gilles Caulier <caulier dot gilles at kdemail dot net>
- * Date  : 2003-02-01
- * Description : 
- * 
- * Copyright 2003-2004 by Renchi Raju
+ * Date   : 2003-02-01
+ * Description : dialog displayed at the first digiKam run
  *
+ * Copyright 2003-2005 by Renchi Raju
+ * Copyright 2006 by Gilles Caulier
+ *
  * This program is free software; you can redistribute it
  * and/or modify it under the terms of the GNU General
  * Public License as published by the Free Software Foundation;
  * either version 2, or (at your option)
  * any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * ============================================================ */
 
 #ifndef DIGIKAMFIRSTRUN_H
@@ -36,7 +37,7 @@
 namespace Digikam
 {
 
-class DigikamFirstFirstRunWidget;
+class FirstRunWidget;
 
 class DIGIKAM_EXPORT DigikamFirstRun : public KDialogBase
 {
@@ -44,21 +45,19 @@
 
 public:
 
-    DigikamFirstRun( KConfig* config,
-                     QWidget* parent = 0,
-                     const char* name = 0,
-                     bool modal = true,
-                     WFlags fl = WDestructiveClose );
+    DigikamFirstRun( KConfig* config, QWidget* parent = 0, const char* name = 0,
+                     bool modal = true, WFlags fl = WDestructiveClose );
     ~DigikamFirstRun();
 
-private:
-
-    KConfig*     config_;
-    DigikamFirstFirstRunWidget *ui;
-
 protected slots:
     
     void slotOk();
+
+private:
+
+    KConfig        *m_config;
+    FirstRunWidget *m_ui;
+    
 };
 
 }  // namespace Digikam



More information about the Digikam-devel mailing list