~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to kleopatra/view/tabwidget.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include <models/keylistsortfilterproxymodel.h>
40
40
 
41
41
#include <utils/action_data.h>
42
 
#include <utils/stl_util.h>
43
42
 
 
43
#include <kleo/stl_util.h>
44
44
#include <kleo/keyfilter.h>
45
45
#include <kleo/keyfiltermanager.h>
46
46
 
275
275
    void slotPageStringFilterChanged( const QString & filter );
276
276
    void slotPageHierarchyChanged( bool on );
277
277
 
 
278
#ifndef QT_NO_INPUTDIALOG
278
279
    void slotRenameCurrentTab() {
279
280
        renamePage( currentPage() );
280
281
    }
 
282
#endif // QT_NO_INPUTDIALOG
281
283
    void slotNewTab();
282
284
    void slotDuplicateCurrentTab() {
283
285
        duplicatePage( currentPage() );
301
303
        collapseAll( currentPage() );
302
304
    }
303
305
 
 
306
#ifndef QT_NO_INPUTDIALOG
304
307
    void renamePage( Page * page );
 
308
#endif
305
309
    void duplicatePage( Page * page );
306
310
    void closePage( Page * page );
307
311
    void movePageLeft( Page * page );
383
387
 
384
388
    const action_data actionDataNew = {
385
389
        "window_new_tab", i18n("New Tab"), i18n("Open a new tab"),
386
 
        "tab-new", q, SLOT(slotNewTab()), i18n("CTRL+SHIFT+N"), false, true
 
390
        "tab-new-background", q, SLOT(slotNewTab()), i18n("CTRL+SHIFT+N"), false, true
387
391
    };
388
392
 
389
393
    newAction = make_action_from_data( actionDataNew, q );
450
454
    if ( contextMenuPage == current || action == newAction )
451
455
        return; // performed through signal/slot connections...
452
456
 
 
457
#ifndef QT_NO_INPUTDIALOG
453
458
    if ( action == otherPageActions[Rename] )
454
459
        renamePage( contextMenuPage );
 
460
#endif // QT_NO_INPUTDIALOG
455
461
    else if ( action == otherPageActions[Duplicate] )
456
462
        duplicatePage( contextMenuPage );
457
463
    else if ( action == otherPageActions[Close] )
522
528
    tabWidget.setCurrentIndex( tabWidget.count()-1 );
523
529
}
524
530
 
 
531
#ifndef QT_NO_INPUTDIALOG
525
532
void TabWidget::Private::renamePage( Page * page ) {
526
533
    if ( !page )
527
534
        return;
531
538
        return;
532
539
    page->setTitle( text );
533
540
}
 
541
#endif
534
542
 
535
543
void TabWidget::Private::duplicatePage( Page * page ) {
536
544
    if ( !page )
639
647
        page->setKeyFilter( filter );
640
648
}
641
649
 
 
650
std::vector<QAbstractItemView*> TabWidget::views() const {
 
651
    std::vector<QAbstractItemView*> result;
 
652
    const unsigned int N = count();
 
653
    result.reserve( N );
 
654
    for ( unsigned int i = 0 ; i != N ; ++i )
 
655
        if ( const Page * const p = d->page( i ) )
 
656
            result.push_back( p->view() );
 
657
    return result;
 
658
}
 
659
 
642
660
QAbstractItemView * TabWidget::currentView() const {
643
661
    if ( Page * const page = d->currentPage() )
644
662
        return page->view();