Diffstat (limited to 'libopie2/opiepim/ui/opimmainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/ui/opimmainwindow.cpp | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/libopie2/opiepim/ui/opimmainwindow.cpp b/libopie2/opiepim/ui/opimmainwindow.cpp index 053b250..cf05329 100644 --- a/libopie2/opiepim/ui/opimmainwindow.cpp +++ b/libopie2/opiepim/ui/opimmainwindow.cpp | |||
@@ -270,6 +270,30 @@ void OPimMainWindow::reloadCategories() { | |||
270 | m_catSelect->insertItem( tr( "Unfiled" ) ); | 270 | m_catSelect->insertItem( tr( "Unfiled" ) ); |
271 | } | 271 | } |
272 | 272 | ||
273 | void OPimMainWindow::setItemNewEnabled( bool enable ) { | ||
274 | m_itemNewAction->setEnabled( enable ); | ||
275 | } | ||
276 | |||
277 | void OPimMainWindow::setItemEditEnabled( bool enable ) { | ||
278 | m_itemEditAction->setEnabled( enable ); | ||
279 | } | ||
280 | |||
281 | void OPimMainWindow::setItemDuplicateEnabled( bool enable ) { | ||
282 | m_itemDuplicateAction->setEnabled( enable ); | ||
283 | } | ||
284 | |||
285 | void OPimMainWindow::setItemDeleteEnabled( bool enable ) { | ||
286 | m_itemDeleteAction->setEnabled( enable ); | ||
287 | } | ||
288 | |||
289 | void OPimMainWindow::setItemBeamEnabled( bool enable ) { | ||
290 | m_itemBeamAction->setEnabled( enable ); | ||
291 | } | ||
292 | |||
293 | void OPimMainWindow::setConfigureEnabled( bool enable ) { | ||
294 | m_configureAction->setEnabled( enable ); | ||
295 | } | ||
296 | |||
273 | void OPimMainWindow::initBars( const QString &itemName ) { | 297 | void OPimMainWindow::initBars( const QString &itemName ) { |
274 | QString itemStr = itemName.lower(); | 298 | QString itemStr = itemName.lower(); |
275 | 299 | ||
@@ -297,11 +321,11 @@ void OPimMainWindow::initBars( const QString &itemName ) { | |||
297 | // Item menu | 321 | // Item menu |
298 | m_itemMenuGroup1 = new QActionGroup( this, QString::null, false ); | 322 | m_itemMenuGroup1 = new QActionGroup( this, QString::null, false ); |
299 | 323 | ||
300 | QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), | 324 | m_itemNewAction = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), |
301 | QString::null, 0, m_itemMenuGroup1, 0 ); | 325 | QString::null, 0, m_itemMenuGroup1, 0 ); |
302 | connect( a, SIGNAL(activated()), this, SLOT(slotItemNew()) ); | 326 | connect( m_itemNewAction, SIGNAL(activated()), this, SLOT(slotItemNew()) ); |
303 | a->setWhatsThis( tr( "Click here to create a new item." ) ); | 327 | m_itemNewAction->setWhatsThis( tr( "Click here to create a new item." ) ); |
304 | a->addTo( toolbar ); | 328 | m_itemNewAction->addTo( toolbar ); |
305 | 329 | ||
306 | m_itemEditAction = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), | 330 | m_itemEditAction = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), |
307 | QString::null, 0, m_itemMenuGroup1, 0 ); | 331 | QString::null, 0, m_itemMenuGroup1, 0 ); |
@@ -321,12 +345,11 @@ void OPimMainWindow::initBars( const QString &itemName ) { | |||
321 | m_itemDeleteAction->addTo( toolbar ); | 345 | m_itemDeleteAction->addTo( toolbar ); |
322 | 346 | ||
323 | if ( Ir::supported() ) { | 347 | if ( Ir::supported() ) { |
324 | a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ), | 348 | m_itemBeamAction = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ), |
325 | QString::null, 0, m_itemMenuGroup1, 0 ); | 349 | QString::null, 0, m_itemMenuGroup1, 0 ); |
326 | connect( a, SIGNAL(activated()), this, SLOT(slotItemBeam()) ); | 350 | connect( m_itemBeamAction, SIGNAL(activated()), this, SLOT(slotItemBeam()) ); |
327 | a->setWhatsThis( tr( "Click here to transmit the selected item." ) ); | 351 | m_itemBeamAction->setWhatsThis( tr( "Click here to transmit the selected item." ) ); |
328 | //a->addTo( m_itemMenu ); | 352 | m_itemBeamAction->addTo( toolbar ); |
329 | a->addTo( toolbar ); | ||
330 | } | 353 | } |
331 | 354 | ||
332 | m_itemMenuGroup1->addTo( m_itemMenu ); | 355 | m_itemMenuGroup1->addTo( m_itemMenu ); |
@@ -341,17 +364,17 @@ void OPimMainWindow::initBars( const QString &itemName ) { | |||
341 | // a->setWhatsThis( tr( "Click here to search for an item." ) ); | 364 | // a->setWhatsThis( tr( "Click here to search for an item." ) ); |
342 | // a->addTo( toolbar ); | 365 | // a->addTo( toolbar ); |
343 | 366 | ||
344 | a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), | 367 | m_configureAction = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), |
345 | QString::null, 0, m_itemMenuGroup2, 0 ); | 368 | QString::null, 0, m_itemMenuGroup2, 0 ); |
346 | connect( a, SIGNAL(activated()), this, SLOT(slotConfigure()) ); | 369 | connect( m_configureAction, SIGNAL(activated()), this, SLOT(slotConfigure()) ); |
347 | a->setWhatsThis( tr( "Click here to set your preferences for this application." ) ); | 370 | m_configureAction->setWhatsThis( tr( "Click here to set your preferences for this application." ) ); |
348 | 371 | ||
349 | m_itemMenuGroup2->addTo( m_itemMenu ); | 372 | m_itemMenuGroup2->addTo( m_itemMenu ); |
350 | 373 | ||
351 | // View menu | 374 | // View menu |
352 | m_viewMenuGroup = new QActionGroup( this, QString::null, false ); | 375 | m_viewMenuGroup = new QActionGroup( this, QString::null, false ); |
353 | 376 | ||
354 | a = new QAction( tr( "Filter" ), QString::null, 0, m_viewMenuGroup, 0 ); | 377 | QAction *a = new QAction( tr( "Filter" ), QString::null, 0, m_viewMenuGroup, 0 ); |
355 | connect( a, SIGNAL(activated()), this, SLOT(slotViewFilter()) ); | 378 | connect( a, SIGNAL(activated()), this, SLOT(slotViewFilter()) ); |
356 | a->setWhatsThis( tr( "Click here to filter the items displayed." ) ); | 379 | a->setWhatsThis( tr( "Click here to filter the items displayed." ) ); |
357 | 380 | ||