SVN commit 526512 by cgilles:
digikam from trunk : improvement camera setup page : - Using KListView look better than QListView - Add gphoto logo to give more visibility to end users about internal camera interface (there is no camera drivers into digikam core). CCMAIL: [hidden email] M +2 -1 digikam/pics/Makefile.am AM digikam/pics/gphotologo.png M +42 -15 utilities/setup/setupcamera.cpp M +2 -0 utilities/setup/setupcamera.h --- trunk/extragear/graphics/digikam/digikam/pics/Makefile.am #526511:526512 @@ -1,6 +1,7 @@ digikampicdir = $(kde_datadir)/digikam/data digikampic_DATA = image_broken.png histogram-lin.png histogram-log.png \ - image-full.png image-selection.png rating.png digikamlogo.png worldmap.png + image-full.png image-selection.png rating.png digikamlogo.png \ + worldmap.png gphotologo.png iconsdir = $(kde_datadir)/digikam/icons/hicolor/32x32/actions icons_DATA = tag.png tag-folder.png tag-events.png tag-people.png tag-places.png ** trunk/extragear/graphics/digikam/digikam/pics/gphotologo.png #property svn:mime-type + application/octet-stream --- trunk/extragear/graphics/digikam/utilities/setup/setupcamera.cpp #526511:526512 @@ -25,13 +25,19 @@ #include <qgroupbox.h> #include <qpushbutton.h> #include <qlayout.h> -#include <qlistview.h> #include <qwhatsthis.h> +#include <qtooltip.h> // KDE includes. +#include <klistview.h> #include <klocale.h> #include <kmessagebox.h> +#include <kurllabel.h> +#include <kiconloader.h> +#include <kglobalsettings.h> +#include <kapplication.h> +#include <kstandarddirs.h> // Local includes. @@ -56,12 +62,12 @@ autoDetectButton = 0; } - QListView* listView; + KListView *listView; - QPushButton* addButton; - QPushButton* removeButton; - QPushButton* editButton; - QPushButton* autoDetectButton; + QPushButton *addButton; + QPushButton *removeButton; + QPushButton *editButton; + QPushButton *autoDetectButton; }; SetupCamera::SetupCamera( QWidget* parent ) @@ -73,16 +79,18 @@ QGridLayout* groupBoxLayout = new QGridLayout( this, 2, 5, 0, KDialog::spacingHint() ); groupBoxLayout->setAlignment( Qt::AlignTop ); - d->listView = new QListView( this ); + d->listView = new KListView( this ); d->listView->addColumn( i18n("Title") ); d->listView->addColumn( i18n("Model") ); d->listView->addColumn( i18n("Port") ); d->listView->addColumn( i18n("Path") ); d->listView->setAllColumnsShowFocus(true); - groupBoxLayout->addMultiCellWidget( d->listView, 0, 4, 0, 0 ); + groupBoxLayout->addMultiCellWidget( d->listView, 0, 5, 0, 0 ); QWhatsThis::add( d->listView, i18n("<p>Here you can see the digital camera list used by digiKam " - "via the Gphoto interface.")); + "via the Gphoto interface.")); + // ------------------------------------------------------------- + d->addButton = new QPushButton( this ); groupBoxLayout->addWidget( d->addButton, 0, 1 ); @@ -104,6 +112,15 @@ QSizePolicy::Expanding ); groupBoxLayout->addItem( spacer, 4, 1 ); + KURLLabel *gphotoLogoLabel = new KURLLabel(this); + gphotoLogoLabel->setText(QString::null); + gphotoLogoLabel->setURL("http://www.gphoto.org"); + KGlobal::dirs()->addResourceType("gphotologo", KGlobal::dirs()->kde_default("data") + "digikam/data"); + QString directory = KGlobal::dirs()->findResourceDir("gphotologo", "gphotologo.png"); + gphotoLogoLabel->setPixmap( QPixmap( directory + "gphotologo.png" ) ); + QToolTip::add(gphotoLogoLabel, i18n("Visit Gphoto project website")); + groupBoxLayout->addWidget( gphotoLogoLabel, 5, 1 ); + adjustSize(); mainLayout->addWidget(this); @@ -112,8 +129,11 @@ d->removeButton->setEnabled(false); d->editButton->setEnabled(false); - // connections + // ------------------------------------------------------------- + connect(gphotoLogoLabel, SIGNAL(leftClickedURL(const QString&)), + this, SLOT(processGphotoURL(const QString&))); + connect(d->listView, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged())); @@ -136,10 +156,11 @@ if (clist) { QPtrList<CameraType>* cl = clist->cameraList(); + for (CameraType *ctype = cl->first(); ctype; ctype = cl->next()) { - new QListViewItem(d->listView, ctype->title(), ctype->model(), + new KListViewItem(d->listView, ctype->title(), ctype->model(), ctype->port(), ctype->path()); } } @@ -150,6 +171,11 @@ delete d; } +void SetupCamera::processGphotoURL(const QString& url) +{ + KApplication::kApplication()->invokeBrowser(url); +} + void SetupCamera::slotSelectionChanged() { QListViewItem *item = d->listView->selectedItem(); @@ -191,8 +217,8 @@ if (!item) return; CameraSelection *select = new CameraSelection; - select->setCamera(item->text(0), item->text(1), - item->text(2), item->text(3)); + select->setCamera(item->text(0), item->text(1), item->text(2), item->text(3)); + connect(select, SIGNAL(signalOkClicked(const QString&, const QString&, const QString&, const QString&)), this, SLOT(slotEditedCamera(const QString&, const QString&, @@ -225,14 +251,14 @@ { KMessageBox::information(this, i18n("Found camera '%1' (%2) and added it to the list.") .arg(model).arg(port)); - new QListViewItem(d->listView, model, model, port, "/"); + new KListViewItem(d->listView, model, model, port, "/"); } } void SetupCamera::slotAddedCamera(const QString& title, const QString& model, const QString& port, const QString& path) { - new QListViewItem(d->listView, title, model, port, path); + new KListViewItem(d->listView, title, model, port, path); } void SetupCamera::slotEditedCamera(const QString& title, const QString& model, @@ -250,6 +276,7 @@ void SetupCamera::applySettings() { CameraList* clist = CameraList::instance(); + if (clist) { clist->clear(); --- trunk/extragear/graphics/digikam/utilities/setup/setupcamera.h #526511:526512 @@ -45,6 +45,8 @@ private slots: + void processGphotoURL(const QString& url); + void slotSelectionChanged(); void slotAddCamera(); _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |