[Kde-imaging] kdeextragear-libs-1/kipi-plugins/commentseditor

Gilles Caulier caulier.gilles at free.fr
Mon Sep 6 15:22:55 CEST 2004


CVS commit by cgilles: 

Added About data in CommentsEditor KIPI plugin
CCMAIL: kde-imaging at kde.org


  M +39 -14    commentseditor.cpp   1.11
  M +8 -1      commentseditor.h   1.6


--- kdeextragear-libs-1/kipi-plugins/commentseditor/commentseditor.cpp  #1.10:1.11
@@ -32,4 +32,5 @@
 #include <qfont.h>
 #include <qevent.h>
+#include <qpushbutton.h>
 
 // KDE includes.
@@ -39,4 +40,9 @@
 #include <kmessagebox.h>
 #include <kio/previewjob.h>
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <khelpmenu.h>
+#include <kiconloader.h>
+#include <kpopupmenu.h>
 
 // LibKipi includes.
@@ -147,9 +153,30 @@ protected:
 
 CommentsEditor::CommentsEditor( KIPI::Interface* interface, KIPI::ImageCollection images, QWidget *parent )
-    : KDialogBase(Plain, i18n("Edit Comments"), Help|User1|Ok|Cancel, Ok,
+              : KDialogBase(Plain, i18n("Edit Comments"), Help|Ok|Cancel, Ok,
                   parent, 0, true, true, i18n("&About") )
 
 {
-    setHelp("commentseditor", "kipi-plugins");
+    // About data and help button.
+    
+    KAboutData* about = new KAboutData("kipiplugins",
+                                       I18N_NOOP("Comments Editor"), 
+                                       "0.1.0-cvs",
+                                       I18N_NOOP("A KIPI plugin for commenting images"),
+                                       KAboutData::License_GPL,
+                                       "(c) 2003-2004, Renchi Raju", 
+                                       0,
+                                       "http://extragear.kde.org/apps/kipi.php");
+    
+    about->addAuthor("Renchi Raju", I18N_NOOP("Author and maintainer"),
+                     "renchi at pooh.tam.uiuc.edu");
+
+    m_helpButton = actionButton( Help );
+    KHelpMenu* helpMenu = new KHelpMenu(this, about, false);
+    helpMenu->menu()->removeItemAt(0);
+    helpMenu->menu()->insertItem(i18n("Comments Editor handbook"), this, SLOT(slotHelp()), 0, -1, 0);
+    m_helpButton->setPopup( helpMenu->menu() );
+
+    // ------------------------------------------
+        
     m_images    = images;
     m_interface = interface;
@@ -198,8 +225,7 @@ CommentsEditor::CommentsEditor( KIPI::In
     connect(m_listView, SIGNAL(selectionChanged()),
             this, SLOT(slotSelectionChanged()));
+            
     connect(m_edit, SIGNAL(textChanged(const QString&)),
             this, SLOT(slotCommentChanged(const QString&)));
-    connect(this, SIGNAL(user1Clicked()),
-            this, SLOT(slotAboutClicked()));
 
     // ----------------------------------------------------------
@@ -214,4 +240,10 @@ CommentsEditor::~CommentsEditor()
 }
 
+void CommentsEditor::slotHelp()
+{
+    KApplication::kApplication()->invokeHelp("commentseditor",
+                                             "kipi-plugins");
+} 
+
 void CommentsEditor::loadItems()
 {
@@ -237,4 +269,5 @@ void CommentsEditor::loadItems()
 
     KIO::PreviewJob* thumbJob = KIO::filePreview( urlList, 64);
+    
     connect(thumbJob, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)),
             SLOT(slotGotPreview(const KFileItem*, const QPixmap&)));
@@ -301,12 +334,4 @@ void CommentsEditor::slotOkClicked()
 }
 
-void CommentsEditor::slotAboutClicked()
-{
-    KMessageBox::about(this, i18n("A KIPI plugin for commenting images\n\n"
-                                  "Author: Renchi Raju\n\n"
-                                  "Email: renchi at pooh.tam.uiuc.edu"),
-                                  i18n("About 'Comments Editor'"));
-}
-
 } // NameSpace KIPICommentsEditorPlugin
 

--- kdeextragear-libs-1/kipi-plugins/commentseditor/commentseditor.h  #1.5:1.6
@@ -38,4 +38,5 @@
 class QListViewItem;
 class QPixmap;
+class QPushButton;
 
 class KFileItem;
@@ -61,7 +62,12 @@ private:
     void loadItems();
 
+    QPushButton                      *m_helpButton;
+    
     CListView                        *m_listView;
+    
     CLineEdit                        *m_edit;
+    
     KIPI::ImageCollection             m_images;
+    
     KIPI::Interface*                  m_interface;
 
@@ -73,5 +79,6 @@ private slots:
     void slotCommentChanged(const QString& newComment);
     void slotOkClicked();
-    void slotAboutClicked();
+    void slotHelp();
+    
 };
 




More information about the Kde-imaging mailing list