summaryrefslogtreecommitdiff
path: root/libopie/big-screen/omodalhelper.cpp
authorzecke <zecke>2004-03-05 22:58:06 (UTC)
committer zecke <zecke>2004-03-05 22:58:06 (UTC)
commitb4ec902435df4e3c834b7790c1dc70a235157477 (patch) (unidiff)
tree56f855525c3da4ca9efd02c148a967a41cc4cdcb /libopie/big-screen/omodalhelper.cpp
parent3dd27f86cf3865b771258d80048190e0ef6c3177 (diff)
downloadopie-b4ec902435df4e3c834b7790c1dc70a235157477.zip
opie-b4ec902435df4e3c834b7790c1dc70a235157477.tar.gz
opie-b4ec902435df4e3c834b7790c1dc70a235157477.tar.bz2
Big Screen Extensions should only be in the new LIBOPIEUI2.
We can remove it without risking binary incompatible as these classes were not in the 1.0 API release
Diffstat (limited to 'libopie/big-screen/omodalhelper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/big-screen/omodalhelper.cpp165
1 files changed, 0 insertions, 165 deletions
diff --git a/libopie/big-screen/omodalhelper.cpp b/libopie/big-screen/omodalhelper.cpp
deleted file mode 100644
index c5a47b3..0000000
--- a/libopie/big-screen/omodalhelper.cpp
+++ b/dev/null
@@ -1,165 +0,0 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2003 hOlgAr <zecke@handhelds.org>
4           .>+-=
5 _;:,     .>    :=|. This library is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#include <qpushbutton.h>
30#include <qvbox.h>
31#include <qlayout.h>
32#include <qlabel.h>
33
34#include "omodalhelper.h"
35
36
37/* SIgnal handling */
38OModalHelperSignal::OModalHelperSignal( OModalHelperBase* base, QObject* parent )
39 : QObject( parent, "OModal Helper Signal" ), m_base( base ) {
40}
41
42OModalHelperSignal::~OModalHelperSignal() {
43 /* special the ancestor deletes its creator */
44 delete m_base;
45}
46
47
48/* Helper Controler */
49/*
50 * the dialogs signal will be slotted here
51 * and we will call into m_base
52 */
53OModalHelperControler::OModalHelperControler( OModalHelperBase* base, QObject* parent )
54 : QObject(parent, "OModal Helper Controler" ), m_base( base ), m_dia( 0 ), m_id( -1 )
55{
56}
57
58TransactionID OModalHelperControler::transactionID()const {
59 return m_id;
60}
61
62void OModalHelperControler::setTransactionID( TransactionID id ) {
63 m_dia = 0;
64 m_id = id;
65}
66
67QDialog* OModalHelperControler::dialog()const {
68 return m_dia;
69}
70
71/*
72 * If we're in the New mode we will map the QDialog
73 * to the TransactionID
74 */
75void OModalHelperControler::done( int result ) {
76 if ( sender() && !sender()->isA("OModalQueuedDialog") )
77 m_dia = static_cast<QDialog*>( sender() );
78
79 m_base->done( result, m_id );
80}
81
82void OModalHelperControler::next() {
83 m_base->next( m_id );
84}
85
86void OModalHelperControler::prev() {
87 m_base->prev( m_id );
88}
89
90/* The Queued Dialog inclusive QueuedBar */
91struct OModalQueueBar : public QHBox {
92 QPushButton* next;
93 QPushButton* prev;
94 QLabel * label;
95
96 OModalQueueBar( QWidget* parent );
97 void setText( const QString& str );
98};
99
100OModalQueueBar::OModalQueueBar( QWidget* parent )
101 : QWidget( parent, "OModal Queue Bar" ) {
102 prev = new QPushButton( this );
103 prev->setText( OModalQueuedDialog::tr("Prev") );
104
105 label = new QLabel(this);
106
107 next = new QPushButton( this );
108 next->setText( OModalQueuedDialog::tr("Next") );
109}
110
111void OModalQueueBar::setText( const QString& str ) {
112 label->setText( str );
113}
114
115
116OModalQueuedDialog::OModalQueuedDialog( QDialog* mainWidget )
117 : QDialog(0, "OModal Queued Dialog" )
118{
119 QVBoxLayout *lay = new QVBoxLayout( this );
120
121 m_bar = new OModalQueueBar( this );
122 lay->addWidget( m_bar );
123
124 m_center = mainWidget;
125 m_center->reparent(this, 0, QPoint(0, 0) );
126 lay->addWidget( m_center );
127
128
129 connect(m_bar->next, SIGNAL(clicked() ), this,
130 SIGNAL(next() ) );
131 connect(m_bar->prev, SIGNAL(clicked() ), this,
132 SIGNAL(prev() ) );
133
134}
135
136OModalQueuedDialog::~OModalQueuedDialog() {
137}
138
139QDialog* OModalQueuedDialog::centerDialog()const {
140 return m_center;
141}
142
143void OModalQueuedDialog::setQueueBarEnabled( bool b) {
144 /* in Qt3 use setEnabled( bool ) */
145 if (b)
146 m_bar->show();
147 else
148 m_bar->hide();
149}
150
151void OModalQueuedDialog::setRecord( int record, int count ) {
152 if (!record && !count ) {
153 hide();
154 return;
155 }else
156 show();
157
158 if ( count > 1 )
159 m_bar->show();
160 else
161 m_bar->hide();
162
163 m_bar->setText( tr("Editing record %1 out of %2",
164 "Shows the current edited record out of an array of records").arg( record ). arg( count ) );
165}