559
558
if ( type == "CalendarEditor" ) {
560
559
vi.name = i18n( "Work & Vacation" );
561
vi.tip = i18n( "Edit working- and vacation days for resources" );
560
vi.tip = i18nc( "@info:tooltip", "Edit working- and vacation days for resources" );
562
561
} else if ( type == "AccountsEditor" ) {
563
562
vi.name = i18n( "Cost Breakdown Structure" );
564
vi.tip = i18n( "Edit cost breakdown structure." );
563
vi.tip = i18nc( "@info:tooltip", "Edit cost breakdown structure." );
565
564
} else if ( type == "ResourceEditor" ) {
566
565
vi.name = i18n( "Resources" );
567
vi.tip = i18n( "Edit resource breakdown structure" );
566
vi.tip = i18nc( "@info:tooltip", "Edit resource breakdown structure" );
568
567
} else if ( type == "TaskEditor" ) {
569
568
vi.name = i18n( "Tasks" );
570
vi.tip = i18n( "Edit work breakdown structure" );
569
vi.tip = i18nc( "@info:tooltip", "Edit work breakdown structure" );
571
570
} else if ( type == "DependencyEditor" ) {
572
571
vi.name = i18n( "Dependencies (Graphic)" );
573
vi.tip = i18n( "Edit task dependencies" );
572
vi.tip = i18nc( "@info:tooltip", "Edit task dependencies" );
574
573
} else if ( type == "PertEditor" ) {
575
574
vi.name = i18n( "Dependencies (List)" );
576
vi.tip = i18n( "Edit task dependencies" );
575
vi.tip = i18nc( "@info:tooltip", "Edit task dependencies" );
577
576
} else if ( type == "ScheduleEditor" ) {
578
577
// This view is not used stand-alone atm
579
578
vi.name = i18n( "Schedules" );
581
580
} else if ( type == "ScheduleHandlerView" ) {
582
581
vi.name = i18n( "Schedules" );
583
vi.tip = i18n( "Calculate and analyze project schedules" );
582
vi.tip = i18nc( "@info:tooltip", "Calculate and analyze project schedules" );
584
583
} else if ( type == "ProjectStatusView" ) {
585
584
vi.name = i18n( "Project Performance Chart" );
586
vi.tip = i18n( "View project status information" );
585
vi.tip = i18nc( "@info:tooltip", "View project status information" );
587
586
} else if ( type == "TaskStatusView" ) {
588
587
vi.name = i18n( "Task Status" );
589
vi.tip = i18n( "View task progress information" );
588
vi.tip = i18nc( "@info:tooltip", "View task progress information" );
590
589
} else if ( type == "TaskView" ) {
591
590
vi.name = i18n( "Task Execution" );
592
vi.tip = i18n( "View task execution information" );
591
vi.tip = i18nc( "@info:tooltip", "View task execution information" );
593
592
} else if ( type == "TaskWorkPackageView" ) {
594
593
vi.name = i18n( "Work Package View" );
595
vi.tip = i18n( "View task work package information" );
594
vi.tip = i18nc( "@info:tooltip", "View task work package information" );
596
595
} else if ( type == "GanttView" ) {
597
596
vi.name = i18n( "Gantt" );
598
vi.tip = i18n( "View gantt chart" );
597
vi.tip = i18nc( "@info:tooltip", "View gantt chart" );
599
598
} else if ( type == "MilestoneGanttView" ) {
600
599
vi.name = i18n( "Milestone Gantt" );
601
vi.tip = i18n( "View milestone gantt chart" );
600
vi.tip = i18nc( "@info:tooltip", "View milestone gantt chart" );
602
601
} else if ( type == "ResourceAppointmentsView" ) {
603
602
vi.name = i18n( "Resource Assignments" );
604
vi.tip = i18n( "View resource assignments" );
603
vi.tip = i18nc( "@info:tooltip", "View resource assignments in a table" );
605
604
} else if ( type == "ResourceAppointmentsGanttView" ) {
606
605
vi.name = i18n( "Resource Assignments (Gantt)" );
607
vi.tip = i18n( "View resource assignments in gantt chart" );
606
vi.tip = i18nc( "@info:tooltip", "View resource assignments in gantt chart" );
608
607
} else if ( type == "AccountsView" ) {
609
608
vi.name = i18n( "Cost Breakdown" );
610
vi.tip = i18n( "View planned and actual cost" );
609
vi.tip = i18nc( "@info:tooltip", "View planned and actual cost" );
611
610
} else if ( type == "PerformanceStatusView" ) {
612
611
vi.name = i18n( "Tasks Performance Chart" );
613
vi.tip = i18n( "View tasks performance status information" );
612
vi.tip = i18nc( "@info:tooltip", "View tasks performance status information" );
614
613
} else if ( type == "ReportView" ) {
615
614
vi.name = i18n( "Report" );
616
vi.tip = i18n( "View report" );
615
vi.tip = i18nc( "@info:tooltip", "View report" );
618
617
kWarning()<<"Unknown viewtype: "<<type;
1225
1224
return resourceAssignmentView;
1228
ViewBase *View::createChartView( ViewListItem *cat, const QString tag, const QString &name, const QString &tip, int index )
1230
ChartView *v = new ChartView( getPart(), m_tab );
1231
m_tab->addWidget( v );
1233
ViewListItem *i = m_viewlist->addView( cat, tag, name, v, getPart(), "", index );
1234
ViewInfo vi = defaultViewInfo( "ChartView" );
1235
if ( name.isEmpty() ) {
1236
i->setText( 0, vi.name );
1238
if ( tip == TIP_USE_DEFAULT_TEXT ) {
1239
i->setToolTip( 0, vi.tip );
1241
i->setToolTip( 0, tip );
1244
v->setProject( &( getProject() ) );
1246
connect( this, SIGNAL( currentScheduleManagerChanged( ScheduleManager* ) ), v, SLOT( setScheduleManager( ScheduleManager* ) ) );
1248
connect( v, SIGNAL( guiActivated( ViewBase*, bool ) ), SLOT( slotGuiActivated( ViewBase*, bool ) ) );
1249
v->updateReadWrite( m_readWrite );
1254
1227
ViewBase *View::createReportView( ViewListItem *cat, const QString tag, const QString &name, const QString &tip, int index )
1256
1229
ReportView *v = new ReportView( getPart(), m_tab );
1563
1536
m_progressBarTimer.stop();
1564
1537
removeProgressBarItems();
1566
QApplication::setOverrideCursor( Qt::WaitCursor );
1567
CalculateScheduleCmd *cmd = new CalculateScheduleCmd( *project, sm, i18nc( "@info:status 1=schedule name", "Calculate %1", sm->name() ) );
1568
m_calculationcommands.insert( sm, cmd );
1570
//getPart() ->addCommand( cmd );
1571
QApplication::restoreOverrideCursor();
1539
// m_calculationcommands.insert( sm, cmd );
1575
void View::slotCalculationStarted( Project *project, ScheduleManager *sm )
1577
//qDebug()<<"View::slotCalculationStarted:"<<sm<<sm->name();
1578
1541
if ( m_progressBarTimer.isActive() ) {
1579
1542
m_progressBarTimer.stop();
1580
1543
removeProgressBarItems();
1582
removeStatusBarItem( m_estlabel );
1583
if ( sm == currentScheduleManager() ) {
1584
connect( project, SIGNAL( projectCalculated( ScheduleManager* ) ), this, SLOT( slotProjectCalculated( ScheduleManager* ) ) );
1586
if ( sm == currentScheduleManager() ) {
1587
connect( project, SIGNAL( projectCalculated( ScheduleManager* ) ), this, SLOT( slotProjectCalculated( ScheduleManager* ) ) );
1589
m_text = new QLabel( i18nc( "@info:status 1=schedule name", "%1: Calculating...", sm->name() ) );
1590
addStatusBarItem( m_text, 0, true );
1545
// removeStatusBarItem( m_estlabel );
1546
if ( sm == currentScheduleManager() ) {
1547
connect( project, SIGNAL( projectCalculated( ScheduleManager* ) ), this, SLOT( slotProjectCalculated( ScheduleManager* ) ) );
1549
if ( sm == currentScheduleManager() ) {
1550
connect( project, SIGNAL( projectCalculated( ScheduleManager* ) ), this, SLOT( slotProjectCalculated( ScheduleManager* ) ) );
1552
// m_text = new QLabel( i18nc( "@info:status 1=schedule name", "%1: Calculating...", sm->name() ) );
1553
// addStatusBarItem( m_text, 0, true );
1591
1554
m_progress = new QProgressBar();
1592
1555
m_progress->setMaximumHeight(statusBar()->fontMetrics().height());
1593
addStatusBarItem( m_progress, 0, true );
1595
connect( project, SIGNAL( maxProgress( int ) ), m_progress, SLOT( setMaximum( int ) ) );
1596
connect( project, SIGNAL( sigProgress( int ) ), m_progress, SLOT( setValue( int ) ) );
1556
// addStatusBarItem( m_progress, 0, true );
1558
connect( project, SIGNAL( maxProgress( int ) ), this, SLOT( slotMaxProgress( int ) ) );
1559
connect( project, SIGNAL( sigProgress( int ) ), this, SLOT( slotSetProgress( int ) ) );
1597
1560
connect( project, SIGNAL( sigCalculationFinished( Project*, ScheduleManager* ) ), this, SLOT( slotCalculationFinished( Project*, ScheduleManager* ) ) );
1562
CalculateScheduleCmd *cmd = new CalculateScheduleCmd( *project, sm, i18nc( "@info:status 1=schedule name", "Calculate %1", sm->name() ) );
1563
getPart() ->addCommand( cmd );
1567
void View::slotMaxProgress( int p )
1570
m_progress->setMaximum( p );
1573
void View::slotSetProgress( int p )
1576
m_progress->setValue( p );
1580
void View::slotCalculationStarted( Project */*project*/, ScheduleManager */*sm */)
1600
1584
void View::slotCalculationFinished( Project *project, ScheduleManager *sm )
1602
1586
switch ( sm->calculationResult() ) {
1603
1587
case ScheduleManager::CalculationStopped:
1604
m_text->setText( i18nc( "@info:status 1=schedule name", "%1: Calculation stopped", sm->name() ) );
1588
//m_text->setText( i18nc( "@info:status 1=schedule name", "%1: Calculation stopped", sm->name() ) );
1606
1590
case ScheduleManager::CalculationCanceled:
1607
m_text->setText( i18nc( "@info:status 1=schedule name", "%1: Calculation canceled", sm->name() ) );
1591
//m_text->setText( i18nc( "@info:status 1=schedule name", "%1: Calculation canceled", sm->name() ) );
1609
1593
case ScheduleManager::CalculationError:
1610
m_text->setText( i18nc( "@info:status 1=schedule name", "%1: Calculation error", sm->name() ) );
1594
//m_text->setText( i18nc( "@info:status 1=schedule name", "%1: Calculation error", sm->name() ) );
1613
m_text->setText( i18nc( "@info:status 1=schedule name", "%1: Calculating done", sm->name() ) );
1597
//m_text->setText( i18nc( "@info:status 1=schedule name", "%1: Calculation done", sm->name() ) );
1614
1598
// if multiple views open, only the view that started calculation has a cmd
1615
if ( m_calculationcommands.contains( sm ) ) {
1616
CalculateScheduleCmd *cmd = m_calculationcommands.value( sm );
1617
m_calculationcommands.remove( sm );
1619
MacroCommand *m = new MacroCommand( cmd->text() );
1620
getPart()->addCommand( m );
1621
m->addCommand( cmd );
1626
// if command is not used, clean up
1627
if ( m_calculationcommands.contains( sm ) ) {
1628
// let command finish before we delete it!
1629
m_undocommands.append( m_calculationcommands.value( sm ) );
1630
m_calculationcommands.remove( sm );
1631
QTimer::singleShot( 0, this, SLOT( slotRemoveCommands() ) );
1603
//m_progressBarTimer.start( 2000 );
1633
1606
disconnect( project, SIGNAL( sigProgress( int ) ), m_progress, SLOT(setValue( int ) ) );
1634
1607
disconnect( project, SIGNAL( maxProgress( int ) ), m_progress, SLOT( setMaximum( int ) ) );
1635
1608
disconnect( project, SIGNAL( sigCalculationFinished( Project*, ScheduleManager* ) ), this, SLOT( slotCalculationFinished( Project*, ScheduleManager* ) ) );
1636
sm->setScheduling( false );
1637
m_progressBarTimer.start( 2000 );
1639
1609
disconnect( project, SIGNAL( projectCalculated( ScheduleManager* ) ), this, SLOT( slotProjectCalculated( ScheduleManager* ) ) );