-rw-r--r-- | libopie2/opieui/okeyconfigwidget.cpp | 20 | ||||
-rw-r--r-- | libopie2/opieui/okeyconfigwidget.h | 2 |
2 files changed, 19 insertions, 3 deletions
diff --git a/libopie2/opieui/okeyconfigwidget.cpp b/libopie2/opieui/okeyconfigwidget.cpp index 2ea0bd5..273f15b 100644 --- a/libopie2/opieui/okeyconfigwidget.cpp +++ b/libopie2/opieui/okeyconfigwidget.cpp | |||
@@ -537,9 +537,8 @@ OKeyConfigItem OKeyConfigManager::handleKeyEvent( QKeyEvent* e ) { | |||
537 | /* | 537 | /* |
538 | * virtual keyboard | 538 | * virtual keyboard |
539 | * else change the button mod only | 539 | * else change the button mod only |
540 | */ | 540 | */ |
541 | qWarning( "handleKeyEvent...." ); | ||
542 | if ( key == 0 ) { | 541 | if ( key == 0 ) { |
543 | key = e->ascii(); | 542 | key = e->ascii(); |
544 | if ( key > 96 && key < 123) | 543 | if ( key > 96 && key < 123) |
545 | key -= 32; | 544 | key -= 32; |
@@ -606,8 +605,14 @@ void OKeyConfigManager::clearKeyConfig() { | |||
606 | m_keys.clear(); | 605 | m_keys.clear(); |
607 | delete m_map; m_map = 0; | 606 | delete m_map; m_map = 0; |
608 | } | 607 | } |
609 | 608 | ||
609 | /** | ||
610 | * | ||
611 | */ | ||
612 | Opie::Ui::OKeyConfigItem::List OKeyConfigManager::keyConfigList()const{ | ||
613 | return m_keys; | ||
614 | } | ||
610 | 615 | ||
611 | /** | 616 | /** |
612 | * Add this OKeyPair to the blackList. | 617 | * Add this OKeyPair to the blackList. |
613 | * Internal lists will be destroyed | 618 | * Internal lists will be destroyed |
@@ -752,13 +757,13 @@ namespace Private { | |||
752 | OKeyConfigManager* OKeyListViewItem::manager() { | 757 | OKeyConfigManager* OKeyListViewItem::manager() { |
753 | return m_manager; | 758 | return m_manager; |
754 | } | 759 | } |
755 | void OKeyListViewItem::setItem( const OKeyConfigItem& item ) { | 760 | void OKeyListViewItem::setItem( const OKeyConfigItem& item ) { |
761 | m_item = item; | ||
756 | setPixmap( 0, m_item.pixmap() ); | 762 | setPixmap( 0, m_item.pixmap() ); |
757 | setText ( 1, m_item.text() ); | 763 | setText ( 1, m_item.text() ); |
758 | setText ( 2, keyToString( m_item.keyPair() ) ); | 764 | setText ( 2, keyToString( m_item.keyPair() ) ); |
759 | setText ( 3, keyToString( m_item.defaultKeyPair() ) ); | 765 | setText ( 3, keyToString( m_item.defaultKeyPair() ) ); |
760 | m_item = item; | ||
761 | } | 766 | } |
762 | 767 | ||
763 | QString keyToString( const OKeyPair& pair ) { | 768 | QString keyToString( const OKeyPair& pair ) { |
764 | int mod = 0; | 769 | int mod = 0; |
@@ -852,9 +857,8 @@ void OKeyConfigWidget::initUi() { | |||
852 | * GROUP with button info | 857 | * GROUP with button info |
853 | */ | 858 | */ |
854 | 859 | ||
855 | QGroupBox *box = new QGroupBox( this ); | 860 | QGroupBox *box = new QGroupBox( this ); |
856 | box ->setEnabled( false ); | ||
857 | box ->setTitle( tr("Shortcut for Selected Action") ); | 861 | box ->setTitle( tr("Shortcut for Selected Action") ); |
858 | box ->setFrameStyle( QFrame::Box | QFrame::Sunken ); | 862 | box ->setFrameStyle( QFrame::Box | QFrame::Sunken ); |
859 | layout->addWidget( box, 1 ); | 863 | layout->addWidget( box, 1 ); |
860 | 864 | ||
@@ -928,9 +932,16 @@ void OKeyConfigWidget::insert( const QString& str, OKeyConfigManager* man ) { | |||
928 | /** | 932 | /** |
929 | * loads the items and allows editing them | 933 | * loads the items and allows editing them |
930 | */ | 934 | */ |
931 | void OKeyConfigWidget::load() { | 935 | void OKeyConfigWidget::load() { |
936 | Opie::Ui::Private::OKeyConfigWidgetPrivateList::Iterator it; | ||
937 | for ( it = m_list.begin(); it != m_list.end(); ++it ) { | ||
938 | OListViewItem *item = new OListViewItem( m_view, (*it).name ); | ||
939 | OKeyConfigItem::List list = (*it).manager->keyConfigList(); | ||
940 | for (OKeyConfigItem::List::Iterator keyIt = list.begin(); keyIt != list.end();++keyIt ) | ||
941 | (void )new Opie::Ui::Private::OKeyListViewItem(*keyIt, (*it).manager, item ); | ||
932 | 942 | ||
943 | } | ||
933 | } | 944 | } |
934 | 945 | ||
935 | /** | 946 | /** |
936 | * Saves if in Queue Mode. It'll update the supplied | 947 | * Saves if in Queue Mode. It'll update the supplied |
@@ -970,8 +981,9 @@ void OKeyConfigWidget::slotListViewItem( QListViewItem* _item) { | |||
970 | } | 981 | } |
971 | } | 982 | } |
972 | 983 | ||
973 | void OKeyConfigWidget::slotNoKey() { | 984 | void OKeyConfigWidget::slotNoKey() { |
985 | qWarning( "No Key" ); | ||
974 | m_none->setChecked( true ); | 986 | m_none->setChecked( true ); |
975 | m_cus ->setChecked( false ); | 987 | m_cus ->setChecked( false ); |
976 | m_btn ->setEnabled( false ); | 988 | m_btn ->setEnabled( false ); |
977 | m_def ->setChecked( false ); | 989 | m_def ->setChecked( false ); |
@@ -994,8 +1006,9 @@ void OKeyConfigWidget::slotNoKey() { | |||
994 | 1006 | ||
995 | } | 1007 | } |
996 | 1008 | ||
997 | void OKeyConfigWidget::slotDefaultKey() { | 1009 | void OKeyConfigWidget::slotDefaultKey() { |
1010 | qWarning( "Slot Default Key" ); | ||
998 | m_none->setChecked( true ); | 1011 | m_none->setChecked( true ); |
999 | m_cus ->setChecked( false ); | 1012 | m_cus ->setChecked( false ); |
1000 | m_btn ->setEnabled( false ); | 1013 | m_btn ->setEnabled( false ); |
1001 | m_def ->setChecked( false ); | 1014 | m_def ->setChecked( false ); |
@@ -1017,8 +1030,9 @@ void OKeyConfigWidget::slotDefaultKey() { | |||
1017 | item->manager()->addKeyConfig( item->item() ); | 1030 | item->manager()->addKeyConfig( item->item() ); |
1018 | } | 1031 | } |
1019 | 1032 | ||
1020 | void OKeyConfigWidget::slotCustomKey() { | 1033 | void OKeyConfigWidget::slotCustomKey() { |
1034 | qWarning( "SlotCustom Key" ); | ||
1021 | m_cus ->setChecked( true ); | 1035 | m_cus ->setChecked( true ); |
1022 | m_btn ->setEnabled( true ); | 1036 | m_btn ->setEnabled( true ); |
1023 | m_def ->setChecked( false ); | 1037 | m_def ->setChecked( false ); |
1024 | m_none->setChecked( false ); | 1038 | m_none->setChecked( false ); |
diff --git a/libopie2/opieui/okeyconfigwidget.h b/libopie2/opieui/okeyconfigwidget.h index b3309af..a7a5f48 100644 --- a/libopie2/opieui/okeyconfigwidget.h +++ b/libopie2/opieui/okeyconfigwidget.h | |||
@@ -179,8 +179,10 @@ public: | |||
179 | 179 | ||
180 | void handleWidget( QWidget* ); | 180 | void handleWidget( QWidget* ); |
181 | 181 | ||
182 | bool eventFilter( QObject*, QEvent* ); | 182 | bool eventFilter( QObject*, QEvent* ); |
183 | |||
184 | OKeyConfigItem::List keyConfigList()const; | ||
183 | signals: | 185 | signals: |
184 | /** | 186 | /** |
185 | * The Signals are triggered on KeyPress and KeyRelease! | 187 | * The Signals are triggered on KeyPress and KeyRelease! |
186 | * You can check the isDown of the QKeyEvent | 188 | * You can check the isDown of the QKeyEvent |