From ceea23677c61f20759ae986bd77b0d5c4d673edb Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 17 Feb 2010 00:43:50 +0000 Subject: Added old KDE3 version of kbfx git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbfx@1091549 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- configdialog/kbfxconfigdlgplugins.ui.h | 157 +++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 configdialog/kbfxconfigdlgplugins.ui.h (limited to 'configdialog/kbfxconfigdlgplugins.ui.h') diff --git a/configdialog/kbfxconfigdlgplugins.ui.h b/configdialog/kbfxconfigdlgplugins.ui.h new file mode 100644 index 0000000..40153d9 --- /dev/null +++ b/configdialog/kbfxconfigdlgplugins.ui.h @@ -0,0 +1,157 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you want to add, delete, or rename functions or slots, use +** Qt Designer to update this file, preserving your code. +** +** You should not define a constructor or destructor in this file. +** Instead, write your code in functions called init() and destroy(). +** These will automatically be called by the form's constructor and +** destructor. +*****************************************************************************/ +void KbfxConfigDlgPlugins::init() +{ + KbfxPanel->clear(); + KbfxPanel->insertItem ( tr2i18n ( "Left Panel" ) ); // index = 0 + KbfxPanel->insertItem ( tr2i18n ( "Right Panel" ) ); // index = 1 +} + +void KbfxConfigDlgPlugins::ChangeForm() +{ + KbfxPanel->setCurrentItem ( 0 ); + KbfxPluginSelector-> selectedListBox()-> clear(); + KbfxPluginSelector-> availableListBox()-> clear(); + KbfxPluginSelector-> selectedListBox()-> insertStringList ( ConfigInit().m_pluginsLeft ); + KbfxPluginSelector-> availableListBox()-> insertStringList ( KbfxListPlugins ( 0 ) ); // list Left Panel Plugins +} + +QStringList KbfxConfigDlgPlugins::KbfxListPlugins ( int panel ) +{ + QStringList _plugins; + _plugins.clear(); + bool _not_present; + QStringList::Iterator it_available; + QStringList::Iterator it_requested; + + KbfxPlasmaPluginLoader *_tmp = new KbfxPlasmaPluginLoader(); + QStringList allPlugins = _tmp -> scanPlugins(); + delete _tmp; + + for ( it_available = allPlugins.begin(); it_available != allPlugins.end(); ++it_available ) + { + _not_present = TRUE; + if ( panel == 0 ) + { + for ( it_requested = ConfigInit ().m_pluginsLeft.begin (); + it_requested != ConfigInit ().m_pluginsLeft.end (); ++it_requested ) + { + if ( ( *it_available ).contains ( *it_requested ) > 0 ) + { + _not_present = FALSE; + break; + } + } + } + if ( panel == 1 ) + { + for ( it_requested = ConfigInit ().m_pluginsRight.begin (); + it_requested != ConfigInit ().m_pluginsRight.end (); ++it_requested ) + { + if ( ( *it_available ).contains ( *it_requested ) > 0 ) + { + _not_present = FALSE; + break; + } + } + } + if ( _not_present ) + { + _plugins += ( *it_available ); + } + } + + kdDebug() << "Available PLUGINS: " << _plugins << endl; + return _plugins; +} + +void KbfxConfigDlgPlugins::KbfxConfigurePluginButton_clicked() +{ + KMessageBox::information ( 0, tr2i18n ( "

Not Implemented yet.

" ) ); +} + + +void KbfxConfigDlgPlugins::KbfxPluginInfoButton_clicked() +{ + KMessageBox::information ( 0, tr2i18n ( "

Not Implemented yet.

" ) ); +} + +void KbfxConfigDlgPlugins::KbfxSaveSelectedPlugins() +{ + int _selectedPanel = KbfxPanel->currentItem(); + QStringList _plugins; + _plugins.clear(); + int it; + int _num = KbfxPluginSelector-> selectedListBox()->count(); + for ( it = 0; it < _num; ++it ) + { + _plugins += KbfxPluginSelector -> selectedListBox() -> text ( it ); + } + kdDebug() << "Selected PLUGINS: " << _plugins << endl; + if ( _selectedPanel == 0 ) + { + ConfigInit().m_pluginsLeft = _plugins; + kdDebug() << "Saved to Left Panel... " << endl; + } + if ( _selectedPanel == 1 ) + { + ConfigInit().m_pluginsRight = _plugins; + kdDebug() << "Saved to Right Panel... " << endl; + } +} + +void KbfxConfigDlgPlugins::KbfxPanelSelected ( int _sel ) +{ + KbfxPluginSelector-> selectedListBox()-> clear(); + KbfxPluginSelector-> availableListBox()-> clear(); + if ( _sel ) + { + KbfxPluginSelector-> selectedListBox()-> insertStringList ( ConfigInit().m_pluginsRight ); + KbfxPluginSelector-> availableListBox()-> insertStringList ( KbfxListPlugins ( 1 ) ); // list Right Panel Plugins + } + else + { + KbfxPluginSelector-> selectedListBox()-> insertStringList ( ConfigInit().m_pluginsLeft ); + KbfxPluginSelector-> availableListBox()-> insertStringList ( KbfxListPlugins ( 0 ) ); // list Left Panel Plugins + } +} + + + + + +void KbfxConfigDlgPlugins::KbfxPluginSelector_movedDown ( QListBoxItem * ) +{ + /* save current selection */ + KbfxSaveSelectedPlugins(); +} + + +void KbfxConfigDlgPlugins::KbfxPluginSelector_movedUp ( QListBoxItem * ) +{ + /* save current selection */ + KbfxSaveSelectedPlugins(); +} + + +void KbfxConfigDlgPlugins::KbfxPluginSelector_removed ( QListBoxItem * ) +{ + /* save current selection */ + KbfxSaveSelectedPlugins(); +} + + +void KbfxConfigDlgPlugins::KbfxPluginSelector_added ( QListBoxItem * ) +{ + /* save current selection */ + KbfxSaveSelectedPlugins(); +} -- cgit v1.2.1