summaryrefslogtreecommitdiff
path: root/libopie2
authordrw <drw>2005-02-06 23:10:54 (UTC)
committer drw <drw>2005-02-06 23:10:54 (UTC)
commit266d71ee80151b3c97671acc95275aa65b682388 (patch) (unidiff)
tree97e7b79df613e4f7b1896bf1fd02db13dd9f3166 /libopie2
parentab32151cd8e85deb354bab04e25efb1f3f399dee (diff)
downloadopie-266d71ee80151b3c97671acc95275aa65b682388.zip
opie-266d71ee80151b3c97671acc95275aa65b682388.tar.gz
opie-266d71ee80151b3c97671acc95275aa65b682388.tar.bz2
Additional menu functionality for OPimMainWindow
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/ui/opimmainwindow.cpp53
-rw-r--r--libopie2/opiepim/ui/opimmainwindow.h10
2 files changed, 48 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
@@ -272,2 +272,26 @@ void OPimMainWindow::reloadCategories() {
272 272
273void OPimMainWindow::setItemNewEnabled( bool enable ) {
274 m_itemNewAction->setEnabled( enable );
275}
276
277void OPimMainWindow::setItemEditEnabled( bool enable ) {
278 m_itemEditAction->setEnabled( enable );
279}
280
281void OPimMainWindow::setItemDuplicateEnabled( bool enable ) {
282 m_itemDuplicateAction->setEnabled( enable );
283}
284
285void OPimMainWindow::setItemDeleteEnabled( bool enable ) {
286 m_itemDeleteAction->setEnabled( enable );
287}
288
289void OPimMainWindow::setItemBeamEnabled( bool enable ) {
290 m_itemBeamAction->setEnabled( enable );
291}
292
293void OPimMainWindow::setConfigureEnabled( bool enable ) {
294 m_configureAction->setEnabled( enable );
295}
296
273void OPimMainWindow::initBars( const QString &itemName ) { 297void OPimMainWindow::initBars( const QString &itemName ) {
@@ -299,7 +323,7 @@ void OPimMainWindow::initBars( const QString &itemName ) {
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
@@ -323,8 +347,7 @@ void OPimMainWindow::initBars( const QString &itemName ) {
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 }
@@ -343,6 +366,6 @@ void OPimMainWindow::initBars( const QString &itemName ) {
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
@@ -353,3 +376,3 @@ void OPimMainWindow::initBars( const QString &itemName ) {
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()) );
diff --git a/libopie2/opiepim/ui/opimmainwindow.h b/libopie2/opiepim/ui/opimmainwindow.h
index b446583..9aa0ded 100644
--- a/libopie2/opiepim/ui/opimmainwindow.h
+++ b/libopie2/opiepim/ui/opimmainwindow.h
@@ -130,2 +130,9 @@ protected:
130 130
131 void setItemNewEnabled( bool enable );
132 void setItemEditEnabled( bool enable );
133 void setItemDuplicateEnabled( bool enable );
134 void setItemDeleteEnabled( bool enable );
135 void setItemBeamEnabled( bool enable );
136 void setConfigureEnabled( bool enable );
137
131private slots: 138private slots:
@@ -158,2 +165,3 @@ private:
158 QActionGroup *m_viewMenuGroup; // Action group containing default items in View menu 165 QActionGroup *m_viewMenuGroup; // Action group containing default items in View menu
166 QAction *m_itemNewAction; // Add new item action
159 QAction *m_itemEditAction; // Edit current item action 167 QAction *m_itemEditAction; // Edit current item action
@@ -161,2 +169,4 @@ private:
161 QAction *m_itemDeleteAction; // Delete current item action 169 QAction *m_itemDeleteAction; // Delete current item action
170 QAction *m_itemBeamAction; // Beam current item action
171 QAction *m_configureAction; // Configure application dialog action
162 172