summaryrefslogtreecommitdiff
authorzecke <zecke>2002-10-21 23:07:17 (UTC)
committer zecke <zecke>2002-10-21 23:07:17 (UTC)
commitcfc75c71bea57ca49367242204f9d3fbfca92deb (patch) (unidiff)
tree3604c59b1905d7d767aefeaaa22d0574bd2f02c8
parent0b0f3dccd3b6dbb01fd268e2c737fd1a6c163379 (diff)
downloadopie-cfc75c71bea57ca49367242204f9d3fbfca92deb.zip
opie-cfc75c71bea57ca49367242204f9d3fbfca92deb.tar.gz
opie-cfc75c71bea57ca49367242204f9d3fbfca92deb.tar.bz2
Now it should compile just fine
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index bf9fc23..71e6750 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -1,244 +1,243 @@
1/* 1/*
2               =. This file is part of the OPIE Project 2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 <> 3             .=l. Copyright (c) 2002 <>
4           .>+-= 4           .>+-=
5 _;:,     .>    :=|. This program is free software; you can 5 _;:,     .>    :=|. This program is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under 6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public 7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software 8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License, 9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version. 10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_. 11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This program is distributed in the hope that 12    .i_,=:_.      -<s. This program is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more 17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details. 18++=   -.     .`     .: details.
19 :     =  ...= . :.=- 19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU 20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = General Public License along with 21  -_. . .   )=.  = General Public License along with
22    --        :-=` this library; see the file COPYING.LIB. 22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include <unistd.h> 29#include <unistd.h>
30 30
31#include <qmenubar.h> 31#include <qmenubar.h>
32#include <qmessagebox.h> 32#include <qmessagebox.h>
33#include <qtoolbar.h> 33#include <qtoolbar.h>
34#include <qpopupmenu.h> 34#include <qpopupmenu.h>
35#include <qwidgetstack.h> 35#include <qwidgetstack.h>
36#include <qaction.h> 36#include <qaction.h>
37#include <qtimer.h> 37#include <qtimer.h>
38#include <qvbox.h> 38#include <qvbox.h>
39#include <qlineedit.h> 39#include <qlineedit.h>
40 40
41#include <qpe/applnk.h> 41#include <qpe/applnk.h>
42#include <qpe/config.h> 42#include <qpe/config.h>
43#include <qpe/ir.h> 43#include <qpe/ir.h>
44#include <qpe/resource.h> 44#include <qpe/resource.h>
45#include <qpe/qpemessagebox.h> 45#include <qpe/qpemessagebox.h>
46 46
47#include <opie/otodoaccessvcal.h> 47#include <opie/otodoaccessvcal.h>
48 48
49#include "quickeditimpl.h" 49#include "quickeditimpl.h"
50#include "todotemplatemanager.h" 50#include "todotemplatemanager.h"
51#include "templateeditor.h" 51#include "templateeditor.h"
52#include "todoentryimpl.h"
53#include "tableview.h" 52#include "tableview.h"
54 53
55#include "textviewshow.h" 54#include "textviewshow.h"
56#include "todoeditor.h" 55#include "todoeditor.h"
57#include "mainwindow.h" 56#include "mainwindow.h"
58 57
59 58
60using namespace Todo; 59using namespace Todo;
61 60
62MainWindow::MainWindow( QWidget* parent, 61MainWindow::MainWindow( QWidget* parent,
63 const char* name ) { 62 const char* name ) {
64 63
65 m_syncing = false; 64 m_syncing = false;
66 m_counter = 0; 65 m_counter = 0;
67 m_tempManager = new TemplateManager(); 66 m_tempManager = new TemplateManager();
68 m_tempManager->load(); 67 m_tempManager->load();
69 68
70 initUI(); 69 initUI();
71 initConfig(); 70 initConfig();
72 initViews(); 71 initViews();
73 initActions(); 72 initActions();
74 initEditor(); 73 initEditor();
75 initShow(); 74 initShow();
76 initTemplate(); 75 initTemplate();
77 76
78 populateTemplates(); 77 populateTemplates();
79 raiseCurrentView(); 78 raiseCurrentView();
80 QTimer::singleShot(0, this, SLOT(populateCategories() ) ); 79 QTimer::singleShot(0, this, SLOT(populateCategories() ) );
81} 80}
82void MainWindow::initTemplate() { 81void MainWindow::initTemplate() {
83 m_curTempEd = new TemplateEditor( this, templateManager() ); 82 m_curTempEd = new TemplateEditor( this, templateManager() );
84} 83}
85void MainWindow::initActions() { 84void MainWindow::initActions() {
86 QAction* a = new QAction( tr("New Task" ), Resource::loadPixmap( "new" ), 85 QAction* a = new QAction( tr("New Task" ), Resource::loadPixmap( "new" ),
87 QString::null, 0, this, 0 ); 86 QString::null, 0, this, 0 );
88 connect(a, SIGNAL( activated() ), 87 connect(a, SIGNAL( activated() ),
89 this, SLOT( slotNew() ) ); 88 this, SLOT( slotNew() ) );
90 a->addTo(m_tool ); 89 a->addTo(m_tool );
91 a->addTo(m_edit ); 90 a->addTo(m_edit );
92 91
93 a = new QAction( tr("Edit Task"), Resource::loadIconSet( "edit" ), 92 a = new QAction( tr("Edit Task"), Resource::loadIconSet( "edit" ),
94 QString::null, 0, this, 0 ); 93 QString::null, 0, this, 0 );
95 connect(a, SIGNAL(activated() ), 94 connect(a, SIGNAL(activated() ),
96 this, SLOT( slotEdit() ) ); 95 this, SLOT( slotEdit() ) );
97 a->addTo( m_tool ); 96 a->addTo( m_tool );
98 a->addTo( m_edit ); 97 a->addTo( m_edit );
99 m_editAction = a; 98 m_editAction = a;
100 99
101 a = new QAction( QString::null, tr("View Task"), 0, this, 0 ); 100 a = new QAction( QString::null, tr("View Task"), 0, this, 0 );
102 connect(a, SIGNAL( activated() ), 101 connect(a, SIGNAL( activated() ),
103 this, SLOT( slotShowDetails() ) ); 102 this, SLOT( slotShowDetails() ) );
104 a->addTo( m_edit ); 103 a->addTo( m_edit );
105 104
106 m_edit->insertSeparator(); 105 m_edit->insertSeparator();
107 106
108 a = new QAction( tr("Delete..."), Resource::loadIconSet( "trash" ), 107 a = new QAction( tr("Delete..."), Resource::loadIconSet( "trash" ),
109 QString::null, 0, this, 0 ); 108 QString::null, 0, this, 0 );
110 connect(a, SIGNAL(activated() ), 109 connect(a, SIGNAL(activated() ),
111 this, SLOT(slotDelete() ) ); 110 this, SLOT(slotDelete() ) );
112 a->addTo( m_tool ); 111 a->addTo( m_tool );
113 a->addTo( m_edit ); 112 a->addTo( m_edit );
114 m_deleteAction = a; 113 m_deleteAction = a;
115 114
116 a = new QAction( QString::null, tr("Delete all..."), 0, this, 0 ); 115 a = new QAction( QString::null, tr("Delete all..."), 0, this, 0 );
117 connect(a, SIGNAL( activated() ), 116 connect(a, SIGNAL( activated() ),
118 this, SLOT( slotDeleteAll() ) ); 117 this, SLOT( slotDeleteAll() ) );
119 a->addTo(m_edit ); 118 a->addTo(m_edit );
120 m_deleteAllAction = a; 119 m_deleteAllAction = a;
121 120
122 a = new QAction( QString::null, tr("Delete completed"), 121 a = new QAction( QString::null, tr("Delete completed"),
123 0, this, 0 ); 122 0, this, 0 );
124 connect(a, SIGNAL( activated() ), 123 connect(a, SIGNAL( activated() ),
125 this, SLOT( slotDeleteCompleted() ) ); 124 this, SLOT( slotDeleteCompleted() ) );
126 a->addTo(m_edit ); 125 a->addTo(m_edit );
127 a->setEnabled( TRUE ); 126 a->setEnabled( TRUE );
128 m_deleteCompleteAction = a; 127 m_deleteCompleteAction = a;
129 128
130 m_edit->insertSeparator(); 129 m_edit->insertSeparator();
131 130
132 a = new QAction( QString::null, tr("Duplicate"), 0, this, 0 ); 131 a = new QAction( QString::null, tr("Duplicate"), 0, this, 0 );
133 connect(a, SIGNAL( activated() ), 132 connect(a, SIGNAL( activated() ),
134 this, SLOT( slotDuplicate() ) ); 133 this, SLOT( slotDuplicate() ) );
135 a->addTo(m_edit ); 134 a->addTo(m_edit );
136 m_duplicateAction = a; 135 m_duplicateAction = a;
137 136
138 m_edit->insertSeparator(); 137 m_edit->insertSeparator();
139 138
140 if ( Ir::supported() ) { 139 if ( Ir::supported() ) {
141 a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ), 140 a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ),
142 QString::null, 0, this, 0 ); 141 QString::null, 0, this, 0 );
143 connect( a, SIGNAL( activated() ), 142 connect( a, SIGNAL( activated() ),
144 this, SLOT( slotBeam() ) ); 143 this, SLOT( slotBeam() ) );
145 a->addTo( m_edit ); 144 a->addTo( m_edit );
146 a->addTo( m_tool ); 145 a->addTo( m_tool );
147 } 146 }
148 147
149 a = new QAction( tr("Find"), Resource::loadIconSet( "mag" ), 148 a = new QAction( tr("Find"), Resource::loadIconSet( "mag" ),
150 QString::null, 0, this, 0 ); 149 QString::null, 0, this, 0 );
151 connect(a, SIGNAL( activated() ), 150 connect(a, SIGNAL( activated() ),
152 this, SLOT( slotFind() ) ); 151 this, SLOT( slotFind() ) );
153 a->addTo( m_options ); 152 a->addTo( m_options );
154 m_findAction = a; 153 m_findAction = a;
155 154
156 m_options->insertSeparator(); 155 m_options->insertSeparator();
157 156
158 m_completedAction = new QAction( QString::null, tr("Completed tasks"), 157 m_completedAction = new QAction( QString::null, tr("Completed tasks"),
159 0, this, 0, TRUE ); 158 0, this, 0, TRUE );
160 m_completedAction->addTo( m_options ); 159 m_completedAction->addTo( m_options );
161 m_completedAction->setOn( showCompleted() ); 160 m_completedAction->setOn( showCompleted() );
162 connect(m_completedAction, SIGNAL( toggled(bool) ), 161 connect(m_completedAction, SIGNAL( toggled(bool) ),
163 this, SLOT(slotShowCompleted(bool) ) ); 162 this, SLOT(slotShowCompleted(bool) ) );
164 163
165 m_showDeadLineAction = new QAction( QString::null, tr("Show Deadline"), 164 m_showDeadLineAction = new QAction( QString::null, tr("Show Deadline"),
166 0, this, 0, TRUE ); 165 0, this, 0, TRUE );
167 m_showDeadLineAction->addTo( m_options ); 166 m_showDeadLineAction->addTo( m_options );
168 m_showDeadLineAction->setOn( showDeadline() ); 167 m_showDeadLineAction->setOn( showDeadline() );
169 connect(m_showDeadLineAction, SIGNAL(toggled(bool) ), 168 connect(m_showDeadLineAction, SIGNAL(toggled(bool) ),
170 this, SLOT( slotShowDeadLine( bool ) ) ); 169 this, SLOT( slotShowDeadLine( bool ) ) );
171 170
172 m_options->insertSeparator(); 171 m_options->insertSeparator();
173 172
174 m_bar->insertItem( tr("Data") ,m_edit ); 173 m_bar->insertItem( tr("Data") ,m_edit );
175 m_bar->insertItem( tr("Category"), m_catMenu ); 174 m_bar->insertItem( tr("Category"), m_catMenu );
176 m_bar->insertItem( tr("Options"), m_options ); 175 m_bar->insertItem( tr("Options"), m_options );
177 176
178 /* initialize the view menu */ 177 /* initialize the view menu */
179 a = new QAction( QString::null, tr("Show over due"), 178 a = new QAction( QString::null, tr("Show over due"),
180 0, this, 0, TRUE ); 179 0, this, 0, TRUE );
181 a->addTo( m_view ); 180 a->addTo( m_view );
182 a->setOn( showOverDue() ); 181 a->setOn( showOverDue() );
183 connect(a, SIGNAL(toggled(bool)), 182 connect(a, SIGNAL(toggled(bool)),
184 this, SLOT(slotShowDue(bool) ) ); 183 this, SLOT(slotShowDue(bool) ) );
185 m_view->insertSeparator(); 184 m_view->insertSeparator();
186 185
187 m_bar->insertItem( tr("View"), m_view ); 186 m_bar->insertItem( tr("View"), m_view );
188 187
189 /* templates */ 188 /* templates */
190 m_edit->insertItem(tr("New from template"), m_template, 189 m_edit->insertItem(tr("New from template"), m_template,
191 -1, 0 ); 190 -1, 0 );
192 191
193} 192}
194/* m_curCat from Config */ 193/* m_curCat from Config */
195void MainWindow::initConfig() { 194void MainWindow::initConfig() {
196 Config config( "todo" ); 195 Config config( "todo" );
197 config.setGroup( "View" ); 196 config.setGroup( "View" );
198 m_completed = config.readBoolEntry( "ShowComplete", TRUE ); 197 m_completed = config.readBoolEntry( "ShowComplete", TRUE );
199 m_curCat = config.readEntry( "Category", QString::null ); 198 m_curCat = config.readEntry( "Category", QString::null );
200 m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE); 199 m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE);
201 m_overdue = config.readBoolEntry("ShowOverDue", TRUE ); 200 m_overdue = config.readBoolEntry("ShowOverDue", TRUE );
202} 201}
203void MainWindow::initUI() { 202void MainWindow::initUI() {
204 m_mainBox = new QVBox(this, "main box "); 203 m_mainBox = new QVBox(this, "main box ");
205 m_curQuick = new QuickEditImpl(this, m_mainBox ); 204 m_curQuick = new QuickEditImpl(this, m_mainBox );
206 m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) ); 205 m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) );
207 m_quickEdit.append( m_curQuick ); 206 m_quickEdit.append( m_curQuick );
208 207
209 208
210 209
211 m_stack = new QWidgetStack(m_mainBox, "main stack"); 210 m_stack = new QWidgetStack(m_mainBox, "main stack");
212 setCentralWidget( m_mainBox ); 211 setCentralWidget( m_mainBox );
213 212
214 setToolBarsMovable( FALSE ); 213 setToolBarsMovable( FALSE );
215 214
216 m_tool = new QToolBar( this ); 215 m_tool = new QToolBar( this );
217 m_tool->setHorizontalStretchable( TRUE ); 216 m_tool->setHorizontalStretchable( TRUE );
218 217
219 m_bar = new QMenuBar( m_tool ); 218 m_bar = new QMenuBar( m_tool );
220 219
221 /** QPopupMenu */ 220 /** QPopupMenu */
222 m_edit = new QPopupMenu( this ); 221 m_edit = new QPopupMenu( this );
223 m_options = new QPopupMenu( this ); 222 m_options = new QPopupMenu( this );
224 m_view = new QPopupMenu( this ); 223 m_view = new QPopupMenu( this );
225 m_catMenu = new QPopupMenu( this ); 224 m_catMenu = new QPopupMenu( this );
226 m_template = new QPopupMenu( this ); 225 m_template = new QPopupMenu( this );
227 226
228 m_catMenu->setCheckable( TRUE ); 227 m_catMenu->setCheckable( TRUE );
229 m_template->setCheckable( TRUE ); 228 m_template->setCheckable( TRUE );
230 229
231 connect(m_catMenu, SIGNAL(activated(int) ), 230 connect(m_catMenu, SIGNAL(activated(int) ),
232 this, SLOT(setCategory(int) ) ); 231 this, SLOT(setCategory(int) ) );
233 connect(m_template, SIGNAL(activated(int) ), 232 connect(m_template, SIGNAL(activated(int) ),
234 this, SLOT(slotNewFromTemplate(int) ) ); 233 this, SLOT(slotNewFromTemplate(int) ) );
235} 234}
236void MainWindow::initViews() { 235void MainWindow::initViews() {
237 TableView* tableView = new TableView( this, m_stack ); 236 TableView* tableView = new TableView( this, m_stack );
238 m_stack->addWidget( tableView, m_counter++ ); 237 m_stack->addWidget( tableView, m_counter++ );
239 m_views.append( tableView ); 238 m_views.append( tableView );
240 m_curView = tableView; 239 m_curView = tableView;
241 connectBase( tableView ); 240 connectBase( tableView );
242 /* add QString type + QString configname to 241 /* add QString type + QString configname to
243 * the View menu 242 * the View menu
244 * and subdirs for multiple views 243 * and subdirs for multiple views