From 819d27e5f48e582affbdb9d0d20fb393fdfa7969 Mon Sep 17 00:00:00 2001
From: Elvio Basello
Date: Wed, 14 May 2008 01:05:12 +0000
Subject: more work on addon manager (wip)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1775 17fca916-40b9-46aa-a4ea-0a15b648b75c
---
src/modules/addon/packaddondialog.cpp | 43 +++++++++++++++++++++++++++++++----
1 file changed, 38 insertions(+), 5 deletions(-)
(limited to 'src/modules/addon/packaddondialog.cpp')
diff --git a/src/modules/addon/packaddondialog.cpp b/src/modules/addon/packaddondialog.cpp
index 8c7a2a348..0fc7bb416 100644
--- a/src/modules/addon/packaddondialog.cpp
+++ b/src/modules/addon/packaddondialog.cpp
@@ -136,7 +136,9 @@ bool KviPackAddonDialog::packAddon()
QString szPackageVersion = m_pPackAddonInfoCreateWidget->packageVersion();
QString szPackageDescription = m_pPackAddonInfoCreateWidget->packageDescription();
QString szSourcePath = m_pPackAddonFileSelectionWidget->sourcePath();
+ QString szConfigPath = m_pPackAddonFileSelectionWidget->configPath();
QString szImagePath = m_pPackAddonFileSelectionWidget->imagePath();
+ QString szLocalePath = m_pPackAddonFileSelectionWidget->localePath();
QString szHelpPath = m_pPackAddonFileSelectionWidget->helpPath();
QString szSoundPath = m_pPackAddonFileSelectionWidget->soundPath();
QString szInstallPath = m_pPackAddonFileSelectionWidget->installerPath();
@@ -144,7 +146,9 @@ bool KviPackAddonDialog::packAddon()
// We need mandatory unix like path separator
szSourcePath.replace('\\',"/");
+ szConfigPath.replace('\\',"/");
szImagePath.replace('\\',"/");
+ szLocalePath.replace('\\',"/");
szHelpPath.replace('\\',"/");
szSoundPath.replace('\\',"/");
szInstallPath.replace('\\',"/");
@@ -171,6 +175,15 @@ bool KviPackAddonDialog::packAddon()
QMessageBox::critical(this,__tr2qs_ctx("Export Addon - KVIrc","addon"),szTmp,QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton);
}
+ // Add config dir
+ if(!pw.addDirectory(szConfigPath,"config/scripts/"))
+ {
+ szTmp = __tr2qs_ctx("Packaging failed","addon");
+ szTmp += ": ";
+ szTmp += pw.lastError();
+ QMessageBox::critical(this,__tr2qs_ctx("Export Addon - KVIrc","addon"),szTmp,QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton);
+ }
+
// Add image dir
if(!pw.addDirectory(szImagePath,"pics/"))
{
@@ -180,6 +193,15 @@ bool KviPackAddonDialog::packAddon()
QMessageBox::critical(this,__tr2qs_ctx("Export Addon - KVIrc","addon"),szTmp,QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton);
}
+ // Add localization dir
+ if(!pw.addDirectory(szLocalePath,"locale/"))
+ {
+ szTmp = __tr2qs_ctx("Packaging failed","addon");
+ szTmp += ": ";
+ szTmp += pw.lastError();
+ QMessageBox::critical(this,__tr2qs_ctx("Export Addon - KVIrc","addon"),szTmp,QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton);
+ }
+
// Add help dir
if(!pw.addDirectory(szImagePath,"help/en/"))
{
@@ -302,17 +324,25 @@ KviPackAddonFileSelectionWidget::KviPackAddonFileSelectionWidget(KviPackAddonDia
m_pSourcePathSelector = new KviDirectorySelector(this,__tr2qs_ctx("Select scripts directory:","addon"),&szSourcePath,true);
pLayout->addWidget(m_pSourcePathSelector,2,0);
+ // Select config dir
+ m_pConfigPathSelector = new KviDirectorySelector(this,__tr2qs_ctx("Select config directory:","addon"),&szConfigPath,true);
+ pLayout->addWidget(m_pConfigPathSelector,3,0);
+
// Select image dir
m_pImagePathSelector = new KviDirectorySelector(this,__tr2qs_ctx("Select images directory:","addon"),&szImagePath,true);
- pLayout->addWidget(m_pImagePathSelector,3,0);
+ pLayout->addWidget(m_pImagePathSelector,4,0);
+
+ // Select localization dir
+ m_pLocalePathSelector = new KviDirectorySelector(this,__tr2qs_ctx("Select localization directory:","addon"),&szLocalePath,true);
+ pLayout->addWidget(m_pLocalePathSelector,5,0);
// Select help dir
m_pHelpPathSelector = new KviDirectorySelector(this,__tr2qs_ctx("Select help directory:","addon"),&szHelpPath,true);
- pLayout->addWidget(m_pHelpPathSelector,4,0);
+ pLayout->addWidget(m_pHelpPathSelector,6,0);
// Select sound dir
m_pSoundPathSelector = new KviDirectorySelector(this,__tr2qs_ctx("Select sounds directory:","addon"),&szSoundPath,true);
- pLayout->addWidget(m_pSoundPathSelector,5,0);
+ pLayout->addWidget(m_pSoundPathSelector,7,0);
}
KviPackAddonSaveSelectionWidget::KviPackAddonSaveSelectionWidget(KviPackAddonDialog *pParent)
@@ -366,13 +396,16 @@ void KviPackAddonInfoWidget::showEvent(QShowEvent *)
KviPackAddonFileSelectionWidget * pFileWidget = m_pParent->m_pPackAddonFileSelectionWidget;
KviPackAddonSaveSelectionWidget * pSaveWidget = m_pParent->m_pPackAddonSaveSelectionWidget;
- QString szText = "" + __tr2qs_ctx("Package Author","addon") + ": " + pCreateWidget->authorName() + "
";
+ QString szText = __tr2qs_ctx("This is what I will check for","addon") + "
";
+ szText += "" + __tr2qs_ctx("Package Author","addon") + ": " + pCreateWidget->authorName() + "
";
szText += "" + __tr2qs_ctx("Package Name","addon") + ": " + pCreateWidget->packageName() + "
";
szText += "" + __tr2qs_ctx("Package Version","addon") + ": " + pCreateWidget->packageVersion() + "
";
- szText += "" + __tr2qs_ctx("Package Description","addon") + ": " + pCreateWidget->packageDescription() + "
";
+ szText += "" + __tr2qs_ctx("Package Description","addon") + ": " + pCreateWidget->packageDescription() + "
";
szText += "" + __tr2qs_ctx("Installer Script","addon") + ": " + pFileWidget->installerPath() + "
";
szText += "" + __tr2qs_ctx("Source Directory","addon") + ": " + pFileWidget->sourcePath() + "
";
+ szText += "" + __tr2qs_ctx("Configuration Directory","addon") + ": " + pFileWidget->configPath() + "
";
szText += "" + __tr2qs_ctx("Image Directory","addon") + ": " + pFileWidget->imagePath() + "
";
+ szText += "" + __tr2qs_ctx("Localization Directory","addon") + ": " + pFileWidget->localePath() + "
";
szText += "" + __tr2qs_ctx("Help Directory","addon") + ": " + pFileWidget->helpPath() + "
";
szText += "" + __tr2qs_ctx("Sound Directory","addon") + ": " + pFileWidget->soundPath() + "
";
szText += "" + __tr2qs_ctx("Save Path","addon") + ": " + pSaveWidget->savePath();
--
cgit v1.3.1-10-gc9f91