~ubuntu-branches/debian/sid/librecad/sid

« back to all changes in this revision

Viewing changes to src/main/qc_applicationwindow.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Howard
  • Date: 2011-12-17 20:08:57 UTC
  • mfrom: (0.2.4)
  • Revision ID: package-import@ubuntu.com-20111217200857-r9wmynaloj230qm1
Tags: 1.0.0+nolibs-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1183
1183
    action = actionFactory.createAction(RS2::ActionLayersEdit, actionHandler);
1184
1184
    action->addTo(menu);
1185
1185
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
 
1186
    action = actionFactory.createAction(RS2::ActionLayersToggleLock,
 
1187
                                        actionHandler);
 
1188
    menu->addAction(action);
 
1189
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
1186
1190
    action = actionFactory.createAction(RS2::ActionLayersToggleView,
1187
1191
                                        actionHandler);
1188
1192
    action->addTo(menu);
1200
1204
                                        actionHandler);
1201
1205
    action->addTo(menu);
1202
1206
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
 
1207
    action = actionFactory.createAction(RS2::ActionBlocksToggleView,
 
1208
                                        actionHandler);
 
1209
    menu->addAction(action);
 
1210
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
1203
1211
    action = actionFactory.createAction(RS2::ActionBlocksAdd, actionHandler);
1204
1212
    action->addTo(menu);
1205
1213
    connect(this, SIGNAL(windowsChanged(bool)), action, SLOT(setEnabled(bool)));
2545
2553
    statusBar()->showMessage(tr("Printing..."));
2546
2554
    QPrinter printer(QPrinter::HighResolution);
2547
2555
 
2548
 
    // Try to set the printer to teh highest resolution
2549
 
    QList<int> res=printer.supportedResolutions ();
2550
 
    if (res.size()>0)
2551
 
        printer.setResolution(res.last());
2552
 
 
2553
2556
    bool landscape = false;
2554
2557
    printer.setPaperSize(RS2::rsToQtPaperFormat(graphic->getPaperFormat(&landscape)));
2555
2558
    if (landscape) {
2571
2574
        //printer.setOutputToFile(true);
2572
2575
        //printer.setOutputFileName(outputFile);
2573
2576
 
 
2577
        // Try to set the printer to the highest resolution
 
2578
        //todo: handler printer resolution better
 
2579
        if(printer.outputFormat() == QPrinter::NativeFormat ){
 
2580
            //bug#3448560
 
2581
            //fixme: supportedResolutions() only reports resolution of 72dpi
 
2582
            //this seems to be a Qt bug up to Qt-4.7.4
 
2583
            //we might be ok to keep the default resolution
 
2584
 
 
2585
//            QList<int> res=printer.supportedResolutions ();
 
2586
//            if (res.size()>0)
 
2587
//                printer.setResolution(res.last());
 
2588
            //        for(int i=0;i<res.size();i++){
 
2589
            //        std::cout<<"res.at(i)="<<res.at(i)<<std::endl;
 
2590
            //        }
 
2591
        }else{//pdf or postscript format
 
2592
            //fixme: user should be able to set resolution output to file
 
2593
            printer.setResolution(1200);
 
2594
        }
 
2595
 
 
2596
//        std::cout<<"printer.resolution()="<<printer.resolution()<<std::endl;
2574
2597
        QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) );
2575
2598
        printer.setFullPage(true);
2576
2599
 
2677
2700
                    // Link the block list to the block widget
2678
2701
                    graphic->addBlockListListener(blockWidget);
2679
2702
 
2680
 
                    // Center by default:
2681
 
                    graphic->centerToPage();
2682
2703
                }
2683
2704
 
2684
2705
                // Link the graphic view to the mouse widget:
2700
2721
                } else {
2701
2722
                    w->show();
2702
2723
                }
 
2724
 
 
2725
                if(graphic!=NULL){
 
2726
                    graphic->fitToPage();
 
2727
                }
2703
2728
                w->getGraphicView()->zoomPage();
2704
2729
                setFocus();
2705
2730
 
2945
2970
                       "</font></p>" +
2946
2971
                       "<br>" +
2947
2972
                       "<center>" +
2948
 
                       tr("Please donate to LibreCAD to help maintain the sourcecode and it's website.") +
 
2973
                       tr("Please consider donating to LibreCAD to help maintain the source code and website.") +
2949
2974
                       "<br>" +
2950
2975
                       "<br>" +
2951
2976
                       "<a href=\"http://librecad.org/donate.html\" alt=\"Donate to LibreCAD\">" +