summaryrefslogtreecommitdiffstats
path: root/src/viewstack.cpp
blob: 45632af694cf4f624c6dda703c2fd9c59e486a0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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 <tdehtmlview.h>
#include <klocale.h>

#include <tqwhatsthis.h>

using Tellico::ViewStack;

ViewStack::ViewStack(TQWidget* parent_, const char* name_/*=0*/) : TQWidgetStack(parent_, name_),
                     m_entryView(new EntryView(this)), m_iconView(new EntryIconView(this)) {
  TQWhatsThis::add(m_entryView->view(), i18n("<qt>The <i>Entry View</i> shows a formatted view of the entry's "
                                            "contents.</qt>"));
  TQWhatsThis::add(m_iconView, i18n("<qt>The <i>Icon View</i> shows each entry in the collection or group using "
                                   "an icon, which may be an image in the entry.</qt>"));
}

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"