Commit b49c6004 authored by Bernd Gehrmann's avatar Bernd Gehrmann
Browse files

made editor configurable again

svn path=/trunk/kdesdk/cervisia/; revision=163240
parent 1ee6ca2a
2002-06-26 Bernd Gehrmann <bernd@mail.berlios.de>
* Made editor configurable again
2002-06-25 Bernd Gehrmann <bernd@mail.berlios.de>
* Fixed char buffer to QString conversion in
......@@ -54,8 +58,13 @@
* Patch by Roland Krause <rokrau@yahoo.com>:
- Added "Last change" to context menu
- Added filter for files which are not in cvs
* Ignore stderr in Make Patch
* Ignore stderr in Make Patch (it would produce
invalid patches previously)
2002-04-03 Bernd Gehrmann <bernd@mail.berlios.de>
* Release 1.5rich
2002-02-04 Bernd Gehrmann <bernd@mail.berlios.de>
* Colored ProtocolView output
......
......@@ -651,36 +651,48 @@ void CervisiaPart::openFiles(const QStringList &filenames)
{
// First check the cvs edit stuff
if (opt_doCVSEdit)
{
CvsProgressDialog l("Edit", widget() );
l.setCaption(i18n("CVS Edit"));
QString cmdline = cvsClient(repository) + " edit ";
bool doit = false;
for ( QStringList::ConstIterator it = filenames.begin();
it != filenames.end(); ++it )
{
if (!QFileInfo(*it).isWritable())
{
doit = true;
break;
}
cmdline += " ";
cmdline += KShellProcess::quote(*it);
CvsProgressDialog l("Edit", widget() );
l.setCaption(i18n("CVS Edit"));
QString cmdline = cvsClient(repository) + " edit ";
bool doit = false;
for ( QStringList::ConstIterator it = filenames.begin();
it != filenames.end(); ++it )
{
if (!QFileInfo(*it).isWritable())
{
doit = true;
break;
}
cmdline += " ";
cmdline += KShellProcess::quote(*it);
}
if (doit)
if (!l.execCommand(sandbox, repository, cmdline, "edit"))
return;
}
if (doit)
if (!l.execCommand(sandbox, repository, cmdline, "edit"))
return;
}
// Now open the files by either by running the configured external
// editor, or (if it is not explicitly set) by using KRun
KConfig *conf = config();
conf->setGroup("Communication");
QString editor = conf->readEntry("Editor");
// Now open the files by using KRun to use system mimetype associations
QDir dir( sandbox );
for ( QStringList::ConstIterator it = filenames.begin();
it != filenames.end(); ++it )
{
new KRun( KURL(dir.absFilePath(*it)), 0, true, false );
if (!editor.isEmpty()) {
KShellProcess proc("/bin/sh");
proc << editor;
for ( QStringList::ConstIterator it = filenames.begin();
it != filenames.end(); ++it )
proc << KShellProcess::quote(*it);
proc.start(KProcess::DontCare);
} else {
QDir dir(sandbox);
for ( QStringList::ConstIterator it = filenames.begin();
it != filenames.end(); ++it )
(void) new KRun(KURL(dir.absFilePath(*it)), 0, true, false);
}
}
......@@ -1201,54 +1213,54 @@ void CervisiaPart::importOrCheckout(CheckoutDialog::ActionType action)
CheckoutDialog *l = new CheckoutDialog(action, widget());
if (l->exec())
{
QString cmdline = "cd ";
cmdline += l->workingDirectory();
cmdline += " && ";
cmdline += cvsClient(repository);
cmdline += " -d ";
cmdline += l->repository();
if (action == CheckoutDialog::Checkout)
{
cmdline += " checkout ";
if (!l->branch().isEmpty())
QString cmdline = "cd ";
cmdline += l->workingDirectory();
cmdline += " && ";
cmdline += cvsClient(repository);
cmdline += " -d ";
cmdline += l->repository();
if (action == CheckoutDialog::Checkout)
{
cmdline += " checkout ";
if (!l->branch().isEmpty())
{
cmdline += " -r ";
cmdline += l->branch();
cmdline += " -r ";
cmdline += l->branch();
}
if (opt_pruneDirs)
cmdline += " -P ";
cmdline += l->module();
}
else
{
cmdline += " import";
if (l->importBinary())
cmdline += " -kb";
QString ignore = l->ignoreFiles().stripWhiteSpace();
if (!ignore.isEmpty())
{
cmdline += " -I ";
cmdline += KShellProcess::quote(ignore);
}
QString comment = l->comment().stripWhiteSpace();
cmdline += " -m ";
cmdline += (QString("\"") + comment + "\" ");
cmdline += l->module();
cmdline += " ";
cmdline += l->vendorTag();
cmdline += " ";
cmdline += l->releaseTag();
}
if (protocol->startJob(sandbox, repository, cmdline))
{
showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)),
this, SLOT(slotJobFinished(bool)) );
if (opt_pruneDirs)
cmdline += " -P ";
cmdline += l->module();
}
else
{
cmdline += " import";
if (l->importBinary())
cmdline += " -kb";
QString ignore = l->ignoreFiles().stripWhiteSpace();
if (!ignore.isEmpty())
{
cmdline += " -I ";
cmdline += KShellProcess::quote(ignore);
}
QString comment = l->comment().stripWhiteSpace();
cmdline += " -m ";
cmdline += (QString("\"") + comment + "\" ");
cmdline += l->module();
cmdline += " ";
cmdline += l->vendorTag();
cmdline += " ";
cmdline += l->releaseTag();
}
if (protocol->startJob(sandbox, repository, cmdline))
{
showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)),
this, SLOT(slotJobFinished(bool)) );
}
}
}
delete l;
}
......@@ -1438,8 +1450,7 @@ void CervisiaPart::slotConfigure()
void CervisiaPart::slotHelp()
{
emit setStatusBarText( i18n("Invoking help on Cervisia") );
// TODO: invokes the wrong help
kapp->invokeHelp();
KApplication::startServiceByDesktopName("khelpcenter", QString("help:/cervisia/index.html"));
}
......
......@@ -135,13 +135,13 @@ LogDialog::LogDialog(QWidget *parent, const char *name)
commentbox[i] = new QTextEdit(this);
commentbox[i]->setReadOnly(true);
commentbox[i]->setMinimumSize(commentbox[i]->sizeHint().width(),
commentbox[i]->sizeHint().height()-50);
commentbox[i]->sizeHint().height()-50);
grid->addMultiCellWidget(commentbox[i], 2, 2, 1, 3);
tagsbox[i] = new QTextEdit(this);
tagsbox[i]->setReadOnly(true);
tagsbox[i]->setMinimumSize(tagsbox[i]->sizeHint().width(),
tagsbox[i]->sizeHint().height()-50);
tagsbox[i]->sizeHint().height()-50);
grid->addWidget(tagsbox[i], 2, 4);
}
......
......@@ -78,6 +78,10 @@ SettingsDialog::SettingsDialog( KConfig *conf, QWidget *parent, const char *name
cvspathedit = new KLineEdit(generalPage);
cvspathlabel->setBuddy(cvspathedit);
QLabel *editorlabel = new QLabel( i18n("&Editor:"), generalPage );
editoredit = new KLineEdit(generalPage);
editorlabel->setBuddy(editoredit);
new QWidget(generalPage);
//
......@@ -201,14 +205,7 @@ void SettingsDialog::readSettings()
remotestatusbox->setChecked(config->readBoolEntry("StatusForRemoteRepos", false));
localstatusbox->setChecked(config->readBoolEntry("StatusForLocalRepos", false));
config->setGroup("Communication");
#if 0
bool usedcop = config->readBoolEntry("UseDCOP", false);
usedcopbox->setChecked(usedcop);
clientedit->setEnabled(usedcop);
objectedit->setEnabled(usedcop);
clientedit->setText(config->readEntry("DCOPClient"));
objectedit->setText(config->readEntry("DCOPObject"));
#endif
editoredit->setText(config->readEntry("Editor"));
config->setGroup("LookAndFeel");
protocolfontbox->setFont(config->readFontEntry("ProtocolFont"));
annotatefontbox->setFont(config->readFontEntry("AnnotateFont"));
......@@ -231,6 +228,7 @@ void SettingsDialog::writeSettings()
config->writeEntry("StatusForRemoteRepos", remotestatusbox->isChecked());
config->writeEntry("StatusForLocalRepos", localstatusbox->isChecked());
config->setGroup("Communication");
config->writeEntry("Editor", editoredit->text());
#if 0
config->writeEntry("UseDCOP", usedcopbox->isChecked());
config->writeEntry("DCOPClient", clientedit->text());
......
......@@ -62,6 +62,7 @@ private:
KLineEdit *cvspathedit;
QComboBox *compressioncombo;
KLineEdit *usernameedit;
KLineEdit *editoredit;
KLineEdit *diffoptedit;
KLineEdit *extdiffedit;
QCheckBox *remotestatusbox;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment