author | zecke <zecke> | 2004-03-28 20:39:22 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-28 20:39:22 (UTC) |
commit | b4c5da4a6cf51753e8d2da505197326e05323d73 (patch) (unidiff) | |
tree | 6b9814683e717f8445496dc0d4c8d23eda223dc3 | |
parent | 4cbd5ad37e51b7bc9c749f8eda2e46a806d904b0 (diff) | |
download | opie-b4c5da4a6cf51753e8d2da505197326e05323d73.zip opie-b4c5da4a6cf51753e8d2da505197326e05323d73.tar.gz opie-b4c5da4a6cf51753e8d2da505197326e05323d73.tar.bz2 |
From yesterday. Some sort of GUI loading
-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 | |||
@@ -538,7 +538,6 @@ OKeyConfigItem OKeyConfigManager::handleKeyEvent( QKeyEvent* e ) { | |||
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) |
@@ -607,6 +606,12 @@ void OKeyConfigManager::clearKeyConfig() { | |||
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. |
@@ -753,11 +758,11 @@ namespace Private { | |||
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 ) { |
@@ -853,7 +858,6 @@ void OKeyConfigWidget::initUi() { | |||
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 ); |
@@ -929,7 +933,14 @@ void OKeyConfigWidget::insert( const QString& str, OKeyConfigManager* man ) { | |||
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 | /** |
@@ -971,6 +982,7 @@ void OKeyConfigWidget::slotListViewItem( QListViewItem* _item) { | |||
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 ); |
@@ -995,6 +1007,7 @@ void OKeyConfigWidget::slotNoKey() { | |||
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 ); |
@@ -1018,6 +1031,7 @@ void OKeyConfigWidget::slotDefaultKey() { | |||
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 ); |
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 | |||
@@ -180,6 +180,8 @@ public: | |||
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! |