On Fri, 25, Jul, 2003 at 02:07:52AM -0400, Silvan spoke thus..
> Oh, I see.  Is there some way to make the list view flummy not allow you to 
> type (well, of course there is, but I haven't fooled with that kind of widget 
> yet...)?  It's very counterintuitive being allowed to type something that's 
> subsequently ignored.

Whoops - Sorry, my fault.  At first I was going to make them directly
editable in the table and must've forgotten to change it.

> Also, I'd suggest that users be presented the opportunity to name the thing 
> immediately after picking a color, and if they choose not to name it, perhaps 
> it could take a default name that has a numerical component.  New1, New2, 
> etc.

Your wish is my command - give the attached patch a whirl.  If your
response is good can someone commit it please.

I've set it so that they give the name first; as that's the first column
it makes sense to me.

> Users suck, don't they?  :)

Nah, it's better than the coding I do in the lab where the only feedback
comes from me and one other person - it's nice to get comments for once!

Actually, I notice you're one of the translators.  Am I correct in
thinking that all I have to do is make sure that any strings which need
translating are wrapped in the i18n() call and that when the translators
come to do their work, the new strings will be added to the list for
translation?

Mark

-- 
Mark Hymers <markh at linuxfromscratch dot org>

"I told you I was ill"
     The epitaph of Spike Milligan (1918-2002)
? autom4te.cache
? stamp-h1
Index: gui/colourwidgets.cpp
===================================================================
RCS file: /cvsroot/rosegarden/gui/colourwidgets.cpp,v
retrieving revision 1.1
diff -u -p -r1.1 colourwidgets.cpp
--- gui/colourwidgets.cpp       22 Jul 2003 07:40:16 -0000      1.1
+++ gui/colourwidgets.cpp       25 Jul 2003 14:05:54 -0000
@@ -97,24 +97,22 @@ RosegardenColourTable::populate_table(Ro
     m_colours.reserve(input.size());
     setNumRows(input.size());
 
+    QString name;
+
     unsigned int i=0;
 
     for (Rosegarden::RCMap::const_iterator it=input.begin(); it!=input.end(); ++it)
     {
         if (it->second.second == std::string(""))
-        {
-            QTableItem *text = new QTableItem(
-                    dynamic_cast<QTable*>(this),
-                    QTableItem::Never, i18n("Default Colour"));
-            setItem(i, 0, text);
-        }
+            name = i18n("Default Colour");
         else
-        {
-            QTableItem *text = new QTableItem(
-                    dynamic_cast<QTable*>(this),
-                    QTableItem::OnTyping, strtoqstr(it->second.second));
-            setItem(i, 0, text);
-        }
+            name = strtoqstr(it->second.second);
+
+        QTableItem *text = new QTableItem(
+                dynamic_cast<QTable*>(this),
+                QTableItem::Never, name);
+
+        setItem(i, 0, text);
 
         list[i] = it->first;
         m_colours[i] = RosegardenGUIColours::convertColour(it->second.first);
Index: gui/rosegardenconfiguredialog.cpp
===================================================================
RCS file: /cvsroot/rosegarden/gui/rosegardenconfiguredialog.cpp,v
retrieving revision 1.119
diff -u -p -r1.119 rosegardenconfiguredialog.cpp
--- gui/rosegardenconfiguredialog.cpp   22 Jul 2003 21:00:50 -0000      1.119
+++ gui/rosegardenconfiguredialog.cpp   25 Jul 2003 14:05:55 -0000
@@ -47,6 +47,7 @@
 #include <qstringlist.h>
 #include <qtable.h>
 #include <qheader.h>
+#include <qinputdialog.h>
 
 #include <kcombobox.h>
 #include <klistview.h>
@@ -1769,15 +1770,24 @@ ColourConfigurationPage::slotAddNew()
 {
     QColor temp;
 
-    KColorDialog box(this, "", true);
+    bool ok = false;
 
-    int result = box.getColor( temp );
-
-    if (result == KColorDialog::Accepted)
+    QString newName = QInputDialog::getText(i18n("New Colour Name"), i18n("Enter new 
name"),
+                                            QLineEdit::Normal, i18n("New"), &ok);
+    if ((ok == true) && (!newName.isEmpty()))
     {
-        Rosegarden::Colour temp2 = RosegardenGUIColours::convertColour(temp);
-        m_map.addItem(temp2, i18n("New").ascii());
-        m_colourtable->populate_table(m_map, m_listmap);
+        KColorDialog box(this, "", true);
+
+        int result = box.getColor( temp );
+
+        if (result == KColorDialog::Accepted)
+        {
+            Rosegarden::Colour temp2 = RosegardenGUIColours::convertColour(temp);
+            m_map.addItem(temp2, qstrtostr(newName));
+            m_colourtable->populate_table(m_map, m_listmap);
+        }
+    // Else we don't do anything as they either didn't give a name 
+    //  or didn't give a colour
     }
 
 }

Reply via email to