File: kconfirmdlg.cpp

package info (click to toggle)
kdewebdev 1%3A3.3.2-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 33,200 kB
  • ctags: 13,047
  • sloc: cpp: 165,029; sh: 9,033; perl: 3,315; makefile: 1,618; xml: 497; ansic: 83
file content (109 lines) | stat: -rw-r--r-- 2,900 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/***************************************************************************
                          kconfirmdlg.cpp  -  description
                             -------------------
    begin                : Fri Jun 23 2000
    copyright            : (C) 2000 by Franois Dupoux
                                  (C) 2004 Emiliano Gulmini <emi_barbarossa@yahoo.it>
    email                : dupoux@dupoux.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include <qlayout.h>
#include <qlabel.h>
#include <qtextedit.h>
#include <qpushbutton.h>
#include "kconfirmdlg.h"
#include <kapplication.h>
#include <klocale.h>




KConfirmDlg::KConfirmDlg(QWidget *parent, const char *name) : KConfirmDlgS(parent,name,true)
{
  initDialog();
  
  connect(pbYes,SIGNAL(clicked()),this,SLOT(slotYes()));
  connect(pbNo,SIGNAL(clicked()),this,SLOT(slotNo()));
  connect(pbSkipFile,SIGNAL(clicked()),this,SLOT(slotSkipFile()));
  connect(pbSkipFolder,SIGNAL(clicked()),this,SLOT(slotSkipFolder()));
  connect(pbCancel,SIGNAL(clicked()),this,SLOT(slotCancel()));
}


KConfirmDlg::~KConfirmDlg()
{
}


void KConfirmDlg::initDialog()
{
  // set normal cursor
  QApplication::setOverrideCursor(Qt::arrowCursor);
}


void KConfirmDlg::setData(const QString& strFile, const QString& strDir, const QString& strSearch, const QString& strReplace)
{
  m_strFile = strFile;
  m_strDir = strDir;
  m_strSearch = strSearch;
  m_strReplace = strReplace;

  tlFile->setText(i18n("<qt>File: <b>%1</b></qt>").arg(strFile));

  tlFolder->setText(i18n("<qt>Folder: <b>%1</b></qt>").arg(strDir));

  txtedSearch->setText(strSearch);

  txtedReplace->setText(strReplace);
}


void KConfirmDlg::slotYes()
{
  // get new replace string if edited
  if (txtedReplace->isModified())
    m_strReplace = txtedReplace->text();

  QApplication::restoreOverrideCursor();
  done(Yes);
}


void KConfirmDlg::slotNo()
{
  QApplication::restoreOverrideCursor();
  done(No);
}


void KConfirmDlg::slotSkipFile()
{
  QApplication::restoreOverrideCursor();
  done(SkipFile);
}


void KConfirmDlg::slotSkipFolder()
{
  QApplication::restoreOverrideCursor();
  done(SkipDir);
}


void KConfirmDlg::slotCancel()
{
  QApplication::restoreOverrideCursor();
  done(Cancel);
}

#include "kconfirmdlg.moc"