Commit d67ed6da authored by Halla Rempt's avatar Halla Rempt
Browse files

Rename KoBundleCreationWidget to KoDlgCreateBundle

parent 4f72a61b
......@@ -9,12 +9,12 @@ set(kritaresourcemanager_PART_SRCS
KoResourceManagerWidget.cpp
KoResourceManagerControl.cpp
KoResourceTableModel.cpp
KoBundleCreationWidget.cpp
KoDlgCreateBundle.cpp
)
kde4_add_ui_files(kritaresourcemanager_PART_SRCS
KoResourceManagerWidget.ui
KoBundleCreationWidget.ui
wdg_dlgcreatebundle.ui
)
kde4_add_plugin(kritaresourcemanager ${kritaresourcemanager_PART_SRCS})
......
#include "KoBundleCreationWidget.h"
#include "ui_KoBundleCreationWidget.h"
#include "KoDlgCreateBundle.h"
#include "ui_wdg_dlgcreatebundle.h"
#include "KoXmlResourceBundleMeta.h"
#include <KoDocumentInfo.h>
......@@ -12,9 +13,9 @@
#include <resourcemanager.h>
KoBundleCreationWidget::KoBundleCreationWidget(QWidget *parent)
KoDlgCreateBundle::KoDlgCreateBundle(QWidget *parent)
: KDialog(parent)
, m_ui(new Ui::KoBundleCreationWidget)
, m_ui(new Ui::WdgDlgCreateBundle)
{
m_page = new QWidget();
m_ui->setupUi(m_page);
......@@ -34,37 +35,37 @@ KoBundleCreationWidget::KoBundleCreationWidget(QWidget *parent)
m_ui->editLicense->setText(cfg.readEntry<QString>("BunleLicense", "CC-BY-SA"));
}
KoBundleCreationWidget::~KoBundleCreationWidget()
KoDlgCreateBundle::~KoDlgCreateBundle()
{
delete m_ui;
}
QString KoBundleCreationWidget::bundleName() const
QString KoDlgCreateBundle::bundleName() const
{
return m_ui->editBundleName->text().replace(" ", "_");
}
QString KoBundleCreationWidget::authorName() const
QString KoDlgCreateBundle::authorName() const
{
return m_ui->editAuthor->text();
}
QString KoBundleCreationWidget::email() const
QString KoDlgCreateBundle::email() const
{
return m_ui->editEmail->text();
}
QString KoBundleCreationWidget::website() const
QString KoDlgCreateBundle::website() const
{
return m_ui->editWebsite->text();
}
QString KoBundleCreationWidget::license() const
QString KoDlgCreateBundle::license() const
{
return m_ui->editLicense->text();
}
QString KoBundleCreationWidget::description() const
QString KoDlgCreateBundle::description() const
{
return m_ui->editDescription->document()->toPlainText();
}
......@@ -72,7 +73,7 @@ QString KoBundleCreationWidget::description() const
//TODO Vérifier la présence de caractères invalides dans le nom du paquet (exemple : *"')
//Même s'ils semblent acceptés par le système
void KoBundleCreationWidget::accept()
void KoDlgCreateBundle::accept()
{
QString name = m_ui->editBundleName->text().remove(" ");
......
......@@ -5,16 +5,16 @@
namespace Ui
{
class KoBundleCreationWidget;
class WdgDlgCreateBundle;
}
class KoBundleCreationWidget : public KDialog
class KoDlgCreateBundle : public KDialog
{
Q_OBJECT
public:
explicit KoBundleCreationWidget(QWidget *parent = 0);
~KoBundleCreationWidget();
explicit KoDlgCreateBundle(QWidget *parent = 0);
~KoDlgCreateBundle();
QString bundleName() const;
QString authorName() const;
......@@ -29,7 +29,7 @@ private slots:
private:
QWidget *m_page;
Ui::KoBundleCreationWidget *m_ui;
Ui::WdgDlgCreateBundle *m_ui;
};
#endif // KOBUNDLECREATIONWIDGET_H
......@@ -20,7 +20,7 @@
#include "KoResourceManagerControl.h"
#include "KoXmlResourceBundleManifest.h"
#include "KoResourceTableModel.h"
#include "KoBundleCreationWidget.h"
#include "KoDlgCreateBundle.h"
#include "KoResourceServerProvider.h"
#include "kis_resource_server_provider.h"
......@@ -86,20 +86,20 @@ bool KoResourceManagerControl::createPack(int type)
else {
emit status("Creating new bundle...");
KoBundleCreationWidget bundleCreationWidget;
if (bundleCreationWidget.exec() != QDialog::Accepted) {
KoDlgCreateBundle dlgCreateBundle;
if (dlgCreateBundle.exec() != QDialog::Accepted) {
emit status("Creation cancelled", 3000);
return false;
}
QString bundlePath = ResourceBundleServerProvider::instance()->resourceBundleServer()->saveLocation() + bundleCreationWidget.bundleName() + ".bundle";
QString bundlePath = ResourceBundleServerProvider::instance()->resourceBundleServer()->saveLocation() + dlgCreateBundle.bundleName() + ".bundle";
KoResourceBundle* newBundle = new KoResourceBundle(bundlePath);
bool isEmpty = true;
newBundle->addMeta("name", bundleCreationWidget.bundleName());
newBundle->addMeta("author", bundleCreationWidget.authorName());
newBundle->addMeta("email", bundleCreationWidget.email());
newBundle->addMeta("license", bundleCreationWidget.license());
newBundle->addMeta("website", bundleCreationWidget.website());
newBundle->addMeta("description", bundleCreationWidget.description());
newBundle->addMeta("name", dlgCreateBundle.bundleName());
newBundle->addMeta("author", dlgCreateBundle.authorName());
newBundle->addMeta("email", dlgCreateBundle.email());
newBundle->addMeta("license", dlgCreateBundle.license());
newBundle->addMeta("website", dlgCreateBundle.website());
newBundle->addMeta("description", dlgCreateBundle.description());
for (int i = 0; i < selected.size(); i++) {
QString currentFileName = selected.at(i);
......
......@@ -29,7 +29,7 @@
#include "KoResourceManagerControl.h"
#include "KoResourceTableModel.h"
#include "KoResourceTaggingManager.h"
#include "KoBundleCreationWidget.h"
#include "KoDlgCreateBundle.h"
#include "KoTagChooserWidget.h"
#include <KoIcon.h>
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>KoBundleCreationWidget</class>
<widget class="QWidget" name="KoBundleCreationWidget">
<class>WdgDlgCreateBundle</class>
<widget class="QWidget" name="WdgDlgCreateBundle">
<property name="geometry">
<rect>
<x>0</x>
......
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