~ubuntu-branches/ubuntu/quantal/kx11grab/quantal

« back to all changes in this revision

Viewing changes to src/settings/loglevelcombobox.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Thomas
  • Date: 2012-05-28 00:05:08 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120528000508-fhxswnrq2zoo983r
Tags: 0.4.4~rc3-0ubuntu1
* New upstream release candidate:
  - Refresh kubuntu_01_fix_linker.diff
  - Add new build-depends: pkg-config, libasound2-dev, libavformat-dev,
    libavcodec-dev, libavutil-dev, libavfilter-dev, libfreetype6-dev,
    libfontconfig1-dev, libpulse-dev, libxrandr-dev, libv4l-dev
  - Build with -DENABLE_KDE_SUPPORT to retain KDE integration.
* Bump debhelper version to 9
* Bump Standards-Version to 3.9.3, no changes necessary

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* This file is part of the qx11grab project
 
3
*
 
4
* Copyright (C) Juergen Heinemann (Undefined) http://qx11grab.hjcms.de, (C) 2007-2012
 
5
*
 
6
* This library is free software; you can redistribute it and/or
 
7
* modify it under the terms of the GNU Library General Public
 
8
* License as published by the Free Software Foundation; either
 
9
* version 2 of the License, or (at your option) any later version.
 
10
*
 
11
* This library is distributed in the hope that it will be useful,
 
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
* Library General Public License for more details.
 
15
*
 
16
* You should have received a copy of the GNU Library General Public License
 
17
* along with this library; see the file COPYING.LIB.  If not, write to
 
18
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
19
* Boston, MA 02110-1301, USA.
 
20
*/
 
21
 
 
22
#include "loglevelcombobox.h"
 
23
 
 
24
/* QtCore */
 
25
#include <QtCore/QDebug>
 
26
#include <QtCore/QVariant>
 
27
 
 
28
/* QtGui */
 
29
#include <QtGui/QIcon>
 
30
 
 
31
LogLevelComboBox::LogLevelComboBox ( QWidget * parent )
 
32
    : QComboBox ( parent )
 
33
{
 
34
  setObjectName ( QLatin1String ( "LogLevelComboBox" ) );
 
35
  /*: ToolTip */
 
36
  setToolTip ( trUtf8 ( "FFmpeg logging level" ) );
 
37
  /*: WhatsThis */
 
38
  setWhatsThis ( trUtf8 ( "Set the logging level used by the FFmpeg application" ) );
 
39
 
 
40
  int index = 0;
 
41
  QIcon icon = QIcon::fromTheme ( "menu-debugger" );
 
42
  insertItem ( index++, icon, trUtf8 ( "Warnings" ), QString::fromUtf8 ( "warning" ) );
 
43
  insertItem ( index++, icon, trUtf8 ( "Information" ), QString::fromUtf8 ( "info" ) );
 
44
  insertItem ( index++, icon, trUtf8 ( "Verbose" ), QString::fromUtf8 ( "verbose" ) );
 
45
  insertItem ( index++, icon, trUtf8 ( "Errors" ), QString::fromUtf8 ( "error" ) );
 
46
  insertItem ( index++, icon, trUtf8 ( "Panic" ), QString::fromUtf8 ( "panic" ) );
 
47
  insertItem ( index++, icon, trUtf8 ( "Fatal" ), QString::fromUtf8 ( "fatal" ) );
 
48
  insertItem ( index++, icon, trUtf8 ( "Manual" ), QString::fromUtf8 ( "NONE" ) );
 
49
  setCurrentIndex ( 0 );
 
50
}
 
51
 
 
52
void LogLevelComboBox::setValue ( const QString &value )
 
53
{
 
54
  for ( int i = 0; i < count(); ++i )
 
55
  {
 
56
    if ( itemData ( i, Qt::UserRole ).toString().compare ( value ) == 0 )
 
57
      setCurrentIndex ( i );
 
58
  }
 
59
}
 
60
 
 
61
const QString LogLevelComboBox::value()
 
62
{
 
63
  QString item = itemData ( currentIndex(), Qt::UserRole ).toString();
 
64
  return ( item.compare ( "NONE" ) == 0 ) ? QString() : item;
 
65
}
 
66
 
 
67
LogLevelComboBox::~LogLevelComboBox()
 
68
{}