[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/plasma/plasmate
From: Aaron J. Seigo <aseigo () kde ! org>
Date: 2010-02-14 1:48:32
Message-ID: 1266112112.281545.27757.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1089797 by aseigo:
require a package name
BUG:226753
M +15 -13 startpage.cpp
M +3 -0 startpage.ui
--- trunk/playground/base/plasma/plasmate/startpage.cpp #1089796:1089797
@@ -138,11 +138,12 @@
}
ui->projectName->setText(QString(name).remove(pos, 1));
}
+
+ ui->newProjectButton->setEnabled(!ui->projectName->text().isEmpty());
}
void StartPage::validateProjectType(const QModelIndex &sender)
{
-
if (sender.row() == 1) {
ui->radioButtonJs->setEnabled(false);
// gotta explicitly setEnabled to true in case it
@@ -151,8 +152,7 @@
// also check this radio to prevent any disabled radios from
// being checked due to previous setting!
ui->radioButtonRb->setEnabled(true);
- ui->newProjectButton->setEnabled(true); // in case previously falsed
-
+ ui->newProjectButton->setEnabled(!ui->projectName->text().isEmpty()); // in \
case previously falsed } else if (sender.row() == 2) {
ui->radioButtonJs->setEnabled(false);
// gotta explicitly setEnabled to true in case it
@@ -162,19 +162,18 @@
// being checked due to previous setting!
ui->radioButtonPy->setChecked(true);
ui->radioButtonRb->setEnabled(false);
- ui->newProjectButton->setEnabled(true); // in case previously falsed
+ ui->newProjectButton->setEnabled(!ui->projectName->text().isEmpty()); // in \
case previously falsed
} else if (sender.row() == 3) {
ui->radioButtonJs->setEnabled(false);
ui->radioButtonPy->setEnabled(false);
ui->radioButtonRb->setEnabled(false);
ui->newProjectButton->setEnabled(false); // disable the create button too.
-
} else /* if (sender.row() == 0) */ {
ui->radioButtonJs->setEnabled(true);
ui->radioButtonPy->setEnabled(true);
ui->radioButtonRb->setEnabled(true);
- ui->newProjectButton->setEnabled(true); // in case previously falsed
+ ui->newProjectButton->setEnabled(!ui->projectName->text().isEmpty()); // in \
case previously falsed }
ui->layoutHackStackedWidget->setCurrentIndex(1);
@@ -268,14 +267,15 @@
void StartPage::createNewProject()
{
-// TODO
-// metadata->setPluginName( view->pluginname_edit->text() );
- kDebug() << "Creating simple folder structure for the project ";
+ // packagePath -> projectPath
+ const QString projectName = ui->projectName->text();
+ if (projectName.isEmpty()) {
+ return;
+ }
- // packagePath -> projectPath
- QString projectNameLowerCase = ui->projectName->text().toLower();
- QString projectNameSnakeCase = camelToSnakeCase(ui->projectName->text());
- QString projectName = ui->projectName->text();
+ kDebug() << "Creating simple folder structure for the project " << projectName;
+ QString projectNameLowerCase = projectName.toLower();
+ QString projectNameSnakeCase = camelToSnakeCase(projectName);
QString projectFileExtension;
QString templateFilePath = KStandardDirs::locate("appdata", "templates/");
@@ -386,6 +386,8 @@
// Write the .desktop file
metadata.setName(projectName);
+ //FIXME: the plugin name needs to be globally unique, so should use more than \
just the project + // name
metadata.setPluginName(projectNameLowerCase);
metadata.setServiceType(serviceTypes);
metadata.setAuthor(ui->authorTextField->text());
--- trunk/playground/base/plasma/plasmate/startpage.ui #1089796:1089797
@@ -374,6 +374,9 @@
</item>
<item>
<widget class="KPushButton" name="newProjectButton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="text">
<string>&Create!</string>
</property>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic