From c8a5bdd7d4b7de88708e88df797bd494eb6f7e71 Mon Sep 17 00:00:00 2001
From: drw <drw>
Date: Sun, 22 Dec 2002 17:03:27 +0000
Subject: QWhatsThis for main task view and toolbars.

---
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index 0ccf73e..d16d1ac 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -27,7 +27,6 @@
 */
 
 #include <unistd.h>
-#include <stdio.h>
 
 #include <qmenubar.h>
 #include <qmessagebox.h>
@@ -38,6 +37,7 @@
 #include <qtimer.h>
 #include <qvbox.h>
 #include <qlineedit.h>
+#include <qwhatsthis.h>
 
 #include <qpe/applnk.h>
 #include <qpe/config.h>
@@ -63,9 +63,8 @@ using namespace Todo;
 
 MainWindow::MainWindow( QWidget* parent,
                         const char* name )
-    : OPimMainWindow("Todolist", parent, name)
+    : OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp )
 {
-
     m_syncing = false;
     m_counter = 0;
     m_tempManager = new TemplateManager();
@@ -96,6 +95,7 @@ void MainWindow::initActions() {
                               QString::null, 0, this, 0 );
     connect(a, SIGNAL( activated() ),
             this, SLOT( slotNew() ) );
+    a->setWhatsThis( tr( "Click here to create a new task." ) );
     a->addTo(m_tool );
     a->addTo(m_edit );
 
@@ -103,6 +103,7 @@ void MainWindow::initActions() {
                      QString::null, 0, this, 0 );
     connect(a, SIGNAL(activated() ),
             this, SLOT( slotEdit() ) );
+    a->setWhatsThis( tr( "Click here to modify the current task." ) );
     a->addTo( m_tool );
     a->addTo( m_edit );
     m_editAction = a;
@@ -118,6 +119,7 @@ void MainWindow::initActions() {
                      QString::null, 0, this, 0 );
     connect(a, SIGNAL(activated() ),
             this, SLOT(slotDelete() ) );
+    a->setWhatsThis( tr( "Click here to remove the current task." ) );
     a->addTo( m_tool );
     a->addTo( m_edit );
     m_deleteAction = a;
@@ -147,12 +149,11 @@ void MainWindow::initActions() {
     m_edit->insertSeparator();
 
     if ( Ir::supported() ) {
-	a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ),
-			 QString::null, 0, this, 0 );
-	connect( a, SIGNAL( activated() ),
-		 this, SLOT( slotBeam() ) );
-	a->addTo( m_edit );
-	a->addTo( m_tool );
+        a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ), QString::null, 0, this, 0 );
+        connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) );
+        a->setWhatsThis( tr( "Click here to send the current task to another device." ) );
+        a->addTo( m_edit );
+        a->addTo( m_tool );
     }
 
     // Options menu
@@ -236,6 +237,7 @@ void MainWindow::initUI() {
 }
 void MainWindow::initViews() {
     TableView* tableView = new TableView( this, m_stack );
+    QWhatsThis::add( tableView, 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." ) );
     m_stack->addWidget( tableView,  m_counter++ );
     m_views.append( tableView );
     m_curView = tableView;
diff --git a/core/pim/todo/quickeditimpl.cpp b/core/pim/todo/quickeditimpl.cpp
index cadec03..7664ee4 100644
--- a/core/pim/todo/quickeditimpl.cpp
+++ b/core/pim/todo/quickeditimpl.cpp
@@ -1,5 +1,6 @@
 #include <qaction.h>
 #include <qlineedit.h>
+#include <qwhatsthis.h>
 
 #include <qpe/resource.h>
 
@@ -18,28 +19,31 @@ QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible )
     priority1 = Resource::loadPixmap( "todo/priority1" );
     priority3 = Resource::loadPixmap( "todo/priority3" );
     priority5 = Resource::loadPixmap( "todo/priority5" );
-	
-	
-	// TODO - come up with icons and replace text priority values
+
     m_lbl = new OClickableLabel( this );
-    m_lbl->setMinimumWidth(15);
+    m_lbl->setMinimumWidth( 15 );
     m_lbl->setPixmap( priority3 );
     connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) );
+    QWhatsThis::add( m_lbl, tr( "Click here to set the priority of new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list.  This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
 
     m_edit = new QLineEdit( this );
     setStretchableWidget( m_edit );
-
+    QWhatsThis::add( m_edit, tr( "Enter description of new task here.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list.  This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
+    
     QAction *a = new QAction( tr( "More" ), Resource::loadPixmap( "todo/more" ), QString::null, 0, this, 0 );
     connect( a, SIGNAL( activated() ), this, SLOT( slotMore() ) );
     a->addTo( this );
+    a->setWhatsThis( tr( "Click here to enter additional information for new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list.  This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
 
     a = new QAction( tr( "Enter" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 );
     connect( a, SIGNAL( activated() ), this, SLOT( slotEnter() ) );
     a->addTo( this );
+    a->setWhatsThis( tr( "Click here to add new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list.  This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
 
     a = new QAction( tr( "Cancel" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
     connect( a, SIGNAL( activated() ), this, SLOT( slotCancel() ) );
     a->addTo( this );
+    a->setWhatsThis( tr( "Click here to reset new task information.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list.  This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
 
     m_visible = visible;
     if ( !m_visible ) {
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp
index d229f52..cd6740a 100644
--- a/core/pim/todo/tableview.cpp
+++ b/core/pim/todo/tableview.cpp
@@ -59,6 +59,17 @@ void TableView::initConfig() {
 
 TableView::TableView( MainWindow* window, QWidget* wid )
     : QTable(  wid ), TodoView( window ) {
+    
+    // Load icons
+    // TODO - probably should be done globally somewhere else, see also quickeditimpl.cpp/h
+    m_pic_completed = Resource::loadPixmap( "todo/completed" );
+    QString namestr;
+    for ( unsigned int i = 1; i < 6; i++ ) {
+        namestr = "todo/priority";
+        namestr.append( QString::number( i ) );
+        m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr );
+    }
+
     setUpdatesEnabled( false );
     viewport()->setUpdatesEnabled( false );
     m_enablePaint = false;
@@ -99,16 +110,6 @@ TableView::TableView( MainWindow* window, QWidget* wid )
     setAscending( TRUE );
     m_first = true;
 
-    // Load icons
-    // TODO - probably should be done globally somewhere else, see also quickeditimpl.cpp/h
-    m_pic_completed = Resource::loadPixmap( "todo/completed" );
-    QString namestr;
-    for ( unsigned int i = 1; i < 6; i++ ) {
-        namestr = "todo/priority";
-        namestr.append( QString::number( i ) );
-        m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr );
-    }
-
     /* now let's init the config */
     initConfig();
 }
--
cgit v0.9.0.2