[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: KXConfig [patch]
From:       Scott Wheeler <scott () slackorama ! net>
Date:       2002-04-14 6:18:02
[Download RAW message or body]

On Saturday 13 April 2002 04:26 am, Matthias Elter wrote:
> Hi
>
> I have commited KXConfig to kdeadmin. KXConfig is a XFree86 4 configuration
> utillity written by Matthias Hölzer Klüpfel, Cornelius Schuhmacher, Simon
> Hausmann and me. Developement happened for and sponsored by Caldera
> Deutschland GmbH. KXConfig is licensed under the GPL.
>
> I'm searching for a new maintainer because neither of us will have much
> time for it. So if you are interested, please contact me.

Nice tool.  I pretty quickly found a bug with the keyboard selection.  If you 
go to the keyboard menu, change your layout, try it in the test area and then 
cancel you will still have the changed keyboard.  

This patch fixes that.  Maybe the non-maintainer can have a look?  :-)

Also, just out of curiosity, is there any reason that this wasn't done as a 
KConfig module?  

-Scott
["kxconfig-keyboard.patch" (text/x-diff)]

Index: keyboardpageimpl.cpp
===================================================================
RCS file: /home/kde/kdeadmin/kxconfig/keyboardpageimpl.cpp,v
retrieving revision 1.1
diff -u -3 -p -r1.1 keyboardpageimpl.cpp
--- keyboardpageimpl.cpp	2002/04/13 08:22:02	1.1
+++ keyboardpageimpl.cpp	2002/04/14 06:08:40
@@ -17,6 +17,9 @@
 KeyboardPage::KeyboardPage( QWidget *parent, const char *name )
     : KeyboardPageBase( parent, name )
 {
+    originalLayout = new KXKeyboardLayout( m_data->currentKeyboards()[ 0 ].layout() );
+    originalModel = new KXKeyboardModel( m_data->currentKeyboards()[ 0 ].model() );
+
     connect( m_models, SIGNAL( currentChanged( QListBoxItem * ) ),
              this, SIGNAL( changed() ) );
     connect( m_layouts, SIGNAL( currentChanged( QListBoxItem * ) ),
@@ -27,6 +30,8 @@ KeyboardPage::KeyboardPage( QWidget *par
 
 KeyboardPage::~KeyboardPage()
 {
+    delete originalLayout;
+    delete originalModel;
 }
 
 bool
@@ -164,6 +169,12 @@ void KeyboardPage::save()
         }
         item = item->next();
     }
+}
+
+void KeyboardPage::revert()
+{
+    kdDebug() << "KeyboardPage::revert()" << endl;
+    set( originalLayout->id(), originalModel->id() );
 }
 
 void KeyboardPage::set( const QString &layout, const QString &model )
Index: keyboardpageimpl.h
===================================================================
RCS file: /home/kde/kdeadmin/kxconfig/keyboardpageimpl.h,v
retrieving revision 1.1
diff -u -3 -p -r1.1 keyboardpageimpl.h
--- keyboardpageimpl.h	2002/04/13 08:22:02	1.1
+++ keyboardpageimpl.h	2002/04/14 06:08:40
@@ -30,12 +30,19 @@ public:
     virtual void load();
     virtual void save();
 
+public slots:
+    void revert();
+
 signals:
     void changed();
     void enableForward( bool );
 
 protected:
     void set( const QString &layout, const QString &model );
+
+private:
+    KXKeyboardLayout *originalLayout;
+    KXKeyboardModel *originalModel;
 };
 
 #endif
Index: toplevel.cpp
===================================================================
RCS file: /home/kde/kdeadmin/kxconfig/toplevel.cpp,v
retrieving revision 1.3
diff -u -3 -p -r1.3 toplevel.cpp
--- toplevel.cpp	2002/04/13 09:08:04	1.3
+++ toplevel.cpp	2002/04/14 06:08:40
@@ -293,6 +293,9 @@ void TopLevel::itemSelected(ListViewItem
 
         connect( p, SIGNAL( enableForward( bool ) ),
                  m_wizard, SLOT( setForwardEnabled( bool ) ) );
+
+        connect( m_wizard, SIGNAL( reject() ),
+                 p, SLOT( revert() ) );
     }
 
     // pointer device page


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic