summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index 58981ca..77cbe17 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -15,57 +15,57 @@
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 <qlayout.h>
39#include <qlineedit.h> 40#include <qlineedit.h>
40#include <qwhatsthis.h> 41#include <qwhatsthis.h>
41 42
42#include <qpe/applnk.h> 43#include <qpe/applnk.h>
43#include <qpe/config.h> 44#include <qpe/config.h>
44#include <qpe/ir.h> 45#include <qpe/ir.h>
45#include <qpe/resource.h> 46#include <qpe/resource.h>
46#include <qpe/qpemessagebox.h> 47#include <qpe/qpemessagebox.h>
47#include <qpe/qpetoolbar.h>
48 48
49#include <opie/orecur.h> 49#include <opie/orecur.h>
50#include <opie/otodoaccessvcal.h> 50#include <opie/otodoaccessvcal.h>
51 51
52#include "quickeditimpl.h" 52#include "quickeditimpl.h"
53#include "todotemplatemanager.h" 53#include "todotemplatemanager.h"
54#include "templateeditor.h" 54#include "templateeditor.h"
55#include "tableview.h" 55#include "tableview.h"
56 56
57#include "textviewshow.h" 57#include "textviewshow.h"
58#include "todoeditor.h" 58#include "todoeditor.h"
59#include "mainwindow.h" 59#include "mainwindow.h"
60 60
61 61
62using namespace Todo; 62using namespace Todo;
63 63
64MainWindow::MainWindow( QWidget* parent, 64MainWindow::MainWindow( QWidget* parent,
65 const char* name ) 65 const char* name )
66 : OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp ) 66 : OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp )
67{ 67{
68 m_syncing = false; 68 m_syncing = false;
69 m_counter = 0; 69 m_counter = 0;
70 m_tempManager = new TemplateManager(); 70 m_tempManager = new TemplateManager();
71 m_tempManager->load(); 71 m_tempManager->load();
@@ -190,73 +190,77 @@ void MainWindow::initActions() {
190 connect(m_showQuickTaskAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowQuickTask(bool) ) ); 190 connect(m_showQuickTaskAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowQuickTask(bool) ) );
191 191
192 m_options->insertSeparator(); 192 m_options->insertSeparator();
193 193
194 m_bar->insertItem( QWidget::tr("Data") ,m_edit ); 194 m_bar->insertItem( QWidget::tr("Data") ,m_edit );
195 m_bar->insertItem( QWidget::tr("Category"), m_catMenu ); 195 m_bar->insertItem( QWidget::tr("Category"), m_catMenu );
196 m_bar->insertItem( QWidget::tr("Options"), m_options ); 196 m_bar->insertItem( QWidget::tr("Options"), m_options );
197 197
198 m_curQuick = new QuickEditImpl( this, m_quicktask ); 198 m_curQuick = new QuickEditImpl( this, m_quicktask );
199 addToolBar( (QPEToolBar *)m_curQuick->widget(), QWidget::tr( "QuickEdit" ), QMainWindow::Top, TRUE ); 199 addToolBar( (QPEToolBar *)m_curQuick->widget(), QWidget::tr( "QuickEdit" ), QMainWindow::Top, TRUE );
200 m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) ); 200 m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) );
201 201
202} 202}
203/* m_curCat from Config */ 203/* m_curCat from Config */
204void MainWindow::initConfig() { 204void MainWindow::initConfig() {
205 Config config( "todo" ); 205 Config config( "todo" );
206 config.setGroup( "View" ); 206 config.setGroup( "View" );
207 m_completed = config.readBoolEntry( "ShowComplete", TRUE ); 207 m_completed = config.readBoolEntry( "ShowComplete", TRUE );
208 m_curCat = config.readEntry( "Category", QString::null ); 208 m_curCat = config.readEntry( "Category", QString::null );
209 m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE); 209 m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE);
210 m_overdue = config.readBoolEntry("ShowOverDue", FALSE ); 210 m_overdue = config.readBoolEntry("ShowOverDue", FALSE );
211 m_quicktask = config.readBoolEntry("ShowQuickTask", TRUE); 211 m_quicktask = config.readBoolEntry("ShowQuickTask", TRUE);
212} 212}
213void MainWindow::initUI() { 213void MainWindow::initUI() {
214
214 m_stack = new QWidgetStack(this, "main stack"); 215 m_stack = new QWidgetStack(this, "main stack");
216
215 setCentralWidget( m_stack ); 217 setCentralWidget( m_stack );
216 218
217 setToolBarsMovable( FALSE ); 219 setToolBarsMovable( FALSE );
218 220
219 m_tool = new QPEToolBar( this ); 221 QToolBar *menubarholder = new QToolBar( this );
220 m_tool->setHorizontalStretchable( TRUE ); 222 menubarholder->setHorizontalStretchable( TRUE );
223 m_bar = new QMenuBar( menubarholder );
221 224
222 m_bar = new QMenuBar( m_tool ); 225 m_tool = new QToolBar( this );
223 226
224 /** QPopupMenu */ 227 /** QPopupMenu */
225 m_edit = new QPopupMenu( this ); 228 m_edit = new QPopupMenu( this );
226 m_options = new QPopupMenu( this ); 229 m_options = new QPopupMenu( this );
227 m_catMenu = new QPopupMenu( this ); 230 m_catMenu = new QPopupMenu( this );
228 m_template = new QPopupMenu( this ); 231 m_template = new QPopupMenu( this );
229 232
230 m_catMenu->setCheckable( TRUE ); 233 m_catMenu->setCheckable( TRUE );
231 m_template->setCheckable( TRUE ); 234 m_template->setCheckable( TRUE );
232 235
233 connect(m_catMenu, SIGNAL(activated(int) ), 236 connect(m_catMenu, SIGNAL(activated(int) ),
234 this, SLOT(setCategory(int) ) ); 237 this, SLOT(setCategory(int) ) );
235 connect(m_template, SIGNAL(activated(int) ), 238 connect(m_template, SIGNAL(activated(int) ),
236 this, SLOT(slotNewFromTemplate(int) ) ); 239 this, SLOT(slotNewFromTemplate(int) ) );
237} 240}
238void MainWindow::initViews() { 241void MainWindow::initViews() {
242
239 TableView* tableView = new TableView( this, m_stack ); 243 TableView* tableView = new TableView( this, m_stack );
240 QWhatsThis::add( tableView, QWidget::tr( "This is a listing of all current tasks.\n\nThe list displays the following information:\n1. Completed - A green checkmark indicates task is completed. Click here to complete a task.\n2. Priority - a graphical representation of task priority. Double-click here to modify.\n3. Description - description of task. Click here to select the task.\n4. Deadline - shows when task is due. This column can be shown or hidden by selecting Options->'Show task deadlines' from the menu above." ) ); 244 QWhatsThis::add( tableView, QWidget::tr( "This is a listing of all current tasks.\n\nThe list displays the following information:\n1. Completed - A green checkmark indicates task is completed. Click here to complete a task.\n2. Priority - a graphical representation of task priority. Double-click here to modify.\n3. Description - description of task. Click here to select the task.\n4. Deadline - shows when task is due. This column can be shown or hidden by selecting Options->'Show task deadlines' from the menu above." ) );
241 m_stack->addWidget( tableView, m_counter++ ); 245 m_stack->addWidget( tableView, m_counter++ );
242 m_views.append( tableView ); 246 m_views.append( tableView );
243 m_curView = tableView; 247 m_curView = tableView;
244 connectBase( tableView ); 248 connectBase( tableView );
245 /* add QString type + QString configname to 249 /* add QString type + QString configname to
246 * the View menu 250 * the View menu
247 * and subdirs for multiple views 251 * and subdirs for multiple views
248 */ 252 */
249} 253}
250void MainWindow::initEditor() { 254void MainWindow::initEditor() {
251 m_curEdit = new Editor(); 255 m_curEdit = new Editor();
252} 256}
253void MainWindow::initShow() { 257void MainWindow::initShow() {
254 m_curShow = new TextViewShow(this, this); 258 m_curShow = new TextViewShow(this, this);
255 m_stack->addWidget( m_curShow->widget() , m_counter++ ); 259 m_stack->addWidget( m_curShow->widget() , m_counter++ );
256} 260}
257MainWindow::~MainWindow() { 261MainWindow::~MainWindow() {
258 delete templateManager(); 262 delete templateManager();
259} 263}
260void MainWindow::connectBase( ViewBase* ) { 264void MainWindow::connectBase( ViewBase* ) {
261 // once templates and signals mix we'll use it again 265 // once templates and signals mix we'll use it again
262} 266}