ebuild work with translation files

master
Denes Matetelki 14 years ago
parent 06e9d8ed95
commit d84063fac6

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

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

@ -18,7 +18,8 @@ int main(int argc, char *argv[])
// translation // translation
QString locale = QLocale::system().name(); QString locale = QLocale::system().name();
QTranslator translator; 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: " std::cerr << "No translation file for locale: "
<< locale.toStdString() << locale.toStdString()

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

Loading…
Cancel
Save