traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src/traverso dialogs/project/NewProjec...


From: Remon Sijrier
Subject: [Traverso-commit] traverso/src/traverso dialogs/project/NewProjec...
Date: Wed, 04 Apr 2007 00:07:15 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       07/04/04 00:07:15

Added files:
        src/traverso/dialogs/project: NewProjectDialog.cpp 
                                      NewProjectDialog.h 
                                      OpenProjectDialog.cpp 
                                      OpenProjectDialog.h 
        src/traverso/ui: NewProjectDialog.ui 
Removed files:
        src/traverso/ui: OpenCreateProjectDialog.ui 

Log message:
        * Further improved menubar layout, well, that's the idea
        * new project using template almost works
        * separation of open/create project dialog

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/dialogs/project/NewProjectDialog.cpp?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/dialogs/project/NewProjectDialog.h?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/dialogs/project/OpenProjectDialog.cpp?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/dialogs/project/OpenProjectDialog.h?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/ui/NewProjectDialog.ui?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/ui/OpenCreateProjectDialog.ui?cvsroot=traverso&r1=1.1&r2=0

Patches:
Index: dialogs/project/NewProjectDialog.cpp
===================================================================
RCS file: dialogs/project/NewProjectDialog.cpp
diff -N dialogs/project/NewProjectDialog.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ dialogs/project/NewProjectDialog.cpp        4 Apr 2007 00:07:14 -0000       
1.1
@@ -0,0 +1,139 @@
+/*
+    Copyright (C) 2007 Remon Sijrier 
+ 
+    This file is part of Traverso
+ 
+    Traverso 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.
+ 
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+ 
+*/
+
+#include "NewProjectDialog.h"
+#include "ui_NewProjectDialog.h"
+
+#include <QDir>
+#include <QStringList>
+#include <QMessageBox>
+#include <QTextStream>
+#include <QDomDocument>
+#include <QFileDialog>
+#include <QHeaderView>
+
+#include <Config.h>
+#include <Information.h>
+#include <ProjectManager.h>
+#include <Project.h>
+#include <Utils.h>
+
+
+// Always put me below _all_ includes, this is needed
+// in case we run with memory leak detection enabled!
+#include "Debugger.h"
+
+NewProjectDialog::NewProjectDialog( QWidget * parent )
+       : QDialog(parent)
+{
+       setupUi(this);
+       trackCountSpinBox->setValue(config().get_property("Song", 
"trackCreationCount", 4).toInt());
+       
+       use_template_checkbox_state_changed(Qt::Unchecked);
+       update_template_combobox();
+
+       connect(useTemplateCheckBox, SIGNAL(stateChanged (int)), this, 
SLOT(use_template_checkbox_state_changed(int)));
+}
+
+NewProjectDialog::~ NewProjectDialog( )
+{}
+
+
+void NewProjectDialog::accept( )
+{
+
+        // do we have the name of the project to create ?
+       QString title = newProjectName->text();
+       
+       if (title.length() == 0) {
+               info().information(tr("You must supply a name for the 
project!") );
+               return;
+       }
+
+
+       // first test if project exists already
+       if (pm().project_exists(title)) {
+               switch (QMessageBox::information(this,
+                       tr("Traverso - Question"),
+                          tr("The Project \"%1\" already exists, do you want 
to remove it and replace it with a new one ?").arg(title),
+                             tr("Yes"), tr("No"), QString::null, 1, -1)) 
+               {
+                       case 0:
+                               pm().remove_project(title);
+                               break;
+                       default:
+                               return;
+                               break;
+               }
+       }
+       
+       int numSongs = songCountSpinBox->value();
+       int numTracks = trackCountSpinBox->value();
+       
+       int index = templateComboBox->currentIndex();
+       bool usetemplate = false;
+       if (useTemplateCheckBox->isChecked() && index >= 0) {
+               usetemplate = true;
+       }
+       
+       Project* project;
+       
+       if (usetemplate) {
+               project = pm().create_new_project(QDir::homePath() + 
"/.traverso/ProjectTemplates/" + 
+                               templateComboBox->itemText(index) + ".tpt", 
title);
+               
+       } else {
+               project = pm().create_new_project(numSongs, numTracks, title);
+       }
+       
+       if (! project) {
+               info().warning(tr("Couldn't create project (%1)").arg(title) );
+               return;
+       }
+       
+       project->set_description(descriptionTextEdit->toPlainText());
+       project->set_engineer(newProjectEngineer->text());
+       project->save();
+       delete project;
+}
+
+void NewProjectDialog::use_template_checkbox_state_changed(int state)
+{
+       if (state == Qt::Checked) {
+               templateComboBox->setEnabled(true);
+               trackCountSpinBox->setEnabled(false);
+       } else {
+               templateComboBox->setEnabled(false);
+               trackCountSpinBox->setEnabled(true);
+       }
+}
+
+void NewProjectDialog::update_template_combobox()
+{
+       QDir templatedir(QDir::homePath() + "/.traverso/ProjectTemplates");
+       
+       foreach (QString filename, templatedir.entryList(QDir::Files | 
QDir::NoDotAndDotDot)) {
+               templateComboBox->insertItem(0, filename.remove(".tpt"));
+       }
+}
+
+
+//eof

Index: dialogs/project/NewProjectDialog.h
===================================================================
RCS file: dialogs/project/NewProjectDialog.h
diff -N dialogs/project/NewProjectDialog.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ dialogs/project/NewProjectDialog.h  4 Apr 2007 00:07:14 -0000       1.1
@@ -0,0 +1,45 @@
+/*
+    Copyright (C) 2007 Remon Sijrier 
+ 
+    This file is part of Traverso
+ 
+    Traverso 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.
+ 
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+ 
+*/
+
+#ifndef NEW_PROJECT_DIALOG_H
+#define NEW_PROJECT_DIALOG_H
+
+#include "ui_NewProjectDialog.h"
+#include <QDialog>
+
+class NewProjectDialog : public QDialog, protected Ui::NewProjectDialog
+{
+       Q_OBJECT
+
+public:
+       NewProjectDialog(QWidget* parent = 0);
+       ~NewProjectDialog();
+
+private slots:
+       void accept();
+       void use_template_checkbox_state_changed(int state);
+       void update_template_combobox();
+};
+
+#endif
+
+//eof
+

Index: dialogs/project/OpenProjectDialog.cpp
===================================================================
RCS file: dialogs/project/OpenProjectDialog.cpp
diff -N dialogs/project/OpenProjectDialog.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ dialogs/project/OpenProjectDialog.cpp       4 Apr 2007 00:07:14 -0000       
1.1
@@ -0,0 +1,242 @@
+/*
+    Copyright (C) 2007 Remon Sijrier 
+ 
+    This file is part of Traverso
+ 
+    Traverso 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.
+ 
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+ 
+*/
+
+#include "OpenProjectDialog.h"
+#include "ui_OpenProjectDialog.h"
+
+#include <QDir>
+#include <QStringList>
+#include <QMessageBox>
+#include <QTextStream>
+#include <QDomDocument>
+#include <QFileDialog>
+#include <QHeaderView>
+
+#include <Config.h>
+#include <Information.h>
+#include <ProjectManager.h>
+#include <Project.h>
+#include <Utils.h>
+
+
+// Always put me below _all_ includes, this is needed
+// in case we run with memory leak detection enabled!
+#include "Debugger.h"
+
+OpenProjectDialog::OpenProjectDialog( QWidget * parent )
+       : QDialog(parent)
+{
+       setupUi(this);
+       projectListView->setColumnCount(2);
+       update_projects_list();
+       QStringList stringList;
+       stringList << "Project Name" << "Songs";
+       projectListView->setHeaderLabels(stringList);
+       
+       projectListView->header()->resizeSection(0, 160);
+       projectListView->header()->resizeSection(1, 30);
+       
+       connect(projectListView, SIGNAL(itemClicked(QTreeWidgetItem*,int)), 
this, SLOT(projectitem_clicked(QTreeWidgetItem*,int)));
+}
+
+OpenProjectDialog::~ OpenProjectDialog( )
+{}
+
+void OpenProjectDialog::update_projects_list()
+{
+       projectListView->clear();
+       
+       QString path = config().get_property("Project", "directory", 
getenv("HOME")).toString();
+
+       QDir dir(path);
+
+       QStringList list = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
+       
+       foreach(QString dirname, list) {
+       
+               /************ FROM HERE ****************/
+               QDomDocument doc("Project");
+               QString fileToOpen = path + "/" + dirname + "/project.traverso";
+               
+               QFile file(fileToOpen);
+
+               if (!file.open(QIODevice::ReadOnly)) {
+                       PWARN("OpenProjectDialog:: Cannot open project 
properties file (%s)", fileToOpen.toAscii().data());
+                       continue;
+               }
+
+               QString errorMsg;
+               if (!doc.setContent(&file, &errorMsg)) {
+                       file.close();
+                       PWARN("OpenProjectDialog:: Cannot set content of XML 
file (%s)", errorMsg.toAscii().data());
+                       continue;
+               }
+
+               file.close();
+
+               QDomElement docElem = doc.documentElement();
+               QDomNode propertiesNode = 
docElem.firstChildElement("Properties");
+               QDomElement e = propertiesNode.toElement();
+               QString title = e.attribute( "title", "" );
+               QString description = e.attribute("description", "No 
description set");
+               qint64 id = e.attribute( "id", "" ).toLongLong();
+               
+
+               QDomNode songsNode = docElem.firstChildElement("Songs");
+               QDomNode songNode = songsNode.firstChild();
+               int songCounter = 0;
+               
+               // count to get Songs number....
+               while(!songNode.isNull()) {
+                       songCounter++;
+                       songNode = songNode.nextSibling();
+               }
+
+               QString sNumSongs = QString::number(songCounter);
+
+               /*********** TO HERE THIS CODE IS DUPLICATE FROM THAT IN 
PROJECT.CC :-( 
+               Don't know if this is avoidable at all *********/
+
+
+               QTreeWidgetItem* item = new QTreeWidgetItem(projectListView);
+               item->setTextAlignment(0, Qt::AlignLeft);
+               item->setTextAlignment(1, Qt::AlignHCenter);
+               item->setText(0, title);
+               item->setText(1, sNumSongs);
+               QString html = "<html><head></head><body>Project: " + title + 
"<br /><br />";
+               html += tr("Description:") + "<br />";
+               html += description + "<br /><br />";
+               html += tr("Created on:") + " " + 
extract_date_time(id).toString() + "<br />";
+               html += "</body></html>";
+               item->setToolTip(0, html);
+       }
+}
+
+void OpenProjectDialog::projectitem_clicked( QTreeWidgetItem* item, int)
+{
+       if (item) {
+               selectedProjectName->setText(item->text(0));
+       }
+}
+
+void OpenProjectDialog::on_loadProjectButton_clicked( )
+{
+        // do we have the name of the project to load ?
+       QString title;
+       if (projectListView->currentItem()) {
+               title = projectListView->currentItem()->text(0);
+       }
+
+       if (title.isEmpty()) {
+               info().warning(tr("No Project selected!") );
+               info().information(tr("Select a project and click the 'Load' 
button again") );
+               return;
+       }
+       
+       Project* project = pm().get_project();
+
+       
+       if (project && (project->get_title() == title)) {
+               QMessageBox::StandardButton button = QMessageBox::question(this,
+                       "Traverso - Question",
+                       "Are you sure you want to reopen the current project ?",
+                       QMessageBox::Ok | QMessageBox::Cancel,
+                       QMessageBox::Cancel );
+               if (button == QMessageBox::Cancel) {
+                       return;
+               }
+       }
+               
+       // first test if project exists
+       // Note: this shouldn't be needed really, the projects in the view
+       // should exist, but just in case someone removed it, you never know!
+       if (!pm().project_exists(title)) {
+               info().warning(tr("Project does not exist! (%1)").arg(title));
+               return;
+       }
+       
+       if (pm().load_project(title)<0) {
+               PERROR("Could not load project %s", title.toAscii().data());
+       }
+}
+
+void OpenProjectDialog::on_deleteProjectbutton_clicked( )
+{
+        // do we have the name of the project to delete ?
+       QString title = selectedProjectName->text();
+
+       if (title.isEmpty()) {
+               info().information(tr("You must supply a name for the 
project!") );
+               return;
+       }
+
+        // first test if project exists
+       if (!pm().project_exists(title)) {
+               info().warning(tr("Project does not exist! (%1)").arg(title));
+               return;
+       }
+
+       switch (QMessageBox::information(this,
+               tr("Traverso - Question"),
+                  tr("Are you sure that you want to remove the project %1 ? 
It's not possible to undo it !").arg(title).toAscii().data(),
+                     "Yes", "No", QString::null, 1, -1)) {
+                             case 0:
+                                     pm().remove_project(title);
+                                     update_projects_list();
+                                     break;
+                             default:
+                                     return;
+                                     break;
+                     }
+                     return;
+}
+
+
+void OpenProjectDialog::on_projectDirSelectButton_clicked( )
+{
+       QString path = config().get_property("Project", "DefaultDirectory", 
getenv("HOME")).toString();
+       
+       QString newPath = QFileDialog::getExistingDirectory(this,
+                       tr("Choose an existing or create a new Project 
Directory"), path);
+                       
+       if (newPath.isEmpty() || newPath.isNull()) {
+               return;
+       }
+       
+       QDir dir;
+       
+       if (dir.exists(newPath)) {
+//             QMessageBox::information( interface, tr("Traverso - 
Information"), tr("Using existing Project directory: %1\n").arg(newPath), "OK", 
0 );
+       } else if (!dir.mkpath(newPath)) {
+               QMessageBox::warning( this, tr("Traverso - Warning"), 
tr("Unable to create Project directory! \n") +
+                               tr("Please check permission for this directory: 
%1").arg(newPath) );
+               return;
+       } else {
+               QMessageBox::information( this, tr("Traverso - Information"), 
tr("Created new Project directory for you here: %1\n").arg(newPath), "OK", 0 );
+       }
+       
+       config().set_property("Project", "directory", newPath);
+       
+       update_projects_list();
+}
+
+
+//eof

Index: dialogs/project/OpenProjectDialog.h
===================================================================
RCS file: dialogs/project/OpenProjectDialog.h
diff -N dialogs/project/OpenProjectDialog.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ dialogs/project/OpenProjectDialog.h 4 Apr 2007 00:07:14 -0000       1.1
@@ -0,0 +1,47 @@
+/*
+    Copyright (C) 2007 Remon Sijrier 
+ 
+    This file is part of Traverso
+ 
+    Traverso 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.
+ 
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+ 
+*/
+
+#ifndef OPEN_PROJECT_DIALOG_H
+#define OPEN_PROJECT_DIALOG_H
+
+#include "ui_OpenProjectDialog.h"
+#include <QDialog>
+
+class OpenProjectDialog : public QDialog, protected Ui::OpenProjectDialog
+{
+Q_OBJECT
+
+public:
+       OpenProjectDialog(QWidget* parent = 0);
+       ~OpenProjectDialog();
+
+private slots:
+       void update_projects_list();
+       void on_loadProjectButton_clicked();
+       void on_deleteProjectbutton_clicked();
+       void on_projectDirSelectButton_clicked();
+       void projectitem_clicked( QTreeWidgetItem* , int  );
+};
+
+#endif
+
+//eof
+

Index: ui/NewProjectDialog.ui
===================================================================
RCS file: ui/NewProjectDialog.ui
diff -N ui/NewProjectDialog.ui
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ ui/NewProjectDialog.ui      4 Apr 2007 00:07:14 -0000       1.1
@@ -0,0 +1,310 @@
+<ui version="4.0" >
+ <class>NewProjectDialog</class>
+ <widget class="QDialog" name="NewProjectDialog" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>283</width>
+    <height>284</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>New Project</string>
+  </property>
+  <layout class="QVBoxLayout" >
+   <property name="margin" >
+    <number>9</number>
+   </property>
+   <property name="spacing" >
+    <number>6</number>
+   </property>
+   <item>
+    <widget class="QGroupBox" name="groupBox" >
+     <property name="title" >
+      <string>New Project</string>
+     </property>
+     <layout class="QVBoxLayout" >
+      <property name="margin" >
+       <number>9</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
+      <item>
+       <layout class="QHBoxLayout" >
+        <property name="margin" >
+         <number>0</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="label_2_2" >
+          <property name="minimumSize" >
+           <size>
+            <width>70</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text" >
+           <string>Name</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="newProjectName" >
+          <property name="sizePolicy" >
+           <sizepolicy>
+            <hsizetype>7</hsizetype>
+            <vsizetype>0</vsizetype>
+            <horstretch>2</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" >
+        <property name="margin" >
+         <number>0</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="label" >
+          <property name="minimumSize" >
+           <size>
+            <width>0</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text" >
+           <string>Description</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QTextEdit" name="descriptionTextEdit" >
+          <property name="sizePolicy" >
+           <sizepolicy>
+            <hsizetype>7</hsizetype>
+            <vsizetype>7</vsizetype>
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="maximumSize" >
+           <size>
+            <width>16777215</width>
+            <height>30</height>
+           </size>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" >
+        <property name="margin" >
+         <number>0</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="label_3_2" >
+          <property name="minimumSize" >
+           <size>
+            <width>70</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="text" >
+           <string>Engineer</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="newProjectEngineer" >
+          <property name="sizePolicy" >
+           <sizepolicy>
+            <hsizetype>7</hsizetype>
+            <vsizetype>5</vsizetype>
+            <horstretch>2</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" >
+        <property name="margin" >
+         <number>0</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="label_2_2_2" >
+          <property name="sizePolicy" >
+           <sizepolicy>
+            <hsizetype>5</hsizetype>
+            <vsizetype>5</vsizetype>
+            <horstretch>2</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text" >
+           <string>Song count</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="songCountSpinBox" >
+          <property name="sizePolicy" >
+           <sizepolicy>
+            <hsizetype>1</hsizetype>
+            <vsizetype>0</vsizetype>
+            <horstretch>1</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="minimumSize" >
+           <size>
+            <width>40</width>
+            <height>0</height>
+           </size>
+          </property>
+          <property name="minimum" >
+           <number>1</number>
+          </property>
+          <property name="value" >
+           <number>1</number>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" >
+        <property name="margin" >
+         <number>0</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="label_2" >
+          <property name="sizePolicy" >
+           <sizepolicy>
+            <hsizetype>5</hsizetype>
+            <vsizetype>5</vsizetype>
+            <horstretch>2</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text" >
+           <string>Tracks per Song</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="trackCountSpinBox" >
+          <property name="sizePolicy" >
+           <sizepolicy>
+            <hsizetype>1</hsizetype>
+            <vsizetype>0</vsizetype>
+            <horstretch>1</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" >
+        <property name="margin" >
+         <number>0</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QCheckBox" name="useTemplateCheckBox" >
+          <property name="text" >
+           <string>Use Template</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="templateComboBox" >
+          <property name="sizePolicy" >
+           <sizepolicy>
+            <hsizetype>5</hsizetype>
+            <vsizetype>0</vsizetype>
+            <horstretch>2</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QDialogButtonBox" name="buttonBox" >
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons" >
+      
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>NewProjectDialog</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>NewProjectDialog</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>

Index: ui/OpenCreateProjectDialog.ui
===================================================================
RCS file: ui/OpenCreateProjectDialog.ui
diff -N ui/OpenCreateProjectDialog.ui
--- ui/OpenCreateProjectDialog.ui       3 Apr 2007 19:05:39 -0000       1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,583 +0,0 @@
-<ui version="4.0" >
- <class>OpenCreateProjectDialog</class>
- <widget class="QDialog" name="OpenCreateProjectDialog" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>520</width>
-    <height>450</height>
-   </rect>
-  </property>
-  <property name="minimumSize" >
-   <size>
-    <width>500</width>
-    <height>410</height>
-   </size>
-  </property>
-  <property name="maximumSize" >
-   <size>
-    <width>520</width>
-    <height>450</height>
-   </size>
-  </property>
-  <property name="windowTitle" >
-   <string>Open / Create Project</string>
-  </property>
-  <layout class="QHBoxLayout" >
-   <property name="margin" >
-    <number>9</number>
-   </property>
-   <property name="spacing" >
-    <number>6</number>
-   </property>
-   <item>
-    <layout class="QVBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-    </layout>
-   </item>
-   <item>
-    <layout class="QVBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item>
-      <widget class="QTreeWidget" name="projectListView" >
-       <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>7</hsizetype>
-         <vsizetype>7</vsizetype>
-         <horstretch>2</horstretch>
-         <verstretch>4</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="minimumSize" >
-        <size>
-         <width>230</width>
-         <height>0</height>
-        </size>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <layout class="QHBoxLayout" >
-       <property name="margin" >
-        <number>0</number>
-       </property>
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <item>
-        <widget class="QPushButton" name="projectDirSelectButton" >
-         <property name="text" >
-          <string>Select Project Dir</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QVBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item>
-      <layout class="QVBoxLayout" >
-       <property name="margin" >
-        <number>0</number>
-       </property>
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <item>
-        <widget class="QGroupBox" name="groupBox_2" >
-         <property name="minimumSize" >
-          <size>
-           <width>16</width>
-           <height>90</height>
-          </size>
-         </property>
-         <property name="title" >
-          <string>Selected Project</string>
-         </property>
-         <layout class="QVBoxLayout" >
-          <property name="margin" >
-           <number>9</number>
-          </property>
-          <property name="spacing" >
-           <number>9</number>
-          </property>
-          <item>
-           <widget class="QLineEdit" name="selectedProjectName" >
-            <property name="enabled" >
-             <bool>false</bool>
-            </property>
-            <property name="sizePolicy" >
-             <sizepolicy>
-              <hsizetype>7</hsizetype>
-              <vsizetype>0</vsizetype>
-              <horstretch>1</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize" >
-             <size>
-              <width>50</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="mouseTracking" >
-             <bool>true</bool>
-            </property>
-            <property name="readOnly" >
-             <bool>false</bool>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
-            <property name="spacing" >
-             <number>6</number>
-            </property>
-            <item>
-             <widget class="QPushButton" name="deleteProjectbutton" >
-              <property name="text" >
-               <string>Delete</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <spacer>
-              <property name="orientation" >
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeHint" >
-               <size>
-                <width>61</width>
-                <height>27</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-            <item>
-             <widget class="QPushButton" name="loadProjectButton" >
-              <property name="text" >
-               <string>Load</string>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-         </layout>
-        </widget>
-       </item>
-       <item>
-        <widget class="QGroupBox" name="groupBox" >
-         <property name="minimumSize" >
-          <size>
-           <width>16</width>
-           <height>110</height>
-          </size>
-         </property>
-         <property name="title" >
-          <string>New Project</string>
-         </property>
-         <layout class="QVBoxLayout" >
-          <property name="margin" >
-           <number>9</number>
-          </property>
-          <property name="spacing" >
-           <number>6</number>
-          </property>
-          <item>
-           <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
-            <property name="spacing" >
-             <number>6</number>
-            </property>
-            <item>
-             <widget class="QLabel" name="label_2_2" >
-              <property name="minimumSize" >
-               <size>
-                <width>70</width>
-                <height>0</height>
-               </size>
-              </property>
-              <property name="text" >
-               <string>Name</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QLineEdit" name="newProjectName" >
-              <property name="sizePolicy" >
-               <sizepolicy>
-                <hsizetype>7</hsizetype>
-                <vsizetype>0</vsizetype>
-                <horstretch>2</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-              <property name="minimumSize" >
-               <size>
-                <width>100</width>
-                <height>0</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
-            <property name="spacing" >
-             <number>6</number>
-            </property>
-            <item>
-             <widget class="QLabel" name="label" >
-              <property name="minimumSize" >
-               <size>
-                <width>0</width>
-                <height>0</height>
-               </size>
-              </property>
-              <property name="text" >
-               <string>Description</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QTextEdit" name="descriptionTextEdit" >
-              <property name="sizePolicy" >
-               <sizepolicy>
-                <hsizetype>7</hsizetype>
-                <vsizetype>7</vsizetype>
-                <horstretch>0</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-              <property name="maximumSize" >
-               <size>
-                <width>16777215</width>
-                <height>30</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
-            <property name="spacing" >
-             <number>6</number>
-            </property>
-            <item>
-             <widget class="QLabel" name="label_3_2" >
-              <property name="minimumSize" >
-               <size>
-                <width>70</width>
-                <height>0</height>
-               </size>
-              </property>
-              <property name="text" >
-               <string>Engineer</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QLineEdit" name="newProjectEngineer" >
-              <property name="sizePolicy" >
-               <sizepolicy>
-                <hsizetype>7</hsizetype>
-                <vsizetype>5</vsizetype>
-                <horstretch>2</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
-            <property name="spacing" >
-             <number>6</number>
-            </property>
-            <item>
-             <widget class="QLabel" name="label_2_2_2" >
-              <property name="sizePolicy" >
-               <sizepolicy>
-                <hsizetype>5</hsizetype>
-                <vsizetype>5</vsizetype>
-                <horstretch>2</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-              <property name="text" >
-               <string>Song count</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QSpinBox" name="songCountSpinBox" >
-              <property name="sizePolicy" >
-               <sizepolicy>
-                <hsizetype>1</hsizetype>
-                <vsizetype>0</vsizetype>
-                <horstretch>1</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-              <property name="minimumSize" >
-               <size>
-                <width>40</width>
-                <height>0</height>
-               </size>
-              </property>
-              <property name="minimum" >
-               <number>1</number>
-              </property>
-              <property name="value" >
-               <number>1</number>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
-            <property name="spacing" >
-             <number>6</number>
-            </property>
-            <item>
-             <widget class="QLabel" name="label_2" >
-              <property name="sizePolicy" >
-               <sizepolicy>
-                <hsizetype>5</hsizetype>
-                <vsizetype>5</vsizetype>
-                <horstretch>2</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-              <property name="text" >
-               <string>Tracks per Song</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QSpinBox" name="trackCountSpinBox" >
-              <property name="sizePolicy" >
-               <sizepolicy>
-                <hsizetype>1</hsizetype>
-                <vsizetype>0</vsizetype>
-                <horstretch>1</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
-            <property name="spacing" >
-             <number>6</number>
-            </property>
-            <item>
-             <widget class="QLabel" name="label_4_2" >
-              <property name="minimumSize" >
-               <size>
-                <width>70</width>
-                <height>0</height>
-               </size>
-              </property>
-              <property name="text" >
-               <string>Template</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QComboBox" name="templateComboBox" >
-              <property name="sizePolicy" >
-               <sizepolicy>
-                <hsizetype>5</hsizetype>
-                <vsizetype>0</vsizetype>
-                <horstretch>2</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <layout class="QHBoxLayout" >
-            <property name="margin" >
-             <number>0</number>
-            </property>
-            <property name="spacing" >
-             <number>6</number>
-            </property>
-            <item>
-             <spacer>
-              <property name="orientation" >
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeHint" >
-               <size>
-                <width>40</width>
-                <height>20</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-            <item>
-             <widget class="QPushButton" name="createProjectButton" >
-              <property name="sizePolicy" >
-               <sizepolicy>
-                <hsizetype>5</hsizetype>
-                <vsizetype>0</vsizetype>
-                <horstretch>0</horstretch>
-                <verstretch>0</verstretch>
-               </sizepolicy>
-              </property>
-              <property name="text" >
-               <string>Create</string>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-         </layout>
-        </widget>
-       </item>
-       <item>
-        <spacer>
-         <property name="orientation" >
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" >
-          <size>
-           <width>254</width>
-           <height>16</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <widget class="QDialogButtonBox" name="buttonBox" >
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="standardButtons" >
-        <set>QDialogButtonBox::Close</set>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections>
-  <connection>
-   <sender>projectListView</sender>
-   <signal>doubleClicked(QModelIndex)</signal>
-   <receiver>loadProjectButton</receiver>
-   <slot>animateClick()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>196</x>
-     <y>204</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>460</x>
-     <y>310</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>newProjectName</sender>
-   <signal>returnPressed()</signal>
-   <receiver>createProjectButton</receiver>
-   <slot>click()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>215</x>
-     <y>444</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>427</x>
-     <y>503</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>newProjectEngineer</sender>
-   <signal>returnPressed()</signal>
-   <receiver>createProjectButton</receiver>
-   <slot>click()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>235</x>
-     <y>475</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>408</x>
-     <y>503</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>clicked(QAbstractButton*)</signal>
-   <receiver>OpenCreateProjectDialog</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>29</x>
-     <y>547</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>355</x>
-     <y>527</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]