You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
3.4 KiB
115 lines
3.4 KiB
15 years ago
|
/***************************************************************************
|
||
|
docking-configuration.cpp - description
|
||
|
-------------------
|
||
|
begin : Son Aug 3 2003
|
||
|
copyright : (C) 2003 by Martin Witte
|
||
|
email : witte@kawo1.rwth-aachen.de
|
||
|
***************************************************************************/
|
||
|
|
||
|
/***************************************************************************
|
||
|
* *
|
||
|
* This program 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. *
|
||
|
* *
|
||
|
***************************************************************************/
|
||
|
|
||
|
#include "docking-configuration.h"
|
||
|
|
||
14 years ago
|
#include <tqcombobox.h>
|
||
|
#include <tqlabel.h>
|
||
13 years ago
|
#include <tqlayout.h>
|
||
14 years ago
|
#include <tqframe.h>
|
||
15 years ago
|
|
||
12 years ago
|
#include <tdelocale.h>
|
||
15 years ago
|
|
||
|
using namespace std;
|
||
|
|
||
14 years ago
|
DockingConfiguration::DockingConfiguration (RadioDocking *docking, TQWidget *parent)
|
||
|
: StationSelector(parent),
|
||
15 years ago
|
m_docking(docking),
|
||
|
m_disableGUIUpdates(false)
|
||
|
{
|
||
13 years ago
|
TQHBoxLayout *layout = new TQHBoxLayout();
|
||
|
TQHBoxLayout *layout2 = new TQHBoxLayout();
|
||
15 years ago
|
|
||
14 years ago
|
m_labelClickMode = new TQLabel(this);
|
||
13 years ago
|
layout->addWidget(m_labelClickMode);
|
||
15 years ago
|
|
||
14 years ago
|
m_comboClickMode = new TQComboBox(this);
|
||
13 years ago
|
layout->addWidget(m_comboClickMode);
|
||
15 years ago
|
|
||
14 years ago
|
TQSpacerItem *spacer = new TQSpacerItem( 20, 2, TQSizePolicy::Expanding, TQSizePolicy::Minimum);
|
||
13 years ago
|
layout->addItem(spacer);
|
||
15 years ago
|
|
||
14 years ago
|
TQFrame *line = new TQFrame(this);
|
||
|
line->setFrameShape ( TQFrame::HLine );
|
||
|
line->setFrameShadow( TQFrame::Sunken );
|
||
13 years ago
|
layout2->addWidget(line);
|
||
15 years ago
|
|
||
|
StationSelectorUILayout->expand(2,0);
|
||
13 years ago
|
StationSelectorUILayout->addMultiCellLayout(layout2, 2, 2, 0, 2);
|
||
|
StationSelectorUILayout->addMultiCellLayout(layout, 3, 3, 0, 2);
|
||
15 years ago
|
|
||
14 years ago
|
connect(m_comboClickMode, TQT_SIGNAL(activated( int )), this, TQT_SLOT(slotSetDirty()));
|
||
15 years ago
|
|
||
|
languageChange();
|
||
|
slotCancel();
|
||
|
}
|
||
|
|
||
|
|
||
|
DockingConfiguration::~DockingConfiguration ()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
|
||
|
void DockingConfiguration::languageChange()
|
||
|
{
|
||
|
StationSelector::languageChange();
|
||
|
m_labelClickMode->setText( i18n( "Left Mouse Click on Tray" ) );
|
||
|
|
||
|
m_comboClickMode->clear();
|
||
|
m_comboClickMode->insertItem(i18n("Show/Hide all GUI Elements"));
|
||
|
m_comboClickMode->insertItem(i18n("Power On/Off"));
|
||
|
}
|
||
|
|
||
|
void DockingConfiguration::slotOK()
|
||
|
{
|
||
|
if (m_dirty) {
|
||
|
StationSelector::slotOK();
|
||
|
bool old = m_disableGUIUpdates;
|
||
|
m_disableGUIUpdates = true;
|
||
|
if (m_docking)
|
||
|
m_docking->setLeftClickAction((LeftClickAction)m_comboClickMode->currentItem());
|
||
|
m_disableGUIUpdates = old;
|
||
|
m_dirty = false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void DockingConfiguration::slotCancel()
|
||
|
{
|
||
|
if (m_dirty) {
|
||
|
StationSelector::slotCancel();
|
||
|
if (m_docking)
|
||
|
m_comboClickMode->setCurrentItem(m_docking->getLeftClickAction());
|
||
|
m_dirty = false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void DockingConfiguration::slotLeftClickActionChanged(LeftClickAction action)
|
||
|
{
|
||
|
if (!m_disableGUIUpdates) {
|
||
|
if (m_docking)
|
||
|
m_comboClickMode->setCurrentItem(action);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void DockingConfiguration::slotSetDirty()
|
||
|
{
|
||
|
m_dirty = true;
|
||
|
}
|
||
|
|
||
|
|
||
|
#include "docking-configuration.moc"
|