Skip to content

Commit

Permalink
Fix window title
Browse files Browse the repository at this point in the history
  • Loading branch information
pvuorela committed Jun 8, 2016
1 parent 00c1c2b commit 84de8a7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
6 changes: 2 additions & 4 deletions qml/Main.qml
Expand Up @@ -27,8 +27,6 @@ Item {
width: 540
height: 960

property string windowTitle: util.currentWindowTitle();

Binding {
target: util
property: "allowGestures"
Expand Down Expand Up @@ -126,8 +124,8 @@ Item {
util.configPath() + "/<br><br>\n" +
"Documentation:<br>\n<a href=\"http://hqh.unlink.org/harmattan\">http://hqh.unlink.org/harmattan</a>"
if (termH != 0 && termW != 0) {
str += "<br><br>Current window title: <font color=\"gray\">" + windowTitle.substring(0,40) + "</font>"; //cut long window title
if(windowTitle.length>40)
str += "<br><br>Current window title: <font color=\"gray\">" + util.windowTitle.substring(0,40) + "</font>"; //cut long window title
if(util.windowTitle.length>40)
str += "...";
str += "<br>Current terminal size: <font color=\"gray\">" + termW + "x" + termH + "</font>";
str += "<br>Charset: <font color=\"gray\">" + util.settingsValue("terminal/charset") + "</font>";
Expand Down
2 changes: 1 addition & 1 deletion qml/MenuFingerterm.qml
Expand Up @@ -81,7 +81,7 @@ Item {
Button {
text: title
isShellCommand: true
enabled: disableOn.length === 0 || windowTitle.search(disableOn) === -1
enabled: disableOn.length === 0 || util.windowTitle.search(disableOn) === -1
onClicked: {
menuWin.showing = false;
term.putString(command, true);
Expand Down
2 changes: 1 addition & 1 deletion util.cpp
Expand Up @@ -64,7 +64,7 @@ void Util::setWindowTitle(QString title)
emit windowTitleChanged();
}

QString Util::currentWindowTitle()
QString Util::windowTitle()
{
return iCurrentWinTitle;
}
Expand Down
3 changes: 2 additions & 1 deletion util.h
Expand Up @@ -30,14 +30,15 @@ class Util : public QObject
{
Q_OBJECT
Q_PROPERTY(bool allowGestures READ allowGestures WRITE setAllowGestures NOTIFY allowGesturesChanged)
Q_PROPERTY(QString windowTitle READ windowTitle NOTIFY windowTitleChanged)

public:
explicit Util(QSettings* settings, QObject *parent = 0);
virtual ~Util();

void setWindow(QQuickView* win);
void setWindowTitle(QString title);
Q_INVOKABLE QString currentWindowTitle();
QString windowTitle();
void setTerm(Terminal* term) { iTerm = term; }
void setRenderer(TextRender* r) { iRenderer = r; }

Expand Down

0 comments on commit 84de8a7

Please sign in to comment.