several minor improvements
This commit is contained in:
parent
542be1a824
commit
68bdbf3e3c
|
@ -63,7 +63,7 @@ private slots:
|
|||
void fileBrowserExpanded(QTreeWidgetItem * item);
|
||||
void fileBrowserCollapsed(QTreeWidgetItem * item);
|
||||
void fileBrowserDoubleClicked(QTreeWidgetItem * item, int column);
|
||||
void fileBrowserDoubleClickFile(QTreeWidgetItem * item, int column);
|
||||
void fileBrowserClicked(QTreeWidgetItem * item, int column);
|
||||
void fileBrowserPathReturnPressed();
|
||||
void fileBrowserContextMenuRequested(QPoint p);
|
||||
void fileBrowserItemChanged(QTreeWidgetItem * item, int col);
|
||||
|
|
|
@ -167,6 +167,7 @@ void FileBrowser::rebuildFileBrowserTree(QString path)
|
|||
|
||||
void FileBrowser::fileBrowserExpanded(QTreeWidgetItem * item)
|
||||
{
|
||||
if (mousePressTimer.isActive()) mousePressTimer.stop();
|
||||
QString path = item->data(0, Qt::UserRole).toString();
|
||||
if (path.size() == 0) return;
|
||||
QFileInfo fInfo(path);
|
||||
|
@ -176,6 +177,7 @@ void FileBrowser::fileBrowserExpanded(QTreeWidgetItem * item)
|
|||
|
||||
void FileBrowser::fileBrowserCollapsed(QTreeWidgetItem * item)
|
||||
{
|
||||
if (mousePressTimer.isActive()) mousePressTimer.stop();
|
||||
while(item->childCount() > 0) {
|
||||
QTreeWidgetItem * child = item->child(item->childCount()-1);
|
||||
if (child->childCount() > 0) {
|
||||
|
@ -201,7 +203,7 @@ void FileBrowser::fileBrowserDoubleClicked(QTreeWidgetItem * item, int column)
|
|||
else if (fInfo.isDir()) rebuildFileBrowserTree(path);
|
||||
}
|
||||
|
||||
void FileBrowser::fileBrowserDoubleClickFile(QTreeWidgetItem * item, int column)
|
||||
void FileBrowser::fileBrowserClicked(QTreeWidgetItem * item, int column)
|
||||
{
|
||||
if (item == nullptr) return;
|
||||
if (column != 0) return;
|
||||
|
@ -209,8 +211,10 @@ void FileBrowser::fileBrowserDoubleClickFile(QTreeWidgetItem * item, int column)
|
|||
if (path.size() == 0) return;
|
||||
QFileInfo fInfo(path);
|
||||
if (!fInfo.exists() || !fInfo.isWritable()) return;
|
||||
bool timerActive = mousePressTimer.isActive();
|
||||
if (mousePressTimer.isActive()) mousePressTimer.stop();
|
||||
if (fInfo.isFile()) emit openFile(path);
|
||||
else if (fInfo.isDir() && timerActive) item->setExpanded(!item->isExpanded());
|
||||
}
|
||||
|
||||
void FileBrowser::fileBrowserPathReturnPressed()
|
||||
|
@ -828,7 +832,7 @@ bool FileBrowser::eventFilter(QObject *watched, QEvent *event)
|
|||
if (mouseEvent != nullptr) {
|
||||
QPoint point(mouseEvent->x(), mouseEvent->y());
|
||||
QTreeWidgetItem * item = treeWidget->itemAt(point);
|
||||
if (item == treeWidget->currentItem()) fileBrowserDoubleClickFile(item, 0);
|
||||
if (item == treeWidget->currentItem()) fileBrowserClicked(item, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -589,8 +589,10 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
connect(shortcutQuickAccess, SIGNAL(activated()), this, SLOT(on_actionQuickAccess_triggered()));
|
||||
|
||||
QString shortcutQuickAccessAltStr = QString::fromStdString(Settings::get("shortcut_quick_access_alt"));
|
||||
QShortcut * shortcutQuickAccessAlt = new QShortcut(QKeySequence(shortcutQuickAccessAltStr), this);
|
||||
connect(shortcutQuickAccessAlt, SIGNAL(activated()), this, SLOT(on_actionQuickAccess_triggered()));
|
||||
if (shortcutQuickAccessStr != shortcutQuickAccessAltStr) {
|
||||
QShortcut * shortcutQuickAccessAlt = new QShortcut(QKeySequence(shortcutQuickAccessAltStr), this);
|
||||
connect(shortcutQuickAccessAlt, SIGNAL(activated()), this, SLOT(on_actionQuickAccess_triggered()));
|
||||
}
|
||||
|
||||
QString shortcutFocusTreeStr = QString::fromStdString(Settings::get("shortcut_focus_tree"));
|
||||
QShortcut * shortcutFocusTree = new QShortcut(QKeySequence(shortcutFocusTreeStr), this);
|
||||
|
@ -1678,21 +1680,33 @@ void MainWindow::on_actionGitInitializeRepository_triggered()
|
|||
|
||||
void MainWindow::on_actionGitAddRemoteURL_triggered()
|
||||
{
|
||||
QString url = Helper::showInputDialog(tr("Add remote URL"), tr("Enter URL:"), QLineEdit::Normal, "", "Note: you might want to add a username and password to repository URL\n(https://username:password@host/path)");
|
||||
QString description = "";
|
||||
#if defined(Q_OS_ANDROID)
|
||||
description = "Note: you might want to add a username and password to repository URL\n(https://username:password@host/path)";
|
||||
#endif
|
||||
QString url = Helper::showInputDialog(tr("Add remote URL"), tr("Enter URL:"), QLineEdit::Normal, "", description);
|
||||
if (url.isNull() || url.size() == 0) return;
|
||||
git->addRemoteURL(getGitWorkingDir(), url);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionGitChangeRemoteURL_triggered()
|
||||
{
|
||||
QString url = Helper::showInputDialog(tr("Change remote URL"), tr("Enter URL:"), QLineEdit::Normal, "", "Note: you might want to add a username and password to repository URL\n(https://username:password@host/path)");
|
||||
QString description = "";
|
||||
#if defined(Q_OS_ANDROID)
|
||||
description = "Note: you might want to add a username and password to repository URL\n(https://username:password@host/path)";
|
||||
#endif
|
||||
QString url = Helper::showInputDialog(tr("Change remote URL"), tr("Enter URL:"), QLineEdit::Normal, "", description);
|
||||
if (url.isNull() || url.size() == 0) return;
|
||||
git->changeRemoteURL(getGitWorkingDir(), url);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionGitCloneRepository_triggered()
|
||||
{
|
||||
QString url = Helper::showInputDialog(tr("Clone repository"), tr("Enter URL:"), QLineEdit::Normal, "", "Note: you might want to add a username and password to repository URL\n(https://username:password@host/path)");
|
||||
QString description = "";
|
||||
#if defined(Q_OS_ANDROID)
|
||||
description = "Note: you might want to add a username and password to repository URL\n(https://username:password@host/path)";
|
||||
#endif
|
||||
QString url = Helper::showInputDialog(tr("Clone repository"), tr("Enter URL:"), QLineEdit::Normal, "", description);
|
||||
if (url.isNull() || url.size() == 0) return;
|
||||
git->clone(getGitWorkingDir(), url);
|
||||
}
|
||||
|
@ -2020,7 +2034,7 @@ void MainWindow::dropEvent(QDropEvent * event)
|
|||
void MainWindow::keyPressEvent(QKeyEvent *e)
|
||||
{
|
||||
if (tabsList->isVisible()) tabsList->hide();
|
||||
if (e->key() != Qt::Key_Down && e->key() != Qt::Key_Up) hideQAPanel();
|
||||
if (e->key() == Qt::Key_Escape) hideQAPanel();
|
||||
QMainWindow::keyPressEvent(e);
|
||||
}
|
||||
|
||||
|
|
|
@ -66,8 +66,8 @@ Search::Search(Editor * codeEditor) : QWidget(codeEditor)
|
|||
|
||||
hLayoutFind = new QHBoxLayout();
|
||||
hLayoutFind->addWidget(findEdit);
|
||||
hLayoutFind->addWidget(findButton);
|
||||
hLayoutFind->addWidget(findPrevButton);
|
||||
hLayoutFind->addWidget(findButton);
|
||||
hLayoutFind->addWidget(findCaseSensitive);
|
||||
hLayoutFind->addWidget(findWholeWords);
|
||||
hLayoutFind->addWidget(findRegexp);
|
||||
|
|
Loading…
Reference in New Issue