• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

umbrello/umbrello

  • sources
  • kde-4.12
  • kdesdk
  • umbrello
  • umbrello
  • dialogs
overwritedialogue.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * This program is free software; you can redistribute it and/or modify *
3  * it under the terms of the GNU General Public License as published by *
4  * the Free Software Foundation; either version 2 of the License, or *
5  * (at your option) any later version. *
6  * *
7  * copyright (C) 2003-2013 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 // own header
12 #include "overwritedialogue.h"
13 
14 // kde includes
15 #include <klocale.h>
16 
17 // qt includes
18 #include <QCheckBox>
19 #include <QLabel>
20 #include <QLayout>
21 #include <QVBoxLayout>
22 
26 OverwriteDialogue::OverwriteDialogue(
27  const QString& fileName,
28  const QString& outputDirectory,
29  bool applyToAllRemaining, QWidget* parent)
30  : KDialog(parent)
31 {
32  setCaption(i18n("Destination File Already Exists"));
33  setButtons(Ok | Apply | Cancel);
34  setDefaultButton(Yes);
35  setModal(true);
36  showButtonSeparator(true);
37 
38  QFrame *frame = new QFrame(this);
39  setMainWidget(frame);
40 
41  QVBoxLayout* layout = new QVBoxLayout(frame);
42  layout->setSpacing(spacingHint());
43  layout->setMargin(0);
44 
45  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.", fileName, outputDirectory), frame);
46  layout->addWidget(dialogueLabel);
47 
48  m_applyToAllRemaining = new QCheckBox(i18n("&Apply to all remaining files"), frame);
49  m_applyToAllRemaining->setChecked(applyToAllRemaining);
50  layout->addWidget(m_applyToAllRemaining);
51 
52  setButtonText(KDialog::Ok, i18n("&Overwrite"));
53  setButtonText(KDialog::Apply, i18n("&Generate Similar File Name"));
54  setButtonText(KDialog::Cancel, i18n("&Do Not Generate File"));
55  connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
56  connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()));
57  connect(this, SIGNAL(cancelClicked()), this, SLOT(slotCancel()));
58 }
59 
63 OverwriteDialogue::~OverwriteDialogue()
64 {
65 }
66 
71 void OverwriteDialogue::slotOk()
72 {
73  done(Yes);
74 }
75 
79 void OverwriteDialogue::slotApply()
80 {
81  done(No);
82 }
83 
87 void OverwriteDialogue::slotCancel()
88 {
89  done(Cancel);
90 }
91 
95 bool OverwriteDialogue::applyToAllRemaining()
96 {
97  return m_applyToAllRemaining->isChecked();
98 }
99 
100 #include "overwritedialogue.moc"
OverwriteDialogue::slotOk
virtual void slotOk()
Overrides standard operation to call QDialog::done(Yes).
Definition: overwritedialogue.cpp:71
OverwriteDialogue::slotCancel
virtual void slotCancel()
Overrides standard operation to call QDialog::done(Cancel).
Definition: overwritedialogue.cpp:87
QWidget
KDialog
overwritedialogue.h
OverwriteDialogue::applyToAllRemaining
bool applyToAllRemaining()
Definition: overwritedialogue.cpp:95
OverwriteDialogue::OverwriteDialogue
OverwriteDialogue(const QString &fileName, const QString &outputDirectory, bool applyToAllRemaining, QWidget *parent=0)
Constructor sets up the dialog, adding checkbox and label.
Definition: overwritedialogue.cpp:26
OverwriteDialogue::~OverwriteDialogue
~OverwriteDialogue()
Destructor.
Definition: overwritedialogue.cpp:63
OverwriteDialogue::slotApply
virtual void slotApply()
Overrides standard operation to call QDialog::done(No).
Definition: overwritedialogue.cpp:79
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal