Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
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 | |||
@@ -18,35 +18,35 @@ | |||
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 | #include <stdio.h> | ||
31 | 30 | ||
32 | #include <qmenubar.h> | 31 | #include <qmenubar.h> |
33 | #include <qmessagebox.h> | 32 | #include <qmessagebox.h> |
34 | #include <qtoolbar.h> | 33 | #include <qtoolbar.h> |
35 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
36 | #include <qwidgetstack.h> | 35 | #include <qwidgetstack.h> |
37 | #include <qaction.h> | 36 | #include <qaction.h> |
38 | #include <qtimer.h> | 37 | #include <qtimer.h> |
39 | #include <qvbox.h> | 38 | #include <qvbox.h> |
40 | #include <qlineedit.h> | 39 | #include <qlineedit.h> |
40 | #include <qwhatsthis.h> | ||
41 | 41 | ||
42 | #include <qpe/applnk.h> | 42 | #include <qpe/applnk.h> |
43 | #include <qpe/config.h> | 43 | #include <qpe/config.h> |
44 | #include <qpe/ir.h> | 44 | #include <qpe/ir.h> |
45 | #include <qpe/resource.h> | 45 | #include <qpe/resource.h> |
46 | #include <qpe/qpemessagebox.h> | 46 | #include <qpe/qpemessagebox.h> |
47 | #include <qpe/qpetoolbar.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" |
@@ -54,27 +54,26 @@ | |||
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 | ||
62 | using namespace Todo; | 62 | using namespace Todo; |
63 | 63 | ||
64 | MainWindow::MainWindow( QWidget* parent, | 64 | MainWindow::MainWindow( QWidget* parent, |
65 | const char* name ) | 65 | const char* name ) |
66 | : OPimMainWindow("Todolist", parent, name) | 66 | : OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp ) |
67 | { | 67 | { |
68 | |||
69 | m_syncing = false; | 68 | m_syncing = false; |
70 | m_counter = 0; | 69 | m_counter = 0; |
71 | m_tempManager = new TemplateManager(); | 70 | m_tempManager = new TemplateManager(); |
72 | m_tempManager->load(); | 71 | m_tempManager->load(); |
73 | 72 | ||
74 | initUI(); | 73 | initUI(); |
75 | initConfig(); | 74 | initConfig(); |
76 | initViews(); | 75 | initViews(); |
77 | initActions(); | 76 | initActions(); |
78 | initEditor(); | 77 | initEditor(); |
79 | initShow(); | 78 | initShow(); |
80 | initTemplate(); | 79 | initTemplate(); |
@@ -87,46 +86,49 @@ void MainWindow::initTemplate() { | |||
87 | m_curTempEd = new TemplateEditor( this, templateManager() ); | 86 | m_curTempEd = new TemplateEditor( this, templateManager() ); |
88 | } | 87 | } |
89 | void MainWindow::initActions() { | 88 | void MainWindow::initActions() { |
90 | 89 | ||
91 | // Data menu | 90 | // Data menu |
92 | m_edit->insertItem(tr("New from template"), m_template, | 91 | m_edit->insertItem(tr("New from template"), m_template, |
93 | -1, 0 ); | 92 | -1, 0 ); |
94 | 93 | ||
95 | QAction* a = new QAction( tr("New Task" ), Resource::loadPixmap( "new" ), | 94 | QAction* a = new QAction( tr("New Task" ), Resource::loadPixmap( "new" ), |
96 | QString::null, 0, this, 0 ); | 95 | QString::null, 0, this, 0 ); |
97 | connect(a, SIGNAL( activated() ), | 96 | connect(a, SIGNAL( activated() ), |
98 | this, SLOT( slotNew() ) ); | 97 | this, SLOT( slotNew() ) ); |
98 | a->setWhatsThis( tr( "Click here to create a new task." ) ); | ||
99 | a->addTo(m_tool ); | 99 | a->addTo(m_tool ); |
100 | a->addTo(m_edit ); | 100 | a->addTo(m_edit ); |
101 | 101 | ||
102 | a = new QAction( tr("Edit Task"), Resource::loadIconSet( "edit" ), | 102 | a = new QAction( tr("Edit Task"), Resource::loadIconSet( "edit" ), |
103 | QString::null, 0, this, 0 ); | 103 | QString::null, 0, this, 0 ); |
104 | connect(a, SIGNAL(activated() ), | 104 | connect(a, SIGNAL(activated() ), |
105 | this, SLOT( slotEdit() ) ); | 105 | this, SLOT( slotEdit() ) ); |
106 | a->setWhatsThis( tr( "Click here to modify the current task." ) ); | ||
106 | a->addTo( m_tool ); | 107 | a->addTo( m_tool ); |
107 | a->addTo( m_edit ); | 108 | a->addTo( m_edit ); |
108 | m_editAction = a; | 109 | m_editAction = a; |
109 | 110 | ||
110 | a = new QAction( QString::null, tr("View Task"), 0, this, 0 ); | 111 | a = new QAction( QString::null, tr("View Task"), 0, this, 0 ); |
111 | connect(a, SIGNAL( activated() ), | 112 | connect(a, SIGNAL( activated() ), |
112 | this, SLOT( slotShowDetails() ) ); | 113 | this, SLOT( slotShowDetails() ) ); |
113 | a->addTo( m_edit ); | 114 | a->addTo( m_edit ); |
114 | 115 | ||
115 | m_edit->insertSeparator(); | 116 | m_edit->insertSeparator(); |
116 | 117 | ||
117 | a = new QAction( tr("Delete..."), Resource::loadIconSet( "trash" ), | 118 | a = new QAction( tr("Delete..."), Resource::loadIconSet( "trash" ), |
118 | QString::null, 0, this, 0 ); | 119 | QString::null, 0, this, 0 ); |
119 | connect(a, SIGNAL(activated() ), | 120 | connect(a, SIGNAL(activated() ), |
120 | this, SLOT(slotDelete() ) ); | 121 | this, SLOT(slotDelete() ) ); |
122 | a->setWhatsThis( tr( "Click here to remove the current task." ) ); | ||
121 | a->addTo( m_tool ); | 123 | a->addTo( m_tool ); |
122 | a->addTo( m_edit ); | 124 | a->addTo( m_edit ); |
123 | m_deleteAction = a; | 125 | m_deleteAction = a; |
124 | 126 | ||
125 | a = new QAction( QString::null, tr("Delete all..."), 0, this, 0 ); | 127 | a = new QAction( QString::null, tr("Delete all..."), 0, this, 0 ); |
126 | connect(a, SIGNAL( activated() ), | 128 | connect(a, SIGNAL( activated() ), |
127 | this, SLOT( slotDeleteAll() ) ); | 129 | this, SLOT( slotDeleteAll() ) ); |
128 | a->addTo(m_edit ); | 130 | a->addTo(m_edit ); |
129 | m_deleteAllAction = a; | 131 | m_deleteAllAction = a; |
130 | 132 | ||
131 | a = new QAction( QString::null, tr("Delete completed"), | 133 | a = new QAction( QString::null, tr("Delete completed"), |
132 | 0, this, 0 ); | 134 | 0, this, 0 ); |
@@ -138,30 +140,29 @@ void MainWindow::initActions() { | |||
138 | 140 | ||
139 | m_edit->insertSeparator(); | 141 | m_edit->insertSeparator(); |
140 | 142 | ||
141 | a = new QAction( QString::null, tr("Duplicate"), 0, this, 0 ); | 143 | a = new QAction( QString::null, tr("Duplicate"), 0, this, 0 ); |
142 | connect(a, SIGNAL( activated() ), | 144 | connect(a, SIGNAL( activated() ), |
143 | this, SLOT( slotDuplicate() ) ); | 145 | this, SLOT( slotDuplicate() ) ); |
144 | a->addTo(m_edit ); | 146 | a->addTo(m_edit ); |
145 | m_duplicateAction = a; | 147 | m_duplicateAction = a; |
146 | 148 | ||
147 | m_edit->insertSeparator(); | 149 | m_edit->insertSeparator(); |
148 | 150 | ||
149 | if ( Ir::supported() ) { | 151 | if ( Ir::supported() ) { |
150 | a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ), | 152 | a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ), QString::null, 0, this, 0 ); |
151 | QString::null, 0, this, 0 ); | 153 | connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); |
152 | connect( a, SIGNAL( activated() ), | 154 | a->setWhatsThis( tr( "Click here to send the current task to another device." ) ); |
153 | this, SLOT( slotBeam() ) ); | 155 | a->addTo( m_edit ); |
154 | a->addTo( m_edit ); | 156 | a->addTo( m_tool ); |
155 | a->addTo( m_tool ); | ||
156 | } | 157 | } |
157 | 158 | ||
158 | // Options menu | 159 | // Options menu |
159 | a = new QAction( tr("Find"), Resource::loadIconSet( "mag" ), | 160 | a = new QAction( tr("Find"), Resource::loadIconSet( "mag" ), |
160 | QString::null, 0, this, 0 ); | 161 | QString::null, 0, this, 0 ); |
161 | connect(a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); | 162 | connect(a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); |
162 | a->addTo( m_options ); | 163 | a->addTo( m_options ); |
163 | m_findAction = a; | 164 | m_findAction = a; |
164 | 165 | ||
165 | m_options->insertSeparator(); | 166 | m_options->insertSeparator(); |
166 | 167 | ||
167 | m_completedAction = new QAction( QString::null, tr("Show completed tasks"), | 168 | m_completedAction = new QAction( QString::null, tr("Show completed tasks"), |
@@ -227,24 +228,25 @@ void MainWindow::initUI() { | |||
227 | m_template = new QPopupMenu( this ); | 228 | m_template = new QPopupMenu( this ); |
228 | 229 | ||
229 | m_catMenu->setCheckable( TRUE ); | 230 | m_catMenu->setCheckable( TRUE ); |
230 | m_template->setCheckable( TRUE ); | 231 | m_template->setCheckable( TRUE ); |
231 | 232 | ||
232 | connect(m_catMenu, SIGNAL(activated(int) ), | 233 | connect(m_catMenu, SIGNAL(activated(int) ), |
233 | this, SLOT(setCategory(int) ) ); | 234 | this, SLOT(setCategory(int) ) ); |
234 | connect(m_template, SIGNAL(activated(int) ), | 235 | connect(m_template, SIGNAL(activated(int) ), |
235 | this, SLOT(slotNewFromTemplate(int) ) ); | 236 | this, SLOT(slotNewFromTemplate(int) ) ); |
236 | } | 237 | } |
237 | void MainWindow::initViews() { | 238 | void MainWindow::initViews() { |
238 | TableView* tableView = new TableView( this, m_stack ); | 239 | TableView* tableView = new TableView( this, m_stack ); |
240 | 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." ) ); | ||
239 | m_stack->addWidget( tableView, m_counter++ ); | 241 | m_stack->addWidget( tableView, m_counter++ ); |
240 | m_views.append( tableView ); | 242 | m_views.append( tableView ); |
241 | m_curView = tableView; | 243 | m_curView = tableView; |
242 | connectBase( tableView ); | 244 | connectBase( tableView ); |
243 | /* add QString type + QString configname to | 245 | /* add QString type + QString configname to |
244 | * the View menu | 246 | * the View menu |
245 | * and subdirs for multiple views | 247 | * and subdirs for multiple views |
246 | */ | 248 | */ |
247 | } | 249 | } |
248 | void MainWindow::initEditor() { | 250 | void MainWindow::initEditor() { |
249 | m_curEdit = new Editor(); | 251 | m_curEdit = new Editor(); |
250 | } | 252 | } |