diff options
author | Ken Moore <ken@ixsystems.com> | 2016-12-16 13:25:35 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2016-12-16 13:25:35 -0500 |
commit | 1608c2880af681b9f4df9681c4482324a62c8e4b (patch) | |
tree | dc3a57a3da021cbede4dcf71f3fe09651e4096bb /src-qt5 | |
parent | If xinput is not available, do not show the input device configuration page. (diff) | |
parent | Hide the small menu popup during the lumina-fm init routine. (diff) | |
download | lumina-1608c2880af681b9f4df9681c4482324a62c8e4b.tar.gz lumina-1608c2880af681b9f4df9681c4482324a62c8e4b.tar.bz2 lumina-1608c2880af681b9f4df9681c4482324a62c8e4b.zip |
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'src-qt5')
-rw-r--r-- | src-qt5/core-utils/lumina-config/pages/page_mouse.cpp | 2 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LuminaXDG.cpp | 15 | ||||
-rw-r--r-- | src-qt5/core/lumina-open/main.cpp | 1 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/MainUI.cpp | 2 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-terminal/TerminalWidget.cpp | 9 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-terminal/TtyProcess.cpp | 67 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-terminal/TtyProcess.h | 5 |
7 files changed, 61 insertions, 40 deletions
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())); 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<mimes.length(); i++){ if(!filename.startsWith( mimes[i].section(":",3,50,QString::SectionSkipEmpty).section("*",0,0), Qt::CaseInsensitive )){ mimes.removeAt(i); i--; } } - } + } + if(mimes.isEmpty()){ + if(extension.contains(".")){ extension = extension.section(".",1,-1); } + else{ break; } + } + } //end of mimes while loop mimes.sort(); //this automatically puts them in weight order (100 on down) QStringList matches; //qDebug() << "Mimes:" << mimes; 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+"\""); } } 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(){ 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 <QProcessEnvironment> #include <QTimer> -#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<QByteArray> 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); |