diff --git a/lib/ptyqt/ptyqt.pri b/lib/ptyqt/ptyqt.pri index b9fa84b7..d260e690 100644 --- a/lib/ptyqt/ptyqt.pri +++ b/lib/ptyqt/ptyqt.pri @@ -20,6 +20,7 @@ win32:{ win32-msvc*{ HEADERS += $$PWD/conptyprocess.h SOURCES += $$PWD/conptyprocess.cpp + LIBS += -lAdvapi32 } LIBS += -lwsock32 -lws2_32 -lcrypt32 -liphlpapi -lnetapi32 -lversion -lwinmm -luserenv diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index fd0b4f40..292b9c33 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3265,6 +3265,8 @@ void CentralWidget::menuAndToolBarConnectSignals(void) { startTftpSeverWindow->retranslateUi(); pluginInfoWindow->retranslateUi(); pluginViewerWidget->retranslateUi(); + notifictionWidget->retranslateUi(); + statusBarWidget->retranslateUi(); foreach(MainWidgetGroup *mainWidgetGroup, mainWidgetGroupList) { mainWidgetGroup->sessionTab->retranslateUi(); mainWidgetGroup->commandWidget->retranslateUi(); @@ -3296,6 +3298,7 @@ void CentralWidget::menuAndToolBarConnectSignals(void) { foreach(SessionsWindow *sessionsWindow, sessionList) { sessionsWindow->reTranslateUi(); } + statusBarWidget->retranslateUi(); globalOptionsWindow->switchTheme(); GlobalSetting settings; settings.setValue("Global/Startup/dark_theme","false"); @@ -3313,6 +3316,7 @@ void CentralWidget::menuAndToolBarConnectSignals(void) { foreach(SessionsWindow *sessionsWindow, sessionList) { sessionsWindow->reTranslateUi(); } + statusBarWidget->retranslateUi(); globalOptionsWindow->switchTheme(); GlobalSetting settings; settings.setValue("Global/Startup/dark_theme","true"); diff --git a/src/notifictionwidget/notifictionwidget.cpp b/src/notifictionwidget/notifictionwidget.cpp index 884a6371..e5e66c27 100644 --- a/src/notifictionwidget/notifictionwidget.cpp +++ b/src/notifictionwidget/notifictionwidget.cpp @@ -87,3 +87,7 @@ void NotifictionWidget::clearNotifiction(void){ ui->listWidget->setVisible(false); } } + +void NotifictionWidget::retranslateUi() { + ui->retranslateUi(this); +} diff --git a/src/notifictionwidget/notifictionwidget.h b/src/notifictionwidget/notifictionwidget.h index 963d84fa..ef49f1ce 100644 --- a/src/notifictionwidget/notifictionwidget.h +++ b/src/notifictionwidget/notifictionwidget.h @@ -22,6 +22,7 @@ class NotifictionWidget : public QWidget bool removeNotifiction(int32_t index); bool isEmpty(void); void clearNotifiction(void); + void retranslateUi(void); signals: void notifictionChanged(uint32_t count); diff --git a/src/sessionswindow/sessionswindow.cpp b/src/sessionswindow/sessionswindow.cpp index 83b05b7a..e07cdd43 100644 --- a/src/sessionswindow/sessionswindow.cpp +++ b/src/sessionswindow/sessionswindow.cpp @@ -804,6 +804,10 @@ int SessionsWindow::startLocalShellSession(const QString &command, ShellType sTp if(forceUTF8) { envs.append("LC_CTYPE=UTF-8"); } + QFileInfo fileInfo(workingDirectory); + if(!fileInfo.exists() || !fileInfo.isDir()) { + workingDirectory = QDir::homePath(); + } bool ret = localShell->startProcess(shellPath, args, workingDirectory, envs, term->screenColumnsCount(), term->screenLinesCount()); if(!ret) { state = Error; diff --git a/src/statusbarwidget/statusbarwidget.cpp b/src/statusbarwidget/statusbarwidget.cpp index 7f49b81c..fe5bef9b 100644 --- a/src/statusbarwidget/statusbarwidget.cpp +++ b/src/statusbarwidget/statusbarwidget.cpp @@ -47,13 +47,6 @@ StatusBarWidget::StatusBarWidget(QWidget *parent) ui->horizontalLayout->addWidget(statusBarSpeedRx); ui->horizontalLayout->addWidget(statusBarNotifiction); - statusBarCursorInfo->setToolTip(tr("Current Cursor")); - statusBarType->setToolTip(tr("Session Type")); - statusBarTransTx->setToolTip(tr("Upload Total")); - statusBarTransRx->setToolTip(tr("Download Total")); - statusBarSpeedTx->setToolTip(tr("Upload Speed")); - statusBarSpeedRx->setToolTip(tr("Download Speed")); - statusBarCursorInfo->setVisible(false); statusBarType->setVisible(false); statusBarTransTx->setVisible(false); @@ -67,11 +60,7 @@ StatusBarWidget::StatusBarWidget(QWidget *parent) statusBarSpeedTx->setEnabled(false); statusBarSpeedRx->setEnabled(false); - statusBarTransTx->setIcon(QFontIcon::icon(QChar(0xf0ee))); - statusBarTransRx->setIcon(QFontIcon::icon(QChar(0xf0ed))); - statusBarSpeedTx->setIcon(QFontIcon::icon(QChar(0xf0aa))); - statusBarSpeedRx->setIcon(QFontIcon::icon(QChar(0xf0ab))); - statusBarNotifiction->setIcon(QFontIcon::icon(QChar(0xf0a2))); + retranslateUi(); statusBarCursorInfo->setPopupMode(QToolButton::InstantPopup); statusBarCursorInfo->setAutoRaise(true); @@ -259,3 +248,21 @@ void StatusBarWidget::contextMenuEvent(QContextMenuEvent *event) { } menu->popup(pos); } + +void StatusBarWidget::retranslateUi() +{ + statusBarCursorInfo->setToolTip(tr("Current Cursor")); + statusBarType->setToolTip(tr("Session Type")); + statusBarTransTx->setToolTip(tr("Upload Total")); + statusBarTransRx->setToolTip(tr("Download Total")); + statusBarSpeedTx->setToolTip(tr("Upload Speed")); + statusBarSpeedRx->setToolTip(tr("Download Speed")); + + statusBarTransTx->setIcon(QFontIcon::icon(QChar(0xf0ee))); + statusBarTransRx->setIcon(QFontIcon::icon(QChar(0xf0ed))); + statusBarSpeedTx->setIcon(QFontIcon::icon(QChar(0xf0aa))); + statusBarSpeedRx->setIcon(QFontIcon::icon(QChar(0xf0ab))); + statusBarNotifiction->setIcon(QFontIcon::icon(QChar(0xf0a2))); + + ui->retranslateUi(this); +} diff --git a/src/statusbarwidget/statusbarwidget.h b/src/statusbarwidget/statusbarwidget.h index f9b58a82..490e397b 100644 --- a/src/statusbarwidget/statusbarwidget.h +++ b/src/statusbarwidget/statusbarwidget.h @@ -118,6 +118,7 @@ class StatusBarWidget : public QWidget void setTransInfo(bool enable, int64_t tx = -1, int64_t rx = -1); void setSpeedInfo(bool enable, qreal tx = -1.0, qreal rx = -1.0); void setNotifiction(bool enable); + void retranslateUi(void); StatusBarToolButton *statusBarCursorInfo; StatusBarToolButton *statusBarType;