diff --git a/plugins/codeutils/Messages.sh b/plugins/codeutils/Messages.sh new file mode 100644 index 0000000000..8b49b0bfff --- /dev/null +++ b/plugins/codeutils/Messages.sh @@ -0,0 +1,4 @@ +#!/bin/sh +$EXTRACTRC `find . -name \*.rc` `find . -name \*.ui` >> rc.cpp +$XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h` -o $podir/kdevcodeutils.pot +rm -f rc.cpp diff --git a/plugins/openwith/Messages.sh b/plugins/openwith/Messages.sh new file mode 100644 index 0000000000..6cd4cd8f40 --- /dev/null +++ b/plugins/openwith/Messages.sh @@ -0,0 +1,4 @@ +#!/bin/sh +#$EXTRACTRC `find . -name \*.rc` `find . -name \*.ui` >> rc.cpp +$XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h` -o $podir/kdevopenwith.pot +#rm -f rc.cpp diff --git a/plugins/pastebin/Messages.sh b/plugins/pastebin/Messages.sh new file mode 100644 index 0000000000..b78095d284 --- /dev/null +++ b/plugins/pastebin/Messages.sh @@ -0,0 +1,4 @@ +#!/bin/sh +#$EXTRACTRC `find . -name \*.rc` `find . -name \*.ui` >> rc.cpp +$XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h` -o $podir/kdevpastebin.pot +#rm -f rc.cpp diff --git a/plugins/reviewboard/Messages.sh b/plugins/reviewboard/Messages.sh new file mode 100644 index 0000000000..35d08738ee --- /dev/null +++ b/plugins/reviewboard/Messages.sh @@ -0,0 +1,4 @@ +#!/bin/sh +$EXTRACTRC `find . -name \*.rc` `find . -name \*.ui` >> rc.cpp +$XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h` -o $podir/kdevreviewboard.pot +rm -f rc.cpp diff --git a/shell/openprojectdialog.cpp b/shell/openprojectdialog.cpp index 19e3de9483..b2d2ecccc5 100644 --- a/shell/openprojectdialog.cpp +++ b/shell/openprojectdialog.cpp @@ -1,255 +1,255 @@ /*************************************************************************** * Copyright (C) 2008 by Andreas Pakulat #include #include #include #include #include #include #include #include #include #include #include "core.h" #include "uicontroller.h" #include "mainwindow.h" #include "shellextension.h" #include "projectsourcepage.h" #include namespace KDevelop { OpenProjectDialog::OpenProjectDialog( bool fetch, const KUrl& startUrl, QWidget* parent ) : KAssistantDialog( parent ) { resize(QSize(700, 500)); KUrl start = startUrl.isValid() ? startUrl : Core::self()->projectController()->projectsBaseDirectory(); start.adjustPath(KUrl::AddTrailingSlash); sourcePageWidget = new ProjectSourcePage( start, this ); connect( sourcePageWidget, SIGNAL( isCorrect(bool) ), this, SLOT( validateSourcePage(bool) ) ); - sourcePage = addPage( sourcePageWidget, "Select the source" ); + sourcePage = addPage( sourcePageWidget, i18n("Select the source") ); openPageWidget = new OpenProjectPage( start, this ); connect( openPageWidget, SIGNAL( urlSelected( const KUrl& ) ), this, SLOT( validateOpenUrl( const KUrl& ) ) ); - openPage = addPage( openPageWidget, "Select the project" ); + openPage = addPage( openPageWidget, i18n("Select the project") ); QWidget* page = new ProjectInfoPage( this ); connect( page, SIGNAL( projectNameChanged( const QString& ) ), this, SLOT( validateProjectName( const QString& ) ) ); connect( page, SIGNAL( projectManagerChanged( const QString& ) ), this, SLOT( validateProjectManager( const QString& ) ) ); - projectInfoPage = addPage( page, "Project information" ); + projectInfoPage = addPage( page, i18n("Project information") ); setValid( sourcePage, true ); setValid( openPage, false ); setValid( projectInfoPage, false); setAppropriate( projectInfoPage, false ); showButton( KDialog::Help, false ); setCurrentPage( fetch ? sourcePage : openPage ); } void OpenProjectDialog::validateSourcePage(bool valid) { setValid(sourcePage, valid); openPageWidget->setUrl(sourcePageWidget->workingDir()); } void OpenProjectDialog::validateOpenUrl( const KUrl& url ) { bool isDir = false; QString extension; bool isValid = false; if( url.isLocalFile() ) { QFileInfo info( url.toLocalFile() ); isValid = info.exists(); if ( isValid ) { isDir = info.isDir(); extension = info.suffix(); } } else { KIO::StatJob* statJob = KIO::stat( url, KIO::HideProgressInfo ); statJob->ui()->setWindow( Core::self()->uiControllerInternal()->defaultMainWindow() ); isValid = statJob->exec(); // TODO: do this asynchronously so that the user isn't blocked while typing every letter of the hostname in sftp://hostname if ( isValid ) { KIO::UDSEntry entry = statJob->statResult(); isDir = entry.isDir(); extension = QFileInfo( entry.stringValue( KIO::UDSEntry::UDS_NAME ) ).suffix(); } } QString msgTemplate; if ( layoutDirection() == Qt::LeftToRight ) { msgTemplate = QString( "" "" "" "" "" "
%1%2
" ); } else { msgTemplate = QString( "" "" "" "" "" "
%2%1
" ); } if ( isValid ) { // reset header openPage->setHeader( msgTemplate .arg(openPage->name()) .arg("" + i18n("open %1 as project", url.fileName()) + "") ); } else { // report error KColorScheme scheme(palette().currentColorGroup()); const QString errorMsg = i18n("Selected URL is invalid."); openPage->setHeader( msgTemplate .arg(openPage->name()) .arg(QString("%2") .arg(scheme.foreground(KColorScheme::NegativeText).color().name()) .arg(errorMsg) ) ); setAppropriate( projectInfoPage, false ); setAppropriate( openPage, true ); setValid( openPage, false ); return; } if( isDir || extension != ShellExtension::getInstance()->projectFileExtension() ) { setAppropriate( projectInfoPage, true ); m_url = url; if( !isDir ) { m_url = m_url.upUrl(); } ProjectInfoPage* page = qobject_cast( projectInfoPage->widget() ); if( page ) { page->setProjectName( m_url.fileName() ); OpenProjectPage* page2 = qobject_cast( openPage->widget() ); if( page2 ) { // Default manager page->setProjectManager( "Generic Project Manager" ); // clear the filelist m_fileList.clear(); if( isDir ) { // If a dir was selected fetch all files in it KIO::ListJob* job = KIO::listDir( m_url ); connect( job, SIGNAL(entries(KIO::Job*, const KIO::UDSEntryList&)), SLOT(storeFileList(KIO::Job*, const KIO::UDSEntryList&))); KIO::NetAccess::synchronousRun( job, Core::self()->uiController()->activeMainWindow() ); } else { // Else we'lll just take the given file m_fileList << url.fileName(); } // Now find a manager for the file(s) in our filelist. bool managerFound = false; foreach( const QString& manager, page2->projectFilters().keys() ) { foreach( const QString& filterexp, page2->projectFilters()[manager] ) { if( !m_fileList.filter( QRegExp( filterexp, Qt::CaseSensitive, QRegExp::Wildcard ) ).isEmpty() ) { managerFound = true; break; } } if( managerFound ) { page->setProjectManager( manager ); break; } } } } m_url.addPath( m_url.fileName()+'.'+ShellExtension::getInstance()->projectFileExtension() ); } else { setAppropriate( projectInfoPage, false ); m_url = url; } validateProjectInfo(); setValid( openPage, true ); } void OpenProjectDialog::validateProjectName( const QString& name ) { m_projectName = name; validateProjectInfo(); } void OpenProjectDialog::validateProjectInfo() { setValid( projectInfoPage, (!projectName().isEmpty() && !projectManager().isEmpty()) ); } void OpenProjectDialog::validateProjectManager( const QString& manager ) { m_projectManager = manager; validateProjectInfo(); } KUrl OpenProjectDialog::projectFileUrl() { return m_url; } QString OpenProjectDialog::projectName() { return m_projectName; } QString OpenProjectDialog::projectManager() { return m_projectManager; } void OpenProjectDialog::storeFileList(KIO::Job*, const KIO::UDSEntryList& list) { foreach( const KIO::UDSEntry& entry, list ) { QString name = entry.stringValue( KIO::UDSEntry::UDS_NAME ); if( name != "." && name != ".." && !entry.isDir() ) { m_fileList << name; } } } } #include "openprojectdialog.moc"