From e38d2351b83fa65c66ccde443777647ef5cb6cff Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 1 Mar 2010 19:17:32 +0000 Subject: Added KDE3 version of Tellico git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1097620 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/viewstack.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/viewstack.cpp (limited to 'src/viewstack.cpp') diff --git a/src/viewstack.cpp b/src/viewstack.cpp new file mode 100644 index 0000000..69d6ff8 --- /dev/null +++ b/src/viewstack.cpp @@ -0,0 +1,55 @@ +/*************************************************************************** + copyright : (C) 2002-2006 by Robby Stephenson + email : robby@periapsis.org + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of version 2 of the GNU General Public License as * + * published by the Free Software Foundation; * + * * + ***************************************************************************/ + +#include "viewstack.h" +#include "entryview.h" +#include "entryiconview.h" +#include "tellico_debug.h" +#include "imagefactory.h" + +#include +#include + +#include + +using Tellico::ViewStack; + +ViewStack::ViewStack(QWidget* parent_, const char* name_/*=0*/) : QWidgetStack(parent_, name_), + m_entryView(new EntryView(this)), m_iconView(new EntryIconView(this)) { + QWhatsThis::add(m_entryView->view(), i18n("The Entry View shows a formatted view of the entry's " + "contents.")); + QWhatsThis::add(m_iconView, i18n("The Icon View shows each entry in the collection or group using " + "an icon, which may be an image in the entry.")); +} + +void ViewStack::clear() { + m_entryView->clear(); + m_iconView->clear(); +} + +void ViewStack::refresh() { + m_entryView->slotRefresh(); + m_iconView->refresh(); +} + +void ViewStack::showEntry(Data::EntryPtr entry_) { + m_entryView->showEntry(entry_); + raiseWidget(m_entryView->view()); +} + +void ViewStack::showEntries(const Data::EntryVec& entries_) { + m_iconView->showEntries(entries_); + raiseWidget(m_iconView); +} + +#include "viewstack.moc" -- cgit v1.2.3