mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-20 07:14:13 +02:00
Compare commits
4 Commits
3cbb930751
...
2785e25569
| Author | SHA1 | Date | |
|---|---|---|---|
| 2785e25569 | |||
| c8e4396b2a | |||
| 0147453494 | |||
| 181bbb7f21 |
@@ -63,7 +63,6 @@ QString SummaryQueryWidget::queryStr() const
|
||||
QStringList keys = selectedKeys();
|
||||
|
||||
QString select ="SELECT ";
|
||||
QString order_by = " ORDER BY ";
|
||||
|
||||
QString column;
|
||||
bool first = true;
|
||||
@@ -72,14 +71,29 @@ QString SummaryQueryWidget::queryStr() const
|
||||
first = false;
|
||||
} else {
|
||||
column += ", ";
|
||||
order_by +=", ";
|
||||
}
|
||||
column += key;
|
||||
order_by += key;
|
||||
}
|
||||
|
||||
QString from = " FROM project_summary_view";
|
||||
|
||||
//Always ordered by the folio's own position, never by the columns
|
||||
//the user happened to choose to display. This is a table of
|
||||
//contents: it lists the folios of the project and its order is the
|
||||
//project's order. Ordering by the displayed columns instead meant
|
||||
//that choosing, say, Title as the first column silently sorted the
|
||||
//summary alphabetically (bugtracker #238).
|
||||
//
|
||||
//project_summary_view exposes the position as "pos", from
|
||||
//diagram.pos, which is an INTEGER -- so this sorts numerically and
|
||||
//folio 10 does not land between folio 1 and folio 2. One row per
|
||||
//folio means pos fully determines the order and no secondary key is
|
||||
//needed.
|
||||
//
|
||||
//A user who wants a different order can still write the query by
|
||||
//hand; that path returns above, untouched.
|
||||
QString order_by = " ORDER BY pos";
|
||||
|
||||
QString q(select + column + from + order_by);
|
||||
return q;
|
||||
}
|
||||
|
||||
@@ -903,8 +903,20 @@ void QETDiagramEditor::setUpMenu()
|
||||
insertMenu(help_menu_, windows_menu);
|
||||
|
||||
// File menu
|
||||
QMenu *recentfile = menu_fichier -> addMenu(QET::Icons::DocumentOpenRecent, tr("&Récemment ouverts"));
|
||||
recentfile->addActions(QETApp::projectsRecentFiles()->menu()->actions());
|
||||
// Add the RecentFiles menu itself, not a copy of the actions it
|
||||
// happened to hold at construction time. RecentFiles::buildMenu()
|
||||
// clears that menu and creates fresh QActions every time a file is
|
||||
// opened, so a snapshot taken here never gained an entry again and
|
||||
// the list only looked right after a restart (bugtracker #97).
|
||||
//
|
||||
// The menu is an application-wide singleton and several editor
|
||||
// windows may exist. QMenu::addMenu() adds the submenu's menuAction()
|
||||
// rather than reparenting it, so every window shows the same live
|
||||
// menu, which is the intent.
|
||||
QMenu *recentfile = QETApp::projectsRecentFiles()->menu();
|
||||
recentfile->setTitle(tr("&Récemment ouverts"));
|
||||
recentfile->setIcon(QET::Icons::DocumentOpenRecent);
|
||||
menu_fichier->addMenu(recentfile);
|
||||
connect(QETApp::projectsRecentFiles(), &RecentFiles::fileOpeningRequested, this, &QETDiagramEditor::openRecentFile);
|
||||
menu_fichier -> addActions(m_file_actions_group.actions());
|
||||
menu_fichier -> addSeparator();
|
||||
|
||||
Reference in New Issue
Block a user