umbrello API Documentation

overwritedialogue.cpp

00001 /***************************************************************************
00002  *                                                                         *
00003  *   This program is free software; you can redistribute it and/or modify  *
00004  *   it under the terms of the GNU General Public License as published by  *
00005  *   the Free Software Foundation; either version 2 of the License, or     *
00006  *   (at your option) any later version.                                   *
00007  *                                                                         *
00008  *   copyright (C) 2003-2007                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 // own header
00013 #include "overwritedialogue.h"
00014 
00015 // qt/kde includes
00016 #include <qcheckbox.h>
00017 #include <qlayout.h>
00018 #include <qlabel.h>
00019 #include <klocale.h>
00020 #include <kdebug.h>
00021 
00022 
00023 OverwriteDialogue::OverwriteDialogue(
00024         const QString& fileName,
00025         const QString& outputDirectory,
00026         bool applyToAllRemaining, QWidget* parent, const char* name) :
00027 KDialogBase(Plain, i18n("Destination File Already Exists"), Ok|Apply|Cancel, Yes, parent, name) {
00028 
00029     QVBoxLayout* layout = new QVBoxLayout( plainPage(), 0, spacingHint() );
00030 
00031     QLabel* dialogueLabel = new QLabel(i18n("The file %1 already exists in %2.\n\nUmbrello can overwrite the file, generate a similar\nfile name or not generate this file.").arg(fileName).arg(outputDirectory), plainPage() );
00032     layout->addWidget(dialogueLabel);
00033 
00034     m_applyToAllRemaining = new QCheckBox( i18n("&Apply to all remaining files"), plainPage() );
00035     m_applyToAllRemaining->setChecked(applyToAllRemaining);
00036     layout->addWidget(m_applyToAllRemaining);
00037 
00038     setButtonText(KDialogBase::Ok, i18n("&Overwrite"));
00039     setButtonText(KDialogBase::Apply, i18n("&Generate Similar File Name"));
00040     setButtonText(KDialogBase::Cancel, i18n("&Do Not Generate File"));
00041 }
00042 
00043 OverwriteDialogue::~OverwriteDialogue() {
00044 }
00045 
00046 void OverwriteDialogue::slotOk() {
00047     done(Yes);
00048 }
00049 
00050 void OverwriteDialogue::slotApply() {
00051     done(No);
00052 }
00053 
00054 void OverwriteDialogue::slotCancel() {
00055     done(Cancel);
00056 }
00057 
00058 bool OverwriteDialogue::applyToAllRemaining() {
00059     return m_applyToAllRemaining->isChecked();
00060 }
00061 
00062 #include "overwritedialogue.moc"
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:07:58 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003