summaryrefslogtreecommitdiff
path: root/core/pim/todo/mainwindow.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index b68aad2..a244e58 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -96,193 +96,193 @@ void MainWindow::initActions() {
96 m_edit->insertItem(QWidget::tr("New from template"), m_template, 96 m_edit->insertItem(QWidget::tr("New from template"), m_template,
97 -1, 0 ); 97 -1, 0 );
98 98
99 QAction* a = new QAction( QWidget::tr("New Task" ), Resource::loadPixmap( "new" ), 99 QAction* a = new QAction( QWidget::tr("New Task" ), Resource::loadPixmap( "new" ),
100 QString::null, 0, this, 0 ); 100 QString::null, 0, this, 0 );
101 connect(a, SIGNAL( activated() ), 101 connect(a, SIGNAL( activated() ),
102 this, SLOT( slotNew() ) ); 102 this, SLOT( slotNew() ) );
103 a->setWhatsThis( QWidget::tr( "Click here to create a new task." ) ); 103 a->setWhatsThis( QWidget::tr( "Click here to create a new task." ) );
104 a->addTo(m_tool ); 104 a->addTo(m_tool );
105 a->addTo(m_edit ); 105 a->addTo(m_edit );
106 106
107 a = new QAction( QWidget::tr("Edit Task"), Resource::loadIconSet( "edit" ), 107 a = new QAction( QWidget::tr("Edit Task"), Resource::loadIconSet( "edit" ),
108 QString::null, 0, this, 0 ); 108 QString::null, 0, this, 0 );
109 connect(a, SIGNAL(activated() ), 109 connect(a, SIGNAL(activated() ),
110 this, SLOT( slotEdit() ) ); 110 this, SLOT( slotEdit() ) );
111 a->setWhatsThis( QWidget::tr( "Click here to modify the current task." ) ); 111 a->setWhatsThis( QWidget::tr( "Click here to modify the current task." ) );
112 a->addTo( m_tool ); 112 a->addTo( m_tool );
113 a->addTo( m_edit ); 113 a->addTo( m_edit );
114 m_editAction = a; 114 m_editAction = a;
115 115
116 a = new QAction( QString::null, QWidget::tr("View Task"), 0, this, 0 ); 116 a = new QAction( QString::null, QWidget::tr("View Task"), 0, this, 0 );
117 connect(a, SIGNAL( activated() ), 117 connect(a, SIGNAL( activated() ),
118 this, SLOT( slotShowDetails() ) ); 118 this, SLOT( slotShowDetails() ) );
119 a->addTo( m_edit ); 119 a->addTo( m_edit );
120 120
121 m_edit->insertSeparator(); 121 m_edit->insertSeparator();
122 122
123 a = new QAction( QWidget::tr("Delete..."), Resource::loadIconSet( "trash" ), 123 a = new QAction( QWidget::tr("Delete..."), Resource::loadIconSet( "trash" ),
124 QString::null, 0, this, 0 ); 124 QString::null, 0, this, 0 );
125 connect(a, SIGNAL(activated() ), 125 connect(a, SIGNAL(activated() ),
126 this, SLOT(slotDelete() ) ); 126 this, SLOT(slotDelete() ) );
127 a->setWhatsThis( QWidget::tr( "Click here to remove the current task." ) ); 127 a->setWhatsThis( QWidget::tr( "Click here to remove the current task." ) );
128 a->addTo( m_tool ); 128 a->addTo( m_tool );
129 a->addTo( m_edit ); 129 a->addTo( m_edit );
130 m_deleteAction = a; 130 m_deleteAction = a;
131 131
132 a = new QAction( QString::null, QWidget::tr("Delete all..."), 0, this, 0 ); 132 a = new QAction( QString::null, QWidget::tr("Delete all..."), 0, this, 0 );
133 connect(a, SIGNAL( activated() ), 133 connect(a, SIGNAL( activated() ),
134 this, SLOT( slotDeleteAll() ) ); 134 this, SLOT( slotDeleteAll() ) );
135 a->addTo(m_edit ); 135 a->addTo(m_edit );
136 m_deleteAllAction = a; 136 m_deleteAllAction = a;
137 137
138 a = new QAction( QString::null, QWidget::tr("Delete completed"), 138 a = new QAction( QString::null, QWidget::tr("Delete completed"),
139 0, this, 0 ); 139 0, this, 0 );
140 connect(a, SIGNAL( activated() ), 140 connect(a, SIGNAL( activated() ),
141 this, SLOT( slotDeleteCompleted() ) ); 141 this, SLOT( slotDeleteCompleted() ) );
142 a->addTo(m_edit ); 142 a->addTo(m_edit );
143 a->setEnabled( TRUE ); 143 a->setEnabled( TRUE );
144 m_deleteCompleteAction = a; 144 m_deleteCompleteAction = a;
145 145
146 m_edit->insertSeparator(); 146 m_edit->insertSeparator();
147 147
148 a = new QAction( QString::null, QWidget::tr("Duplicate"), 0, this, 0 ); 148 a = new QAction( QString::null, QWidget::tr("Duplicate"), 0, this, 0 );
149 connect(a, SIGNAL( activated() ), 149 connect(a, SIGNAL( activated() ),
150 this, SLOT( slotDuplicate() ) ); 150 this, SLOT( slotDuplicate() ) );
151 a->addTo(m_edit ); 151 a->addTo(m_edit );
152 m_duplicateAction = a; 152 m_duplicateAction = a;
153 153
154 m_edit->insertSeparator(); 154 m_edit->insertSeparator();
155 155
156 if ( Ir::supported() ) { 156 if ( Ir::supported() ) {
157 a = new QAction( QWidget::tr( "Beam" ), Resource::loadPixmap( "beam" ), QString::null, 0, this, 0 ); 157 a = new QAction( QWidget::tr( "Beam" ), Resource::loadPixmap( "beam" ), QString::null, 0, this, 0 );
158 connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); 158 connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) );
159 a->setWhatsThis( QWidget::tr( "Click here to send the current task to another device." ) ); 159 a->setWhatsThis( QWidget::tr( "Click here to send the current task to another device." ) );
160 a->addTo( m_edit ); 160 a->addTo( m_edit );
161 a->addTo( m_tool ); 161 a->addTo( m_tool );
162 } 162 }
163 163
164#if 0 164#if 0
165 // Options menu 165 // Options menu
166 a = new QAction( QWidget::tr("Find"), Resource::loadIconSet( "mag" ), 166 a = new QAction( QWidget::tr("Find"), Resource::loadIconSet( "mag" ),
167 QString::null, 0, this, 0 ); 167 QString::null, 0, this, 0 );
168 connect(a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); 168 connect(a, SIGNAL( activated() ), this, SLOT( slotFind() ) );
169 a->addTo( m_options ); 169 a->addTo( m_options );
170 m_findAction = a; 170 m_findAction = a;
171 171
172 172
173 m_options->insertSeparator(); 173 m_options->insertSeparator();
174#endif 174#endif
175 175
176 m_completedAction = new QAction( QString::null, QWidget::tr("Show completed tasks"), 176 m_completedAction = new QAction( QString::null, QWidget::tr("Show completed tasks"),
177 0, this, 0, TRUE ); 177 0, this, 0, TRUE );
178 m_completedAction->addTo( m_options ); 178 m_completedAction->addTo( m_options );
179 m_completedAction->setOn( showCompleted() ); 179 m_completedAction->setOn( showCompleted() );
180 connect(m_completedAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowCompleted(bool) ) ); 180 connect(m_completedAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowCompleted(bool) ) );
181 181
182 a = new QAction( QString::null, QWidget::tr("Show only over-due tasks"), 182 a = new QAction( QString::null, QWidget::tr("Show only over-due tasks"),
183 0, this, 0, TRUE ); 183 0, this, 0, TRUE );
184 a->addTo( m_options ); 184 a->addTo( m_options );
185 a->setOn( showOverDue() ); 185 a->setOn( showOverDue() );
186 connect(a, SIGNAL(toggled(bool)), this, SLOT(slotShowDue(bool) ) ); 186 connect(a, SIGNAL(toggled(bool)), this, SLOT(slotShowDue(bool) ) );
187 187
188 m_showDeadLineAction = new QAction( QString::null, QWidget::tr("Show task deadlines"), 188 m_showDeadLineAction = new QAction( QString::null, QWidget::tr("Show task deadlines"),
189 0, this, 0, TRUE ); 189 0, this, 0, TRUE );
190 m_showDeadLineAction->addTo( m_options ); 190 m_showDeadLineAction->addTo( m_options );
191 m_showDeadLineAction->setOn( showDeadline() ); 191 m_showDeadLineAction->setOn( showDeadline() );
192 connect(m_showDeadLineAction, SIGNAL(toggled(bool) ), this, SLOT( slotShowDeadLine( bool ) ) ); 192 connect(m_showDeadLineAction, SIGNAL(toggled(bool) ), this, SLOT( slotShowDeadLine(bool) ) );
193 193
194 m_showQuickTaskAction = new QAction( QString::null, QWidget::tr("Show quick task bar"), 194 m_showQuickTaskAction = new QAction( QString::null, QWidget::tr("Show quick task bar"),
195 0, this, 0, TRUE ); 195 0, this, 0, TRUE );
196 m_showQuickTaskAction->addTo( m_options ); 196 m_showQuickTaskAction->addTo( m_options );
197 m_showQuickTaskAction->setOn( showQuickTask() ); 197 m_showQuickTaskAction->setOn( showQuickTask() );
198 connect(m_showQuickTaskAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowQuickTask(bool) ) ); 198 connect(m_showQuickTaskAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowQuickTask(bool) ) );
199 199
200 m_options->insertSeparator(); 200 m_options->insertSeparator();
201 201
202 m_bar->insertItem( QWidget::tr("Data") ,m_edit ); 202 m_bar->insertItem( QWidget::tr("Data") ,m_edit );
203 m_bar->insertItem( QWidget::tr("Category"), m_catMenu ); 203 m_bar->insertItem( QWidget::tr("Category"), m_catMenu );
204 m_bar->insertItem( QWidget::tr("Options"), m_options ); 204 m_bar->insertItem( QWidget::tr("Options"), m_options );
205 205
206 m_curQuick = new QuickEditImpl( this, m_quicktask ); 206 m_curQuick = new QuickEditImpl( this, m_quicktask );
207 addToolBar( (QToolBar *)m_curQuick->widget(), QWidget::tr( "QuickEdit" ), QMainWindow::Top, TRUE ); 207 addToolBar( (QToolBar *)m_curQuick->widget(), QWidget::tr( "QuickEdit" ), QMainWindow::Top, TRUE );
208 m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) ); 208 m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) );
209 209
210} 210}
211/* m_curCat from Config */ 211/* m_curCat from Config */
212void MainWindow::initConfig() { 212void MainWindow::initConfig() {
213 Config config( "todo" ); 213 Config config( "todo" );
214 config.setGroup( "View" ); 214 config.setGroup( "View" );
215 m_completed = config.readBoolEntry( "ShowComplete", TRUE ); 215 m_completed = config.readBoolEntry( "ShowComplete", TRUE );
216 m_curCat = config.readEntry( "Category", QString::null ); 216 m_curCat = config.readEntry( "Category", QString::null );
217 m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE); 217 m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE);
218 m_overdue = config.readBoolEntry("ShowOverDue", FALSE ); 218 m_overdue = config.readBoolEntry("ShowOverDue", FALSE );
219 m_quicktask = config.readBoolEntry("ShowQuickTask", TRUE); 219 m_quicktask = config.readBoolEntry("ShowQuickTask", TRUE);
220} 220}
221void MainWindow::initUI() { 221void MainWindow::initUI() {
222 222
223 m_stack = new OWidgetStack(this, "main stack"); 223 m_stack = new OWidgetStack(this, "main stack");
224 224
225 setCentralWidget( m_stack ); 225 setCentralWidget( m_stack );
226 226
227 setToolBarsMovable( FALSE ); 227 setToolBarsMovable( FALSE );
228 228
229 QToolBar *menubarholder = new QToolBar( this ); 229 QToolBar *menubarholder = new QToolBar( this );
230 menubarholder->setHorizontalStretchable( TRUE ); 230 menubarholder->setHorizontalStretchable( TRUE );
231 m_bar = new QMenuBar( menubarholder ); 231 m_bar = new QMenuBar( menubarholder );
232 232
233 m_tool = new QToolBar( this ); 233 m_tool = new QToolBar( this );
234 234
235 /** QPopupMenu */ 235 /** QPopupMenu */
236 m_edit = new QPopupMenu( this ); 236 m_edit = new QPopupMenu( this );
237 m_options = new QPopupMenu( this ); 237 m_options = new QPopupMenu( this );
238 m_catMenu = new QPopupMenu( this ); 238 m_catMenu = new QPopupMenu( this );
239 m_template = new QPopupMenu( this ); 239 m_template = new QPopupMenu( this );
240 240
241 m_catMenu->setCheckable( TRUE ); 241 m_catMenu->setCheckable( TRUE );
242 m_template->setCheckable( TRUE ); 242 m_template->setCheckable( TRUE );
243 243
244 connect(m_catMenu, SIGNAL(activated(int) ), 244 connect(m_catMenu, SIGNAL(activated(int) ),
245 this, SLOT(setCategory(int) ) ); 245 this, SLOT(setCategory(int) ) );
246 connect(m_template, SIGNAL(activated(int) ), 246 connect(m_template, SIGNAL(activated(int) ),
247 this, SLOT(slotNewFromTemplate(int) ) ); 247 this, SLOT(slotNewFromTemplate(int) ) );
248} 248}
249void MainWindow::initViews() { 249void MainWindow::initViews() {
250 250
251 TableView* tableView = new TableView( this, m_stack ); 251 TableView* tableView = new TableView( this, m_stack );
252 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." ) ); 252 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." ) );
253 m_stack->addWidget( tableView, m_counter++ ); 253 m_stack->addWidget( tableView, m_counter++ );
254 m_views.append( tableView ); 254 m_views.append( tableView );
255 m_curView = tableView; 255 m_curView = tableView;
256 connectBase( tableView ); 256 connectBase( tableView );
257 /* add QString type + QString configname to 257 /* add QString type + QString configname to
258 * the View menu 258 * the View menu
259 * and subdirs for multiple views 259 * and subdirs for multiple views
260 */ 260 */
261} 261}
262void MainWindow::initEditor() { 262void MainWindow::initEditor() {
263 m_curEdit = new Editor(); 263 m_curEdit = new Editor();
264} 264}
265void MainWindow::initShow() { 265void MainWindow::initShow() {
266 m_curShow = new TextViewShow(this, this); 266 m_curShow = new TextViewShow(this, this);
267 m_stack->addWidget( m_curShow->widget() , m_counter++ ); 267 m_stack->addWidget( m_curShow->widget() , m_counter++ );
268} 268}
269MainWindow::~MainWindow() { 269MainWindow::~MainWindow() {
270 delete templateManager(); 270 delete templateManager();
271} 271}
272void MainWindow::connectBase( ViewBase* ) { 272void MainWindow::connectBase( ViewBase* ) {
273 // once templates and signals mix we'll use it again 273 // once templates and signals mix we'll use it again
274} 274}
275QPopupMenu* MainWindow::contextMenu( int , bool recur ) { 275QPopupMenu* MainWindow::contextMenu( int , bool recur ) {
276 QPopupMenu* menu = new QPopupMenu(); 276 QPopupMenu* menu = new QPopupMenu();
277 277
278 m_editAction->addTo( menu ); 278 m_editAction->addTo( menu );
279 m_deleteAction->addTo( menu ); 279 m_deleteAction->addTo( menu );
280 m_duplicateAction->addTo( menu ); 280 m_duplicateAction->addTo( menu );
281 281
282 menu->insertSeparator(); 282 menu->insertSeparator();
283 283
284 /* 284 /*
285 * if this event recurs we allow 285 * if this event recurs we allow
286 * to detach it. 286 * to detach it.
287 * remove all 287 * remove all
288 */ 288 */