Beispiel #1
0
void KviIconWidget::init()
{
	setWindowTitle(__tr2qs("Icon Table"));
	setWindowIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::IconManager))));

	int iRows = KviIconManager::IconCount / 20;
	if((iRows * 20) < KviIconManager::IconCount)
		iRows++;

	QGridLayout * pLayout = new QGridLayout(this);
	int i;
	for(i = 0; i < 20; i++)
	{
		KviCString szTmp(KviCString::Format,"%d",i);
		QLabel * pLabel = new QLabel(szTmp.ptr(),this);
		pLayout->addWidget(pLabel,0,i + 1);
	}
	for(i = 0; i < iRows; i++)
	{
		KviCString szTmp(KviCString::Format,"%d",i * 20);
		QLabel * pLabel = new QLabel(szTmp.ptr(),this);
		pLayout->addWidget(pLabel,i + 1,0);
	}
	for(i = 0; i < KviIconManager::IconCount; i++)
	{
		KviCString szTmp(KviCString::Format,"%d",i);
		QLabel * pLabel = new QLabel(this);
		pLabel->setObjectName(szTmp.ptr());
		pLabel->setPixmap(*(g_pIconManager->getSmallIcon(i)));
		pLabel->installEventFilter(this);
		pLabel->setAcceptDrops(true);
		pLayout->addWidget(pLabel,(i / 20) + 1,(i % 20) + 1);
	}
}
void TabBarWidget::tabInserted(int index)
{
	setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);

	QTabBar::tabInserted(index);

	if (m_showUrlIcon)
	{
		QLabel *label = new QLabel();
		label->setFixedSize(QSize(16, 16));

		setTabButton(index, m_iconButtonPosition, label);
	}
	else
	{
		setTabButton(index, m_iconButtonPosition, NULL);
	}

	if (m_showCloseButton || getTabProperty(index, QLatin1String("isPinned"), false).toBool())
	{
		QLabel *label = new QLabel();
		label->setFixedSize(QSize(16, 16));
		label->installEventFilter(this);

		setTabButton(index, m_closeButtonPosition, label);
	}

	updateTabs();

	emit tabsAmountChanged(count());
}
void FilterItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
	QAbstractItemView *view = qobject_cast<QAbstractItemView*>(parent());
	QLabel *label;

	if (view->indexWidget(index) == 0)
	{
		label = new QLabel();

		label->installEventFilter(filter);
		label->setAutoFillBackground(true);
		label->setFocusPolicy(Qt::TabFocus);
		label->setText(index.data().toString());
		view->setIndexWidget(index, label);
	}

	label = (QLabel*)view->indexWidget(index);

	if (option.state & QStyle::State_Selected)
		if (option.state & QStyle::State_HasFocus)
			label->setBackgroundRole(QPalette::Highlight);
		else
			label->setBackgroundRole(QPalette::Window);
	else
		label->setBackgroundRole(QPalette::Base);
}
Beispiel #4
0
void KStatusBar::insertPermanentItem( const QString& text, int id, int stretch)
{
    if (d->items[id]) {
        kDebug() << "KStatusBar::insertPermanentItem: item id " << id << " already exists.";
    }

    QLabel *l = new QLabel( text, this );
    l->installEventFilter( this );
    l->setFixedHeight( fontMetrics().height() + 2 );
    l->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
    d->items.insert( id, l );
    addPermanentWidget( l, stretch );
    l->show();
}
Beispiel #5
0
void CloudView::createLoadingFailedView()
{
    loading_failed_view_ = new QWidget(this);

    QVBoxLayout *layout = new QVBoxLayout;
    loading_failed_view_->setLayout(layout);

    QLabel *label = new QLabel;
    label->setObjectName(kLoadingFaieldLabelName);
    QString link = QString("<a style=\"color:#777\" href=\"#\">%1</a>").arg(tr("retry"));
    QString label_text = tr("Failed to get libraries information<br/>"
                            "Please %1").arg(link);
    label->setText(label_text);
    label->setAlignment(Qt::AlignCenter);

    connect(label, SIGNAL(linkActivated(const QString&)),
            this, SLOT(onRefreshClicked()));
    label->installEventFilter(this);

    layout->addWidget(label);
}
Beispiel #6
0
/* Overloading the AbstractController one, because we don't manage the
   Spacing items in the same ways */
void DroppingController::createAndAddWidget( QBoxLayout *newControlLayout,
                                             int i_index,
                                             buttonType_e i_type,
                                             int i_option )
{
    /* Special case for SPACERS, who aren't QWidgets */
    if( i_type == WIDGET_SPACER || i_type == WIDGET_SPACER_EXTEND )
    {
        QLabel *label = new QLabel( this );
        label->setPixmap( ImageHelper::loadSvgToPixmap( ":/toolbar/space.svg", height(), height() ) );
        if( i_type == WIDGET_SPACER_EXTEND )
        {
            label->setSizePolicy( QSizePolicy::MinimumExpanding,
                    QSizePolicy::Preferred );

            /* Create a box around it */
            label->setFrameStyle( QFrame::Panel | QFrame::Sunken );
            label->setLineWidth ( 1 );
            label->setAlignment( Qt::AlignCenter );
        }
        else
            label->setSizePolicy( QSizePolicy::Fixed,
                    QSizePolicy::Preferred );

        /* Install event Filter for drag'n drop */
        label->installEventFilter( this );
        newControlLayout->insertWidget( i_index, label );
    }

    /* Normal Widgets */
    else
    {
        QWidget *widg = createWidget( i_type, i_option );
        if( !widg ) return;

        /* Install the Event Filter in order to catch the drag */
        widg->setParent( this );
        widg->installEventFilter( this );

        /* We are in a complex widget, we need to stop events on children too */
        if( i_type >= TIME_LABEL && i_type < SPECIAL_MAX )
        {
            QList<QObject *>children = widg->children();

            QObject *child;
            foreach( child, children )
            {
                QWidget *childWidg;
                if( ( childWidg = qobject_cast<QWidget *>( child ) ) )
                {
                    child->installEventFilter( this );
                    childWidg->setEnabled( true );
                }
            }

            /* Decorating the frames when possible */
            QFrame *frame;
            if( (i_type >= MENU_BUTTONS || i_type == TIME_LABEL) /* Don't bother to check for volume */
                && ( frame = qobject_cast<QFrame *>( widg ) ) != NULL )
            {
                frame->setFrameStyle( QFrame::Panel | QFrame::Raised );
                frame->setLineWidth ( 1 );
            }
        }
QBalloonTip::QBalloonTip(QSystemTrayIcon::MessageIcon icon, const QString& title,
                         const QString& message, QSystemTrayIcon *ti)
    : QWidget(0, Qt::ToolTip), trayIcon(ti), timerId(-1)
{
    setAttribute(Qt::WA_DeleteOnClose);
    QObject::connect(ti, SIGNAL(destroyed()), this, SLOT(close()));

    QLabel *titleLabel = new QLabel;
    titleLabel->installEventFilter(this);
    titleLabel->setText(title);
    QFont f = titleLabel->font();
    f.setBold(true);
#ifdef Q_WS_WINCE
    f.setPointSize(f.pointSize() - 2);
#endif
    titleLabel->setFont(f);
    titleLabel->setTextFormat(Qt::PlainText); // to maintain compat with windows

#ifdef Q_WS_WINCE
    const int iconSize = style()->pixelMetric(QStyle::PM_SmallIconSize);
    const int closeButtonSize = style()->pixelMetric(QStyle::PM_SmallIconSize) - 2;
#else
    const int iconSize = 18;
    const int closeButtonSize = 15;
#endif

    QPushButton *closeButton = new QPushButton;
    closeButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarCloseButton));
    closeButton->setIconSize(QSize(closeButtonSize, closeButtonSize));
    closeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    closeButton->setFixedSize(closeButtonSize, closeButtonSize);
    QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));

    QLabel *msgLabel = new QLabel;
#ifdef Q_WS_WINCE
    f.setBold(false);
    msgLabel->setFont(f);
#endif
    msgLabel->installEventFilter(this);
    msgLabel->setText(message);
    msgLabel->setTextFormat(Qt::PlainText);
    msgLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);

    // smart size for the message label
#ifdef Q_WS_WINCE
    int limit = QApplication::desktop()->availableGeometry(msgLabel).size().width() / 2;
#else
    int limit = QApplication::desktop()->availableGeometry(msgLabel).size().width() / 3;
#endif
    if (msgLabel->sizeHint().width() > limit) {
        msgLabel->setWordWrap(true);
        if (msgLabel->sizeHint().width() > limit) {
            msgLabel->d_func()->ensureTextControl();
            if (QTextControl *control = msgLabel->d_func()->control) {
                QTextOption opt = control->document()->defaultTextOption();
                opt.setWrapMode(QTextOption::WrapAnywhere);
                control->document()->setDefaultTextOption(opt);
            }
        }
#ifdef Q_WS_WINCE
        // Make sure that the text isn't wrapped "somewhere" in the balloon widget
        // in the case that we have a long title label.
        setMaximumWidth(limit);
#else
        // Here we allow the text being much smaller than the balloon widget
        // to emulate the weird standard windows behavior.
        msgLabel->setFixedSize(limit, msgLabel->heightForWidth(limit));
#endif
    }

    QIcon si;
    switch (icon) {
    case QSystemTrayIcon::Warning:
        si = style()->standardIcon(QStyle::SP_MessageBoxWarning);
        break;
    case QSystemTrayIcon::Critical:
	si = style()->standardIcon(QStyle::SP_MessageBoxCritical);
        break;
    case QSystemTrayIcon::Information:
	si = style()->standardIcon(QStyle::SP_MessageBoxInformation);
        break;
    case QSystemTrayIcon::NoIcon:
    default:
        break;
    }

    QGridLayout *layout = new QGridLayout;
    if (!si.isNull()) {
        QLabel *iconLabel = new QLabel;
        iconLabel->setPixmap(si.pixmap(iconSize, iconSize));
        iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
        iconLabel->setMargin(2);
        layout->addWidget(iconLabel, 0, 0);
        layout->addWidget(titleLabel, 0, 1);
    } else {
        layout->addWidget(titleLabel, 0, 0, 1, 2);
    }

    layout->addWidget(closeButton, 0, 2);
    layout->addWidget(msgLabel, 1, 0, 1, 3);
    layout->setSizeConstraint(QLayout::SetFixedSize);
    layout->setMargin(3);
    setLayout(layout);

    QPalette pal = palette();
    pal.setColor(QPalette::Window, QColor(0xff, 0xff, 0xe1));
    pal.setColor(QPalette::WindowText, Qt::black);
    setPalette(pal);
}
Beispiel #8
0
void KMix::createWidgets()
{
  QPixmap miniDevPM;
  QPixmap WMminiIcon = globalKIL->loadIcon("mixer_mini.xpm");

  // keep this enum local. It is really only needed here
  enum {audioIcon, bassIcon, cdIcon, extIcon, microphoneIcon,
	midiIcon, recmonIcon,trebleIcon, unknownIcon, volumeIcon };
#ifdef ALSA /* not sure if this is for ALSA in general or just my SB16 */
  char DefaultMixerIcons[]={
    volumeIcon,		bassIcon,	trebleIcon,	midiIcon,	audioIcon,
    extIcon,	microphoneIcon,	cdIcon, recmonIcon, recmonIcon, unknownIcon
  };
  const unsigned char numDefaultMixerIcons=11;
#else
  char DefaultMixerIcons[]={
    volumeIcon,		bassIcon,	trebleIcon,	midiIcon,	audioIcon,
    unknownIcon,	extIcon,	microphoneIcon,	cdIcon,		recmonIcon,
    audioIcon,		recmonIcon,	recmonIcon,	recmonIcon,	extIcon,
    extIcon,		extIcon
  };
  const unsigned char numDefaultMixerIcons=17;
#endif
  // Init DnD: Set up drop zone and drop handler
  //  dropZone = new KDNDDropZone( this, DndURL );
  //connect( dropZone, SIGNAL( dropAction( KDNDDropZone* )),
  //	   SLOT( onDrop( KDNDDropZone*)));

  // Window title
  setCaption( globalKapp->getCaption() );

  // Create a big container containing every widget of this toplevel
  Container  = new QWidget(this);
  setView(Container);
  // Create Menu
  createMenu();
  setMenu(mainmenu);
  // Create Sliders (Volume indicators)
  MixDevice *MixPtr = mix->First;
  while (MixPtr) {
    // If you encounter a relayout signal from a mixer device, obey blindly ;-)
    connect((QObject*)MixPtr, SIGNAL(relayout()), this, SLOT(placeWidgets()));

    int devnum = MixPtr->device_num;


    // Figure out default icon
    unsigned char iconnum;
    if (devnum < numDefaultMixerIcons)
      iconnum=DefaultMixerIcons[devnum];
    else
      iconnum=unknownIcon;
    switch (iconnum) {
      // TODO: Should be replaceable by user.
    case audioIcon:
      miniDevPM = globalKIL->loadIcon("mix_audio.xpm");	break;
    case bassIcon:
      miniDevPM = globalKIL->loadIcon("mix_bass.xpm");	break;
    case cdIcon:
      miniDevPM = globalKIL->loadIcon("mix_cd.xpm");	break;
    case extIcon:
      miniDevPM = globalKIL->loadIcon("mix_ext.xpm");	break;
    case microphoneIcon:
      miniDevPM = globalKIL->loadIcon("mix_microphone.xpm");break;
    case midiIcon:
      miniDevPM = globalKIL->loadIcon("mix_midi.xpm");	break;
    case recmonIcon:
      miniDevPM = globalKIL->loadIcon("mix_recmon.xpm");	break;
    case trebleIcon:
      miniDevPM = globalKIL->loadIcon("mix_treble.xpm");	break;
    case unknownIcon:
      miniDevPM = globalKIL->loadIcon("mix_unknown.xpm");	break;
    case volumeIcon:
      miniDevPM = globalKIL->loadIcon("mix_volume.xpm");	break;
    default:
      miniDevPM = globalKIL->loadIcon("mix_unknown.xpm");	break;
    }

    QLabel *qb = new QLabel(Container);
    if (! miniDevPM.isNull()) {
      qb->setPixmap(miniDevPM);
      qb->installEventFilter(this);
    }
    else
      cerr << "Pixmap missing.\n";
    MixPtr->picLabel=qb;
    qb->resize(miniDevPM.width(),miniDevPM.height());


    QSlider *VolSB = new QSlider( 0, 100, 10, MixPtr->Left->volume,\
				  QSlider::Vertical, Container, "VolL");

    MixPtr->Left->slider = VolSB;  // Remember the Slider (for the eventFilter)
    connect( VolSB, SIGNAL(valueChanged(int)), MixPtr->Left, SLOT(VolChanged(int)));
    VolSB->installEventFilter(this);
    // Create a second slider, when the current channel is a stereo channel.
    bool BothSliders = (MixPtr->is_stereo  == true );

    if ( BothSliders) {
      QSlider *VolSB2 = new QSlider( 0, 100, 10, MixPtr->Right->volume,\
				     QSlider::Vertical, Container, "VolR");
      MixPtr->Right->slider= VolSB2;  // Remember Slider (for eventFilter)
      connect( VolSB2, SIGNAL(valueChanged(int)), MixPtr->Right, SLOT(VolChanged(int)));
      VolSB2->installEventFilter(this);

    }
    MixPtr=MixPtr->Next;
    // Append MixEntry of current mixer device
  }

  // Create the Left-Right-Slider, add Tooltip and Context menu
  LeftRightSB = new QSlider( -100, 100, 25, 0,\
			     QSlider::Horizontal, Container, "RightLeft");
  connect( LeftRightSB, SIGNAL(valueChanged(int)), \
	   this, SLOT(MbalChangeCB(int)));
  LeftRightSB->installEventFilter(this);
  QToolTip::add( LeftRightSB, "Left/Right balancing" );
}
void MainWindow::showRoomGrid()
{
    if(0!=Grid || 0!=scroll || 0!=layout)
    {
        delete Grid;
        delete scroll;
        delete layout;
    }
    layout = new QVBoxLayout();
    scroll = new QScrollArea(this);
    Grid = new QGridLayout(this);

    Grid->setHorizontalSpacing(6);
    Grid->setVerticalSpacing(6);
    scroll->setLayout(Grid);
    layout->addWidget(scroll);

    ui->Tabs2->widget(0)->setLayout(layout);
    vector<Room> Room;
    QString RoomNumTitle,RoomFloor;

    Room = RM.fetchAllRooms();

    int RoomSize=Room.size();
    int i=0,j=0;
    int num=0,RoomNum=0;

    while(num!=RoomSize)
    {
        QLabel * RoomLabel = new QLabel(this);
        RoomLabel->setGeometry(0,0,310,180);
        RoomLabel->setFrameShape(QFrame::Box);
        RoomLabel->setFrameShadow(QFrame::Sunken);
        RoomLabel->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
        RoomLabel->setFont(QFont( "Comic Sans MS", 8, QFont::Bold ));
        //-----------------------------------------------------------
        RoomNumTitle.setNum(Room[RoomNum].getRoomNumber());
        RoomFloor.setNum(Room[RoomNum].getRoomFloor());
        RoomLabel->setObjectName(RoomNumTitle);
        RoomLabel->setText("Num:"+RoomNumTitle+"\n Floor:"+RoomFloor);
        //-----------------------------------------------------------
        if(RM.getStatus(Room[RoomNum].getRoomNumber(),QDate::currentDate(),QDate::currentDate())==false)
            RoomLabel->setStyleSheet("color: white; background-color:green;");
        else
            RoomLabel->setStyleSheet("color: white; background-color:red;");
        //-----------------------------------------------------------
        RoomLabel->installEventFilter(this);
        Grid->addWidget(RoomLabel,i,j);
        num++;
        if(j<5)
        {
            j++;
        }
        else
        {
            j=0;
            i++;
        }
        RoomNum++;
    }
}
    AccountInfoPanel::AccountInfoPanel(Service * service, QWidget * parent)
        : QWidget(parent), service(service), serviceNameAlternative(false)
    {
        // Get defaults
        QVariantMap defaults(Utopia::defaults());

        serviceInfoLayout = new QGridLayout(this);

        // Account type (hidden until there are more possibilities)
        QLabel * serviceTypeLabel = new QLabel("Account type:");
        serviceInfoLayout->addWidget(serviceTypeLabel, 0, 0, Qt::AlignRight);
        serviceTypeLabel->hide();
        serviceType = new QLabel;
        serviceInfoLayout->addWidget(serviceType, 0, 1, 1, 2);
        serviceType->hide();

        // Service name
        QLabel * serviceNameLabel = new QLabel("Service name:");
        serviceNameLabel->installEventFilter(this);
        serviceInfoLayout->addWidget(serviceNameLabel, 1, 0, Qt::AlignRight);
        serviceName = new QLabel;
        serviceName->installEventFilter(this);
        serviceInfoLayout->addWidget(serviceName, 1, 1, 1, 2);

        // Account description
        serviceInfoLayout->addWidget(new QLabel("Description:"), 2, 0, Qt::AlignRight);
        descriptionLineEdit = new QLineEdit;
        connect(descriptionLineEdit, SIGNAL(textEdited(const QString &)), this, SLOT(onDescriptionChanged(const QString &)));
        serviceInfoLayout->addWidget(descriptionLineEdit, 2, 1, 1, 2);

        // Credentials
        // The following renaming is a temporary fix for commercial users whose usernames
        // are not email addresses
        userNameLabel = new QLabel(defaults.value("rename_username", "Email address").toString() + ":");
        serviceInfoLayout->addWidget(userNameLabel, 3, 0, Qt::AlignRight);
        userName = new QLineEdit;
        connect(userName, SIGNAL(textEdited(const QString &)), this, SLOT(onUserNameChanged(const QString &)));
        serviceInfoLayout->addWidget(userName, 3, 1);
        registerLabel = new QLabel("<a href='register' style='text-decoration: none'>Register</a>");
        registerLabel->setProperty("class", "link");
        connect(registerLabel, SIGNAL(linkActivated(const QString &)), this, SLOT(onLinkActivated(const QString &)));
        serviceInfoLayout->addWidget(registerLabel, 3, 2);
        passwordLabel = new QLabel("Password:"******"<a href='resetPassword' style='text-decoration: none'>Reset Password</a>");
        resetPasswordLabel->setProperty("class", "link");
        connect(resetPasswordLabel, SIGNAL(linkActivated(const QString &)), this, SLOT(onLinkActivated(const QString &)));
        serviceInfoLayout->addWidget(resetPasswordLabel, 4, 2);
        anonymousCheckBox = new QCheckBox("Use anonymously");
        connect(anonymousCheckBox, SIGNAL(clicked(bool)), this, SLOT(onAnonymousChanged(bool)));
        serviceInfoLayout->addWidget(anonymousCheckBox, 5, 1, 1, 2, Qt::AlignTop);

        profileButton = new QPushButton("User profile...");
        connect(profileButton, SIGNAL(clicked()), this, SLOT(onProfileButtonClicked()));
        serviceInfoLayout->addWidget(profileButton, 6, 0, 1, 3, Qt::AlignRight);

        // Disclaimer text
        disclaimer = new QLabel;
        disclaimer->setAlignment(Qt::AlignBottom | Qt::AlignLeft);
        disclaimer->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
        disclaimer->setObjectName("disclaimer");
        serviceInfoLayout->addWidget(disclaimer, 6, 1, 1, 2);

        // Layout
        serviceInfoLayout->setColumnStretch(0, 0);
        serviceInfoLayout->setColumnStretch(1, 1);
        serviceInfoLayout->setRowStretch(0, 0);
        serviceInfoLayout->setRowStretch(1, 0);
        serviceInfoLayout->setRowStretch(2, 0);
        serviceInfoLayout->setRowStretch(3, 0);
        serviceInfoLayout->setRowStretch(4, 0);
        serviceInfoLayout->setRowStretch(5, 1);
        serviceInfoLayout->setRowStretch(6, 1);

        refreshInformation();

        setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);

        connect(service, SIGNAL(serviceStateChanged(Kend::Service::ServiceState)), this, SLOT(onServiceStateChanged(Kend::Service::ServiceState)));

        onServiceStateChanged(service->serviceState());
    }
PlayerWidget::PlayerWidget(QWidget *parent) :
	QWidget(parent),
	m_subtitle(0),
	m_translationMode(false),
	m_showTranslation(false),
	m_overlayLine(0),
	m_playingLine(0),
	m_fullScreenTID(0),
	m_fullScreenMode(false),
	m_player(Player::instance()),
	m_lengthString(UNKNOWN_LENGTH_STRING),
	m_updatePositionControls(1),
	m_updateVideoPosition(false),
	m_updateVolumeControls(true),
	m_updatePlayerVolume(false),
	m_showPositionTimeEdit(app()->playerConfig()->showPositionTimeEdit())
{
	m_layeredWidget = new LayeredWidget(this);
	m_layeredWidget->setAcceptDrops(true);
	m_layeredWidget->installEventFilter(this);
	m_layeredWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

	m_player->initialize(m_layeredWidget, app()->playerConfig()->playerBackend());

	connect(m_player, SIGNAL(backendInitialized(ServiceBackend *)), this, SLOT(onPlayerBackendInitialized()));

	m_textOverlay = new TextOverlayWidget(m_layeredWidget);
	m_textOverlay->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);

	m_seekSlider = new PointingSlider(Qt::Horizontal, this);
	m_seekSlider->setTickPosition(QSlider::NoTicks);
	m_seekSlider->setTracking(false);
	m_seekSlider->setMinimum(0);
	m_seekSlider->setMaximum(1000);
	m_seekSlider->setPageStep(10);
	m_seekSlider->setFocusPolicy(Qt::NoFocus);

	m_infoControlsGroupBox = new QGroupBox(this);
	m_infoControlsGroupBox->setAcceptDrops(true);
	m_infoControlsGroupBox->installEventFilter(this);

	QLabel *positionTagLabel = new QLabel(m_infoControlsGroupBox);
	positionTagLabel->setText(i18n("<b>Position</b>"));
	positionTagLabel->installEventFilter(this);

	m_positionLabel = new QLabel(m_infoControlsGroupBox);
	m_positionEdit = new TimeEdit(m_infoControlsGroupBox);
	m_positionEdit->setFocusPolicy(Qt::NoFocus);

	QLabel *lengthTagLabel = new QLabel(m_infoControlsGroupBox);
	lengthTagLabel->setText(i18n("<b>Length</b>"));
	lengthTagLabel->installEventFilter(this);
	m_lengthLabel = new QLabel(m_infoControlsGroupBox);

	QLabel *fpsTagLabel = new QLabel(m_infoControlsGroupBox);
	fpsTagLabel->setText(i18n("<b>FPS</b>"));
	fpsTagLabel->installEventFilter(this);
	m_fpsLabel = new QLabel(m_infoControlsGroupBox);

	m_fpsLabel->setMinimumWidth(m_positionEdit->sizeHint().width());        // sets the minimum width for the whole group

	m_volumeSlider = new PointingSlider(Qt::Vertical, this);
	m_volumeSlider->setFocusPolicy(Qt::NoFocus);
	m_volumeSlider->setTickPosition(QSlider::NoTicks);
//  m_volumeSlider->setInvertedAppearance( true );
	m_volumeSlider->setTracking(true);
	m_volumeSlider->setPageStep(5);
	m_volumeSlider->setMinimum(0);
	m_volumeSlider->setMaximum(100);
	m_volumeSlider->setFocusPolicy(Qt::NoFocus);

	QGridLayout *videoControlsLayout = new QGridLayout();
	videoControlsLayout->setMargin(0);
	videoControlsLayout->setSpacing(2);
	videoControlsLayout->addWidget(createToolButton(this, ACT_PLAY_PAUSE, 16), 0, 0);
	videoControlsLayout->addWidget(createToolButton(this, ACT_STOP, 16), 0, 1);
	videoControlsLayout->addWidget(createToolButton(this, ACT_SEEK_BACKWARDS, 16), 0, 2);
	videoControlsLayout->addWidget(createToolButton(this, ACT_SEEK_FORWARDS, 16), 0, 3);
	videoControlsLayout->addItem(new QSpacerItem(2, 2), 0, 4);
	videoControlsLayout->addWidget(createToolButton(this, ACT_SEEK_TO_PREVIOUS_LINE, 16), 0, 5);
	videoControlsLayout->addWidget(createToolButton(this, ACT_SEEK_TO_NEXT_LINE, 16), 0, 6);
	videoControlsLayout->addItem(new QSpacerItem(2, 2), 0, 7);
	videoControlsLayout->addWidget(createToolButton(this, ACT_SET_CURRENT_LINE_SHOW_TIME, 16), 0, 8);
	videoControlsLayout->addWidget(createToolButton(this, ACT_SET_CURRENT_LINE_HIDE_TIME, 16), 0, 9);
	videoControlsLayout->addItem(new QSpacerItem(2, 2), 0, 10);
	videoControlsLayout->addWidget(createToolButton(this, ACT_CURRENT_LINE_FOLLOWS_VIDEO, 16), 0, 11);
	videoControlsLayout->addWidget(m_seekSlider, 0, 12);

	QGridLayout *audioControlsLayout = new QGridLayout();
	audioControlsLayout->setMargin(0);
	audioControlsLayout->addWidget(createToolButton(this, ACT_TOGGLE_MUTED, 16), 0, 0, Qt::AlignHCenter);
	audioControlsLayout->addWidget(m_volumeSlider, 1, 0, Qt::AlignHCenter);

	QGridLayout *infoControlsLayout = new QGridLayout(m_infoControlsGroupBox);
	infoControlsLayout->setSpacing(5);
	infoControlsLayout->addWidget(fpsTagLabel, 0, 0);
	infoControlsLayout->addWidget(m_fpsLabel, 1, 0);
	infoControlsLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding), 2, 0);
	infoControlsLayout->addWidget(lengthTagLabel, 3, 0);
	infoControlsLayout->addWidget(m_lengthLabel, 4, 0);
	infoControlsLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding), 5, 0);
	infoControlsLayout->addWidget(positionTagLabel, 6, 0);
	infoControlsLayout->addWidget(m_positionLabel, 7, 0);
	infoControlsLayout->addWidget(m_positionEdit, 8, 0);

	m_mainLayout = new QGridLayout(this);
	m_mainLayout->setMargin(0);
	m_mainLayout->setSpacing(5);
	m_mainLayout->addWidget(m_infoControlsGroupBox, 0, 0, 2, 1);
	m_mainLayout->addWidget(m_layeredWidget, 0, 1);
	m_mainLayout->addLayout(audioControlsLayout, 0, 2);
	m_mainLayout->addLayout(videoControlsLayout, 1, 1);
	m_mainLayout->addWidget(createToolButton(this, ACT_TOGGLE_FULL_SCREEN, 16), 1, 2);

	m_fullScreenControls = new AttachableWidget(AttachableWidget::Bottom, 4);
	m_fullScreenControls->setAutoFillBackground(true);
	m_layeredWidget->setWidgetMode(m_fullScreenControls, LayeredWidget::IgnoreResize);

	m_fsSeekSlider = new PointingSlider(Qt::Horizontal, m_fullScreenControls);
	m_fsSeekSlider->setTickPosition(QSlider::NoTicks);
	m_fsSeekSlider->setTracking(false);
	m_fsSeekSlider->setMinimum(0);
	m_fsSeekSlider->setMaximum(1000);
	m_fsSeekSlider->setPageStep(10);

	m_fsVolumeSlider = new PointingSlider(Qt::Horizontal, m_fullScreenControls);
	m_fsVolumeSlider->setFocusPolicy(Qt::NoFocus);
	m_fsVolumeSlider->setTickPosition(QSlider::NoTicks);
	m_fsVolumeSlider->setTracking(true);
	m_fsVolumeSlider->setPageStep(5);
	m_fsVolumeSlider->setMinimum(0);
	m_fsVolumeSlider->setMaximum(100);

	m_fsPositionLabel = new QLabel(m_fullScreenControls);
	QPalette fsPositionPalette;
	fsPositionPalette.setColor(m_fsPositionLabel->backgroundRole(), Qt::black);
	fsPositionPalette.setColor(m_fsPositionLabel->foregroundRole(), Qt::white);
	m_fsPositionLabel->setPalette(fsPositionPalette);
	m_fsPositionLabel->setAutoFillBackground(true);
	m_fsPositionLabel->setFrameShape(QFrame::Panel);
	m_fsPositionLabel->setText(Time().toString(false) + " /  " + Time().toString(false));
	m_fsPositionLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
	m_fsPositionLabel->adjustSize();
	m_fsPositionLabel->setMinimumWidth(m_fsPositionLabel->width());

	QHBoxLayout *fullScreenControlsLayout = new QHBoxLayout(m_fullScreenControls);
	fullScreenControlsLayout->setMargin(0);
	fullScreenControlsLayout->setSpacing(0);

	const int FS_BUTTON_SIZE = 32;
	fullScreenControlsLayout->addWidget(createToolButton(m_fullScreenControls, ACT_PLAY_PAUSE, FS_BUTTON_SIZE));
	fullScreenControlsLayout->addWidget(createToolButton(m_fullScreenControls, ACT_STOP, FS_BUTTON_SIZE));
	fullScreenControlsLayout->addWidget(createToolButton(m_fullScreenControls, ACT_SEEK_BACKWARDS, FS_BUTTON_SIZE));
	fullScreenControlsLayout->addWidget(createToolButton(m_fullScreenControls, ACT_SEEK_FORWARDS, FS_BUTTON_SIZE));
	fullScreenControlsLayout->addSpacing(3);
	fullScreenControlsLayout->addWidget(createToolButton(m_fullScreenControls, ACT_SEEK_TO_PREVIOUS_LINE, FS_BUTTON_SIZE));
	fullScreenControlsLayout->addWidget(createToolButton(m_fullScreenControls, ACT_SEEK_TO_NEXT_LINE, FS_BUTTON_SIZE));
	fullScreenControlsLayout->addSpacing(3);
	fullScreenControlsLayout->addWidget(m_fsSeekSlider, 9);
//  fullScreenControlsLayout->addSpacing( 1 );
	fullScreenControlsLayout->addWidget(m_fsPositionLabel);
	fullScreenControlsLayout->addWidget(m_fsVolumeSlider, 2);
	fullScreenControlsLayout->addWidget(createToolButton(m_fullScreenControls, ACT_TOGGLE_MUTED, FS_BUTTON_SIZE));
	fullScreenControlsLayout->addWidget(createToolButton(m_fullScreenControls, ACT_TOGGLE_FULL_SCREEN, FS_BUTTON_SIZE));
	m_fullScreenControls->adjustSize();

	connect(m_volumeSlider, SIGNAL(valueChanged(int)), this, SLOT(onVolumeSliderValueChanged(int)));
	connect(m_fsVolumeSlider, SIGNAL(valueChanged(int)), this, SLOT(onVolumeSliderValueChanged(int)));

	connect(m_seekSlider, SIGNAL(valueChanged(int)), this, SLOT(onSeekSliderValueChanged(int)));
	connect(m_seekSlider, SIGNAL(sliderMoved(int)), this, SLOT(onSeekSliderMoved(int)));
	connect(m_seekSlider, SIGNAL(sliderPressed()), this, SLOT(onSeekSliderPressed()));
	connect(m_seekSlider, SIGNAL(sliderReleased()), this, SLOT(onSeekSliderReleased()));
	connect(m_fsSeekSlider, SIGNAL(valueChanged(int)), this, SLOT(onSeekSliderValueChanged(int)));
	connect(m_fsSeekSlider, SIGNAL(sliderMoved(int)), this, SLOT(onSeekSliderMoved(int)));
	connect(m_fsSeekSlider, SIGNAL(sliderPressed()), this, SLOT(onSeekSliderPressed()));
	connect(m_fsSeekSlider, SIGNAL(sliderReleased()), this, SLOT(onSeekSliderReleased()));

	connect(m_positionEdit, SIGNAL(valueChanged(int)), this, SLOT(onPositionEditValueChanged(int)));
	connect(m_positionEdit, SIGNAL(valueEntered(int)), this, SLOT(onPositionEditValueChanged(int)));

	connect(app()->playerConfig(), SIGNAL(optionChanged(const QString &, const QString &)), this, SLOT(onPlayerOptionChanged(const QString &, const QString &)));

	connect(m_player, SIGNAL(fileOpened(const QString &)), this, SLOT(onPlayerFileOpened(const QString &)));
	connect(m_player, SIGNAL(fileOpenError(const QString &)), this, SLOT(onPlayerFileOpenError(const QString &)));
	connect(m_player, SIGNAL(fileClosed()), this, SLOT(onPlayerFileClosed()));
	connect(m_player, SIGNAL(playbackError(const QString &)), this, SLOT(onPlayerPlaybackError(const QString &)));
	connect(m_player, SIGNAL(playing()), this, SLOT(onPlayerPlaying()));
	connect(m_player, SIGNAL(stopped()), this, SLOT(onPlayerStopped()));
	connect(m_player, SIGNAL(positionChanged(double)), this, SLOT(onPlayerPositionChanged(double)));
	connect(m_player, SIGNAL(lengthChanged(double)), this, SLOT(onPlayerLengthChanged(double)));
	connect(m_player, SIGNAL(framesPerSecondChanged(double)), this, SLOT(onPlayerFramesPerSecondChanged(double)));
	connect(m_player, SIGNAL(volumeChanged(double)), this, SLOT(onPlayerVolumeChanged(double)));

	connect(m_player, SIGNAL(leftClicked(const QPoint &)), this, SLOT(onPlayerLeftClicked(const QPoint &)));
	connect(m_player, SIGNAL(rightClicked(const QPoint &)), this, SLOT(onPlayerRightClicked(const QPoint &)));
	connect(m_player, SIGNAL(doubleClicked(const QPoint &)), this, SLOT(onPlayerDoubleClicked(const QPoint &)));

	setOverlayLine(0);
	onPlayerFileClosed();
	onPlayerOptionChanged(QString(), QString());    // initializes the font
}