terminal start delay
This commit is contained in:
parent
0683b6d7d4
commit
422bbdd4f8
6 changed files with 17 additions and 1 deletions
Binary file not shown.
|
@ -229,6 +229,7 @@ private slots:
|
|||
void terminalCopy();
|
||||
void terminalPaste();
|
||||
void showTerminal();
|
||||
void startTerminal();
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
Settings * settings;
|
||||
|
|
|
@ -17,6 +17,7 @@ public:
|
|||
virtual void changeDir(QString path) = 0;
|
||||
virtual void copy() = 0;
|
||||
virtual void paste() = 0;
|
||||
virtual void startShell() = 0;
|
||||
};
|
||||
|
||||
#define TerminalInterface_iid "com.github.ziracms.editor.TerminalInterface"
|
||||
|
|
|
@ -11,7 +11,6 @@ void TerminalPlugin::initialize(QString path)
|
|||
console->setEnvironment(QStringList() << "TERM=konsole-256color");
|
||||
console->setColorScheme("Linux"); // "GreenOnBlack", "Linux", "SolarizedLight", "BlackOnWhite", "DarkPastels", "BlackOnRandomLight", "WhiteOnBlack", "BlackOnLightYellow", "Solarized", "BreezeModified"
|
||||
console->setWorkingDirectory(path);
|
||||
console->startShellProgram();
|
||||
}
|
||||
|
||||
QString TerminalPlugin::getDirName()
|
||||
|
@ -48,3 +47,8 @@ void TerminalPlugin::changeDir(QString path)
|
|||
{
|
||||
console->changeDir(path);
|
||||
}
|
||||
|
||||
void TerminalPlugin::startShell()
|
||||
{
|
||||
console->startShellProgram();
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ public:
|
|||
void changeDir(QString path) override;
|
||||
void copy() override;
|
||||
void paste() override;
|
||||
void startShell() override;
|
||||
private:
|
||||
QTermWidget * console;
|
||||
};
|
||||
|
|
|
@ -43,6 +43,7 @@ const int SIDEBAR_TAB_NAVIGATOR_INDEX = 1;
|
|||
const int SIDEBAR_TAB_GIT_BROWSER_INDEX = 2;
|
||||
|
||||
int const MainWindow::EXIT_CODE_RESTART = -123456789;
|
||||
int const TERMINAL_START_DELAY = 250; // should not be less then PROJECT_LOAD_DELAY
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
|
@ -442,6 +443,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
QString showTerminalStr = QString::fromStdString(settings->get("shortcut_terminal"));
|
||||
QShortcut * showTerminal = new QShortcut(QKeySequence(showTerminalStr), this);
|
||||
connect(showTerminal, SIGNAL(activated()), this, SLOT(showTerminal()));
|
||||
|
||||
QTimer::singleShot(TERMINAL_START_DELAY, this, SLOT(startTerminal()));
|
||||
} else {
|
||||
terminalTabIndex = -1;
|
||||
}
|
||||
|
@ -2468,3 +2471,9 @@ void MainWindow::terminalPaste()
|
|||
if (terminal == nullptr) return;
|
||||
terminal->paste();
|
||||
}
|
||||
|
||||
void MainWindow::startTerminal()
|
||||
{
|
||||
if (terminal == nullptr) return;
|
||||
terminal->startShell();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue