ebuild work with translation files

master
Denes Matetelki 14 years ago
parent 06e9d8ed95
commit d84063fac6

@ -22,8 +22,8 @@ RDEPEND="${DEPEND}"
src_configure() {
eqmake4 "${S}"/qtmindmap-qtmindmap/qtmindmap.pro
# lrelease /qtmindmap-qtmindmap/lang/qtmindmap_hu.ts
# lrelease /qtmindmap-qtmindmap/lang/qtmindmap_nb_NO.ts
lrelease "${S}"/qtmindmap-qtmindmap/lang/qtmindmap_hu.ts
lrelease "${S}"/qtmindmap-qtmindmap/lang/qtmindmap_nb_NO.ts
}
src_install() {
@ -32,7 +32,7 @@ src_install() {
insinto /usr/bin
doins qtmindmap
# insinto /usr/share/qtmindmap/i18n
# doins /qtmindmap-qtmindmap/lang/qtmindmap_hu.ts
# doins /qtmindmap-qtmindmap/lang/qtmindmap_nb_NO.ts
insinto /usr/share/qtmindmap/i18n
doins "${S}"/qtmindmap-qtmindmap/lang/qtmindmap_hu.qm
doins "${S}"/qtmindmap-qtmindmap/lang/qtmindmap_nb_NO.qm
}

@ -436,15 +436,15 @@ void GraphWidget::nodeColor()
QColorDialog dialog(this);
dialog.setWindowTitle(tr("Select node color"));
dialog.setCurrentColor(m_activeNode->color());
if (dialog.exec())
if (!dialog.exec())
return;
QColor color = dialog.selectedColor();
foreach(Node *node, nodeList)
{
QColor color = dialog.selectedColor();
foreach(Node *node, nodeList)
{
node->setColor(color);
foreach (Edge * edge, node->edgesToThis(false))
edge->setColor(color);
}
node->setColor(color);
foreach (Edge * edge, node->edgesToThis(false))
edge->setColor(color);
}
}
@ -472,12 +472,12 @@ void GraphWidget::nodeTextColor()
QColorDialog dialog(this);
dialog.setWindowTitle(tr("Select text color"));
dialog.setCurrentColor(m_activeNode->textColor());
if (dialog.exec())
{
QColor color = dialog.selectedColor();
foreach(Node *node, nodeList)
node->setTextColor(color);
}
if (!dialog.exec())
return;
QColor color = dialog.selectedColor();
foreach(Node *node, nodeList)
node->setTextColor(color);
}
void GraphWidget::addEdge()

@ -18,7 +18,8 @@ int main(int argc, char *argv[])
// translation
QString locale = QLocale::system().name();
QTranslator translator;
if (locale != "C" && !translator.load(QString("qtmindmap_") + locale))
if (locale != "C" && !translator.load(
QString("/usr/share/qtmindmap/i18n/qtmindmap_") + locale))
{
std::cerr << "No translation file for locale: "
<< locale.toStdString()

@ -100,14 +100,10 @@ void MainWindow::openFile(const QString &fileName)
dialog.setAcceptMode(QFileDialog::AcceptOpen);
dialog.setDefaultSuffix("qmm");
if (dialog.exec())
{
m_fileName = dialog.selectedFiles().first();
}
else
{
if (!dialog.exec())
return;
}
m_fileName = dialog.selectedFiles().first();
}
else
{
@ -162,17 +158,13 @@ bool MainWindow::saveFileAs()
dialog.setAcceptMode(QFileDialog::AcceptSave);
dialog.setDefaultSuffix("qmm");
if (dialog.exec())
{
m_fileName = dialog.selectedFiles().first();
setTitle(m_fileName);
saveFile();
return true;
}
else
{
return false; // cancelled
}
if (!dialog.exec())
return false;
m_fileName = dialog.selectedFiles().first();
setTitle(m_fileName);
saveFile();
return true;
}
bool MainWindow::closeFile()

Loading…
Cancel
Save