git-svn-id: svn://db.shs.com.ru/libs@625 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -12,10 +12,10 @@ action_show_all_docks(this), action_hide_all_docks(this), first_show(true) {
|
||||
action_clear_recent = new QAction(QIcon(":/icons/edit-clear.png"), tr("Clear recent list"), this);
|
||||
connect(action_clear_recent, SIGNAL(triggered()), this, SLOT(clearRecent()));
|
||||
qRegisterMetaType<Qt::DockWidgetArea>("Qt::DockWidgetArea");
|
||||
action_show_all_tools.setText(trUtf8("Show all"));
|
||||
action_show_all_docks.setText(trUtf8("Show all"));
|
||||
action_hide_all_tools.setText(trUtf8("Hide all"));
|
||||
action_hide_all_docks.setText(trUtf8("Hide all"));
|
||||
action_show_all_tools.setText(tr("Show all"));
|
||||
action_show_all_docks.setText(tr("Show all"));
|
||||
action_hide_all_tools.setText(tr("Hide all"));
|
||||
action_hide_all_docks.setText(tr("Hide all"));
|
||||
action_show_all_tools.setIcon(QIcon(":/icons/layer-visible-on.png"));
|
||||
action_show_all_docks.setIcon(QIcon(":/icons/layer-visible-on.png"));
|
||||
action_hide_all_tools.setIcon(QIcon(":/icons/layer-visible-off.png"));
|
||||
@@ -133,7 +133,7 @@ QMenu * EMainWindow::createPopupMenu() {
|
||||
lbl = new QLabel();
|
||||
lbl->setFrameShape(QFrame::StyledPanel);
|
||||
lbl->setFrameShadow(QFrame::Sunken);
|
||||
lbl->setText(trUtf8("Toolbars"));
|
||||
lbl->setText(tr("Toolbars"));
|
||||
lbl->setFont(f);
|
||||
lbl->setAlignment(Qt::AlignCenter);
|
||||
wa->setDefaultWidget(lbl);
|
||||
@@ -158,7 +158,7 @@ QMenu * EMainWindow::createPopupMenu() {
|
||||
lbl = new QLabel();
|
||||
lbl->setFrameShape(QFrame::StyledPanel);
|
||||
lbl->setFrameShadow(QFrame::Sunken);
|
||||
lbl->setText(trUtf8("Docks"));
|
||||
lbl->setText(tr("Docks"));
|
||||
lbl->setFont(f);
|
||||
lbl->setAlignment(Qt::AlignCenter);
|
||||
wa->setDefaultWidget(lbl);
|
||||
@@ -376,7 +376,7 @@ void EMainWindow::newFile() {
|
||||
|
||||
void EMainWindow::openFile() {
|
||||
if (!checkSave()) return;
|
||||
QString ret = QFileDialog::getOpenFileName(this, trUtf8("Select file to open"), file_name, loadFilter());
|
||||
QString ret = QFileDialog::getOpenFileName(this, tr("Select file to open"), file_name, loadFilter());
|
||||
if (ret.isEmpty()) return;
|
||||
if (load(ret))
|
||||
addToRecent(ret);
|
||||
@@ -385,7 +385,7 @@ void EMainWindow::openFile() {
|
||||
|
||||
void EMainWindow::openFiles() {
|
||||
if (!checkSave()) return;
|
||||
QStringList ret = QFileDialog::getOpenFileNames(this, trUtf8("Select files to open"), file_name, loadFilter());
|
||||
QStringList ret = QFileDialog::getOpenFileNames(this, tr("Select files to open"), file_name, loadFilter());
|
||||
foreach (QString s, ret) {
|
||||
if (load(s))
|
||||
addToRecent(s);
|
||||
@@ -395,7 +395,7 @@ void EMainWindow::openFiles() {
|
||||
|
||||
bool EMainWindow::saveFile(bool ask) {
|
||||
if (ask) {
|
||||
int ret = QMessageBox::question(this, windowTitle(), trUtf8("Save changes%1?").arg(!file_name.isEmpty() ? (trUtf8(" in") + " \"" + file_name + "\"") : ""), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save);
|
||||
int ret = QMessageBox::question(this, windowTitle(), tr("Save changes%1?").arg(!file_name.isEmpty() ? (tr(" in") + " \"" + file_name + "\"") : ""), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save);
|
||||
if (ret == QMessageBox::Cancel) return false;
|
||||
if (ret == QMessageBox::Save) return saveFile();
|
||||
return true;
|
||||
@@ -408,7 +408,7 @@ bool EMainWindow::saveFile(bool ask) {
|
||||
|
||||
|
||||
bool EMainWindow::saveAsFile() {
|
||||
QString ret = QFileDialog::getSaveFileName(this, trUtf8("Select file to save"), file_name, saveFilter());
|
||||
QString ret = QFileDialog::getSaveFileName(this, tr("Select file to save"), file_name, saveFilter());
|
||||
if (ret.isEmpty()) return false;
|
||||
if (save(ret))
|
||||
addToRecent(ret);
|
||||
|
||||
@@ -264,22 +264,22 @@ actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom(
|
||||
new_item = cur_item = 0;
|
||||
view_ = 0;
|
||||
resize_enabled = true;
|
||||
text_dlg.setWindowTitle(trUtf8("Edit text"));
|
||||
text_dlg.setWindowTitle(tr("Edit text"));
|
||||
text_dlg.setLayout(new QBoxLayout(QBoxLayout::TopToBottom));
|
||||
QDialogButtonBox * bbox = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Cancel);
|
||||
connect(bbox, SIGNAL(accepted()), &text_dlg, SLOT(accept()));
|
||||
connect(bbox, SIGNAL(rejected()), &text_dlg, SLOT(reject()));
|
||||
text_dlg.layout()->addWidget(&text_edit);
|
||||
text_dlg.layout()->addWidget(bbox);
|
||||
actions_Z_up.setText(trUtf8("Bring\nforward")); actions_Z_up.setIcon(QIcon(":/icons/z-up.png")); actions_Z_up.setEnabled(false);
|
||||
actions_Z_top.setText(trUtf8("Bring\nto front")); actions_Z_top.setIcon(QIcon(":/icons/z-top.png")); actions_Z_top.setEnabled(false);
|
||||
actions_Z_down.setText(trUtf8("Send\nbackward")); actions_Z_down.setIcon(QIcon(":/icons/z-down.png")); actions_Z_down.setEnabled(false);
|
||||
actions_Z_bottom.setText(trUtf8("Send\nto back")); actions_Z_bottom.setIcon(QIcon(":/icons/z-bottom.png")); actions_Z_bottom.setEnabled(false);
|
||||
actions_add << newAction(trUtf8("Draw\nRectangle"), QIcon(":/icons/draw-rectangle.png"), 1)
|
||||
<< newAction(trUtf8("Draw\nEllipse"), QIcon(":/icons/draw-ellipse.png"), 2)
|
||||
<< newAction(trUtf8("Draw\nLine"), QIcon(":/icons/draw-line.png"), 4)
|
||||
<< newAction(trUtf8("Draw\nText"), QIcon(":/icons/draw-text.png"), 0)
|
||||
<< newAction(trUtf8("Draw\nImage"), QIcon(":/icons/view-preview.png"), 3);
|
||||
actions_Z_up.setText(tr("Bring\nforward")); actions_Z_up.setIcon(QIcon(":/icons/z-up.png")); actions_Z_up.setEnabled(false);
|
||||
actions_Z_top.setText(tr("Bring\nto front")); actions_Z_top.setIcon(QIcon(":/icons/z-top.png")); actions_Z_top.setEnabled(false);
|
||||
actions_Z_down.setText(tr("Send\nbackward")); actions_Z_down.setIcon(QIcon(":/icons/z-down.png")); actions_Z_down.setEnabled(false);
|
||||
actions_Z_bottom.setText(tr("Send\nto back")); actions_Z_bottom.setIcon(QIcon(":/icons/z-bottom.png")); actions_Z_bottom.setEnabled(false);
|
||||
actions_add << newAction(tr("Draw\nRectangle"), QIcon(":/icons/draw-rectangle.png"), 1)
|
||||
<< newAction(tr("Draw\nEllipse"), QIcon(":/icons/draw-ellipse.png"), 2)
|
||||
<< newAction(tr("Draw\nLine"), QIcon(":/icons/draw-line.png"), 4)
|
||||
<< newAction(tr("Draw\nText"), QIcon(":/icons/draw-text.png"), 0)
|
||||
<< newAction(tr("Draw\nImage"), QIcon(":/icons/view-preview.png"), 3);
|
||||
buttons_align << ui->buttonAlignTL << ui->buttonAlignTC << ui->buttonAlignTR
|
||||
<< ui->buttonAlignCL << ui->buttonAlignCC << ui->buttonAlignCR
|
||||
<< ui->buttonAlignBL << ui->buttonAlignBC << ui->buttonAlignBR;
|
||||
@@ -807,7 +807,7 @@ void DrawTools::buttonImage_clicked() {
|
||||
f += "*.";
|
||||
f += i;
|
||||
}
|
||||
QString ret = QFileDialog::getOpenFileName(0, trUtf8("Select image"), prev_dir, QString("Images(%1)").arg(f));
|
||||
QString ret = QFileDialog::getOpenFileName(0, tr("Select image"), prev_dir, QString("Images(%1)").arg(f));
|
||||
if (ret.isEmpty()) return;
|
||||
QImage im(ret);
|
||||
if (im.isNull()) return;
|
||||
|
||||
@@ -1633,7 +1633,7 @@ void Graphic::updateLegend(bool es) {
|
||||
graphics[i].pb->setProperty("graphic_num", i);
|
||||
graphics[i].pb->setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||
//qDebug() << graphics[i].pb->actions();
|
||||
QAction * act = new QAction(trUtf8("Check all"), 0);
|
||||
QAction * act = new QAction(tr("Check all"), 0);
|
||||
act->setCheckable(true);
|
||||
act->setChecked(true);
|
||||
graphics[i].pb->addAction(act);
|
||||
|
||||
@@ -231,7 +231,7 @@ SQLFilterEdit::SQLFilterEdit(const ColumnProperties & prop, const QString & conn
|
||||
combo = new QComboBox();
|
||||
combo->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
|
||||
QStringList sl;
|
||||
sl << " " << "=" << trUtf8("≈") << trUtf8("≠") << ">" << trUtf8("≥") << "<" << trUtf8("≤");
|
||||
sl << " " << "=" << QString::fromUtf8("≈") << QString::fromUtf8("≠") << ">" << QString::fromUtf8("≥") << "<" << QString::fromUtf8("≤");
|
||||
combo->addItems(sl);
|
||||
combo->setCurrentIndex(0);
|
||||
connect(line, SIGNAL(valueChanged(QVariant)), this, SIGNAL(filterChanged()));
|
||||
@@ -353,9 +353,9 @@ SQLTableWidget::SQLTableWidget(QWidget * parent): QWidget(parent), filters_group
|
||||
connect(ui->view->horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(scrolled(int)));
|
||||
|
||||
|
||||
//act_add.setText(trUtf8("Add ..."));
|
||||
//act_del.setText(trUtf8("Remove selected"));
|
||||
action_del = new QAction(QIcon(":/icons/edit-delete.png"), trUtf8("Remove selected"), this);
|
||||
//act_add.setText(tr("Add ..."));
|
||||
//act_del.setText(tr("Remove selected"));
|
||||
action_del = new QAction(QIcon(":/icons/edit-delete.png"), tr("Remove selected"), this);
|
||||
connect(action_del, SIGNAL(triggered(bool)), this, SLOT(del_triggered()));
|
||||
popup_menu.addAction(action_del);
|
||||
ui->actionFilter_AND->setChecked(true);
|
||||
|
||||
@@ -410,7 +410,12 @@ QPIConfig::Entry & QPIConfig::addEntry(const QString & name, const QString & val
|
||||
tn += delim + i;
|
||||
}
|
||||
QPIConfig::Branch ch = entry->_children;
|
||||
qSort(ch.begin(), ch.end(), QPIConfig::Entry::compare);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,13,0)
|
||||
qSort
|
||||
#else
|
||||
std::sort
|
||||
#endif
|
||||
(ch.begin(), ch.end(), QPIConfig::Entry::compare);
|
||||
te = (entry->isLeaf() ? 0 : ch.back());
|
||||
ce = new Entry();
|
||||
ce->delim = delim;
|
||||
@@ -423,7 +428,12 @@ QPIConfig::Entry & QPIConfig::addEntry(const QString & name, const QString & val
|
||||
if (toRoot) ce->_line = other.size();
|
||||
else {
|
||||
ch = entry->_parent->_children;
|
||||
qSort(ch.begin(), ch.end(), QPIConfig::Entry::compare);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,13,0)
|
||||
qSort
|
||||
#else
|
||||
std::sort
|
||||
#endif
|
||||
(ch.begin(), ch.end(), QPIConfig::Entry::compare);
|
||||
ce->_line = ch.back()->_line + 1;
|
||||
}
|
||||
} else {
|
||||
@@ -473,6 +483,19 @@ void QPIConfig::setValue(const QString & name, const QString & value, const QStr
|
||||
}
|
||||
|
||||
|
||||
QPIConfig::Branch QPIConfig::allLeaves() {
|
||||
Branch b;
|
||||
allLeaves(b, &root);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,13,0)
|
||||
qSort
|
||||
#else
|
||||
std::sort
|
||||
#endif
|
||||
(b.begin(), b.end(), Entry::compare);
|
||||
return b;
|
||||
}
|
||||
|
||||
|
||||
int QPIConfig::entryIndex(const QString & name) {
|
||||
QStringList tree = name.split(delim);
|
||||
Entry * ce = &root;
|
||||
|
||||
@@ -223,7 +223,7 @@ public:
|
||||
bool isEntryExists(const QString & name) const {return entryExists(&root, name);}
|
||||
|
||||
Branch allTree() {Branch b; foreach (Entry * i, root._children) b << i; return b;}
|
||||
Branch allLeaves() {Branch b; allLeaves(b, &root); qSort(b.begin(), b.end(), Entry::compare); return b;}
|
||||
Branch allLeaves();
|
||||
int entryIndex(const QString & name);
|
||||
|
||||
QString getName(uint number) {return entryByIndex(number)._name;}
|
||||
|
||||
@@ -64,7 +64,12 @@ void QPIEvaluatorContent::clearCustomVariables() {
|
||||
|
||||
void QPIEvaluatorContent::sortVariables() {
|
||||
var_index.clear();
|
||||
qSort(variables.begin(), variables.end());
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,13,0)
|
||||
qSort
|
||||
#else
|
||||
std::sort
|
||||
#endif
|
||||
(variables.begin(), variables.end());
|
||||
for (int i = 0; i < variables.size(); i++)
|
||||
var_index[variables[i].name] = i;
|
||||
/*
|
||||
|
||||
@@ -50,7 +50,7 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
|
||||
widget_help->layout()->addWidget(lbl_help[i]);
|
||||
}
|
||||
lbl_help[1]->setIcon(QIcon(":/icons/f1.png"));
|
||||
lbl_help[1]->setText(trUtf8("Press F1 for details"));
|
||||
lbl_help[1]->setText(tr("Press F1 for details"));
|
||||
completer = new QTreeWidget();
|
||||
completer->setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
|
||||
completer->setFocusPolicy(Qt::NoFocus);
|
||||
|
||||
@@ -183,7 +183,7 @@ void QVariantEdit::_recreate(const QVariant & new_value) {
|
||||
if (!new_value.isValid()) {
|
||||
if (_cur_edit != _empty) _delete();
|
||||
if (_empty == 0) {
|
||||
_empty = new QLabel(trUtf8("Invalid value"), this);
|
||||
_empty = new QLabel(tr("Invalid value"), this);
|
||||
_empty->setAlignment(Qt::AlignCenter);
|
||||
_cur_edit = _empty;
|
||||
_resize();
|
||||
|
||||
Reference in New Issue
Block a user