forked from qt-creator/qt-creator
Remove output mode.
Replaced by the maximize and "More..." buttons. Edit mode is now the fallback mode for the output panes.
This commit is contained in:
@@ -63,7 +63,6 @@ const char * const IDE_REVISION_STR = "";
|
|||||||
//modes
|
//modes
|
||||||
const char * const MODE_WELCOME = "Welcome";
|
const char * const MODE_WELCOME = "Welcome";
|
||||||
const char * const MODE_EDIT = "Edit";
|
const char * const MODE_EDIT = "Edit";
|
||||||
const char * const MODE_OUTPUT = "Output";
|
|
||||||
const int P_MODE_WELCOME = 100;
|
const int P_MODE_WELCOME = 100;
|
||||||
const int P_MODE_EDIT = 90;
|
const int P_MODE_EDIT = 90;
|
||||||
const int P_MODE_OUTPUT = 10;
|
const int P_MODE_OUTPUT = 10;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ FancyTabBar::FancyTabBar(QWidget *parent)
|
|||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
m_hoverIndex = -1;
|
m_hoverIndex = -1;
|
||||||
m_currentIndex = 0;
|
m_currentIndex = -1;
|
||||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
|
||||||
setStyle(new QWindowsStyle);
|
setStyle(new QWindowsStyle);
|
||||||
setMinimumWidth(qMax(2 * m_rounding, 40));
|
setMinimumWidth(qMax(2 * m_rounding, 40));
|
||||||
|
|||||||
@@ -134,7 +134,6 @@ MainWindow::MainWindow() :
|
|||||||
m_rightPaneWidget(0),
|
m_rightPaneWidget(0),
|
||||||
m_versionDialog(0),
|
m_versionDialog(0),
|
||||||
m_activeContext(0),
|
m_activeContext(0),
|
||||||
m_outputMode(0),
|
|
||||||
m_generalSettings(new GeneralSettings),
|
m_generalSettings(new GeneralSettings),
|
||||||
m_shortcutSettings(new ShortcutSettings),
|
m_shortcutSettings(new ShortcutSettings),
|
||||||
m_focusToEditor(0),
|
m_focusToEditor(0),
|
||||||
@@ -253,9 +252,6 @@ MainWindow::~MainWindow()
|
|||||||
m_uniqueIDManager = 0;
|
m_uniqueIDManager = 0;
|
||||||
delete m_vcsManager;
|
delete m_vcsManager;
|
||||||
m_vcsManager = 0;
|
m_vcsManager = 0;
|
||||||
pm->removeObject(m_outputMode);
|
|
||||||
delete m_outputMode;
|
|
||||||
m_outputMode = 0;
|
|
||||||
//we need to delete editormanager and statusbarmanager explicitly before the end of the destructor,
|
//we need to delete editormanager and statusbarmanager explicitly before the end of the destructor,
|
||||||
//because they might trigger stuff that tries to access data from editorwindow, like removeContextWidget
|
//because they might trigger stuff that tries to access data from editorwindow, like removeContextWidget
|
||||||
|
|
||||||
@@ -297,27 +293,7 @@ bool MainWindow::init(QString *errorMessage)
|
|||||||
m_statusBarManager->init();
|
m_statusBarManager->init();
|
||||||
m_modeManager->init();
|
m_modeManager->init();
|
||||||
m_progressManager->init();
|
m_progressManager->init();
|
||||||
QWidget *outputModeWidget = new QWidget;
|
|
||||||
outputModeWidget->setLayout(new QVBoxLayout);
|
|
||||||
outputModeWidget->layout()->setMargin(0);
|
|
||||||
outputModeWidget->layout()->setSpacing(0);
|
|
||||||
m_outputMode = new BaseMode;
|
|
||||||
m_outputMode->setName(tr("Output"));
|
|
||||||
m_outputMode->setUniqueModeName(Constants::MODE_OUTPUT);
|
|
||||||
m_outputMode->setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Output.png")));
|
|
||||||
m_outputMode->setPriority(Constants::P_MODE_OUTPUT);
|
|
||||||
m_outputMode->setWidget(outputModeWidget);
|
|
||||||
OutputPanePlaceHolder *oph = new OutputPanePlaceHolder(m_outputMode);
|
|
||||||
oph->setCloseable(false);
|
|
||||||
outputModeWidget->layout()->addWidget(oph);
|
|
||||||
oph->setVisible(true); // since the output pane placeholder is invisible at startup by default (which makes sense in most cases)
|
|
||||||
outputModeWidget->setFocusProxy(oph);
|
|
||||||
|
|
||||||
connect(m_modeManager, SIGNAL(currentModeChanged(Core::IMode*)),
|
|
||||||
this, SLOT(modeChanged(Core::IMode*)), Qt::QueuedConnection);
|
|
||||||
|
|
||||||
m_outputMode->setContext(m_globalContext);
|
|
||||||
pm->addObject(m_outputMode);
|
|
||||||
pm->addObject(m_generalSettings);
|
pm->addObject(m_generalSettings);
|
||||||
pm->addObject(m_shortcutSettings);
|
pm->addObject(m_shortcutSettings);
|
||||||
|
|
||||||
@@ -330,16 +306,6 @@ bool MainWindow::init(QString *errorMessage)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::modeChanged(Core::IMode *mode)
|
|
||||||
{
|
|
||||||
if (mode == m_outputMode) {
|
|
||||||
int idx = OutputPaneManager::instance()->m_widgetComboBox->itemData(OutputPaneManager::instance()->m_widgetComboBox->currentIndex()).toInt();
|
|
||||||
IOutputPane *out = OutputPaneManager::instance()->m_pageMap.value(idx);
|
|
||||||
if (out && out->canFocus())
|
|
||||||
out->setFocus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::extensionsInitialized()
|
void MainWindow::extensionsInitialized()
|
||||||
{
|
{
|
||||||
m_editorManager->init();
|
m_editorManager->init();
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ private slots:
|
|||||||
void updateFocusWidget(QWidget *old, QWidget *now);
|
void updateFocusWidget(QWidget *old, QWidget *now);
|
||||||
void setSidebarVisible(bool visible);
|
void setSidebarVisible(bool visible);
|
||||||
void destroyVersionDialog();
|
void destroyVersionDialog();
|
||||||
void modeChanged(Core::IMode *mode);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateContextObject(IContext *context);
|
void updateContextObject(IContext *context);
|
||||||
@@ -201,7 +200,6 @@ private:
|
|||||||
|
|
||||||
QMap<QWidget *, IContext *> m_contextWidgets;
|
QMap<QWidget *, IContext *> m_contextWidgets;
|
||||||
|
|
||||||
BaseMode *m_outputMode;
|
|
||||||
GeneralSettings *m_generalSettings;
|
GeneralSettings *m_generalSettings;
|
||||||
ShortcutSettings *m_shortcutSettings;
|
ShortcutSettings *m_shortcutSettings;
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,10 @@ void ModeManager::addWidget(QWidget *widget)
|
|||||||
|
|
||||||
IMode *ModeManager::currentMode() const
|
IMode *ModeManager::currentMode() const
|
||||||
{
|
{
|
||||||
return m_modes.at(m_modeStack->currentIndex());
|
int currentIndex = m_modeStack->currentIndex();
|
||||||
|
if (currentIndex < 0)
|
||||||
|
return 0;
|
||||||
|
return m_modes.at(currentIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ModeManager::indexOf(const QString &id) const
|
int ModeManager::indexOf(const QString &id) const
|
||||||
|
|||||||
@@ -536,10 +536,10 @@ void OutputPaneManager::showPage(int idx, bool focus)
|
|||||||
if (!OutputPanePlaceHolder::m_current) {
|
if (!OutputPanePlaceHolder::m_current) {
|
||||||
// In this mode we don't have a placeholder
|
// In this mode we don't have a placeholder
|
||||||
// switch to the output mode and switch the page
|
// switch to the output mode and switch the page
|
||||||
ICore::instance()->modeManager()->activateMode(Constants::MODE_OUTPUT);
|
ICore::instance()->modeManager()->activateMode(Constants::MODE_EDIT);
|
||||||
ensurePageVisible(idx);
|
}
|
||||||
} else {
|
if (OutputPanePlaceHolder::m_current) {
|
||||||
// else we make that page visible
|
// make the page visible
|
||||||
OutputPanePlaceHolder::m_current->setVisible(true);
|
OutputPanePlaceHolder::m_current->setVisible(true);
|
||||||
ensurePageVisible(idx);
|
ensurePageVisible(idx);
|
||||||
if (focus && out->canFocus())
|
if (focus && out->canFocus())
|
||||||
|
|||||||
Reference in New Issue
Block a user