Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 2.0 with new dropdown terminal
- Loading branch information
Showing
13 changed files
with
364 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include "settingswindow.h" | ||
#include "ui_settingswindow.h" | ||
|
||
extern bool capturingKeyPress; | ||
extern NativeEventFilter* filter; | ||
|
||
SettingsWindow::SettingsWindow(QWidget *parent) : | ||
QDialog(parent), | ||
ui(new Ui::SettingsWindow) | ||
{ | ||
ui->setupUi(this); | ||
|
||
ui->settingsLists->addItem(new QListWidgetItem(QIcon::fromTheme("configure"), "General")); | ||
ui->settingsLists->addItem(new QListWidgetItem(QIcon::fromTheme("go-down"), "Drop Down")); | ||
|
||
on_keybindingButton_toggled(false); | ||
|
||
connect(filter, SIGNAL(keypressCaptureComplete()), this, SLOT(keypressCaptureComplete())); | ||
} | ||
|
||
SettingsWindow::~SettingsWindow() | ||
{ | ||
disconnect(filter, SIGNAL(keypressCaptureComplete()), this, SLOT(keypressCaptureComplete())); | ||
delete ui; | ||
} | ||
|
||
void SettingsWindow::on_settingsLists_currentRowChanged(int currentRow) | ||
{ | ||
ui->pages->setCurrentIndex(currentRow); | ||
} | ||
|
||
void SettingsWindow::on_DoneButton_clicked() | ||
{ | ||
this->close(); | ||
} | ||
|
||
void SettingsWindow::on_keybindingButton_toggled(bool checked) | ||
{ | ||
if (checked) { | ||
//Capture keyboard | ||
XGrabKeyboard(QX11Info::display(), RootWindow(QX11Info::display(), 0), True, GrabModeAsync, GrabModeAsync, CurrentTime); | ||
filter->captureKeyPresses(true); | ||
|
||
ui->keybindingButton->setText("Strike a key!"); | ||
} else { | ||
XUngrabKeyboard(QX11Info::display(), CurrentTime); | ||
filter->captureKeyPresses(false); | ||
|
||
ui->keybindingButton->setText(settings.value("dropdown/keyString", "F12").toString()); | ||
} | ||
} | ||
|
||
void SettingsWindow::keypressCaptureComplete() { | ||
ui->keybindingButton->setChecked(false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#ifndef SETTINGSWINDOW_H | ||
#define SETTINGSWINDOW_H | ||
|
||
#include <QDialog> | ||
#include <QStackedWidget> | ||
#include <QListWidget> | ||
#include <QKeySequenceEdit> | ||
#include <QX11Info> | ||
#include "nativeeventfilter.h" | ||
#include <X11/Xlib.h> | ||
#include <X11/XF86keysym.h> | ||
#include <X11/Xatom.h> | ||
|
||
#undef Unsorted | ||
#undef None | ||
#undef KeyPress | ||
#undef KeyRelease | ||
#undef FocusIn | ||
#undef FocusOut | ||
#undef FontChange | ||
#undef Expose | ||
#undef Bool | ||
|
||
namespace Ui { | ||
class SettingsWindow; | ||
} | ||
|
||
class SettingsWindow : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit SettingsWindow(QWidget *parent = 0); | ||
~SettingsWindow(); | ||
|
||
private slots: | ||
void on_settingsLists_currentRowChanged(int currentRow); | ||
|
||
void on_DoneButton_clicked(); | ||
|
||
void on_keybindingButton_toggled(bool checked); | ||
|
||
void keypressCaptureComplete(); | ||
|
||
private: | ||
Ui::SettingsWindow *ui; | ||
|
||
QSettings settings; | ||
}; | ||
|
||
#endif // SETTINGSWINDOW_H |
Oops, something went wrong.