mirror of
https://github.com/overte-org/overte.git
synced 2025-06-19 20:00:19 +02:00
Merge pull request #3593 from huffman/20024
CR for Job #20024 - UI edits to Running Scripts dialog
This commit is contained in:
commit
2a35c4af4d
3 changed files with 67 additions and 46 deletions
|
@ -158,7 +158,7 @@ Menu::Menu() :
|
||||||
addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScriptURL,
|
addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScriptURL,
|
||||||
Qt::CTRL | Qt::SHIFT | Qt::Key_O, appInstance, SLOT(loadScriptURLDialog()));
|
Qt::CTRL | Qt::SHIFT | Qt::Key_O, appInstance, SLOT(loadScriptURLDialog()));
|
||||||
addActionToQMenuAndActionHash(fileMenu, MenuOption::StopAllScripts, 0, appInstance, SLOT(stopAllScripts()));
|
addActionToQMenuAndActionHash(fileMenu, MenuOption::StopAllScripts, 0, appInstance, SLOT(stopAllScripts()));
|
||||||
addActionToQMenuAndActionHash(fileMenu, MenuOption::ReloadAllScripts, Qt::CTRL | Qt::SHIFT | Qt::Key_R,
|
addActionToQMenuAndActionHash(fileMenu, MenuOption::ReloadAllScripts, Qt::CTRL | Qt::Key_R,
|
||||||
appInstance, SLOT(reloadAllScripts()));
|
appInstance, SLOT(reloadAllScripts()));
|
||||||
addActionToQMenuAndActionHash(fileMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J,
|
addActionToQMenuAndActionHash(fileMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J,
|
||||||
appInstance, SLOT(toggleRunningScriptsWidget()));
|
appInstance, SLOT(toggleRunningScriptsWidget()));
|
||||||
|
|
|
@ -40,6 +40,9 @@ RunningScriptsWidget::RunningScriptsWidget(QWidget* parent) :
|
||||||
connect(&_proxyModel, &QSortFilterProxyModel::modelReset,
|
connect(&_proxyModel, &QSortFilterProxyModel::modelReset,
|
||||||
this, &RunningScriptsWidget::selectFirstInList);
|
this, &RunningScriptsWidget::selectFirstInList);
|
||||||
|
|
||||||
|
QString shortcutText = Menu::getInstance()->getActionForOption(MenuOption::ReloadAllScripts)->shortcut().toString(QKeySequence::NativeText);
|
||||||
|
ui->tipLabel->setText("Tip: Use " + shortcutText + " to reload all scripts.");
|
||||||
|
|
||||||
_proxyModel.setSourceModel(&_scriptsModel);
|
_proxyModel.setSourceModel(&_scriptsModel);
|
||||||
_proxyModel.sort(0, Qt::AscendingOrder);
|
_proxyModel.sort(0, Qt::AscendingOrder);
|
||||||
_proxyModel.setDynamicSortFilter(true);
|
_proxyModel.setDynamicSortFilter(true);
|
||||||
|
@ -86,7 +89,7 @@ void RunningScriptsWidget::setBoundary(const QRect& rect) {
|
||||||
void RunningScriptsWidget::setRunningScripts(const QStringList& list) {
|
void RunningScriptsWidget::setRunningScripts(const QStringList& list) {
|
||||||
setUpdatesEnabled(false);
|
setUpdatesEnabled(false);
|
||||||
QLayoutItem* widget;
|
QLayoutItem* widget;
|
||||||
while ((widget = ui->scrollAreaWidgetContents->layout()->takeAt(0)) != NULL) {
|
while ((widget = ui->scriptListWidget->layout()->takeAt(0)) != NULL) {
|
||||||
delete widget->widget();
|
delete widget->widget();
|
||||||
delete widget;
|
delete widget;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +99,7 @@ void RunningScriptsWidget::setRunningScripts(const QStringList& list) {
|
||||||
if (!hash.contains(list.at(i))) {
|
if (!hash.contains(list.at(i))) {
|
||||||
hash.insert(list.at(i), 1);
|
hash.insert(list.at(i), 1);
|
||||||
}
|
}
|
||||||
QWidget* row = new QWidget(ui->scrollAreaWidgetContents);
|
QWidget* row = new QWidget(ui->scriptListWidget);
|
||||||
row->setLayout(new QHBoxLayout(row));
|
row->setLayout(new QHBoxLayout(row));
|
||||||
|
|
||||||
QUrl url = QUrl(list.at(i));
|
QUrl url = QUrl(list.at(i));
|
||||||
|
@ -130,17 +133,16 @@ void RunningScriptsWidget::setRunningScripts(const QStringList& list) {
|
||||||
line->setFrameShape(QFrame::HLine);
|
line->setFrameShape(QFrame::HLine);
|
||||||
line->setStyleSheet("color: #E1E1E1; margin-left: 6px; margin-right: 6px;");
|
line->setStyleSheet("color: #E1E1E1; margin-left: 6px; margin-right: 6px;");
|
||||||
|
|
||||||
ui->scrollAreaWidgetContents->layout()->addWidget(row);
|
ui->scriptListWidget->layout()->addWidget(row);
|
||||||
ui->scrollAreaWidgetContents->layout()->addWidget(line);
|
ui->scriptListWidget->layout()->addWidget(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ui->noRunningScriptsLabel->setVisible(list.isEmpty());
|
ui->noRunningScriptsLabel->setVisible(list.isEmpty());
|
||||||
ui->runningScriptsList->setVisible(!list.isEmpty());
|
|
||||||
ui->reloadAllButton->setVisible(!list.isEmpty());
|
ui->reloadAllButton->setVisible(!list.isEmpty());
|
||||||
ui->stopAllButton->setVisible(!list.isEmpty());
|
ui->stopAllButton->setVisible(!list.isEmpty());
|
||||||
|
|
||||||
ui->scrollAreaWidgetContents->updateGeometry();
|
ui->scriptListWidget->updateGeometry();
|
||||||
setUpdatesEnabled(true);
|
setUpdatesEnabled(true);
|
||||||
Application::processEvents();
|
Application::processEvents();
|
||||||
repaint();
|
repaint();
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>319</width>
|
<width>364</width>
|
||||||
<height>481</height>
|
<height>728</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -16,19 +16,7 @@
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">* { font-family: Helvetica, Arial, sans-serif; }</string>
|
<string notr="true">* { font-family: Helvetica, Arial, sans-serif; }</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="3,2">
|
||||||
<property name="leftMargin">
|
|
||||||
<number>14</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>20</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>14</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>20</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="runningScriptsArea" native="true">
|
<widget class="QWidget" name="runningScriptsArea" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -195,6 +183,25 @@ font: bold 16px;
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="noRunningScriptsLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">font: 14px; color: #5f5f5f; margin: 2px;</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>There are no scripts running.</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QScrollArea" name="runningScriptsList">
|
<widget class="QScrollArea" name="runningScriptsList">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -219,10 +226,10 @@ font: bold 16px;
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="verticalScrollBarPolicy">
|
<property name="verticalScrollBarPolicy">
|
||||||
<enum>Qt::ScrollBarAlwaysOn</enum>
|
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="horizontalScrollBarPolicy">
|
<property name="horizontalScrollBarPolicy">
|
||||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeAdjustPolicy">
|
<property name="sizeAdjustPolicy">
|
||||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||||
|
@ -238,8 +245,8 @@ font: bold 16px;
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>264</width>
|
<width>328</width>
|
||||||
<height>16</height>
|
<height>18</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -254,7 +261,7 @@ font: bold 16px;
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">font-size: 14px;</string>
|
<string notr="true">font-size: 14px;</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -270,29 +277,41 @@ font: bold 16px;
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="scriptListWidget" native="true">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="tipLabel">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">font: 14px; color: #5f5f5f; margin: 2px;</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Tip</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="noRunningScriptsLabel">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">font: 14px; color: #5f5f5f;</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>There are no scripts running.</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in a new issue