Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct scaling on Linux and other minor fixes #5185

Merged
merged 4 commits into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/images/autoopen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/autoopen_ifdevice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions docs/styles/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,6 @@ video {
max-width: 100%;
}

@media all and (max-width: 600px) {
table {
width: 55vw!important;
font-size: 3vw;
}
}

.exampleblock > .content {
background-color: var(--background);
}
Expand Down
2 changes: 2 additions & 0 deletions docs/topics/AutoType.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ The Auto-Type feature acts like a virtual keyboard to populate data from your en

NOTE: Auto-Type is a completely separate feature from Browser Integration. You do not need to have the KeePassXC browser extension installed in your browser to use Auto-Type.

WARNING: Auto-Type will be disabled when run with a Wayland compositor on Linux. To use Auto-Type in this environment, you must set `QT_QPA_PLATFORM=xcb` or start KeePassXC with the `-platform xcb` command-line flag.

=== Configure Global Auto-Type
You can define a global Auto-Type hotkey that starts the Auto-Type process. To configure the hotkey, perform the following steps:

Expand Down
28 changes: 27 additions & 1 deletion docs/topics/DatabaseOperations.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ KeePassXC provides an enhanced and granular search features the enables you to s
|===
|Modifier |Description

|- |Exclude this term from results
|- |Exclude this term from results
|! |Exclude this term from results
|+ |Match this term exactly
|* |Term is handled as a regular expression
|===
Expand Down Expand Up @@ -235,6 +236,31 @@ image::edit_entry_history.png[]

NOTE: Restoring an old history item will store the current entry settings as a new history item.

== Automatic Database Opening
You can setup one or more databases to open automatically when you unlock a single database. This is done by *(1)* defining a special group named `AutoOpen` with *(2)* entries that contain the file path and credentials for each database that should be opened. There is no limit to the number of databases that can be opened.

TIP: Case matters with auto open, the group name must be exactly `AutoOpen`.

.AutoOpen Group and Entries
image::autoopen.png[]

To setup an entry for auto open perform the following steps:

1. Create a new entry and give it any title you wish.
2. If your database has a key file, enter its absolute or relative path in the `username` field.
3. If your database has a password, enter it in the `password` field
4. Enter the absolute or relative path to the database file in the `url` field. You can also use the `{DB_DIR}` placeholder to reference the absolute path of the current database file.
5. To restrict auto open to particular devices, go to the advanced category and enter the following:
a. Create a new attribute named `IfDevice`.
b. Enter hostnames in a comma separated list to define computers that will open this database.
c. Prepend an exclamation mark (`!`) to explicitly exclude a device.
d. Examples: `LAPTOP, DESKTOP` will auto open on a computer named LAPTOP or DESKTOP. `!LAPTOP` will auto open on all devices *not* named LAPTOP.

.Auto open IfDevice example
image::autoopen_ifdevice.png[]

NOTE: You can setup an entry to open on double click of the URL field by prepending `kdbx://` to the relative or absolute path to the database file. You may also have to add `file://` to access network shares (e.g., `kdbx://file://share/database.kdbx`).

== Database Settings
At any point of time, you can change the settings for your database. To make changes to the general settings, perform the following steps:

Expand Down
2 changes: 1 addition & 1 deletion src/autotype/AutoType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void AutoType::executeAutoTypeActions(const Entry* entry, QWidget* hideWindow, c
macUtils()->raiseLastActiveWindow();
m_plugin->hideOwnWindow();
#else
hideWindow->showMinimized();
getMainWindow()->minimizeOrHide();
#endif
}

Expand Down
1 change: 1 addition & 0 deletions src/gui/ApplicationSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ ApplicationSettingsWidget::ApplicationSettingsWidget(QWidget* parent)
m_generalUi->faviconTimeoutSpinBox->installEventFilter(mouseWheelFilter);
m_generalUi->toolButtonStyleComboBox->installEventFilter(mouseWheelFilter);
m_generalUi->languageComboBox->installEventFilter(mouseWheelFilter);
m_generalUi->trayIconAppearance->installEventFilter(mouseWheelFilter);

#ifdef WITH_XC_UPDATECHECK
connect(m_generalUi->checkForUpdatesOnStartupCheckBox, SIGNAL(toggled(bool)), SLOT(checkUpdatesToggled(bool)));
Expand Down
6 changes: 6 additions & 0 deletions src/gui/ApplicationSettingsWidgetGeneral.ui
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="accessibleName">
<string>Tray icon type</string>
</property>
</widget>
</item>
<item row="0" column="1">
Expand Down
23 changes: 14 additions & 9 deletions src/gui/DatabaseWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2060,18 +2060,23 @@ void DatabaseWidget::processAutoOpen()
// Support ifDevice advanced entry, a comma separated list of computer names
// that control whether to perform AutoOpen on this entry or not. Can be
// negated using '!'
auto ifDevice = entry->attribute("ifDevice");
auto ifDevice = entry->attribute("IfDevice");
if (!ifDevice.isEmpty()) {
bool loadDb = false;
bool loadDb = true;
auto hostName = QHostInfo::localHostName();
for (auto& dev : ifDevice.split(",")) {
dev = dev.trimmed();
if (dev.startsWith("!") && dev.mid(1).compare(hostName, Qt::CaseInsensitive) == 0) {
// Machine name matched an exclusion, don't load this database
loadDb = false;
break;
} else if (dev.compare(hostName, Qt::CaseInsensitive) == 0) {
for (auto& device : ifDevice.split(",")) {
device = device.trimmed();
if (device.startsWith("!")) {
if (device.mid(1).compare(hostName, Qt::CaseInsensitive) == 0) {
// Machine name matched an exclusion, don't load this database
loadDb = false;
break;
}
} else if (device.compare(hostName, Qt::CaseInsensitive) == 0) {
loadDb = true;
} else {
// Don't load the database if there are devices not starting with '!'
loadDb = false;
}
}
if (!loadDb) {
Expand Down
2 changes: 1 addition & 1 deletion src/gui/MessageWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ void MessageWidget::openHttpUrl(const QString& link)
if (link.startsWith("http://") || link.startsWith("https://")) {
QDesktopServices::openUrl(QUrl(link));
}
}
}
2 changes: 1 addition & 1 deletion src/gui/MessageWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public slots:
private:
QTimer* m_autoHideTimer;
int m_autoHideTimeout;
bool m_animate;
bool m_animate = true;
};

#endif // MESSAGEWIDGET_H
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main(int argc, char** argv)
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) && defined(Q_OS_WIN)
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif

Expand Down