1 /****************************************************************************
2 ** ui.h extension file, included from the uic-generated form implementation.
4 ** If you wish to add, delete or rename functions or slots use
5 ** Qt Designer which will update this file, preserving your code. Create an
6 ** init() function in place of a constructor, and a destroy() function in
7 ** place of a destructor.
8 *****************************************************************************/
10 void HostProfiles::removeHost()
12 HostPreferences
*hps
= HostPreferences::instance();
14 Q3ListViewItemIterator
it(hostListView
);
17 Q3ListViewItem
*vi
= it
.current();
20 HostPrefPtr hp
= hps
->getHostPref(vi
->text(0), vi
->text(1));
28 removeAllButton
->setEnabled(hostListView
->childCount() > 0);
31 void HostProfiles::removeAllHosts()
33 HostPreferences
*hps
= HostPreferences::instance();
35 Q3ListViewItemIterator
it(hostListView
);
38 Q3ListViewItem
*vi
= it
.current();
39 HostPrefPtr hp
= hps
->getHostPref(vi
->text(0), vi
->text(1));
44 hostListView
->clear();
45 removeAllButton
->setEnabled(false);
49 void HostProfiles::selectionChanged()
51 Q3ListViewItemIterator
it(hostListView
);
54 if (it
.current()->isSelected())
56 removeHostButton
->setEnabled(true);
61 removeHostButton
->setEnabled(false);
65 void HostProfiles::load()
67 HostPreferences
*hps
= HostPreferences::instance();
69 HostPrefPtrList hplist
= hps
->getAllHostPrefs();
70 HostPrefPtrList::iterator it
= hplist
.begin();
71 while ( it
!= hplist
.end() )
74 new K3ListViewItem( hostListView
, hp
->host(), hp
->type(),
75 hp
->prefDescription() );
81 void HostProfiles::save()
83 HostPreferences
*hps
= HostPreferences::instance();
85 HostPrefPtrList::iterator it
= deletedHosts
.begin();
86 while (it
!= deletedHosts
.end())
88 hps
->removeHostPref(*it
);