From 391a6851f10740554ebe80baa98276cc558b803a Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 16 Dec 2016 09:18:21 -0500 Subject: Switch the "clicked" signal for the "Activated" signal within the input device checkbox detection. This will allow keyboard changes to be detected/applied as well. --- src-qt5/core-utils/lumina-config/pages/page_mouse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-qt5') diff --git a/src-qt5/core-utils/lumina-config/pages/page_mouse.cpp b/src-qt5/core-utils/lumina-config/pages/page_mouse.cpp index bda90ad4..f4eebd0e 100644 --- a/src-qt5/core-utils/lumina-config/pages/page_mouse.cpp +++ b/src-qt5/core-utils/lumina-config/pages/page_mouse.cpp @@ -76,7 +76,7 @@ void page_mouse::generateUI(){ tree = new QTreeWidget(this); tree->setHeaderHidden(true); tree->setColumnCount(2); - connect(tree, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(itemClicked(QTreeWidgetItem*,int)) ); + connect(tree, SIGNAL(itemActivated(QTreeWidgetItem*, int)), this, SLOT(itemClicked(QTreeWidgetItem*,int)) ); if(devices[i]->isPointer()){ int tab = ui->tabWidget->addTab(tree, LXDG::findIcon("input-mouse",""), QString(tr("Mouse #%1")).arg(QString::number(mouse)) ); ui->tabWidget->setTabWhatsThis(tab, "mouse:"+QString::number(devices[i]->devNumber())); -- cgit From 42210dc6fa063a33b637dbe12574494f4f8e6a10 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 16 Dec 2016 09:46:38 -0500 Subject: A bit more cleanup for the terminal. --- .../lumina-terminal/TerminalWidget.cpp | 9 +-- .../desktop-utils/lumina-terminal/TtyProcess.cpp | 67 +++++++++++++--------- src-qt5/desktop-utils/lumina-terminal/TtyProcess.h | 5 +- 3 files changed, 47 insertions(+), 34 deletions(-) (limited to 'src-qt5') diff --git a/src-qt5/desktop-utils/lumina-terminal/TerminalWidget.cpp b/src-qt5/desktop-utils/lumina-terminal/TerminalWidget.cpp index a4622817..906252cf 100644 --- a/src-qt5/desktop-utils/lumina-terminal/TerminalWidget.cpp +++ b/src-qt5/desktop-utils/lumina-terminal/TerminalWidget.cpp @@ -164,9 +164,10 @@ void TerminalWidget::applyANSI(QByteArray code){ else{ qDebug() << "Unhandled ANSI Code:" << code; } - /*}else if(code.startsWith("[@") && code.length()==3){ - //Strange VT220? code - just print the character after the @ - InsertText( QString(code[2]) );*/ + + }else if(code.startsWith("[") && code.contains("@")){ + code = code.remove(0, code.indexOf("@")+1); + InsertText(code); //insert character (cursor position already accounted for with other systems) }else if(code.startsWith("[")){ // VT100 ESCAPE CODES //CURSOR MOVEMENT @@ -432,7 +433,7 @@ void TerminalWidget::sendKeyPress(int key){ //Check for special keys switch(key){ case Qt::Key_Delete: - ba.append("\x7F"); + ba.append("\e[3~"); break; case Qt::Key_Backspace: ba.append("\x08"); diff --git a/src-qt5/desktop-utils/lumina-terminal/TtyProcess.cpp b/src-qt5/desktop-utils/lumina-terminal/TtyProcess.cpp index 6ddd876b..a4550fe3 100644 --- a/src-qt5/desktop-utils/lumina-terminal/TtyProcess.cpp +++ b/src-qt5/desktop-utils/lumina-terminal/TtyProcess.cpp @@ -4,7 +4,7 @@ #include #include -#define DEBUG 0 +#define DEBUG 1 TTYProcess::TTYProcess(QObject *parent) : QObject(parent){ childProc = 0; @@ -107,7 +107,7 @@ void TTYProcess::closeTTY(){ void TTYProcess::writeTTY(QByteArray output){ //qDebug() << "Write:" << output; static QList knownFixes; - if(knownFixes.isEmpty()){ knownFixes << "\x1b[C" << "\x1b[D" << "\b" << "\x7F" << "\x08"; } + if(knownFixes.isEmpty()){ knownFixes << "\x1b[C" << "\x1b[D" << "\b" << "\x7F" << "\x08"; }//<<"\x1b[H"<<"\x1b[F"; } fixReply = knownFixes.indexOf(output); ::write(ttyfd, output.data(), output.size()); } @@ -172,6 +172,12 @@ QByteArray TTYProcess::readTTY(){ } } break; + case 5: //Home Key + BA = "\x1b[H"; + break; + case 6: //End Key + BA = "\x1b[F"; + break; } fixReply = -1; //done with the fix - resume normal operations if(DEBUG){ qDebug() << " - Fixed:" << BA; } @@ -268,14 +274,14 @@ QByteArray TTYProcess::CleanANSI(QByteArray raw, bool &incomplete){ writeTTY("\x1b[1c"); //VT220 reply code } //Terminal Identify request (xterm/termcap?) - index = raw.indexOf("\x1b[P"); + /*index = raw.indexOf("\x1b[P"); while(index>=0){ raw = raw.remove(index,3); index = raw.indexOf("\x1b[P"); //Also send the proper reply to this identify request right away qDebug() << " - Got XTERM/TERMCAP identify request ([P)"; writeTTY("\x1b[/Z"); - } + }*/ incomplete = false; return raw; @@ -291,38 +297,18 @@ pid_t TTYProcess::LaunchProcess(int& fd, char *prog, char **child_args){ if(rc!=0){ return -1; } rc = unlockpt(fd); //unlock file (ready for use) //rc = fchown(fd, getuid(), getgid()); + setupTtyFd(fd); if(rc!=0){ return -1; } //Now fork, return the Master device and setup the child pid_t PID = fork(); if(PID==0){ //SLAVE/child int fds = ::open(ptsname(fd), O_RDWR | O_NOCTTY); //open slave side read/write - //rc = fchown(fds, getuid(), getgid()); - //::close(fd); //close the master side from the slave thread + rc = fchown(fds, getuid(), getgid()); + ::close(fd); //close the master side from the slave thread //Adjust the slave side mode to SANE - struct termios TSET; - rc = tcgetattr(fds, &TSET); //read the current settings - //cfmakesane(&TSET); //set the SANE mode on the settings ( RAW: cfmakeraw(&TSET); ) - //Set Input Modes - TSET.c_iflag |= IGNPAR; //ignore parity errors - TSET.c_iflag &= ~(IGNBRK | PARMRK | ISTRIP | ICRNL | IXON | IXANY | IXOFF); //ignore special characters - //TSET.c_iflag &= IUTF8; //enable UTF-8 support - //Set Local Modes - TSET.c_lflag &= (ECHO | ECHONL | ECHOKE); //Echo inputs (normal, newline, and KILL character line break) - TSET.c_lflag &= ~ICANON ; //non-canonical mode (individual inputs - not a line-at-a-time) - //Set Control Modes - TSET.c_cflag |= CLOCAL; //Local Terminal Connection (non-modem) - //TSET.c_lflag &= ~IEXTEN; - //TSET.c_cflag &= ~(CSIZE | PARENB); - //TSET.c_cflag |= CS8; - //tt.c_oflag &= ~OPOST; // disable special output processing - //Set Output Modes - TSET.c_oflag |= OPOST; - //TSET.c_oflag |= OXTABS; - TSET.c_cc[VTIME] = 0; // timeout - //Now apply the settings - tcsetattr(fds, TCSANOW, &TSET); //apply the changed settings + setupTtyFd(fds); //Change the controlling terminal in child thread to the slave PTY ::close(0); //close current terminal standard input ::close(1); //close current terminal standard output @@ -344,6 +330,31 @@ pid_t TTYProcess::LaunchProcess(int& fd, char *prog, char **child_args){ return PID; } +void TTYProcess::setupTtyFd(int fd){ + struct termios TSET; + tcgetattr(fd, &TSET); //read the current settings + cfmakesane(&TSET); //set the SANE mode on the settings ( RAW: cfmakeraw(&TSET); ) + //Set Input Modes + //TSET.c_iflag |= IGNPAR; //ignore parity errors + //TSET.c_iflag &= ~(IGNBRK | PARMRK | ISTRIP | ICRNL | IXON | IXANY | IXOFF); //ignore special characters + //TSET.c_iflag &= IUTF8; //enable UTF-8 support + //Set Local Modes + //TSET.c_lflag &= (ECHO | ECHONL | ECHOKE); //Echo inputs (normal, newline, and KILL character line break) + //TSET.c_lflag &= ~ICANON ; //non-canonical mode (individual inputs - not a line-at-a-time) + //Set Control Modes + //TSET.c_cflag |= CLOCAL; //Local Terminal Connection (non-modem) + //TSET.c_lflag &= ~IEXTEN; + //TSET.c_cflag &= ~(CSIZE | PARENB); + //TSET.c_cflag |= CS8; + //tt.c_oflag &= ~OPOST; // disable special output processing + //Set Output Modes + //TSET.c_oflag |= OPOST; + //TSET.c_oflag |= OXTABS; + TSET.c_cc[VTIME] = 0; // timeout + //Now apply the settings + tcsetattr(fd, TCSANOW, &TSET); //apply the changed settings +} + // === PRIVATE SLOTS === void TTYProcess::checkStatus(int sock){ //This is run when the socket gets activated diff --git a/src-qt5/desktop-utils/lumina-terminal/TtyProcess.h b/src-qt5/desktop-utils/lumina-terminal/TtyProcess.h index 97b4626b..f8d709a8 100644 --- a/src-qt5/desktop-utils/lumina-terminal/TtyProcess.h +++ b/src-qt5/desktop-utils/lumina-terminal/TtyProcess.h @@ -73,8 +73,9 @@ private: // Returns: // -1 for errors, child process PID (positive integer) if successful //==================================== - static pid_t LaunchProcess(int& fd, char *prog, char **child_args); - + pid_t LaunchProcess(int& fd, char *prog, char **child_args); + void setupTtyFd(pid_t fd); + private slots: void checkStatus(int); -- cgit From 0249c04c50ece0177c899f180cb6067c921039f2 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 16 Dec 2016 10:09:33 -0500 Subject: Fix the mimetype matching routine to support multiple-extension formats better (*.tar.gz as opposed to *.gz) --- src-qt5/core/libLumina/LuminaXDG.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src-qt5') diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index d6342269..b01eaccb 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -868,16 +868,18 @@ QIcon LXDG::findMimeIcon(QString extension){ QString LXDG::findAppMimeForFile(QString filename, bool multiple){ QString out; - QString extension = filename.section(".",-1); + QString extension = filename.section(".",1,-1); if("."+extension == filename){ extension.clear(); } //hidden file without extension //qDebug() << "MIME SEARCH:" << filename << extension; QStringList mimefull = LXDG::loadMimeFileGlobs2(); QStringList mimes; - //Just in case the extension/filename is a mimetype itself + //Just in case the filename is a mimetype itself if( mimefull.filter(":"+filename+":").length() == 1){ return filename; } - else if(mimefull.filter(":"+extension+":").length() == 1){ +while(mimes.isEmpty()){ + //Check for an exact mimetype match + if(mimefull.filter(":"+extension+":").length() == 1){ return extension; } //Look for globs at the end of the filename @@ -898,7 +900,12 @@ QString LXDG::findAppMimeForFile(QString filename, bool multiple){ for(int i=0; i Date: Fri, 16 Dec 2016 10:23:48 -0500 Subject: Another mimetype detection fix. --- src-qt5/core/lumina-open/main.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src-qt5') diff --git a/src-qt5/core/lumina-open/main.cpp b/src-qt5/core/lumina-open/main.cpp index 279f7c1b..d0bf79c0 100644 --- a/src-qt5/core/lumina-open/main.cpp +++ b/src-qt5/core/lumina-open/main.cpp @@ -333,6 +333,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat }else{ //No field codes (or improper field codes given in the file - which is quite common) // - Just tack the input file on the end and let the app handle it as necessary + inFile.replace("%20"," "); //assume a local-file format rather than URL format cmd.append(" \""+inFile+"\""); } } -- cgit From 4f546a4aca08d192aaedd0e9e2c8b7c14ad748a3 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 16 Dec 2016 10:28:29 -0500 Subject: Hide the small menu popup during the lumina-fm init routine. --- src-qt5/desktop-utils/lumina-fm/MainUI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-qt5') diff --git a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp index b017600b..c302c869 100644 --- a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp @@ -26,7 +26,6 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ waitingToClose = false; ui->setupUi(this); - ui->menuGit->setVisible( GIT::isAvailable() ); if(DEBUG){ qDebug() << "Initilization:"; } settings = new QSettings( QSettings::UserScope, "lumina-desktop", "lumina-fm", this); @@ -193,6 +192,7 @@ void MainUI::OpenDirs(QStringList dirs){ //qDebug() << "OpenDirs:" << DWLIST.length() << dirs << invalid << tabBar->currentIndex(); if(DWLIST.isEmpty()){ OpenDirs(QStringList()); } waitingToClose = false; + ui->menuGit->setVisible( GIT::isAvailable() ); } void MainUI::setupIcons(){ -- cgit