diff --git a/mainwindow.hpp b/mainwindow.hpp
index 4eb3b53..a5a87c4 100644
--- a/mainwindow.hpp
+++ b/mainwindow.hpp
@@ -28,8 +28,8 @@ private slots:
void on_actionSettings_triggered();
void on_actionColor_Picker_triggered();
void on_actionAbout_triggered();
-
void on_actionActive_window_triggered();
+ void on_actionAbort_triggered();
public:
static MainWindow *inst();
diff --git a/mainwindow.ui b/mainwindow.ui
index 699f6df..fc55e2c 100644
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -84,6 +84,7 @@
+
@@ -136,6 +137,11 @@
Active window
+
+
+ Abort
+
+
diff --git a/platformspecifics/u32/u32backend.cpp b/platformspecifics/u32/u32backend.cpp
index d084928..5919a9d 100644
--- a/platformspecifics/u32/u32backend.cpp
+++ b/platformspecifics/u32/u32backend.cpp
@@ -29,6 +29,17 @@ WId PlatformBackend::getActiveWID() {
return (WId)GetForegroundWindow();
}
+QString illegal(QStringLiteral("<>:\"/\|?*"));
+QStringList illegalNames({ "CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7",
+ "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9" });
+
bool PlatformBackend::filenamValid(QString name) {
- return IsValidFileName(name.toLocal8Bit().constData()) == 0;
+ unsigned int periods = 0;
+ for (QChar c : name) {
+ if (c == '.') periods++;
+ if (illegal.contains(c)) return false;
+ if (c < 32) return false;
+ }
+ if (periods == name.length()) return false;
+ return !illegalNames.contains(name);
}