~ubuntu-branches/ubuntu/gutsy/kde4libs/gutsy

« back to all changes in this revision

Viewing changes to kdeprint/kprintpreview.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-02-21 11:00:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070221110012-6kw8khr9knv6lmg1
Tags: 3.80.3-0ubuntu1
New upstream unstable release

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include <ktoolbar.h>
40
40
#include <kmimetype.h>
41
41
#include <kactioncollection.h>
42
 
#include <kstdaction.h>
 
42
#include <kstandardaction.h>
43
43
 
44
44
KPreviewProc::KPreviewProc()
45
45
: KProcess()
92
92
        {
93
93
                if (gvpart_) delete gvpart_;
94
94
        }
95
 
        void plugAction(KAction *act)
 
95
        void plugAction(QAction *act)
96
96
        {
97
97
                toolbar_->addAction( act );
98
98
        }
153
153
        // create main view and actions
154
154
        setMainWidget(d->mainwidget_);
155
155
        if (previewOnly)
156
 
                KStdAction::close(this, SLOT(reject()), d->actions_, "close_print");
 
156
                d->actions_->addAction(KStandardAction::Close, "close_print", this, SLOT(reject()));
157
157
        else
158
158
        {
159
159
    KAction *action = 0;
160
 
    action = new KAction(i18n("Print"), d->actions_, "continue_print");
161
 
    action->setIcon( KIcon( "fileprint" ) );
162
 
    action->setShortcut( Qt::Key_Return );
163
 
    connect( action, SIGNAL( triggered( bool ) ), this, SLOT(accept()) );
164
 
 
165
 
    action = new KAction(i18n("Print"), d->actions_, "continue_print");
166
 
    action->setIcon( KIcon( "fileprint" ) );
167
 
    action->setShortcut( Qt::Key_Return );
168
 
    connect( action, SIGNAL( triggered( bool ) ), this, SLOT(accept()) );
169
 
 
170
 
    action = new KAction(i18n("Cancel"), d->actions_, "stop_print");
 
160
    action = new KAction(i18n("Print"), this);
 
161
        d->actions_->addAction( "continue_print", action );
 
162
    action->setIcon( KIcon( "fileprint" ) );
 
163
    action->setShortcut( QKeySequence(Qt::Key_Return) );
 
164
    connect( action, SIGNAL( triggered( bool ) ), this, SLOT(accept()) );
 
165
 
 
166
    action = new KAction(i18n("Print"), this);
 
167
        d->actions_->addAction( "continue_print", action );
 
168
    action->setIcon( KIcon( "fileprint" ) );
 
169
    action->setShortcut( QKeySequence(Qt::Key_Return) );
 
170
    connect( action, SIGNAL( triggered( bool ) ), this, SLOT(accept()) );
 
171
 
 
172
    action = new KAction(i18n("Cancel"), this);
 
173
        d->actions_->addAction( "stop_print", action );
171
174
    action->setIcon( KIcon( "stop" ) );
172
 
    action->setShortcut( Qt::Key_Escape );
 
175
    action->setShortcut( QKeySequence(Qt::Key_Escape) );
173
176
    connect( action, SIGNAL( triggered( bool ) ), this, SLOT(reject()) );
174
177
        }
175
178
 
205
208
                                QDomElement a = acts.item( i ).toElement();
206
209
                                if ( a.attribute( "name" ) == "goToPage" )
207
210
                                        continue;
208
 
                                KAction *act = d->gvpart_->action( a );
 
211
                                QAction *act = d->gvpart_->action( a );
209
212
                                if ( act != 0 )
210
213
                                        d->plugAction( act );
211
214
                        }
212
215
                }
213
216
                /*
214
 
                KAction *act;
 
217
                QAction *act;
215
218
                d->toolbar_->insertLineSeparator();
216
219
                if ((act = d->gvpart_->action("zoomIn")) != 0)
217
220
                        d->plugAction(act);
242
245
 
243
246
void KPrintPreview::openFile(const QString& file)
244
247
{
245
 
        d->gvpart_->openURL(KUrl(file));
 
248
        d->gvpart_->openUrl(KUrl(file));
246
249
}
247
250
 
248
251
bool KPrintPreview::isValid() const
331
334
        }
332
335
        else if (!previewOnly)
333
336
        {
334
 
                return (KMessageBox::questionYesNo(parentW, i18n("Do you want to continue printing?"), QString(), KGuiItem(i18n("Print"),"fileprint"), KStdGuiItem::cancel(), "continuePrinting") == KMessageBox::Yes);
 
337
                return (KMessageBox::questionYesNo(parentW, i18n("Do you want to continue printing?"), QString(), KGuiItem(i18n("Print"),"fileprint"), KStandardGuiItem::cancel(), "continuePrinting") == KMessageBox::Yes);
335
338
        }
336
339
        else
337
340
                return false;