Commit 549bb7da authored by Bernd Gehrmann's avatar Bernd Gehrmann
Browse files

* Hide custom tooltips in list views when contents

  are scrolled
* #include cleanup
* i18n fixes

svn path=/trunk/kdesdk/cervisia/; revision=163077
parent 9f267c5f
2002-06-25 Bernd Gehrmann <bernd@mail.berlios.de>
* Fixed char buffer to QString conversion in
CvsProgressDialog, resulting in random garbage
inserted in the annotate view. Also a bug
introduced in 2002-06-11
* Change annotate view to QListView. Based
on a patch by André Wöbbeking <Woebbeking@web.de>
* Hide custom tooltips in list views when contents
are scrolled
* Simplified history dialog filtering by
using QListViewItem::setVisible()
* #include cleanup
2002-06-22 Bernd Gehrmann <bernd@mail.berlios.de>
* Fixed diff dialog bug due to changes from 2002-06-11
......
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......@@ -12,6 +12,8 @@
*/
#include "annotatedlg.h"
#include <qpushbutton.h>
#include <qfileinfo.h>
#include <qframe.h>
......@@ -19,6 +21,7 @@
#include <kapplication.h>
#include <kbuttonbox.h>
#include <kconfig.h>
#include <kdebug.h>
#include <klocale.h>
#include <kprocess.h>
......@@ -26,9 +29,6 @@
#include "cvsprogressdlg.h"
#include "misc.h"
#include "annotatedlg.h"
#include "annotatedlg.moc"
AnnotateDialog::Options *AnnotateDialog::options = 0;
......@@ -104,9 +104,10 @@ bool AnnotateDialog::parseCvsAnnotate(const QString &sandbox, const QString &rep
enum { Begin, Tags, Admin, Revision,
Author, Branches, Comment, Finished } state;
setCaption(i18n("CVS Annotate: ") + filename);
setCaption(i18n("CVS Annotate: %1").arg(filename));
QString cmdline = cvsClient(repository);
QString cmdline = "( ";
cmdline += cvsClient(repository);
cmdline += " log ";
cmdline += KShellProcess::quote(filename);
cmdline += " && ";
......@@ -122,7 +123,7 @@ bool AnnotateDialog::parseCvsAnnotate(const QString &sandbox, const QString &rep
cmdline += KShellProcess::quote(filename);
// Hack because the string Annotations for blabla is
// printed to stderr even with option -Q. Arg!
cmdline += " 2>&1";
cmdline += " ) 2>&1";
CvsProgressDialog l("Annotate", this);
l.setCaption(i18n("CVS Annotate"));
......@@ -217,6 +218,8 @@ bool AnnotateDialog::parseCvsAnnotate(const QString &sandbox, const QString &rep
return true; // successful
}
#include "annotatedlg.moc"
// Local Variables:
// c-basic-offset: 4
......
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......@@ -12,11 +12,12 @@
*/
#ifndef _ANNOTATEDLG_H_
#define _ANNOTATEDLG_H_
#ifndef ANNOTATEDLG_H
#define ANNOTATEDLG_H
#include <qdialog.h>
class KConfig;
class AnnotateView;
......
......@@ -92,7 +92,7 @@ KAboutData *CervisiaFactory::aboutData()
CERVISIA_VERSION,
I18N_NOOP("A CVS frontend"),
KAboutData::License_QPL,
I18N_NOOP("(c) 1999-2001 Bernd Gehrmann"));
I18N_NOOP("(c) 1999-2002 Bernd Gehrmann"));
}
CervisiaPart::CervisiaPart( QWidget *parentWidget, const char *widgetName,
......
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......@@ -12,6 +12,8 @@
*/
#include "changelogdlg.h"
#include <qfile.h>
#include <qfileinfo.h>
#include <qlayout.h>
......@@ -28,9 +30,6 @@
#include "misc.h"
#include "cervisiapart.h"
#include "changelogdlg.h"
#include "changelogdlg.moc"
static QString timeStringISO8601()
{
......@@ -188,8 +187,7 @@ QString ChangeLogDialog::message()
// Skip empty lines
while (no < edit->numLines())
{
// Replace with isEmpty() in 2.0
if (qstrcmp(edit->textLine(no).latin1(), "") != 0)
if (edit->textLine(no).isEmpty())
break;
++no;
}
......@@ -224,6 +222,8 @@ QString ChangeLogDialog::message()
return res;
}
#include "changelogdlg.moc"
// Local Variables:
// c-basic-offset: 4
......
......@@ -12,11 +12,14 @@
*/
#ifndef _CHANGELOGDLG_H_
#define _CHANGELOGDLG_H_
#ifndef CHANGELOGDLG_H
#define CHANGELOGDLG_H
#include <qdialog.h>
class QMultiLineEdit;
class KConfig;
class ChangeLogDialog : public QDialog
{
......@@ -25,7 +28,7 @@ class ChangeLogDialog : public QDialog
public:
ChangeLogDialog( QWidget *parent=0, const char *name=0 );
bool readFile(const QString &filename);
bool readFile(const QString &fileName);
QString message();
static void loadOptions(KConfig *config);
......
......@@ -12,6 +12,8 @@
*/
#include "checkoutdlg.h"
#include <qlayout.h>
#include <qpushbutton.h>
#include <qlabel.h>
......@@ -31,9 +33,6 @@
#include "repositories.h"
#include "misc.h"
#include "checkoutdlg.h"
#include "checkoutdlg.moc"
CheckoutDialog::Options *CheckoutDialog::options = 0;
......@@ -350,6 +349,8 @@ void CheckoutDialog::moduleButtonClicked()
}
}
#include "checkoutdlg.moc"
// Local Variables:
// c-basic-offset: 4
// End:
......@@ -12,14 +12,16 @@
*/
#ifndef _CHECKOUTDLG_H_
#define _CHECKOUTDLG_H_
#ifndef CHECKOUTDLG_H
#define CHECKOUTDLG_H
#include <qdialog.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <klineedit.h>
class KConfig;
class CheckoutDialog : public QDialog
{
......
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......@@ -11,6 +11,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#include "commitdlg.h"
#include <qlayout.h>
#include <qpushbutton.h>
......@@ -24,9 +25,6 @@
#include "diffdlg.h"
#include "misc.h"
#include "commitdlg.h"
#include "commitdlg.moc"
CommitDialog::Options *CommitDialog::options = 0;
......@@ -140,8 +138,6 @@ void CommitDialog::saveOptions(KConfig *config)
void CommitDialog::setLogHistory(const QString &sbox, const QString &repo,
const QStringList &list)
{
kdDebug() << "CommitDialog::setLogHistory, list = " << list.join( "|" ) << endl;
sandbox = sbox;
repository = repo;
commits = list;
......@@ -200,6 +196,8 @@ void CommitDialog::fileSelected(int index)
delete l;
}
#include "commitdlg.moc"
// Local Variables:
// c-basic-offset: 4
......
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......@@ -12,14 +12,17 @@
*/
#ifndef _COMMITDLG_H_
#define _COMMITDLG_H_
#ifndef COMMITDLG_H
#define COMMITDLG_H
#include <qdialog.h>
#include <qlistbox.h>
#include <qmultilinedit.h>
#include <qstringlist.h>
class QComboBox;
class KConfig;
class CommitDialog : public QDialog
{
......
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......@@ -12,8 +12,8 @@
*/
#ifndef _CVSDIR_H_
#define _CVSDIR_H_
#ifndef CVSDIR_H
#define CVSDIR_H
#include <qdir.h>
......
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......@@ -11,6 +11,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#include "diffdlg.h"
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qcombobox.h>
......@@ -25,12 +27,11 @@
#include <klocale.h>
#include <ktempfile.h>
#include <kprocess.h>
#include "misc.h"
#include "cervisiapart.h"
#include "cvsprogressdlg.h"
#include "diffview.h"
#include "diffdlg.h"
#include "diffdlg.moc"
DiffDialog::Options *DiffDialog::options = 0;
......@@ -263,7 +264,7 @@ bool DiffDialog::parseCvsDiff(const QString &sandbox, const QString &repository,
int linenoA, linenoB;
enum { Normal, VersionA, VersionB } state;
setCaption(i18n("CVS Diff: ") + filename);
setCaption(i18n("CVS Diff: %1").arg(filename));
revlabel1->setText( revA.isEmpty()?
QString(i18n("Repository"))
: i18n("Revision ")+revA );
......@@ -554,6 +555,8 @@ void DiffDialog::forwClicked()
updateHighlight(newitem);
}
#include "diffdlg.moc"
// Local Variables:
// c-basic-offset: 4
// End:
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......@@ -12,14 +12,16 @@
*/
#ifndef _DIFFDLG_H_
#define _DIFFDLG_H_
#ifndef DIFFDLG_H
#define DIFFDLG_H
#include <qdialog.h>
#include <qptrlist.h>
class QLabel;
class QCheckBox;
class QComboBox;
class KConfig;
class DiffItem;
class DiffView;
......@@ -33,7 +35,6 @@ public:
bool parseCvsDiff(const QString &sandbox, const QString &repository,
const QString &filename, const QString &revA, const QString &revB);
// void updateViews();
static void loadOptions(KConfig *config);
static void saveOptions(KConfig *config);
......@@ -66,7 +67,7 @@ private:
QPushButton *backbutton, *forwbutton;
DiffView *diff1, *diff2;
QList<DiffItem> items;
QPtrList<DiffItem> items;
int markeditem;
};
......
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......@@ -12,23 +12,21 @@
*/
#include "diffview.h"
#include <qpainter.h>
#include <qscrollbar.h>
#include <qpixmap.h>
#if QT_VERSION >= 300
#include <qstyle.h>
#endif
#include <kapplication.h>
#include <kconfig.h>
#include <kdebug.h>
#include <klocale.h>
#include "misc.h"
#include "cervisiapart.h"
#include "diffview.h"
#include "diffview.moc"
class DiffViewItem
{
......@@ -47,12 +45,12 @@ int DiffViewItemList::compareItems(QCollection::Item item1, QCollection::Item it
}
static const int DIFFBORDER = 7;
const int DiffView::BORDER = 7;
DiffView::DiffView( bool withlinenos, bool withmarker,
QWidget *parent, const char *name )
: QTableView(parent, name, WNorthWestGravity | WRepaintNoErase)
: QtTableView(parent, name, WNorthWestGravity | WRepaintNoErase)
{
setNumRows(0);
setNumCols( 1 + (withlinenos?1:0) + (withmarker?1:0) );
......@@ -79,7 +77,7 @@ DiffView::DiffView( bool withlinenos, bool withmarker,
void DiffView::setFont(const QFont &font)
{
QTableView::setFont(font);
QtTableView::setFont(font);
QFontMetrics fm(font);
setCellHeight(fm.lineSpacing());
}
......@@ -252,7 +250,7 @@ int DiffView::cellWidth(int col)
QFontMetrics fm( fontMetrics() );
return QMAX(QMAX( fm.width(i18n("Delete")),
fm.width(i18n("Insert"))),
fm.width(i18n("Change")))+2*DIFFBORDER;
fm.width(i18n("Change")))+2*BORDER;
}
else
{
......@@ -319,7 +317,7 @@ void DiffView::paintCell(QPainter *p, int row, int col)
backgroundColor = lightGray;
inverted = false;
align = AlignRight;
innerborder = DIFFBORDER;
innerborder = BORDER;
str = (item->type==Change)? i18n("Change")
: (item->type==Insert)? i18n("Insert")
: (item->type==Delete)? i18n("Delete") : QString::null;
......@@ -401,16 +399,12 @@ void DiffZoomWidget::paintEvent(QPaintEvent *)
if (!bar)
return;
int sliderMin, sliderMax, sliderLength, dummy;
int sliderMin, sliderMax, sliderLength;
if (bar->isVisible())
{
#if QT_VERSION < 300
style().scrollBarMetrics(bar, sliderMin, sliderMax, sliderLength, dummy);
#else
sliderMin = style().pixelMetric(QStyle::PM_ScrollBarSliderMin, bar);
sliderLength = style().pixelMetric(QStyle::PM_SliderLength, bar);
sliderMax = style().pixelMetric(QStyle::PM_SliderSpaceAvailable, bar);
#endif
}
else
{
......@@ -454,6 +448,8 @@ void DiffZoomWidget::paintEvent(QPaintEvent *)
bitBlt(this, 0, 0, &pixbuf);
}
#include "diffview.moc"
// Local Variables:
// c-basic-offset: 4
......
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......@@ -12,34 +12,24 @@
*/
#ifndef _DIFFVIEW_H_
#define _DIFFVIEW_H_
#ifndef DIFFVIEW_H
#define DIFFVIEW_H
#include <qobject.h>
#if QT_VERSION < 300
#include <qlist.h>
#include <qtableview.h>
#else
#include <qptrlist.h>
#include <qttableview.h>
#endif
class DiffViewItem;
#if QT_VERSION < 300
typedef QList<DiffViewItem> DiffViewItemListBase;
#else
typedef QPtrList<DiffViewItem> DiffViewItemListBase;
typedef QtTableView QTableView; // XXX: This is a hack
#endif
class DiffViewItemList : public DiffViewItemListBase
class DiffViewItemList : public QPtrList<DiffViewItem>
{
protected:
virtual int compareItems(QCollection::Item item1, QCollection::Item item2);
};
class DiffView : public QTableView
class DiffView : public QtTableView
{
Q_OBJECT
......@@ -90,7 +80,7 @@ private:
bool marker;
int textwidth;
DiffView *partner;
static const int BORDER;
};
......@@ -113,8 +103,6 @@ private:
DiffView *diffview;
};
#endif
......
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......@@ -12,6 +12,8 @@
*/
#include "logdlg.h"
#include <stdio.h>
#include <qpushbutton.h>
#include <qlayout.h>
......@@ -25,13 +27,11 @@
#include <kconfig.h>
#include <kprocess.h>
#include <diffdlg.h>
#include <annotatedlg.h>
#include "annotatedlg.h"
#include "cvsprogressdlg.h"
#include "misc.h"
#include "logdlg.h"
#include "logdlg.moc"
LogDialog::Options *LogDialog::options = 0;
......@@ -241,7 +241,6 @@ bool LogDialog::parseCvsLog(const QString &sbox, const QString &repo, const QStr
QString line;
while ( l.getOneLine(&line) )
{
kdDebug() << "Line:#" << line << "#" << endl;
switch (state)
{
case Begin:
......@@ -480,6 +479,8 @@ void LogDialog::tagBSelected(int n)
tagSelected(tags.at(n-1)->tag, true);
}
#include "logdlg.moc"
// Local Variables:
// c-basic-offset: 4
// End:
/*
* Copyright (C) 1999-2001 Bernd Gehrmann
* Copyright (C) 1999-2002 Bernd Gehrmann
* bernd@physik.hu-berlin.de
*
* This program may be distributed under the terms of the Q Public
......@@ -12,8 +12,8 @@
*/
#ifndef _LOGDLG_H_