~ubuntu-branches/debian/sid/scribus/sid

« back to all changes in this revision

Viewing changes to scribus/colorlistbox.cpp

  • Committer: Package Import Robot
  • Author(s): Oleksandr Moskalenko
  • Date: 2012-02-09 21:50:56 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120209215056-2wrx1ara0jbm7fi5
Tags: 1.4.0.dfsg+r17287-1
* New upstream stable release upload into Debian (Closes: #654703).
* Applied the Ubuntu armel patch.
* Removed non-free color swatches from resources.
* debian/control:
  - Moved icc-profiles from Recommends to Suggests (Closes: #655885).
  - Updated Standards-Version to 3.9.2.
  - Updated extended description per lintian warning.
* debian/rules:
  - Update mailcap (Closes: #630751). A request for mime.types update has
    been sent to the mime-support maintainer.
  - Added build-arch and build-indep targets per lintian warning.
* debian/patches:
  - top_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't copy extra docs and changelogs.
  - scribus_cmakelists.patch - don't install the non-free "doc" dir.
  - profiles_cmakelists.patch - don't install non-free sRGB profile.
* debian/copyright: 
  - Converted to the DEP5 machine readable foramt.
  - Added licenses for free color swatches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
        setItemDelegate(new ColorWideItemDelegate());
194
194
}
195
195
 
 
196
void ColorListBox::changeEvent(QEvent *e)
 
197
{
 
198
        if (e->type() == QEvent::LanguageChange)
 
199
        {
 
200
                languageChange();
 
201
                return;
 
202
        }
 
203
        QListWidget::changeEvent(e);
 
204
}
 
205
 
 
206
void ColorListBox::languageChange()
 
207
{
 
208
        if (this->count() > 0)
 
209
        {
 
210
                QModelIndexList result;
 
211
                QModelIndex start = model()->index(0, 0, this->rootIndex());
 
212
                result =  model()->match(start, Qt::UserRole, CommonStrings::None, 1, Qt::MatchExactly | Qt::MatchCaseSensitive);
 
213
                if (result.isEmpty())
 
214
                        return;
 
215
                int index = result.first().row();
 
216
                QListWidgetItem* item = this->item(index);
 
217
                item->setText(CommonStrings::tr_NoneColor);
 
218
        }
 
219
}
196
220
 
197
221
QString ColorListBox::currentColor() const
198
222
{
242
266
void ColorListBox::addItem(QString text)
243
267
{
244
268
        QListWidget::addItem(text);
 
269
        if (text == CommonStrings::None || text == CommonStrings::tr_NoneColor)
 
270
        {
 
271
                QListWidgetItem* item = this->item(count() - 1);
 
272
                item->setData(Qt::UserRole, CommonStrings::None);
 
273
        }
245
274
}
246
275
 
247
276
void ColorListBox::insertSmallPixmapItems(ColorList& list)