summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--seentl.cpp16
-rw-r--r--seentl.h2
-rw-r--r--seentl.ui67
3 files changed, 85 insertions, 0 deletions
diff --git a/seentl.cpp b/seentl.cpp
index 8c6e84e..688c152 100644
--- a/seentl.cpp
+++ b/seentl.cpp
@@ -24,6 +24,7 @@ SEENTL::SEENTL(QWidget *parent)
connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openScript()));
connect(ui->actionClose, SIGNAL(triggered()), this, SLOT(closeScript()));
connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(closeApp()));
+ connect(ui->lines->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectLine(QItemSelection,QItemSelection)));
}
SEENTL::~SEENTL()
@@ -47,6 +48,7 @@ void SEENTL::openScript()
setWindowTitle(QString("%1 - SEENTL").arg(file.fileName()));
ui->actionClose->setEnabled(1);
+ ui->statusBar->showMessage(QString("Found %1 translatable lines").arg(script.rowCount(QModelIndex())), 2000);
}
void SEENTL::closeScript()
@@ -65,3 +67,17 @@ void SEENTL::closeApp()
closeScript();
close();
}
+
+void SEENTL::selectLine(const QItemSelection &selected, const QItemSelection &deselected)
+{
+ int row = selected.indexes().at(0).row();
+ if(row >= script.rowCount(QModelIndex()))
+ return;
+ QStringList nfo = script.lineInfo(row);
+ ui->lineNr->setText(QString("<%1>").arg(nfo[0]));
+ ui->lineOrig->setText(nfo[1]);
+ ui->lineTrans->setText(nfo[2]);
+ ui->lineComm->clear();
+ ui->lineComm->appendPlainText(nfo[3]);
+ ui->lineTrans->setFocus();
+}
diff --git a/seentl.h b/seentl.h
index 455971c..dcb3748 100644
--- a/seentl.h
+++ b/seentl.h
@@ -3,6 +3,7 @@
#include <QtGui/QMainWindow>
#include <QFileInfo>
+#include <QItemSelection>
#include "utfscriptmodel.h"
namespace Ui
@@ -22,6 +23,7 @@ public slots:
void openScript();
void closeScript();
void closeApp();
+ void selectLine(const QItemSelection &selected, const QItemSelection &deselected);
private:
Ui::SEENTLClass *ui;
diff --git a/seentl.ui b/seentl.ui
index 93c51af..d09cf6d 100644
--- a/seentl.ui
+++ b/seentl.ui
@@ -25,6 +25,73 @@
</property>
</widget>
</item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="verticalSpacing">
+ <number>1</number>
+ </property>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="lineOrig">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="lineTrans"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="lineNr">
+ <property name="text">
+ <string>&lt;0000&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QPlainTextEdit" name="lineComm">
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>50</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Translation</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Comments</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" colspan="2">
+ <widget class="Line" name="line">
+ <property name="lineWidth">
+ <number>3</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">