From ae364d9bed0589bf1a22cd5f530c563462379e3e Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 22 Feb 2010 18:23:26 +0000 Subject: Added old KDE3 version of kradio git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kradio@1094417 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../gui-docking-menu/docking-configuration.cpp | 114 +++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 kradio3/plugins/gui-docking-menu/docking-configuration.cpp (limited to 'kradio3/plugins/gui-docking-menu/docking-configuration.cpp') diff --git a/kradio3/plugins/gui-docking-menu/docking-configuration.cpp b/kradio3/plugins/gui-docking-menu/docking-configuration.cpp new file mode 100644 index 0000000..3e32c64 --- /dev/null +++ b/kradio3/plugins/gui-docking-menu/docking-configuration.cpp @@ -0,0 +1,114 @@ +/*************************************************************************** + 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" + +#include +#include +#include +#include + +#include + +using namespace std; + +DockingConfiguration::DockingConfiguration (RadioDocking *docking, QWidget *parent) + : StationSelector(parent), + m_docking(docking), + m_disableGUIUpdates(false) +{ + QHBoxLayout *layout = new QHBoxLayout(); + QHBoxLayout *layout2 = new QHBoxLayout(); + + m_labelClickMode = new QLabel(this); + layout->addWidget(m_labelClickMode); + + m_comboClickMode = new QComboBox(this); + layout->addWidget(m_comboClickMode); + + QSpacerItem *spacer = new QSpacerItem( 20, 2, QSizePolicy::Expanding, QSizePolicy::Minimum); + layout->addItem(spacer); + + QFrame *line = new QFrame(this); + line->setFrameShape ( QFrame::HLine ); + line->setFrameShadow( QFrame::Sunken ); + layout2->addWidget(line); + + StationSelectorUILayout->expand(2,0); + StationSelectorUILayout->addMultiCellLayout(layout2, 2, 2, 0, 2); + StationSelectorUILayout->addMultiCellLayout(layout, 3, 3, 0, 2); + + connect(m_comboClickMode, SIGNAL(activated( int )), this, SLOT(slotSetDirty())); + + 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" -- cgit v1.2.1