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 @@ -20,25 +20,25 @@ */ class MainWindow : public QMainWindow { Q_OBJECT public: static QString appName() { return QString::fromLatin1("keyconfig"); } MainWindow( QWidget*, const char*, WFlags fl ); ~MainWindow() {} private slots: void slotClicked(); private: - Opie::Ui::OKeyConfigManager *m_manager; + Opie::Core::OKeyConfigManager *m_manager; }; OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MainWindow> ) MainWindow::MainWindow( QWidget* parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl ) { QVBoxLayout *lay = new QVBoxLayout( this ); QPushButton *btn = new QPushButton( tr("Configure" ), this ); TestMainWindow *wid = new TestMainWindow( this, "name", 0 ); @@ -67,62 +67,62 @@ void MainWindow::slotClicked() { } } TestMainWindow::TestMainWindow( QWidget* parent, const char* slot, WFlags fl ) : Opie::Ui::OListView( parent, slot, fl) { addColumn( tr( "A Doo" ) ); addColumn( tr( "B Doo" ) ); m_config = new Opie::Core::OConfig( "test_config_foo" ); /* generate the black list */ - Opie::Ui::OKeyPair::List blackList; - blackList.append( Opie::Ui::OKeyPair::leftArrowKey() ); - blackList.append( Opie::Ui::OKeyPair::rightArrowKey() ); - blackList.append( Opie::Ui::OKeyPair::downArrowKey() ); - blackList.append( Opie::Ui::OKeyPair::upArrowKey() ); + Opie::Core::OKeyPair::List blackList; + blackList.append( Opie::Core::OKeyPair::leftArrowKey() ); + blackList.append( Opie::Core::OKeyPair::rightArrowKey() ); + blackList.append( Opie::Core::OKeyPair::downArrowKey() ); + blackList.append( Opie::Core::OKeyPair::upArrowKey() ); - m_manager = new Opie::Ui::OKeyConfigManager( m_config, "Key Group", + m_manager = new Opie::Core::OKeyConfigManager( m_config, "Key Group", blackList, false, this, "Key Manager" ); - m_manager->addKeyConfig( Opie::Ui::OKeyConfigItem( tr( "Delete Action" ), "delete_key", QPixmap(), - 10, Opie::Ui::OKeyPair( Qt::Key_D, Qt::ShiftButton ), this, + m_manager->addKeyConfig( Opie::Core::OKeyConfigItem( tr( "Delete Action" ), "delete_key", QPixmap(), + 10, Opie::Core::OKeyPair( Qt::Key_D, Qt::ShiftButton ), this, SLOT(slotDelete(QWidget*,QKeyEvent*)) ) ); - m_manager->addKeyConfig( Opie::Ui::OKeyConfigItem( tr( "Show Action" ), "show_key", QPixmap(), - 11, Opie::Ui::OKeyPair( Qt::Key_S, Qt::AltButton ) ) ); + m_manager->addKeyConfig( Opie::Core::OKeyConfigItem( tr( "Show Action" ), "show_key", QPixmap(), + 11, Opie::Core::OKeyPair( Qt::Key_S, Qt::AltButton ) ) ); - connect(m_manager, SIGNAL(actionActivated(QWidget*,QKeyEvent*,const Opie::Ui::OKeyConfigItem&)), - this, SLOT(slotAction(QWidget*, QKeyEvent*, const Opie::Ui::OKeyConfigItem&)) ); + connect(m_manager, SIGNAL(actionActivated(QWidget*,QKeyEvent*,const Opie::Core::OKeyConfigItem&)), + this, SLOT(slotAction(QWidget*, QKeyEvent*, const Opie::Core::OKeyConfigItem&)) ); // when commenting the line below out the keyPressEvent will work m_manager->handleWidget( this ); m_manager->load(); } TestMainWindow::~TestMainWindow() { m_manager->save(); delete m_config; } -Opie::Ui::OKeyConfigManager* TestMainWindow::manager() { +Opie::Core::OKeyConfigManager* TestMainWindow::manager() { return m_manager; } /* * This only works if we do not handle the even with m_manager->handleWidget( this ) * So this is only for demo purposes */ void TestMainWindow::keyPressEvent( QKeyEvent* ev ) { qWarning( "String is "+ m_manager->handleKeyEvent( ev ).text() ); qWarning( "Id was %d %d %d %d", m_manager->handleKeyEventId( ev ),ev->key(),ev->state(), ev->ascii() ); ev->ignore(); } void TestMainWindow::slotDelete( QWidget* wid, QKeyEvent* ev ) { qWarning( "Slot Delete %d %d %d", wid, ev->key(), ev->state() ); } -void TestMainWindow::slotAction( QWidget* wid, QKeyEvent* ev, const Opie::Ui::OKeyConfigItem& item) { +void TestMainWindow::slotAction( QWidget* wid, QKeyEvent* ev, const Opie::Core::OKeyConfigItem& item) { qWarning( "Slot Action %d %d %d %s %d", wid, ev->key(), ev->state(), item.text().latin1(), item.id() ); } #include "testwidget.moc" |