SVN commit 629121 by cgilles:
digiKam from trunk : Simplification of preview mode : - remore "Back to Album" button ==> use the new toggle button from tool bar to change Preview mode. - remore "Edit" button ==> use the Edit button from tool bar. CCMAIL: [hidden email] M +2 -8 albumwidgetstack.cpp M +5 -0 digikamapp.cpp M +1 -0 digikamapp.h M +2 -0 digikamview.cpp M +8 -58 imagepreviewview.cpp M +3 -7 imagepreviewview.h M +6 -18 mediaplayerview.cpp M +2 -9 mediaplayerview.h --- trunk/extragear/graphics/digikam/digikam/albumwidgetstack.cpp #629120:629121 @@ -81,12 +81,6 @@ // ----------------------------------------------------------------- - connect(d->mediaPlayerView, SIGNAL( backToAlbumSignal() ), - this, SIGNAL( backToAlbumSignal() ) ); - - connect(d->imagePreviewView, SIGNAL( backToAlbumSignal() ), - this, SIGNAL( backToAlbumSignal() ) ); - connect(d->imagePreviewView, SIGNAL( editImageSignal() ), this, SIGNAL( editImageSignal() ) ); @@ -102,7 +96,7 @@ void AlbumWidgetStack::slotEscapePreview() { if (previewMode() == MediaPlayerMode) - d->mediaPlayerView->slotBackButtonClicked(); + d->mediaPlayerView->escapePreview(); } AlbumIconView* AlbumWidgetStack::albumIconView() @@ -122,7 +116,7 @@ if (previewMode() == MediaPlayerMode) d->mediaPlayerView->setMediaPlayerFromUrl(KURL()); else if (previewMode() == PreviewImageMode) - d->imagePreviewView->slotPreviewFailed(); + slotPreviewLoaded(); } else { --- trunk/extragear/graphics/digikam/digikam/digikamapp.cpp #629120:629121 @@ -1735,5 +1735,10 @@ KApplication::kApplication()->invokeBrowser("http://www.digikam.org/?q=donation"); } +void DigikamApp::escapePreview() +{ + d->imagePreviewAction->setChecked(false); +} + } // namespace Digikam --- trunk/extragear/graphics/digikam/digikam/digikamapp.h #629120:629121 @@ -76,6 +76,7 @@ void enableThumbSizeMinusAction(bool val); void enableAlbumBackwardHistory(bool enable); void enableAlbumForwardHistory(bool enable); + void escapePreview(); signals: --- trunk/extragear/graphics/digikam/digikam/digikamview.cpp #629120:629121 @@ -865,6 +865,8 @@ slot_imagePreview(currItem); else slot_imagePreview(0); + + d->parent->escapePreview(); } void DigikamView::slotEditImage() --- trunk/extragear/graphics/digikam/digikam/imagepreviewview.cpp #629120:629121 @@ -1,9 +1,9 @@ /* ============================================================ * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net> * Date : 2006-21-12 - * Description : a view to embed the image preview widget. + * Description : a embeded view to show the image preview widget. * - * Copyright 2006 Gilles Caulier + * Copyright 2006-2007 Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -20,10 +20,7 @@ // Qt includes. -#include <qwidget.h> #include <qstring.h> -#include <qpushbutton.h> -#include <qlayout.h> // KDE includes. @@ -46,17 +43,9 @@ ImagePreviewViewPriv() { - buttonsArea = 0; - backButton = 0; - editButton = 0; imagePreviewWidget = 0; } - QPushButton *backButton; - QPushButton *editButton; - - QWidget *buttonsArea; - ImagePreviewWidget *imagePreviewWidget; }; @@ -65,40 +54,21 @@ { d = new ImagePreviewViewPriv; d->imagePreviewWidget = new ImagePreviewWidget(this); - d->buttonsArea = new QWidget(this); - QHBoxLayout *hlay = new QHBoxLayout(d->buttonsArea); - d->backButton = new QPushButton(i18n("Back to Album"), d->buttonsArea); - d->editButton = new QPushButton(i18n("Edit..."), d->buttonsArea); - setFrameStyle(QFrame::GroupBoxPanel|QFrame::Plain); - setMargin(0); - setLineWidth(1); - hlay->setMargin(KDialogBase::marginHint()); - hlay->addStretch(1); - hlay->addWidget(d->backButton); - hlay->addStretch(10); - hlay->addWidget(d->editButton); - hlay->addStretch(1); + setFrameStyle(QFrame::GroupBoxPanel|QFrame::Plain); + setMargin(0); + setLineWidth(1); // ---------------------------------------------------------------- connect(ThemeEngine::instance(), SIGNAL(signalThemeChanged()), this, SLOT(slotThemeChanged())); - connect(d->backButton, SIGNAL( clicked() ), - this, SIGNAL( backToAlbumSignal() ) ); - - connect(d->editButton, SIGNAL( clicked() ), - this, SIGNAL( editImageSignal() ) ); - - connect(d->imagePreviewWidget, SIGNAL( previewStarted() ), - this, SLOT( slotPreviewStarted() ) ); - connect(d->imagePreviewWidget, SIGNAL( previewComplete() ), - this, SLOT( slotPreviewComplete() ) ); + this, SIGNAL( previewLoadedSignal() ) ); connect(d->imagePreviewWidget, SIGNAL( previewFailed() ), - this, SLOT( slotPreviewFailed() ) ); + this, SIGNAL( previewLoadedSignal() ) ); } ImagePreviewView::~ImagePreviewView() @@ -113,28 +83,8 @@ void ImagePreviewView::slotThemeChanged() { - d->buttonsArea->setPaletteBackgroundColor(ThemeEngine::instance()->baseColor()); + setPaletteBackgroundColor(ThemeEngine::instance()->baseColor()); } -void ImagePreviewView::slotPreviewStarted() -{ - d->backButton->setEnabled(false); - d->editButton->setEnabled(false); -} - -void ImagePreviewView::slotPreviewComplete() -{ - d->backButton->setEnabled(true); - d->editButton->setEnabled(true); - emit previewLoadedSignal(); -} - -void ImagePreviewView::slotPreviewFailed() -{ - d->backButton->setEnabled(true); - d->editButton->setEnabled(false); - emit previewLoadedSignal(); -} - } // NameSpace Digikam --- trunk/extragear/graphics/digikam/digikam/imagepreviewview.h #629120:629121 @@ -1,9 +1,9 @@ /* ============================================================ * Authors: Gilles Caulier <caulier dot gilles at kdemail dot net> * Date : 2006-21-12 - * Description : a view to embed the image preview widget. + * Description : a embeded view to show the image preview widget. * - * Copyright 2006 Gilles Caulier + * Copyright 2006-2007 Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -48,19 +48,15 @@ signals: - void backToAlbumSignal(); - void editImageSignal(); void previewLoadedSignal(); public slots: - void slotPreviewFailed(); +// void slotPreviewFailed(); private slots: void slotThemeChanged(); - void slotPreviewStarted(); - void slotPreviewComplete(); private: --- trunk/extragear/graphics/digikam/digikam/mediaplayerview.cpp #629120:629121 @@ -3,7 +3,7 @@ * Date : 2006-20-12 * Description : a view to embed a KPart media player. * - * Copyright 2006 Gilles Caulier + * Copyright 2006-2007 Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -22,7 +22,6 @@ #include <qlabel.h> #include <qstring.h> -#include <qpushbutton.h> #include <qlayout.h> #include <qframe.h> @@ -83,35 +82,32 @@ d->errorView = new QFrame(this); QLabel *errorMsg = new QLabel(i18n("No media player available..."), d->errorView); - QGridLayout *grid = new QGridLayout(d->errorView, 1, 2, + QGridLayout *grid = new QGridLayout(d->errorView, 2, 2, KDialogBase::marginHint(), KDialogBase::spacingHint()); - QPushButton *backBtn1 = new QPushButton(i18n("Back to Album"), d->errorView); errorMsg->setAlignment(Qt::AlignCenter); d->errorView->setFrameStyle(QFrame::GroupBoxPanel|QFrame::Plain); d->errorView->setMargin(0); d->errorView->setLineWidth(1); - grid->addMultiCellWidget(errorMsg, 0, 0, 0, 2); - grid->addMultiCellWidget(backBtn1, 1, 1, 1, 1); + grid->addMultiCellWidget(errorMsg, 1, 1, 0, 2); grid->setColStretch(0, 10), grid->setColStretch(2, 10), grid->setRowStretch(0, 10), + grid->setRowStretch(2, 10), addWidget(d->errorView, MediaPlayerViewPriv::ErrorView); // -------------------------------------------------------------------------- d->mediaPlayerView = new QFrame(this); - d->grid = new QGridLayout(d->mediaPlayerView, 1, 2, + d->grid = new QGridLayout(d->mediaPlayerView, 2, 2, KDialogBase::marginHint(), KDialogBase::spacingHint()); - QPushButton *backBtn2 = new QPushButton(i18n("Back to Album"), d->mediaPlayerView); d->mediaPlayerView->setFrameStyle(QFrame::GroupBoxPanel|QFrame::Plain); d->mediaPlayerView->setMargin(0); d->mediaPlayerView->setLineWidth(1); - d->grid->addMultiCellWidget(backBtn2, 1, 1, 1, 1); d->grid->setColStretch(0, 10), d->grid->setColStretch(2, 10), d->grid->setRowStretch(0, 10), @@ -121,12 +117,6 @@ // -------------------------------------------------------------------------- - connect(backBtn1, SIGNAL(clicked()), - this, SLOT(slotBackButtonClicked()) ); - - connect(backBtn2, SIGNAL(clicked()), - this, SLOT(slotBackButtonClicked()) ); - connect(ThemeEngine::instance(), SIGNAL(signalThemeChanged()), this, SLOT(slotThemeChanged())); } @@ -219,7 +209,7 @@ setPreviewMode(MediaPlayerViewPriv::PlayerView); } -void MediaPlayerView::slotBackButtonClicked() +void MediaPlayerView::escapePreview() { if (d->mediaPlayerPart) { @@ -227,8 +217,6 @@ delete d->mediaPlayerPart; d->mediaPlayerPart = 0; } - - emit backToAlbumSignal(); } void MediaPlayerView::slotThemeChanged() --- trunk/extragear/graphics/digikam/digikam/mediaplayerview.h #629120:629121 @@ -3,7 +3,7 @@ * Date : 2006-20-12 * Description : a view to embed a KPart media player. * - * Copyright 2006 Gilles Caulier + * Copyright 2006-2007 Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -48,15 +48,8 @@ ~MediaPlayerView(); void setMediaPlayerFromUrl(const KURL& url); + void escapePreview(); -signals: - - void backToAlbumSignal(); - -public slots: - - void slotBackButtonClicked(); - private slots: void slotThemeChanged(); _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |