From 963bfd49550f8ec555174ce236f4f0bfa2d370f3 Mon Sep 17 00:00:00 2001 From: daniel-Jones Date: Sat, 18 Jun 2016 15:15:36 +0930 Subject: Added ability to save presets to file. NOTE: this commit includes a hardcoded presets.txt file location for personal use, make sure to replace it with just presets.txt! --- qt/RGBController/.controllerwindow.cpp.swo | Bin 16384 -> 0 bytes qt/RGBController/.controllerwindow.cpp.swp | Bin 24576 -> 0 bytes qt/RGBController/.controllerwindow.h.swo | Bin 12288 -> 0 bytes qt/RGBController/.controllerwindow.h.swp | Bin 12288 -> 0 bytes qt/RGBController/RGBController.pro.user | 2 +- qt/RGBController/controllerwindow.cpp | 9 +++++++-- qt/build/degub/RGBController | Bin 1300072 -> 1302536 bytes qt/build/degub/controllerwindow.o | Bin 1007624 -> 1007824 bytes 8 files changed, 8 insertions(+), 3 deletions(-) delete mode 100644 qt/RGBController/.controllerwindow.cpp.swo delete mode 100644 qt/RGBController/.controllerwindow.cpp.swp delete mode 100644 qt/RGBController/.controllerwindow.h.swo delete mode 100644 qt/RGBController/.controllerwindow.h.swp diff --git a/qt/RGBController/.controllerwindow.cpp.swo b/qt/RGBController/.controllerwindow.cpp.swo deleted file mode 100644 index 39ed63a..0000000 Binary files a/qt/RGBController/.controllerwindow.cpp.swo and /dev/null differ diff --git a/qt/RGBController/.controllerwindow.cpp.swp b/qt/RGBController/.controllerwindow.cpp.swp deleted file mode 100644 index e33becb..0000000 Binary files a/qt/RGBController/.controllerwindow.cpp.swp and /dev/null differ diff --git a/qt/RGBController/.controllerwindow.h.swo b/qt/RGBController/.controllerwindow.h.swo deleted file mode 100644 index b273e95..0000000 Binary files a/qt/RGBController/.controllerwindow.h.swo and /dev/null differ diff --git a/qt/RGBController/.controllerwindow.h.swp b/qt/RGBController/.controllerwindow.h.swp deleted file mode 100644 index 51c6912..0000000 Binary files a/qt/RGBController/.controllerwindow.h.swp and /dev/null differ diff --git a/qt/RGBController/RGBController.pro.user b/qt/RGBController/RGBController.pro.user index 92130ad..cd38fba 100755 --- a/qt/RGBController/RGBController.pro.user +++ b/qt/RGBController/RGBController.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/qt/RGBController/controllerwindow.cpp b/qt/RGBController/controllerwindow.cpp index 250be58..ef0ab30 100755 --- a/qt/RGBController/controllerwindow.cpp +++ b/qt/RGBController/controllerwindow.cpp @@ -82,7 +82,11 @@ void controllerWindow::load_presets() * -> split line at delimeter * -> add [0] to dropdown (name), add [1] to an array that stores all the values */ - QFile inputFile("presets.txt"); + + /* PLEASE READ ME + * This is a hard coded directory for i3wm's sake, you have to fix this yourself. + */ + QFile inputFile("/home/daniel_j/documents/school/2016\ research\ project/RGBController/qt/build/degub/presets.txt"); if (inputFile.open(QIODevice::ReadOnly)) { QTextStream in(&inputFile); @@ -99,7 +103,7 @@ void controllerWindow::load_presets() info_log("Presets loaded"); } else { - show_msgbox("Unable to find the presets fle.\nThis file needs to be named 'presets.txt' and be located in the same directory as the binary."); + show_msgbox("Unable to find the presets file.\nThis file needs to be named 'presets.txt' and be located in the same directory as the binary."); info_log("Presets file not found."); } } @@ -306,4 +310,5 @@ void controllerWindow::on_preset_save_button_clicked() { save_preset(tempname); } + ui->preset_name_textbox->clear(); } diff --git a/qt/build/degub/RGBController b/qt/build/degub/RGBController index fecc4e7..21a2bfd 100755 Binary files a/qt/build/degub/RGBController and b/qt/build/degub/RGBController differ diff --git a/qt/build/degub/controllerwindow.o b/qt/build/degub/controllerwindow.o index c5c9213..07494b6 100644 Binary files a/qt/build/degub/controllerwindow.o and b/qt/build/degub/controllerwindow.o differ -- cgit v1.2.3