/*************************************************************************** * $Id: usability.ui.h,v 1.12 2008/07/31 19:56:28 hoganrobert Exp $ * Copyright (C) 2006 - 2008 Robert Hogan * * robert@roberthogan.net * * * * 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. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "torkconfig.h" #include "portsandnames.h" void Usability::init() { TQListViewItemIterator it(LongLivedPorts); while ( it.current() ) { int i; TQString port; for (i = 0; _port_name[i].port; ++i) { portsandnames_t *pics = &_port_name[i]; if (it.current()->text(0) == pics->name){ port = pics->port; continue; } } if (TorkConfig::longLivedPorts().contains(port)) LongLivedPorts->setSelected(*it,true); ++it; } TQStringList existingTracks = TorkConfig::trackHostExits(); TQListViewItem *tm; for ( TQStringList::Iterator it = existingTracks.begin(); it != existingTracks.end(); ++it ) { if ((*it).isEmpty()) continue; tm = new TQListViewItem(TrackHostExits,(*it)); } } void Usability::LongLivedPorts_selectionChanged() { emit settingsChanged(); } void Usability::PushAdd_clicked() { new TQListViewItem(TrackHostExits,NewHost->text()); } void Usability::TrackHostExits_contextMenuRequested( TQListViewItem *, const TQPoint &point, int ) { TQPopupMenu *menu = new TQPopupMenu( TrackHostExits ); menu->clear(); menu->insertItem( "Delete Entry", this,TQ_SLOT(slotDeleteEntry()) ); menu->popup( point ); } void Usability::slotDeleteEntry( ) { TQListViewItemIterator it(TrackHostExits, TQListViewItemIterator::Selected); while ( it.current() ) { if (TrackHostExits->isSelected( it.current())) delete it.current(); ++it; } } // // // LongLivedPorts // selectionChanged() // Usability // LongLivedPorts_selectionChanged() // // // TrackHostExits // contextMenuRequested(TQListViewItem*,const TQPoint&,int) // Usability // TrackHostExits_contextMenuRequested(TQListViewItem*,const TQPoint&,int) // // // PushAdd // clicked() // Usability // PushAdd_clicked() // // // // usability.ui.h // // // settingsChanged() // // // LongLivedPorts_selectionChanged() // TrackHostExits_contextMenuRequested( TQListViewItem *, const TQPoint & point, int ) // slotDeleteEntry() // PushAdd_clicked() // // // init() // // // void Usability::clearSelected_clicked() { TQListViewItemIterator it(LongLivedPorts, TQListViewItemIterator::Selected); while ( it.current() ) { it.current()->listView()->setSelected(it.current(),false); ++it; } }