Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding title to projectdock

  • Loading branch information...
commit 3695ba9dc204c7ea9ba884b6e4dc5d719d5fffff 1 parent a1722e8
@stefanbeller authored
Showing with 23 additions and 4 deletions.
  1. +20 −3 src/tiled/projectdock.cpp
  2. +3 −1 src/tiled/projectdock.h
View
23 src/tiled/projectdock.cpp
@@ -28,6 +28,7 @@
#include <QAbstractItemModel>
#include <QAction>
+#include <QEvent>
#include <QFileSystemModel>
#include <QMenu>
#include <QToolBar>
@@ -86,6 +87,12 @@ ProjectDock::ProjectDock(ProjectTreeModel *m, QWidget *parent)
connect (mTreeView, SIGNAL(doubleClicked(QModelIndex)),
SLOT(doubleClick(QModelIndex)));
+ retranslateUi();
+}
+
+ProjectDock::~ProjectDock()
+{
+ delete mTreeView;
}
void ProjectDock::doubleClick(const QModelIndex &index)
@@ -97,9 +104,19 @@ void ProjectDock::doubleClick(const QModelIndex &index)
emit openFile(pti->fullPath());
}
-ProjectDock::~ProjectDock()
+void ProjectDock::retranslateUi()
{
- delete mTreeView;
+ setWindowTitle(tr("Projects"));
}
-
+void ProjectDock::changeEvent(QEvent *e)
+{
+ QDockWidget::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ retranslateUi();
+ break;
+ default:
+ break;
+ }
+}
View
4 src/tiled/projectdock.h
@@ -40,6 +40,8 @@ class ProjectDock : public QDockWidget
public:
ProjectDock(ProjectTreeModel *m, QWidget *parent = 0);
~ProjectDock();
+protected:
+ void changeEvent(QEvent *e);
signals:
void openFile(QString file);
@@ -47,8 +49,8 @@ class ProjectDock : public QDockWidget
private slots:
void doubleClick(const QModelIndex &index);
-
private:
+ void retranslateUi();
QTreeView *mTreeView;
ProjectTreeModel *mProjectTreeModel;
Please sign in to comment.
Something went wrong with that request. Please try again.