summaryrefslogtreecommitdiffstats
path: root/src/libgui/project_editor.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
commitf508189682b6fba62e08feeb1596f682bad5fff9 (patch)
tree28aeb0e6c19386c385c1ce5edf8a92c1bca15281 /src/libgui/project_editor.cpp
downloadpiklab-f508189682b6fba62e08feeb1596f682bad5fff9.tar.gz
piklab-f508189682b6fba62e08feeb1596f682bad5fff9.zip
Added KDE3 version of PikLab
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/libgui/project_editor.cpp')
-rw-r--r--src/libgui/project_editor.cpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/libgui/project_editor.cpp b/src/libgui/project_editor.cpp
new file mode 100644
index 0000000..4b86429
--- /dev/null
+++ b/src/libgui/project_editor.cpp
@@ -0,0 +1,72 @@
+/***************************************************************************
+ * Copyright (C) 2005-2006 Nicolas Hadacek <hadacek@kde.org> *
+ * Copyright (C) 2003 Alain Gibaud <alain.gibaud@free.fr> *
+ * *
+ * 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. *
+ ***************************************************************************/
+#include "project_editor.h"
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <klocale.h>
+
+#include "project.h"
+#include "tools/list/compile_config.h"
+#include "device_gui.h"
+
+ProjectEditor::ProjectEditor(Project &project, QWidget *parent)
+ : Dialog(parent, "project_options", true, i18n("Project Options"), Ok|Cancel, Ok, false),
+ _project(project)
+{
+ QVBoxLayout *top = new QVBoxLayout(mainWidget(), 0, 10);
+ TabWidget *tabWidget = new TabWidget(mainWidget());
+ top->addWidget(tabWidget);
+
+// global
+ QWidget *tab = new QWidget(tabWidget);
+ tabWidget->addTab(tab, i18n("General"));
+ QGridLayout *grid = new QGridLayout(tab, 0, 0, 10, 10);
+ QLabel *label = new QLabel(i18n("Name:"), tab);
+ grid->addWidget(label, 0, 0);
+ label = new QLabel(project.name(), tab);
+ grid->addWidget(label, 0, 1);
+ label = new QLabel(i18n("Description:"), tab);
+ grid->addWidget(label, 1, 0);
+ _description = new QTextEdit(tab);
+ _description->setText(_project.description());
+ grid->addMultiCellWidget(_description, 1,1, 1,2);
+ label = new QLabel(i18n("Version:"), tab);
+ grid->addWidget(label, 2, 0);
+ _version = new QLineEdit(tab);
+ _version->setText(_project.version());
+ grid->addWidget(_version, 2, 1);
+ label = new QLabel(i18n("Device:"), tab);
+ grid->addWidget(label, 3, 0);
+ _device = new DeviceChooser::Button(false, tab);
+ _device->setDevice(Compile::Config::device(&_project));
+ grid->addWidget(_device, 3, 1);
+ grid->setRowStretch(4, 1);
+ grid->setColStretch(2, 1);
+
+// toochain
+ tab = new QWidget(tabWidget);
+ tabWidget->addTab(tab, i18n("Toochain"));
+ grid = new QGridLayout(tab, 0, 0, 10, 10);
+ _tools = new ToolsConfigWidget(&project, tab);
+ _tools->loadConfig();
+ grid->addMultiCellWidget(_tools, 0,0, 0,2);
+ grid->setRowStretch(1, 1);
+ grid->setColStretch(2, 1);
+}
+
+void ProjectEditor::slotOk()
+{
+ _project.setDescription(_description->text());
+ _project.setVersion(_version->text());
+ Compile::Config::setDevice(&_project, _device->device());
+ _tools->saveConfig();
+ accept();
+}