Diffstat (limited to 'libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp b/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp index 10b52f9..5c7bac2 100644 --- a/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp +++ b/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp | |||
@@ -26,13 +26,13 @@ public: | |||
26 | } | 26 | } |
27 | MainWindow( QWidget*, const char*, WFlags fl ); | 27 | MainWindow( QWidget*, const char*, WFlags fl ); |
28 | ~MainWindow() {} | 28 | ~MainWindow() {} |
29 | private slots: | 29 | private slots: |
30 | void slotClicked(); | 30 | void slotClicked(); |
31 | private: | 31 | private: |
32 | Opie::Ui::OKeyConfigManager *m_manager; | 32 | Opie::Core::OKeyConfigManager *m_manager; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | 35 | ||
36 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MainWindow> ) | 36 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MainWindow> ) |
37 | 37 | ||
38 | 38 | ||
@@ -73,40 +73,40 @@ TestMainWindow::TestMainWindow( QWidget* parent, const char* slot, WFlags fl ) | |||
73 | addColumn( tr( "A Doo" ) ); | 73 | addColumn( tr( "A Doo" ) ); |
74 | addColumn( tr( "B Doo" ) ); | 74 | addColumn( tr( "B Doo" ) ); |
75 | 75 | ||
76 | m_config = new Opie::Core::OConfig( "test_config_foo" ); | 76 | m_config = new Opie::Core::OConfig( "test_config_foo" ); |
77 | 77 | ||
78 | /* generate the black list */ | 78 | /* generate the black list */ |
79 | Opie::Ui::OKeyPair::List blackList; | 79 | Opie::Core::OKeyPair::List blackList; |
80 | blackList.append( Opie::Ui::OKeyPair::leftArrowKey() ); | 80 | blackList.append( Opie::Core::OKeyPair::leftArrowKey() ); |
81 | blackList.append( Opie::Ui::OKeyPair::rightArrowKey() ); | 81 | blackList.append( Opie::Core::OKeyPair::rightArrowKey() ); |
82 | blackList.append( Opie::Ui::OKeyPair::downArrowKey() ); | 82 | blackList.append( Opie::Core::OKeyPair::downArrowKey() ); |
83 | blackList.append( Opie::Ui::OKeyPair::upArrowKey() ); | 83 | blackList.append( Opie::Core::OKeyPair::upArrowKey() ); |
84 | 84 | ||
85 | m_manager = new Opie::Ui::OKeyConfigManager( m_config, "Key Group", | 85 | m_manager = new Opie::Core::OKeyConfigManager( m_config, "Key Group", |
86 | blackList, false, this, "Key Manager" ); | 86 | blackList, false, this, "Key Manager" ); |
87 | 87 | ||
88 | m_manager->addKeyConfig( Opie::Ui::OKeyConfigItem( tr( "Delete Action" ), "delete_key", QPixmap(), | 88 | m_manager->addKeyConfig( Opie::Core::OKeyConfigItem( tr( "Delete Action" ), "delete_key", QPixmap(), |
89 | 10, Opie::Ui::OKeyPair( Qt::Key_D, Qt::ShiftButton ), this, | 89 | 10, Opie::Core::OKeyPair( Qt::Key_D, Qt::ShiftButton ), this, |
90 | SLOT(slotDelete(QWidget*,QKeyEvent*)) ) ); | 90 | SLOT(slotDelete(QWidget*,QKeyEvent*)) ) ); |
91 | m_manager->addKeyConfig( Opie::Ui::OKeyConfigItem( tr( "Show Action" ), "show_key", QPixmap(), | 91 | m_manager->addKeyConfig( Opie::Core::OKeyConfigItem( tr( "Show Action" ), "show_key", QPixmap(), |
92 | 11, Opie::Ui::OKeyPair( Qt::Key_S, Qt::AltButton ) ) ); | 92 | 11, Opie::Core::OKeyPair( Qt::Key_S, Qt::AltButton ) ) ); |
93 | 93 | ||
94 | connect(m_manager, SIGNAL(actionActivated(QWidget*,QKeyEvent*,const Opie::Ui::OKeyConfigItem&)), | 94 | connect(m_manager, SIGNAL(actionActivated(QWidget*,QKeyEvent*,const Opie::Core::OKeyConfigItem&)), |
95 | this, SLOT(slotAction(QWidget*, QKeyEvent*, const Opie::Ui::OKeyConfigItem&)) ); | 95 | this, SLOT(slotAction(QWidget*, QKeyEvent*, const Opie::Core::OKeyConfigItem&)) ); |
96 | // when commenting the line below out the keyPressEvent will work | 96 | // when commenting the line below out the keyPressEvent will work |
97 | m_manager->handleWidget( this ); | 97 | m_manager->handleWidget( this ); |
98 | m_manager->load(); | 98 | m_manager->load(); |
99 | } | 99 | } |
100 | 100 | ||
101 | TestMainWindow::~TestMainWindow() { | 101 | TestMainWindow::~TestMainWindow() { |
102 | m_manager->save(); | 102 | m_manager->save(); |
103 | delete m_config; | 103 | delete m_config; |
104 | } | 104 | } |
105 | 105 | ||
106 | Opie::Ui::OKeyConfigManager* TestMainWindow::manager() { | 106 | Opie::Core::OKeyConfigManager* TestMainWindow::manager() { |
107 | return m_manager; | 107 | return m_manager; |
108 | } | 108 | } |
109 | 109 | ||
110 | /* | 110 | /* |
111 | * This only works if we do not handle the even with m_manager->handleWidget( this ) | 111 | * This only works if we do not handle the even with m_manager->handleWidget( this ) |
112 | * So this is only for demo purposes | 112 | * So this is only for demo purposes |
@@ -118,11 +118,11 @@ void TestMainWindow::keyPressEvent( QKeyEvent* ev ) { | |||
118 | } | 118 | } |
119 | 119 | ||
120 | void TestMainWindow::slotDelete( QWidget* wid, QKeyEvent* ev ) { | 120 | void TestMainWindow::slotDelete( QWidget* wid, QKeyEvent* ev ) { |
121 | qWarning( "Slot Delete %d %d %d", wid, ev->key(), ev->state() ); | 121 | qWarning( "Slot Delete %d %d %d", wid, ev->key(), ev->state() ); |
122 | } | 122 | } |
123 | 123 | ||
124 | void TestMainWindow::slotAction( QWidget* wid, QKeyEvent* ev, const Opie::Ui::OKeyConfigItem& item) { | 124 | void TestMainWindow::slotAction( QWidget* wid, QKeyEvent* ev, const Opie::Core::OKeyConfigItem& item) { |
125 | qWarning( "Slot Action %d %d %d %s %d", wid, ev->key(), ev->state(), item.text().latin1(), item.id() ); | 125 | qWarning( "Slot Action %d %d %d %s %d", wid, ev->key(), ev->state(), item.text().latin1(), item.id() ); |
126 | } | 126 | } |
127 | 127 | ||
128 | #include "testwidget.moc" | 128 | #include "testwidget.moc" |