00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
#include <qlayout.h>
00015
#include <qlabel.h>
00016
#include <qcheckbox.h>
00017
#include <qlineedit.h>
00018
#include <qtextedit.h>
00019
#include <qpushbutton.h>
00020
00021
#include <kapplication.h>
00022
#include <kbuttonbox.h>
00023
#include <klocale.h>
00024
#include <kmessagebox.h>
00025
00026
#include "commitdlg.h"
00027
00029
00031
00032
00033 CommitDialog::CommitDialog(
const QString &changeLogfileNamePath,
QWidget *parent )
00034 :
CommitDialogBase( parent, "commitdialog", true )
00035 {
00036 connect( buttonOk, SIGNAL(clicked()), SLOT(
accept()) );
00037 connect( buttonCancel, SIGNAL(clicked()), SLOT(reject()) );
00038
00039
setChangeLogFileName( changeLogfileNamePath );
00040 }
00041
00043
00044 QStringList CommitDialog::logMessage()
const
00045
{
00046
QStringList textLines;
00047
for (
int i=0; i<textEdit->paragraphs(); ++i)
00048 {
00049 textLines << textEdit->text( i );
00050 }
00051
return textLines;
00052 }
00053
00055
00056 bool CommitDialog::mustAddToChangeLog()
const
00057
{
00058
return checkAddToChangelog->isChecked();
00059 }
00060
00062
00063 void CommitDialog::accept()
00064 {
00065
if (textEdit->text().isNull() || textEdit->text().isEmpty()) {
00066
int s = KMessageBox::warningContinueCancel(
this,
00067 i18n(
"You are committing your changes without any comment. This is not a good practice. Continue anyway?"),
00068 i18n(
"CVS Commit Warning"),
00069 KStdGuiItem::cont(),
00070 i18n(
"askWhenCommittingEmptyLogs") );
00071
if ( s != KMessageBox::Continue ) {
00072
return;
00073 }
00074 }
00075 QDialog::accept();
00076 }
00077
00079
00080 void CommitDialog::setChangeLogFileName(
const QString &fileName )
00081 {
00082 changeLogNameEdit->setText( fileName );
00083 }
00084
00086
00087 QString CommitDialog::changeLogFileName()
const
00088
{
00089
return changeLogNameEdit->text();
00090 }
00091
00092
#include "commitdlg.moc"