From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- vcs/subversion/integrator/Makefile.am | 14 ++ .../integrator/kdevsubversionintegrator.desktop | 45 +++++ vcs/subversion/integrator/subversionintegrator.cpp | 54 ++++++ vcs/subversion/integrator/subversionintegrator.h | 39 +++++ vcs/subversion/integrator/svnintegratordlg.cpp | 122 +++++++++++++ vcs/subversion/integrator/svnintegratordlg.h | 39 +++++ vcs/subversion/integrator/svnintegratordlgbase.ui | 190 +++++++++++++++++++++ 7 files changed, 503 insertions(+) create mode 100644 vcs/subversion/integrator/Makefile.am create mode 100644 vcs/subversion/integrator/kdevsubversionintegrator.desktop create mode 100644 vcs/subversion/integrator/subversionintegrator.cpp create mode 100644 vcs/subversion/integrator/subversionintegrator.h create mode 100644 vcs/subversion/integrator/svnintegratordlg.cpp create mode 100644 vcs/subversion/integrator/svnintegratordlg.h create mode 100644 vcs/subversion/integrator/svnintegratordlgbase.ui (limited to 'vcs/subversion/integrator') diff --git a/vcs/subversion/integrator/Makefile.am b/vcs/subversion/integrator/Makefile.am new file mode 100644 index 00000000..a0fe82cd --- /dev/null +++ b/vcs/subversion/integrator/Makefile.am @@ -0,0 +1,14 @@ +INCLUDES = -I$(top_srcdir)/lib/interfaces \ + -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/extras -I$(top_srcdir)/lib/util \ + $(all_includes) +METASOURCES = AUTO + +kde_module_LTLIBRARIES = libsubversionintegrator.la +libsubversionintegrator_la_LDFLAGS = -avoid-version -no-undefined $(all_libraries) +libsubversionintegrator_la_LIBADD =\ + $(top_builddir)/lib/interfaces/extras/libkdevextras.la\ + $(top_builddir)/lib/libkdevelop.la +kde_services_DATA = kdevsubversionintegrator.desktop +noinst_HEADERS = subversionintegrator.h svnintegratordlg.h +libsubversionintegrator_la_SOURCES = subversionintegrator.cpp \ + svnintegratordlgbase.ui svnintegratordlg.cpp diff --git a/vcs/subversion/integrator/kdevsubversionintegrator.desktop b/vcs/subversion/integrator/kdevsubversionintegrator.desktop new file mode 100644 index 00000000..4b3a1c1c --- /dev/null +++ b/vcs/subversion/integrator/kdevsubversionintegrator.desktop @@ -0,0 +1,45 @@ +[Desktop Entry] +Type=Service +Name=KDevSubversionIntegrator +Name[da]=KDevelop Subversion-integration +Name[nds]=KDevelop-Subversion-Integreren +Name[sk]=KDev Subversion integrácia +Name[sv]=KDevelop Subversion-integration +Name[zh_TW]=KDevelop Subversion 整合器 +Comment=Subversion Project Integration Facility +Comment[ca]=Facilitat per a la integració amb Subversion +Comment[da]=Subversion projektintegration +Comment[de]=Subversion-Projektintegration +Comment[el]=Λειτουργία ενσωμάτωσης Subversion στο έργο +Comment[es]=Facilidad para integración con proyectos que utilicen Subversion +Comment[et]=Subversion projekti põimimisvahend +Comment[eu]=Subversion proiektuen integrazio-tesna +Comment[fa]=تسهیلات مجتمع‌سازی پروژۀ زیرنسخه +Comment[fr]=Fonction d'intégration pour un projet utilisant Subversion +Comment[gl]=Utilidade para a integración de proxectos Subversión +Comment[hu]=Projektintegrálást tesz lehetővé a Subversion-nel +Comment[it]=Funzione di integrazione del progetto Subversion +Comment[ja]=Subversion プロジェクト統合ツール +Comment[ms]=Kemudahan Integrasi Projek Subversion +Comment[nds]=Subversion-Projektintegreren +Comment[ne]=सबभर्सन परियोजना एकिकरण सुविधा +Comment[nl]=Subversion project-integratie +Comment[pl]=Integracja z Subversion +Comment[pt]=Integração com Projectos Subversion +Comment[pt_BR]=Facilidade de Integração ao Projeto de Subversão +Comment[ru]=Интеграция Subversion +Comment[sk]=Subversion projektová integrácia +Comment[sr]=Интеграција Subversion-а у пројекат +Comment[sr@Latn]=Integracija Subversion-a u projekat +Comment[sv]=Funktion för integrering av Subversion i projekt +Comment[tr]=Subversion Proje Bütünleştirme Aracı +Comment[zh_CN]=Subversion 工程集成功能 +Comment[zh_TW]=Subversion 專案整合工具 +Icon=misc +Exec=blubb +ServiceTypes=KDevelop/VCSIntegrator +X-KDE-Library=libsubversionintegrator +X-KDevelop-Default=false +X-KDevelop-VCS=Subversion +X-KDevelop-VCSPlugin=kdevsubversion +X-KDevelop-Version=5 diff --git a/vcs/subversion/integrator/subversionintegrator.cpp b/vcs/subversion/integrator/subversionintegrator.cpp new file mode 100644 index 00000000..65bf1a78 --- /dev/null +++ b/vcs/subversion/integrator/subversionintegrator.cpp @@ -0,0 +1,54 @@ +/*************************************************************************** + * Copyright (C) 2004 by Alexander Dymo * + * adymo@kdevelop.org * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "subversionintegrator.h" + +#include +#include + +#include "svnintegratordlg.h" + +static const KDevPluginInfo data("kdevsubversionintegrator"); +typedef KDevGenericFactory SubversionIntegratorFactory; +K_EXPORT_COMPONENT_FACTORY( libsubversionintegrator, SubversionIntegratorFactory(data) ) + +SubversionIntegrator::SubversionIntegrator(QObject* parent, const char* name, + const QStringList // args + ) + :KDevVCSIntegrator(parent, name) +{ +} + +SubversionIntegrator::~SubversionIntegrator() +{ +} + +VCSDialog* SubversionIntegrator::fetcher(QWidget* // parent + ) +{ + return 0; +} + +VCSDialog* SubversionIntegrator::integrator(QWidget* parent) +{ + SvnIntegratorDlg *dlg = new SvnIntegratorDlg(parent); + return dlg; +} + +#include "subversionintegrator.moc" diff --git a/vcs/subversion/integrator/subversionintegrator.h b/vcs/subversion/integrator/subversionintegrator.h new file mode 100644 index 00000000..e58c7786 --- /dev/null +++ b/vcs/subversion/integrator/subversionintegrator.h @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2004 by Alexander Dymo * + * adymo@kdevelop.org * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SUBVERSIONINTEGRATOR_H +#define SUBVERSIONINTEGRATOR_H + +#include + +#include + +class SubversionIntegrator : public KDevVCSIntegrator +{ +Q_OBJECT +public: + SubversionIntegrator(QObject* parent, const char* name, const QStringList args = QStringList()); + ~SubversionIntegrator(); + + virtual VCSDialog* fetcher(QWidget* parent); + virtual VCSDialog* integrator(QWidget* parent); + +}; + +#endif diff --git a/vcs/subversion/integrator/svnintegratordlg.cpp b/vcs/subversion/integrator/svnintegratordlg.cpp new file mode 100644 index 00000000..9d271a90 --- /dev/null +++ b/vcs/subversion/integrator/svnintegratordlg.cpp @@ -0,0 +1,122 @@ +/*************************************************************************** + * Copyright (C) 2004 by Alexander Dymo * + * adymo@kdevelop.org * + * Copyright (C) 2004 * + * Mickael Marchand * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "svnintegratordlg.h" +#include "blockingkprocess.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace KIO; + +SvnIntegratorDlg::SvnIntegratorDlg( QWidget *parent, const char *name ) + : SvnIntegratorDlgBase( parent, name ) +{ + repos1->setMode( KFile::Directory ); +} + +void SvnIntegratorDlg::accept() +{ + // to let ioslave know which protocol it should start. + KURL protocolUrl = KURL("kdevsvn+svn://blah/"); + KURL servURL( repos1->url() ); + if ( servURL.isEmpty() ) return; + + kdDebug( 9036 ) << "servURL : " << servURL.prettyURL() << endl; + if ( createProject->isChecked() ) + { + KURL::List list; + list << servURL; // project root directory + KURL miscURL = servURL.url(); + miscURL.setPath( servURL.path() + "/tags/" ); + list << miscURL; + miscURL.setPath( servURL.path() + "/branches/" ); + list << miscURL; + miscURL.setPath( servURL.path() + "/trunk/" ); + list << miscURL; + + QByteArray parms; + QDataStream s( parms, IO_WriteOnly ); + int cmd = 10; // MKDIR(list) + s << cmd << list; + KIO::SimpleJob* job = KIO::special( protocolUrl, parms, true ); + if( !NetAccess::synchronousRun( job, 0 ) ){ + KMessageBox::error( this, i18n("Unable to create project directories on repository") ); + return; + } + + QByteArray parms2; + QDataStream s2( parms2, IO_WriteOnly ); + cmd = 5; //IMPORT + servURL.setPath( servURL.path() + "/trunk/" ); + s2 << cmd << servURL << KURL::fromPathOrURL( m_projectLocation ); + KIO::SimpleJob* importJob = KIO::special( protocolUrl, parms2, true ); + if( !NetAccess::synchronousRun( importJob, 0 ) ){ + KMessageBox::error( this, i18n("Unable to import into repository.") ); + return; + } + } + //delete the template directory and checkout a fresh one from the server + BlockingKProcess *rmproc = new BlockingKProcess(); + *rmproc << "rm"; + *rmproc << "-f" << "-r" << m_projectLocation; + rmproc->start(); + + delete rmproc; + rmproc = NULL; + + QByteArray parms3; + QDataStream s3( parms3, IO_WriteOnly ); + int cmd2 = 1; //CHECKOUT + int rev = -1; + + s3 << cmd2 << servURL << KURL::fromPathOrURL( m_projectLocation ) << rev << QString( "HEAD" ); + SimpleJob *job2 = KIO::special( protocolUrl, parms3, true ); + if( ! NetAccess::synchronousRun( job2, 0 ) ){ + // Checkout failed + KMessageBox::error(this, i18n("Unable to checkout from repository.") ); + return; + } +} + +void SvnIntegratorDlg::init( const QString &projectName, const QString &projectLocation ) +{ + m_name = projectName; + m_projectLocation = projectLocation; +} + +QWidget *SvnIntegratorDlg::self() +{ + return const_cast( this ); +} + +#include "svnintegratordlg.moc" diff --git a/vcs/subversion/integrator/svnintegratordlg.h b/vcs/subversion/integrator/svnintegratordlg.h new file mode 100644 index 00000000..c68ee256 --- /dev/null +++ b/vcs/subversion/integrator/svnintegratordlg.h @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2004 by Alexander Dymo * + * adymo@kdevelop.org * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SVNINTEGRATORDLG_H +#define SVNINTEGRATORDLG_H + +#include "svnintegratordlgbase.h" +#include + +class SvnIntegratorDlg: public SvnIntegratorDlgBase, public VCSDialog { +Q_OBJECT +public: + SvnIntegratorDlg(QWidget *parent = 0, const char *name = 0); + + virtual void accept(); + virtual void init(const QString &projectName, const QString &projectLocation); + virtual QWidget *self(); +private: + QString m_name; + QString m_projectLocation; +}; + +#endif diff --git a/vcs/subversion/integrator/svnintegratordlgbase.ui b/vcs/subversion/integrator/svnintegratordlgbase.ui new file mode 100644 index 00000000..a2ec9982 --- /dev/null +++ b/vcs/subversion/integrator/svnintegratordlgbase.ui @@ -0,0 +1,190 @@ + +SvnIntegratorDlgBase + + + SvnIntegratorDlgBase + + + + 0 + 0 + 648 + 429 + + + + + unnamed + + + 0 + + + + buttonGroup1 + + + + 7 + 7 + 0 + 0 + + + + NoFrame + + + Sunken + + + + + + + unnamed + + + 0 + + + + doNothing + + + &Do not do anything + + + true + + + Adds subversion menus to project. + +NOTE: Unless you import the project +out of kdevelop, you will not be able +to perform any subversion operations. + + + Adds subversion menus to project. + +NOTE: Unless you import the project +out of kdevelop, you will not be able +to perform any subversion operations. + + + + + createProject + + + &Create a project tree and import new project into trunk, then checkout from the repository + + + Creates project, imports it into the subversion +repository and checks it out as a working copy. + +NOTE: The repository has to exist. +e.g. has been created with 'svnadmin' + + + Creates project, imports it into the subversion +repository and checks it out as a working copy. + +NOTE: The repository has to exist. +e.g. has been created with 'svnadmin' + + + + + textLabel1 + + + Example for the url (if /home/user/subversion is the subversion repository): +file:///home/user/subversion/mynewproject + + + + + layout5 + + + + unnamed + + + + repositoryLabel1 + + + false + + + Repository: + + + + + repos1 + + + false + + + Subversion repository location. +The repository has to exist - +e.g. has been created with 'svnadmin' + + + Subversion repository location. This should include the subdirectory for the project in the repository. The project subdirectory and further subdirectories will be created. + +So for example if you give http://localhost/svn/projectname the following directories will be created and the project imported into the trunk subdirectory: +http://localhost/svn/projectname +http://localhost/svn/projectname/tags +http://localhost/svn/projectname/branches +http://localhost/svn/projectname/trunk + + + + + + + spacer9 + + + Vertical + + + Expanding + + + + 21 + 131 + + + + + + + + + + createProject + toggled(bool) + repositoryLabel1 + setEnabled(bool) + + + createProject + toggled(bool) + repos1 + setEnabled(bool) + + + + + kurlrequester.h + klineedit.h + kpushbutton.h + + -- cgit v1.2.1