diff --git a/kpasman/kpasman.h b/kpasman/kpasman.h index c3d0248..4f39c32 100644 --- a/kpasman/kpasman.h +++ b/kpasman/kpasman.h @@ -66,7 +66,9 @@ public: /** handy way to flip all the flags at once */ void setModified(bool modified = true); - + /** flips menus in locking situation */ + void setLocked(); + protected: /** save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration * file @@ -224,3 +226,4 @@ private: + diff --git a/kpasman/kpasmanview.cpp b/kpasman/kpasmanview.cpp index 2af0887..47f6058 100644 --- a/kpasman/kpasmanview.cpp +++ b/kpasman/kpasmanview.cpp @@ -7,7 +7,10 @@ #include "kpasman.h" #include "kpasentrydlg.h" -KpasmanView::KpasmanView(QWidget *parent, const char* name) : QListView(parent, name){ +KpasmanView::KpasmanView(QWidget *parent, const char* name) : QListView(parent, name) +{ + m_parent = (KpasmanApp*)parent; + setBackgroundMode( PaletteBase ); setAllColumnsShowFocus(true); @@ -54,6 +57,12 @@ void KpasmanView::hidePassword(bool mode) } void KpasmanView::lockWindow(bool mode) +{ + lockWindowMode(mode); + m_parent->setLocked(); +} + +void KpasmanView::lockWindowMode(bool mode) { if (mode && !m_bLocked) { if (getDocument()->lock()) { @@ -180,3 +189,5 @@ void KpasmanView::mousePressEvent(QMouseEvent* event) } + + diff --git a/kpasman/kpasmanview.h b/kpasman/kpasmanview.h index a40bb90..1714f50 100644 --- a/kpasman/kpasmanview.h +++ b/kpasman/kpasmanview.h @@ -10,6 +10,7 @@ #include #include +class KpasmanApp; class KpasmanDoc; /** The KpasmanView class provides the view widget for the KpasmanApp instance. @@ -47,6 +48,7 @@ public: /** locks/unlocks the window */ void lockWindow(bool mode); + void lockWindowMode(bool mode); /** returns if window is locked */ bool isLocked() {return m_bLocked;}; @@ -72,6 +74,7 @@ protected: void mousePressEvent(QMouseEvent* event); private: + KpasmanApp* m_parent; /** stores password column number */ int m_iPWColumn; /** stores whether or not the password column is "hidden" */ @@ -86,3 +89,5 @@ private: #endif // KPASMANVIEW_H + +