Add option to show the application window always on top

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@340 b624d157-de02-0410-bad0-e51aec6abb33
master
sniperbeamer 15 years ago
parent 73e8c49e3b
commit ab221b9e60
  1. 4
      changelog
  2. 2
      src/KpxConfig.h
  3. 2
      src/dialogs/SettingsDlg.cpp
  4. 7
      src/forms/SettingsDlg.ui
  5. 10
      src/mainwindow.cpp

@ -1,8 +1,10 @@
----------------------------
0.4.1 (2009-08-XX)
0.4.1 (2009-09-XX)
----------------------------
- Added initial documentation (by Jussi Sainio)
- Added and improved many translations
- Added ability to drag'n'drop fields (username, password, ...) to other applications
- Added option to show the application window always on top
- Seperate columns settings between normal and search results view
- Interrupt auto-type if the focused window changed meanwhile
- Reduced height of password generator dialog (Bug #2831504)

@ -64,6 +64,7 @@ public:
bool hidePasswords(){return settings.value("UI/HidePasswords",true).toBool();}
bool hideUsernames(){return settings.value("UI/HideUsernames",true).toBool();}
QByteArray hSplitterPos(){return settings.value("UI/HSplitterPos").toByteArray();}
bool alwaysOnTop(){return settings.value("UI/AlwaysOnTop",false).toBool();}
IntegrPluginType integrPlugin(){return stringToIntegrPluginType(settings.value("Options/IntegrPlugin").toString());}
QString lastFile(){return settings.value("Options/LastFile").toString();}
QString lastKeyLocation(){return settings.value("Options/LastKeyLocation").toString();}
@ -135,6 +136,7 @@ public:
void setHidePasswords(bool value){settings.setValue("UI/HidePasswords",value);}
void setHideUsernames(bool value){settings.setValue("UI/HideUsernames",value);}
void setHSplitterPos(const QByteArray& value){settings.setValue("UI/HSplitterPos",value);}
void setAlwaysOnTop(bool value){settings.setValue("UI/AlwaysOnTop",value);}
void setIntegrPlugin(IntegrPluginType value){settings.setValue("Options/IntegrPlugin",integrPluginTypeToString(value));}
void setLastFile(const QString& value){settings.setValue("Options/LastFile",value);}
void setLastKeyLocation(const QString& value){settings.setValue("Options/LastKeyLocation",value);}

@ -106,6 +106,7 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
}
//Appearance
CheckBox_AlwaysOnTop->setChecked(config->alwaysOnTop());
QPixmap *pxt=new QPixmap(pixmTextColor->width(),pixmTextColor->height());
pxt->fill(config->bannerTextColor());
pixmTextColor->clear();
@ -252,6 +253,7 @@ void CSettingsDlg::apply(){
config->setAutoSaveChange(CheckBox_AutoSaveChange->isChecked());
//Appearence
config->setAlwaysOnTop(CheckBox_AlwaysOnTop->isChecked());
config->setBannerColor1(color1);
config->setBannerColor2(color2);
config->setBannerTextColor(textcolor);

@ -649,6 +649,13 @@ QListView::item {
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="CheckBox_AlwaysOnTop">
<property name="text">
<string>Show window always on top</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="CheckBox_AlternatingRowColors">
<property name="text">

@ -84,6 +84,8 @@ KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,bool ArgMin,bool Arg
//statusBar()->addWidget(StatusBarSelection,85);
statusBar()->setVisible(config->showStatusbar());
setStatusBarMsg(StatusBarReady);
if (config->alwaysOnTop())
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
NormalCentralWidget=QMainWindow::centralWidget();
LockedCentralWidget=new QWidget(this);
@ -1114,6 +1116,7 @@ void KeepassMainWindow::showEvent(QShowEvent* event){
void KeepassMainWindow::OnExtrasSettings(){
QString oldLang = config->language();
bool oldAlwaysOnTop = config->alwaysOnTop();
CSettingsDlg dlg(this);
dlg.exec();
if (config->language() != oldLang){
@ -1130,6 +1133,13 @@ void KeepassMainWindow::OnExtrasSettings(){
EntryView->setAlternatingRowColors(config->alternatingRowColors());
SysTray->setVisible(config->showSysTrayIcon());
menuBookmarks->menuAction()->setVisible(config->featureBookmarks());
if (config->alwaysOnTop() != oldAlwaysOnTop) {
if (config->alwaysOnTop())
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
else
setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
show();
}
EventOccurred = true;
if (config->lockOnInactivity() && config->lockAfterSec()!=0 && !inactivityTimer->isActive()){