Commit 6567f787 authored by Bernd Gehrmann's avatar Bernd Gehrmann
Browse files

* Patch by Gregory Green <gregory.p.green@boeing.com>:

  - Checkout of branches
* 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

svn path=/trunk/kdesdk/cervisia/; revision=149998
parent dd7020a9
2002-04-17 Bernd Gehrmann <bernd@mail.berlios.de>
* Patch by Gregory Green <gregory.p.green@boeing.com>:
- Checkout of branches
* 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
2002-02-04 Bernd Gehrmann <bernd@mail.berlios.de>
* Colored ProtocolView output
......
INCLUDES = $(all_includes)
LDFLAGS = $(all_libraries) $(KDE_RPATH)
CXXFLAGS = -UQT_NO_COMPAT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE
CXXFLAGS = -g -fpermissive -UQT_NO_COMPAT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE
bin_PROGRAMS = cervisia
lib_LTLIBRARIES = libcervisia.la
......
......@@ -115,7 +115,6 @@ CervisiaPart::CervisiaPart( QWidget *parentWidget, const char *widgetName,
update = new UpdateView(splitter);
update->setFocusPolicy( QWidget::StrongFocus );
update->setFocus();
connect( update, SIGNAL(contextMenu()),
this, SLOT(popupRequested()) );
connect( update, SIGNAL(fileOpened(QString)),
......@@ -449,6 +448,13 @@ void CervisiaPart::setupActions()
action->setToolTip( hint );
action->setWhatsThis( hint );
action = new KToggleAction( i18n("Hide Non CVS Files"), 0,
this, SLOT(slotHideNotInCVS()),
actionCollection(), "settings_hide_notincvs" );
hint = i18n("Determines whether files not in CVS are hidden");
action->setToolTip( hint );
action->setWhatsThis( hint );
action = new KToggleAction( i18n("Create &Directories on Update"), 0,
this, SLOT(slotCreateDirs()),
actionCollection(), "settings_create_dirs" );
......@@ -1143,7 +1149,7 @@ void CervisiaPart::slotMakePatch()
l.setCaption(i18n("CVS Diff"));
QString cmdline = cvsClient(repository);
cmdline += " diff -uR";
cmdline += " diff -uR 2>/dev/null";
if (!l.execCommand(sandbox, repository, cmdline, ""))
return;
......@@ -1195,8 +1201,13 @@ void CervisiaPart::importOrCheckout(CheckoutDialog::ActionType action)
if (action == CheckoutDialog::Checkout)
{
cmdline += " checkout ";
if (!l->branch().isEmpty())
{
cmdline += " -r ";
cmdline += l->branch();
}
if (opt_pruneDirs)
cmdline += "-P ";
cmdline += " -P ";
cmdline += l->module();
}
else
......@@ -1353,6 +1364,13 @@ void CervisiaPart::slotHideRemoved()
}
void CervisiaPart::slotHideNotInCVS()
{
opt_hideNotInCVS = !opt_hideNotInCVS;
setFilter();
}
void CervisiaPart::slotCreateDirs()
{
opt_createDirs = !opt_createDirs;
......@@ -1460,6 +1478,7 @@ void CervisiaPart::openSandbox(const QString &dirname)
emit setWindowCaption(sandbox + "(" + repository + ")");
QDir::setCurrent(sandbox);
update->openDirectory(sandbox);
setFilter();
KConfig *conf = config();
conf->setGroup("General");
......@@ -1488,6 +1507,8 @@ void CervisiaPart::setFilter()
filter = UpdateView::Filter(filter | UpdateView::NoUpToDate);
if (opt_hideRemoved)
filter = UpdateView::Filter(filter | UpdateView::NoRemoved);
if (opt_hideNotInCVS)
filter = UpdateView::Filter(filter | UpdateView::NoNotInCVS);
update->setFilter(filter);
QString str;
......@@ -1643,6 +1664,10 @@ void CervisiaPart::readProperties(KConfig *config)
(static_cast<KToggleAction *> (actionCollection()->action( "settings_hide_removed" )))
->setChecked( opt_hideRemoved );
opt_hideNotInCVS = config->readBoolEntry("Hide Non CVS Files", false);
(static_cast<KToggleAction *> (actionCollection()->action( "settings_hide_notincvs" )))
->setChecked( opt_hideNotInCVS );
setFilter();
int splitterpos1 = config->readNumEntry("Splitter Pos 1", 0);
......@@ -1669,6 +1694,7 @@ void CervisiaPart::saveProperties( KConfig *config )
config->writeEntry("Hide Files", opt_hideFiles);
config->writeEntry("Hide UpToDate Files", opt_hideUpToDate);
config->writeEntry("Hide Removed Files", opt_hideRemoved);
config->writeEntry("Hide Non CVS Files", opt_hideNotInCVS);
QValueList<int> sizes = splitter->sizes();
config->writeEntry("Splitter Pos 1", sizes[0]);
config->writeEntry("Splitter Pos 2", sizes[1]);
......
......@@ -122,6 +122,7 @@ public slots:
void slotHideFiles();
void slotHideUpToDate();
void slotHideRemoved();
void slotHideNotInCVS();
void slotUpdateRecursive();
void slotCommitRecursive();
void slotDoCVSEdit();
......@@ -156,7 +157,7 @@ private:
QString changelogstr;
QStringList recentCommits;
bool opt_hideFiles, opt_hideUpToDate, opt_hideRemoved;
bool opt_hideFiles, opt_hideUpToDate, opt_hideRemoved, opt_hideNotInCVS;
bool opt_createDirs, opt_pruneDirs;
bool opt_updateRecursive, opt_commitRecursive, opt_doCVSEdit;
......
......@@ -31,6 +31,7 @@
<Action name="settings_hide_files"/>
<Action name="settings_hide_uptodate"/>
<Action name="settings_hide_removed"/>
<Action name="settings_hide_notincvs"/>
<Separator/>
<Action name="view_unfold_tree"/>
<Action name="view_fold_tree"/>
......@@ -82,6 +83,7 @@
<Menu name="context_popup">
<Action name="file_edit"/>
<Action name="view_diff"/>
<Action name="view_last_change"/>
<Action name="file_resolve"/>
<Action name="view_log"/>
<Separator/>
......
......@@ -45,11 +45,11 @@ CheckoutDialog::CheckoutDialog(ActionType action, QWidget *parent, const char *n
QBoxLayout *layout = new QVBoxLayout(this, 10);
QGridLayout *grid = new QGridLayout((action==Checkout)? 3 : 7, 2, 10);
QGridLayout *grid = new QGridLayout((action==Checkout)? 4 : 8, 2, 10);
layout->addLayout(grid);
grid->setColStretch(0, 1);
grid->setColStretch(1, 20);
for (int i = 0; i < ((action==Checkout)? 3 : 7); ++i)
for (int i = 0; i < ((action==Checkout)? 4 : 8); ++i)
grid->setRowStretch(i, 0);
repo_combo = new QComboBox(true, this);
......@@ -64,6 +64,7 @@ CheckoutDialog::CheckoutDialog(ActionType action, QWidget *parent, const char *n
repo_label->setFixedSize(repo_label->sizeHint());
grid->addWidget(repo_label, 0, 0, AlignLeft | AlignVCenter);
int resume_row = 2;
if (action == Import)
{
module_edit = new KLineEdit(this);
......@@ -72,6 +73,7 @@ CheckoutDialog::CheckoutDialog(ActionType action, QWidget *parent, const char *n
QLabel *module_label = new QLabel(module_edit, i18n("&Module:"), this);
module_label->setFixedSize(module_label->sizeHint());
grid->addWidget(module_label, 1, 0, AlignLeft | AlignVCenter);
}
else
{
......@@ -90,7 +92,16 @@ CheckoutDialog::CheckoutDialog(ActionType action, QWidget *parent, const char *n
QLabel *module_label = new QLabel(module_combo, i18n("&Module:"), this);
module_label->setFixedSize(module_label->sizeHint());
grid->addWidget(module_label, 1, 0, AlignLeft | AlignVCenter);
branch_edit = new QLineEdit(this);
branch_edit->setMinimumSize(branch_edit->sizeHint());
grid->addWidget(branch_edit, 2, 1);
QLabel *branch_label = new QLabel(branch_edit, i18n("&Branch Tag:"), this);
branch_label->setFixedSize(branch_label->sizeHint());
grid->addWidget(branch_label, 2, 0, AlignLeft | AlignVCenter);
resume_row = 3;
}
workdir_edit = new KLineEdit(this);
......@@ -102,53 +113,53 @@ CheckoutDialog::CheckoutDialog(ActionType action, QWidget *parent, const char *n
QPushButton *dir_button = new QPushButton("...", this);
connect( dir_button, SIGNAL(clicked()),
this, SLOT(dirButtonClicked()) );
dir_button->setFixedHeight(workdir_edit->sizeHint().height());
dir_button->setFixedWidth(30);
QBoxLayout *workdir_layout = new QHBoxLayout();
grid->addLayout(workdir_layout, 2, 1);
workdir_layout->addWidget(workdir_edit, 10);
workdir_layout->addWidget(dir_button, 0, AlignVCenter);
QLabel *workdir_label = new QLabel
(workdir_edit, i18n("Working &directory:"), this);
workdir_label->setFixedSize(workdir_label->sizeHint());
grid->addWidget(workdir_label, 2, 0, AlignLeft | AlignVCenter);
if (action == Import)
{
vendortag_edit = new KLineEdit(this);
vendortag_edit->setMinimumSize(vendortag_edit->sizeHint());
grid->addWidget(vendortag_edit, 3, 1);
QLabel *vendortag_label = new QLabel
(vendortag_edit, i18n("&Vendor Tag:"), this);
vendortag_label->setFixedSize(vendortag_label->sizeHint());
grid->addWidget(vendortag_label, 3, 0, AlignLeft | AlignVCenter);
releasetag_edit = new KLineEdit(this);
releasetag_edit->setMinimumSize(releasetag_edit->sizeHint());
grid->addWidget(releasetag_edit, 4, 1);
QLabel *releasetag_label = new QLabel
(releasetag_edit, i18n("&Release Tag:"), this);
releasetag_label->setFixedSize(releasetag_label->sizeHint());
grid->addWidget(releasetag_label, 4, 0, AlignLeft | AlignVCenter);
ignore_edit = new KLineEdit(this);
ignore_edit->setMinimumSize(ignore_edit->sizeHint());
grid->addWidget(ignore_edit, 5, 1);
QLabel *ignore_label = new QLabel
(ignore_edit, i18n("&Ignore files:"), this);
ignore_label->setFixedSize(ignore_label->sizeHint());
grid->addWidget(ignore_label, 5, 0, AlignLeft | AlignVCenter);
binary_box = new QCheckBox(i18n("Import as &binaries"), this);
binary_box->setMinimumSize(binary_box->sizeHint());
grid->addMultiCellWidget(binary_box, 6, 6, 0, 1);
}
dir_button->setFixedHeight(workdir_edit->sizeHint().height());
dir_button->setFixedWidth(30);
QBoxLayout *workdir_layout = new QHBoxLayout();
grid->addLayout(workdir_layout, resume_row, 1);
workdir_layout->addWidget(workdir_edit, 10);
workdir_layout->addWidget(dir_button, 0, AlignVCenter);
QLabel *workdir_label = new QLabel
(workdir_edit, i18n("Working &directory:"), this);
workdir_label->setFixedSize(workdir_label->sizeHint());
grid->addWidget(workdir_label, resume_row, 0, AlignLeft | AlignVCenter);
if (action == Import)
{
vendortag_edit = new QLineEdit(this);
vendortag_edit->setMinimumSize(vendortag_edit->sizeHint());
grid->addWidget(vendortag_edit, resume_row + 1, 1);
QLabel *vendortag_label = new QLabel
(vendortag_edit, i18n("&Vendor Tag:"), this);
vendortag_label->setFixedSize(vendortag_label->sizeHint());
grid->addWidget(vendortag_label, resume_row + 1, 0, AlignLeft | AlignVCenter);
releasetag_edit = new QLineEdit(this);
releasetag_edit->setMinimumSize(releasetag_edit->sizeHint());
grid->addWidget(releasetag_edit, resume_row + 2, 1);
QLabel *releasetag_label = new QLabel
(releasetag_edit, i18n("&Release Tag:"), this);
releasetag_label->setFixedSize(releasetag_label->sizeHint());
grid->addWidget(releasetag_label, resume_row + 2, 0, AlignLeft | AlignVCenter);
ignore_edit = new QLineEdit(this);
ignore_edit->setMinimumSize(ignore_edit->sizeHint());
grid->addWidget(ignore_edit, resume_row + 3, 1);
QLabel *ignore_label = new QLabel
(ignore_edit, i18n("&Ignore files:"), this);
ignore_label->setFixedSize(ignore_label->sizeHint());
grid->addWidget(ignore_label, resume_row + 3, 0, AlignLeft | AlignVCenter);
binary_box = new QCheckBox(i18n("Import as &binaries"), this);
binary_box->setMinimumSize(binary_box->sizeHint());
grid->addMultiCellWidget(binary_box, resume_row + 4, 6, 0, 1);
}
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
......
......@@ -36,6 +36,8 @@ public:
{ return repo_combo->currentText(); }
QString module() const
{ return act==Import? module_edit->text() : module_combo->currentText(); }
QString branch() const
{ return branch_edit->text(); }
QString vendorTag() const
{ return vendortag_edit->text(); }
QString releaseTag() const
......@@ -59,6 +61,7 @@ private:
struct Options {
QString repo;
QString module;
QString branch;
QString workdir;
QString vendortag;
QString releasetag;
......@@ -68,8 +71,9 @@ private:
static Options *options;
QComboBox *repo_combo, *module_combo;
KLineEdit *module_edit, *workdir_edit;
KLineEdit *vendortag_edit, *releasetag_edit, *ignore_edit;
QLineEdit *module_edit, *workdir_edit;
QLineEdit *branch_edit;
QLineEdit *vendortag_edit, *releasetag_edit, *ignore_edit;
QCheckBox *binary_box;
QPushButton *ok_button, *cancel_button;
ActionType act;
......
......@@ -454,7 +454,9 @@ void UpdateViewItem::applyFilter(UpdateView::Filter filter)
if ((filter & UpdateView::NoUpToDate) && (m_status == UpdateView::UpToDate))
hide = true;
if ((filter & UpdateView::NoRemoved) && (m_status == UpdateView::Removed))
hide = true;
hide = true;
if ((filter & UpdateView::NoNotInCVS) && (m_status == UpdateView::NotInCVS))
hide = true;
setVisible(!hide);
}
......
......@@ -25,11 +25,12 @@ class UpdateView : public ListView
public:
enum Status { LocallyModified, LocallyAdded, LocallyRemoved,
NeedsUpdate, NeedsPatch, NeedsMerge,
UpToDate, Conflict,
Updated, Patched, Removed,
NeedsUpdate, NeedsPatch, NeedsMerge,
UpToDate, Conflict,
Updated, Patched, Removed,
NotInCVS, Unknown };
enum Filter { NoFilter=0, OnlyDirectories=1, NoUpToDate=2, NoRemoved=4 };
enum Filter { NoFilter=0, OnlyDirectories=1, NoUpToDate=2,
NoRemoved=4, NoNotInCVS=8 };
enum Action { Add, Remove, Update, UpdateNoAct, Commit };
UpdateView( QWidget *parent=0, const char *name=0 );
......
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