summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-23 00:27:27 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-23 00:27:27 (GMT)
commit5d602188905366d7ac6187c7305c20cb0e9320aa (patch)
tree71badd61b7a7f93d1dc981d93c2cb0ffa8c47678
parentb0b1158790779695cb3c51e9a492ef8dfa4da28d (diff)
remove not needed information message signal, now done internally with the ktexteditor messages, fixup statusbar
-rw-r--r--src/include/ktexteditor/view.h9
-rw-r--r--src/view/katestatusbar.cpp98
-rw-r--r--src/view/katestatusbar.h3
3 files changed, 43 insertions, 67 deletions
diff --git a/src/include/ktexteditor/view.h b/src/include/ktexteditor/view.h
index 17424e3..b621d73 100644
--- a/src/include/ktexteditor/view.h
+++ b/src/include/ktexteditor/view.h
@@ -260,15 +260,6 @@ Q_SIGNALS:
enum KTextEditor::View::EditMode mode);
/**
- * This signal is emitted whenever the \p view wants to display a
- * information \p message. The \p message can be displayed in the status bar
- * for example.
- * \param view view which sends out information
- * \param message information message
- */
- void informationMessage(KTextEditor::View *view, const QString &message);
-
- /**
* This signal is emitted from \p view whenever the users inserts \p text
* at \p position, that means the user typed/pasted text.
* \param view view in which the text was inserted
diff --git a/src/view/katestatusbar.cpp b/src/view/katestatusbar.cpp
index 1fe85c8..fd5b49b 100644
--- a/src/view/katestatusbar.cpp
+++ b/src/view/katestatusbar.cpp
@@ -49,6 +49,15 @@ void KateStatusBarOpenUpMenu::setVisible(bool visibility) {
}
//END menu
+static QFrame *separator (QWidget *parent)
+{
+ QFrame * const line = new QFrame(parent);
+ line->setFixedWidth(2);
+ line->setFixedHeight(SmallIcon(QStringLiteral("document-save")).height());
+ line->setFrameShape(QFrame::VLine);
+ line->setFrameShadow(QFrame::Sunken);
+ return line;
+}
KateStatusBar::KateStatusBar(KTextEditor::ViewPrivate *view)
: KateViewBarWidget(false)
@@ -57,8 +66,6 @@ KateStatusBar::KateStatusBar(KTextEditor::ViewPrivate *view)
{
setFocusProxy(m_view);
- QFrame *line;
-
/**
* just add our status bar to central widget, full sized
*/
@@ -81,11 +88,11 @@ KateStatusBar::KateStatusBar(KTextEditor::ViewPrivate *view)
m_mode->setMenu(m_view->modeAction()->menu());
m_mode->setFocusProxy(m_view);
- line = new QFrame(this);
- line->setFixedWidth(3);
- line->setFrameShape(QFrame::VLine);
- line->setFrameShadow(QFrame::Sunken);
- topLayout->addWidget(line,0);
+ /**
+ * separator
+ */
+ topLayout->addWidget(separator (this),0);
+
/**
* add encoding button which allows user to switch encoding of document
* this will reuse the encoding action menu of the view
@@ -96,36 +103,17 @@ KateStatusBar::KateStatusBar(KTextEditor::ViewPrivate *view)
m_encoding->setMenu(m_view->encodingAction()->menu());
m_encoding->setFocusProxy(m_view);
- line = new QFrame(this);
- line->setFixedWidth(3);
- line->setFrameShape(QFrame::VLine);
- line->setFrameShadow(QFrame::Sunken);
- topLayout->addWidget(line,0);
-
- m_selectModeLabel = new QLabel( i18n(" LINE "), this );
- topLayout->addWidget( m_selectModeLabel, 0 );
- m_selectModeLabel->setAlignment( Qt::AlignCenter );
- m_selectModeLabel->setFocusProxy(m_view);
-
- m_insertModeLabel = new QLabel( i18n(" INS "), this );
- topLayout->addWidget( m_insertModeLabel, 0 );
- m_insertModeLabel->setAlignment( Qt::AlignVCenter | Qt::AlignLeft );
- m_insertModeLabel->setFocusProxy(m_view);
+ /**
+ * separator
+ */
+ topLayout->addWidget(separator (this),0);
-
- line = new QFrame(this);
- line->setFixedWidth(3);
- line->setFrameShape(QFrame::VLine);
- line->setFrameShadow(QFrame::Sunken);
- topLayout->addWidget(line,0);
-
m_spacesOnly=ki18n("Soft Tabs: %1");
m_spacesOnlyShowTabs=ki18n("Soft Tabs: %1 (%2)");
m_tabsOnly=ki18n("Tab Size: %1");
m_tabSpacesMixed=ki18n("Indent/Tab: %1/%2");
int myWidth=0;
-
QAction *action;
m_tabGroup=new QActionGroup(this);
m_indentGroup=new QActionGroup(this);
@@ -159,8 +147,7 @@ KateStatusBar::KateStatusBar(KTextEditor::ViewPrivate *view)
action->setCheckable(true);
action->setActionGroup(radioGroup);
m_softAction=action;
-
-
+
m_tabsIndent->setFlat(true);
topLayout->addWidget( m_tabsIndent, 0 );
m_tabsIndent->setMenu(m_indentSettingsMenu);
@@ -184,19 +171,30 @@ KateStatusBar::KateStatusBar(KTextEditor::ViewPrivate *view)
m_tabsIndent->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed));
m_tabsIndent->setFixedWidth(myWidth);
- line = new QFrame(this);
- line->setFixedWidth(3);
- line->setFrameShape(QFrame::VLine);
- line->setFrameShadow(QFrame::Sunken);
- topLayout->addWidget(line,0);
-
- m_infoLabel = new KSqueezedTextLabel( this );
- topLayout->addWidget( m_infoLabel, 1 );
- m_infoLabel->setTextFormat(Qt::PlainText);
- m_infoLabel->setMinimumSize( 0, 0 );
- m_infoLabel->setSizePolicy(QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Fixed ));
- m_infoLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
- m_infoLabel->setFocusProxy(m_view);
+ /**
+ * separator
+ */
+ topLayout->addWidget(separator (this),0);
+
+ m_selectModeLabel = new QLabel( i18n(" LINE "), this );
+ topLayout->addWidget( m_selectModeLabel, 0 );
+ m_selectModeLabel->setAlignment( Qt::AlignCenter );
+ m_selectModeLabel->setFocusProxy(m_view);
+
+ /**
+ * separator
+ */
+ topLayout->addWidget(separator (this),0);
+
+ m_insertModeLabel = new QLabel( i18n(" INS "), this );
+ topLayout->addWidget( m_insertModeLabel, 0 );
+ m_insertModeLabel->setAlignment( Qt::AlignVCenter | Qt::AlignLeft );
+ m_insertModeLabel->setFocusProxy(m_view);
+
+ /**
+ * stretch now
+ */
+ topLayout->addStretch (1000);
m_lineColLabel = new QLabel( this );
topLayout->addWidget( m_lineColLabel, 0 );
@@ -207,7 +205,6 @@ KateStatusBar::KateStatusBar(KTextEditor::ViewPrivate *view)
connect(m_view, SIGNAL(cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor)), this, SLOT(cursorPositionChanged()));
connect(m_view, SIGNAL(viewModeChanged(KTextEditor::View*)), this, SLOT(viewModeChanged()));
connect(m_view, SIGNAL(selectionChanged(KTextEditor::View*)), this, SLOT(selectionChanged()));
- connect(m_view, SIGNAL(informationMessage(KTextEditor::View*,QString)), this, SLOT(informationMessage(KTextEditor::View*,QString)));
connect(m_view->document(), SIGNAL(modifiedChanged(KTextEditor::Document*)), this, SLOT(modifiedChanged()));
connect(m_view->document(), SIGNAL(modifiedOnDisk(KTextEditor::Document*,bool,KTextEditor::ModificationInterface::ModifiedOnDiskReason)), this, SLOT(modifiedChanged()) );
connect(m_view->document(), SIGNAL(configChanged()), this, SLOT(documentConfigChanged()));
@@ -225,7 +222,6 @@ void KateStatusBar::updateStatus ()
cursorPositionChanged ();
selectionChanged ();
modifiedChanged ();
- m_infoLabel->clear ();
documentConfigChanged();
modeChanged();
}
@@ -252,14 +248,6 @@ void KateStatusBar::selectionChanged ()
m_selectModeLabel->setText( m_view->blockSelection() ? i18n(" BLOCK ") : i18n(" LINE ") );
}
-void KateStatusBar::informationMessage (KTextEditor::View *, const QString &message)
-{
- m_infoLabel->setText( message );
-
- // timer to reset this after 4 seconds
- QTimer::singleShot(4000, this, SLOT(updateStatus()));
-}
-
void KateStatusBar::modifiedChanged()
{
const bool mod = m_view->doc()->isModified();
diff --git a/src/view/katestatusbar.h b/src/view/katestatusbar.h
index b581433..2e3ec11 100644
--- a/src/view/katestatusbar.h
+++ b/src/view/katestatusbar.h
@@ -60,8 +60,6 @@ public Q_SLOTS:
void documentConfigChanged ();
- void informationMessage (KTextEditor::View *view, const QString &message);
-
void modeChanged ();
private:
@@ -77,7 +75,6 @@ private:
KLocalizedString m_tabsOnly;
KLocalizedString m_tabSpacesMixed;
KLocalizedString m_spacesOnlyShowTabs;
- KSqueezedTextLabel* m_infoLabel;
QMenu *m_indentSettingsMenu;
unsigned int m_modifiedStatus;
QActionGroup *m_tabGroup;