diff --git a/src/svnfrontend/fronthelpers/rangeinput.ui b/src/svnfrontend/fronthelpers/rangeinput.ui
index bccf3652..dad117cd 100644
--- a/src/svnfrontend/fronthelpers/rangeinput.ui
+++ b/src/svnfrontend/fronthelpers/rangeinput.ui
@@ -1,319 +1,305 @@
RangeInput
-
-
- 0
- 0
- 517
- 398
-
-
-
-
- 517
- 0
-
-
Revisions
-
Start with revision
false
-
-
-
-
-
- N&umber
+
-
+
+
+ Select current working copy changes
-
- true
+
+ WORKING
+ -
+
+
-
0
0
- -
+
-
Date
- -
-
-
- -
-
+
-
+
- S&TART
+ N&umber
+
+
+ true
-
HEAD
- -
-
-
- Select current working copy changes
-
+
-
+
- WORKING
+ S&TART
-
Stop with revision
-
-
Number
true
-
0
0
- -
-
-
- Date
-
-
-
-
-
-
- -
-
-
-
START
-
HEAD
- -
+
-
+
+
+ -
+
+
+ Date
+
+
+
+
+
+
+ -
Select current working copy changes
WORKING
-
Qt::Vertical
20
- 40
+ 0
m_stopNumberButton
m_endRevInput
m_stopStartButton
m_stopHeadButton
m_startNumberButton
toggled(bool)
RangeInput
startNumberToggled(bool)
20
20
20
20
m_startHeadButton
toggled(bool)
RangeInput
startHeadToggled(bool)
20
20
20
20
m_startStartButton
toggled(bool)
RangeInput
startBaseToggled(bool)
20
20
20
20
m_stopStartButton
toggled(bool)
RangeInput
stopBaseToggled(bool)
20
20
20
20
m_stopHeadButton
toggled(bool)
RangeInput
stopHeadToggled(bool)
20
20
20
20
m_stopNumberButton
toggled(bool)
RangeInput
stopNumberToggled(bool)
20
20
20
20
m_stopDateButton
toggled(bool)
RangeInput
stopDateToggled(bool)
20
20
20
20
m_startDateButton
toggled(bool)
RangeInput
startDateToggled(bool)
20
20
20
20
diff --git a/src/svnfrontend/fronthelpers/rangeinput_impl.cpp b/src/svnfrontend/fronthelpers/rangeinput_impl.cpp
index e2491d3f..7fbacebd 100644
--- a/src/svnfrontend/fronthelpers/rangeinput_impl.cpp
+++ b/src/svnfrontend/fronthelpers/rangeinput_impl.cpp
@@ -1,201 +1,214 @@
/***************************************************************************
* Copyright (C) 2005-2009 by Rajko Albrecht *
* ral@alwins-world.de *
* *
* 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. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "rangeinput_impl.h"
#include
#include
Rangeinput_impl::Rangeinput_impl(QWidget *parent)
: QWidget(parent)
, m_StartOnly(false)
{
setupUi(this);
m_startRevInput->setRange(0, INT_MAX);
m_startRevInput->setSingleStep(1);
m_startRevInput->setValue(1);
m_endRevInput->setRange(0, INT_MAX);
m_endRevInput->setSingleStep(1);
m_endRevInput->setValue(1);
m_startDateInput->setDateTime(QDateTime::currentDateTime());
m_stopDateInput->setDateTime(QDateTime::currentDateTime());
m_stopDateInput->setEnabled(false);
m_startDateInput->setEnabled(false);
m_stopHeadButton->setChecked(true);
-}
-
-Rangeinput_impl::~Rangeinput_impl()
-{
-}
-bool Rangeinput_impl::getRevisionRange(revision_range &range, bool bWithWorking, bool bStartOnly, QWidget *parent)
+ const int minHeight = qMax(m_startRevInput->height(), m_startDateInput->height());
+ m_startNumberButton->setMinimumHeight(minHeight);
+ m_startDateButton->setMinimumHeight(minHeight);
+ m_startStartButton->setMinimumHeight(minHeight);
+ m_startHeadButton->setMinimumHeight(minHeight);
+ m_startWorkingButton->setMinimumHeight(minHeight);
+ m_stopNumberButton->setMinimumHeight(minHeight);
+ m_stopDateButton->setMinimumHeight(minHeight);
+ m_stopStartButton->setMinimumHeight(minHeight);
+ m_stopHeadButton->setMinimumHeight(minHeight);
+ m_stopWorkingButton->setMinimumHeight(minHeight);
+}
+
+bool Rangeinput_impl::getRevisionRange(revision_range &range,
+ bool bWithWorking,
+ bool bStartOnly,
+ const svn::Revision &preset,
+ QWidget *parent)
{
QPointer dlg(new KSvnSimpleOkDialog(QStringLiteral("revisions_dlg"), parent));
dlg->setWindowTitle(i18nc("@title:window", "Select Revisions"));
dlg->setWithCancelButton();
Rangeinput_impl *rdlg(new Rangeinput_impl(dlg));
rdlg->setNoWorking(!bWithWorking);
rdlg->setStartOnly(bStartOnly);
+ rdlg->m_startRevInput->setValue(preset.revnum());
dlg->addWidget(rdlg);
if (dlg->exec() == QDialog::Accepted) {
range = rdlg->getRange();
delete dlg;
return true;
}
delete dlg;
return false;
}
void Rangeinput_impl::startNumberToggled(bool how)
{
m_startRevInput->setEnabled(how);
if (how) {
m_startDateInput->setEnabled(!how);
}
}
void Rangeinput_impl::startBaseToggled(bool how)
{
if (how) {
m_startRevInput->setEnabled(!how);
m_startDateInput->setEnabled(!how);
}
}
void Rangeinput_impl::startHeadToggled(bool how)
{
if (how) {
m_startRevInput->setEnabled(!how);
m_startDateInput->setEnabled(!how);
}
}
void Rangeinput_impl::setNoWorking(bool aValue)
{
if (!aValue) {
if (m_startWorkingButton->isChecked()) {
m_startHeadButton->setChecked(false);
}
if (m_stopWorkingButton->isChecked()) {
m_stopHeadButton->setChecked(false);
}
}
m_startWorkingButton->setEnabled(!aValue);
m_stopWorkingButton->setEnabled(!aValue);
}
void Rangeinput_impl::onHelp()
{
}
void Rangeinput_impl::stopHeadToggled(bool how)
{
if (how) {
m_endRevInput->setEnabled(!how);
m_stopDateInput->setEnabled(!how);
}
}
void Rangeinput_impl::stopBaseToggled(bool how)
{
if (how) {
m_endRevInput->setEnabled(!how);
m_stopDateInput->setEnabled(!how);
}
}
void Rangeinput_impl::stopNumberToggled(bool how)
{
m_endRevInput->setEnabled(how);
if (how) {
m_stopDateInput->setEnabled(!how);
}
}
Rangeinput_impl::revision_range Rangeinput_impl::getRange() const
{
revision_range ret;
if (m_startStartButton->isChecked()) {
ret.first = svn::Revision::START;
} else if (m_startHeadButton->isChecked()) {
ret.first = svn::Revision::HEAD;
} else if (m_startNumberButton->isChecked()) {
ret.first = m_startRevInput->value();
} else if (m_startDateButton->isChecked()) {
ret.first = m_startDateInput->dateTime();
} else if (m_startWorkingButton->isChecked()) {
ret.first = svn::Revision::WORKING;
}
if (m_stopStartButton->isChecked()) {
ret.second = svn::Revision::START;
} else if (m_stopHeadButton->isChecked()) {
ret.second = svn::Revision::HEAD;
} else if (m_stopNumberButton->isChecked()) {
ret.second = m_endRevInput->value();
} else if (m_stopDateButton->isChecked()) {
ret.second = m_stopDateInput->dateTime();
} else if (m_stopWorkingButton->isChecked()) {
ret.second = svn::Revision::WORKING;
}
return ret;
}
void Rangeinput_impl::stopDateToggled(bool how)
{
m_stopDateInput->setEnabled(how);
if (how) {
m_endRevInput->setEnabled(!how);
}
}
void Rangeinput_impl::startDateToggled(bool how)
{
m_startDateInput->setEnabled(how);
if (how) {
m_startRevInput->setEnabled(!how);
}
}
bool Rangeinput_impl::StartOnly() const
{
return m_StartOnly;
}
void Rangeinput_impl::setHeadDefault()
{
m_stopHeadButton->setChecked(true);
m_startHeadButton->setChecked(true);
}
void Rangeinput_impl::setStartOnly(bool theValue)
{
m_StartOnly = theValue;
if (m_StartOnly) {
layout()->removeWidget(m_stopRevBox);
m_stopRevBox->hide();
m_startRevBox->setTitle(i18n("Select revision"));
} else {
layout()->addWidget(m_stopRevBox);
m_stopRevBox->show();
m_startRevBox->setTitle(i18n("Start with revision"));
}
updateGeometry();
setMinimumSize(minimumSizeHint());
resize(QSize(397, 272).expandedTo(minimumSizeHint()));
}
diff --git a/src/svnfrontend/fronthelpers/rangeinput_impl.h b/src/svnfrontend/fronthelpers/rangeinput_impl.h
index 104f8a21..6f607f4f 100644
--- a/src/svnfrontend/fronthelpers/rangeinput_impl.h
+++ b/src/svnfrontend/fronthelpers/rangeinput_impl.h
@@ -1,60 +1,63 @@
/***************************************************************************
* Copyright (C) 2005-2009 by Rajko Albrecht *
* ral@alwins-world.de *
* *
* 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. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef RANGEINPUT_IMPL_H
#define RANGEINPUT_IMPL_H
#include "ui_rangeinput.h"
#include "svnqt/revision.h"
-#include
+#include
-class Rangeinput_impl: public QWidget, public Ui::RangeInput
+class Rangeinput_impl final : public QWidget, public Ui::RangeInput
{
Q_OBJECT
public:
explicit Rangeinput_impl(QWidget *parent = nullptr);
- ~Rangeinput_impl();
typedef QPair revision_range;
- static bool getRevisionRange(revision_range &range, bool bWithWorking = true, bool bStartOnly = false, QWidget *parent = nullptr);
+ static bool getRevisionRange(revision_range &range,
+ bool bWithWorking = true,
+ bool bStartOnly = false,
+ const svn::Revision &preset = svn::Revision(),
+ QWidget *parent = nullptr);
revision_range getRange() const;
void setStartOnly(bool theValue);
void setNoWorking(bool aValue);
bool StartOnly() const;
void setHeadDefault();
protected slots:
- virtual void onHelp();
- virtual void stopHeadToggled(bool);
- virtual void stopBaseToggled(bool);
- virtual void stopNumberToggled(bool);
- virtual void startHeadToggled(bool);
- virtual void startBaseToggled(bool);
- virtual void startNumberToggled(bool);
- virtual void stopDateToggled(bool);
- virtual void startDateToggled(bool);
+ void onHelp();
+ void stopHeadToggled(bool);
+ void stopBaseToggled(bool);
+ void stopNumberToggled(bool);
+ void startHeadToggled(bool);
+ void startBaseToggled(bool);
+ void startNumberToggled(bool);
+ void stopDateToggled(bool);
+ void startDateToggled(bool);
protected:
bool m_StartOnly;
};
#endif
diff --git a/src/svnfrontend/fronthelpers/revisionbuttonimpl.cpp b/src/svnfrontend/fronthelpers/revisionbuttonimpl.cpp
index 92e4de04..f7dc4571 100644
--- a/src/svnfrontend/fronthelpers/revisionbuttonimpl.cpp
+++ b/src/svnfrontend/fronthelpers/revisionbuttonimpl.cpp
@@ -1,56 +1,49 @@
/***************************************************************************
* Copyright (C) 2005-2009 by Rajko Albrecht *
* ral@alwins-world.de *
* *
* 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. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "revisionbuttonimpl.h"
#include "svnfrontend/fronthelpers/rangeinput_impl.h"
#include "settings/kdesvnsettings.h"
-#include "ksvnwidgets/ksvndialog.h"
-
-#include
RevisionButtonImpl::RevisionButtonImpl(QWidget *parent)
: QWidget(parent),
m_Rev(svn::Revision::UNDEFINED), m_noWorking(false)
{
setupUi(this);
}
-RevisionButtonImpl::~RevisionButtonImpl()
-{
-}
-
void RevisionButtonImpl::setRevision(const svn::Revision &aRev)
{
m_Rev = aRev;
m_RevisionButton->setText(m_Rev.toString());
emit revisionChanged();
}
void RevisionButtonImpl::askRevision()
{
Rangeinput_impl::revision_range range;
- if (Rangeinput_impl::getRevisionRange(range, !m_noWorking, true)) {
+ if (Rangeinput_impl::getRevisionRange(range, !m_noWorking, true, m_Rev)) {
setRevision(range.first);
}
}
void RevisionButtonImpl::setNoWorking(bool how)
{
m_noWorking = how;
}
diff --git a/src/svnfrontend/fronthelpers/revisionbuttonimpl.h b/src/svnfrontend/fronthelpers/revisionbuttonimpl.h
index fee7c7d9..8188c74a 100644
--- a/src/svnfrontend/fronthelpers/revisionbuttonimpl.h
+++ b/src/svnfrontend/fronthelpers/revisionbuttonimpl.h
@@ -1,53 +1,48 @@
/***************************************************************************
* Copyright (C) 2005-2009 by Rajko Albrecht *
* ral@alwins-world.de *
* *
* 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. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#ifndef REVISIONBUTTONIMPL_H
#define REVISIONBUTTONIMPL_H
#include "ui_revisionbutton.h"
#include "svnqt/revision.h"
-class RevisionButtonImpl: public QWidget, public Ui::RevisionButton
+class RevisionButtonImpl final : public QWidget, public Ui::RevisionButton
{
Q_OBJECT
public:
explicit RevisionButtonImpl(QWidget *parent = nullptr);
- virtual ~RevisionButtonImpl();
- virtual void setRevision(const svn::Revision &aRev);
-
- virtual void setNoWorking(bool);
- const svn::Revision &revision()const
- {
- return m_Rev;
- }
+ void setRevision(const svn::Revision &aRev);
+ void setNoWorking(bool);
+ const svn::Revision &revision() const { return m_Rev; }
protected:
svn::Revision m_Rev;
bool m_noWorking;
public slots:
- virtual void askRevision();
+ void askRevision();
signals:
void revisionChanged();
};
#endif