mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 01:10:53 +01:00
Amelioration de l'integration de certains dialogues sous MacOS.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@730 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -93,6 +93,9 @@ void DiagramPrintDialog::exec() {
|
||||
if (printer_choice_ -> isChecked()) {
|
||||
// affichage du dialogue d'impression standard pour parametrer l'imprimante
|
||||
QPrintDialog print_dialog(printer_, parentWidget());
|
||||
#ifdef Q_WS_MAC
|
||||
print_dialog -> setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
print_dialog.setWindowTitle(tr("Options d'impression", "window title"));
|
||||
print_dialog.setEnabledOptions(QAbstractPrintDialog::PrintShowPageSize);
|
||||
if (print_dialog.exec() == QDialog::Rejected) return;
|
||||
@@ -159,6 +162,10 @@ int DiagramPrintDialog::verticalPagesCount(Diagram *diagram, bool fullpage) cons
|
||||
void DiagramPrintDialog::buildPrintTypeDialog() {
|
||||
// initialisation des widgets
|
||||
dialog_ = new QDialog(parentWidget());
|
||||
#ifdef Q_WS_MAC
|
||||
dialog_ -> setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
|
||||
printtype_label_ = new QLabel(tr("Quel type d'impression d\351sirez-vous effectuer ?"));
|
||||
printer_icon_ = new QLabel();
|
||||
pdf_icon_ = new QLabel();
|
||||
|
||||
@@ -344,6 +344,10 @@ void DiagramView::editDiagramProperties() {
|
||||
|
||||
// construit le dialogue
|
||||
QDialog popup(diagramEditor());
|
||||
#ifdef Q_WS_MAC
|
||||
popup.setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
|
||||
popup.setMinimumWidth(400);
|
||||
popup.setWindowTitle(tr("Propri\351t\351s du sch\351ma", "window title"));
|
||||
|
||||
@@ -744,6 +748,10 @@ void DiagramView::editDefaultConductorProperties() {
|
||||
|
||||
// l'insere dans un dialogue
|
||||
QDialog conductor_dialog(diagramEditor());
|
||||
#ifdef Q_WS_MAC
|
||||
conductor_dialog.setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
|
||||
conductor_dialog.setWindowTitle(tr("\311diter les propri\351t\351s par d\351faut des conducteurs", "window title"));
|
||||
QVBoxLayout *dialog_layout = new QVBoxLayout(&conductor_dialog);
|
||||
dialog_layout -> addWidget(cpw);
|
||||
|
||||
@@ -750,6 +750,9 @@ void ElementScene::slot_editSizeHotSpot() {
|
||||
// cree un dialogue
|
||||
QDialog dialog_sh(element_editor);
|
||||
dialog_sh.setModal(true);
|
||||
#ifdef Q_WS_MAC
|
||||
dialog_sh.setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
dialog_sh.setWindowTitle(tr("\311diter la taille et le point de saisie", "window title"));
|
||||
QVBoxLayout *dialog_layout = new QVBoxLayout(&dialog_sh);
|
||||
|
||||
@@ -789,6 +792,9 @@ void ElementScene::slot_editOrientations() {
|
||||
// cree un dialogue
|
||||
QDialog dialog_ori(element_editor);
|
||||
dialog_ori.setModal(true);
|
||||
#ifdef Q_WS_MAC
|
||||
dialog_ori.setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
dialog_ori.setMinimumSize(400, 260);
|
||||
dialog_ori.setWindowTitle(tr("\311diter les orientations", "window title"));
|
||||
QVBoxLayout *dialog_layout = new QVBoxLayout(&dialog_ori);
|
||||
@@ -834,6 +840,9 @@ void ElementScene::slot_editNames() {
|
||||
|
||||
// cree un dialogue
|
||||
QDialog dialog(element_editor);
|
||||
#ifdef Q_WS_MAC
|
||||
dialog.setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
dialog.setModal(true);
|
||||
dialog.setMinimumSize(400, 330);
|
||||
dialog.setWindowTitle(tr("\311diter les noms", "window title"));
|
||||
|
||||
@@ -400,6 +400,10 @@ void ProjectView::editProjectProperties() {
|
||||
|
||||
// dialogue d'edition des proprietes du projet
|
||||
QDialog properties_dialog(parentWidget());
|
||||
#ifdef Q_WS_MAC
|
||||
properties_dialog.setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
|
||||
properties_dialog.setMinimumWidth(786);
|
||||
properties_dialog.setMinimumHeight(585);
|
||||
properties_dialog.setWindowTitle(tr("Propri\351t\351s du projet", "window title"));
|
||||
@@ -506,12 +510,7 @@ void ProjectView::printProject() {
|
||||
}
|
||||
|
||||
// recupere le dossier contenant le fichier courant
|
||||
QString dir_path = project_ -> filePath();
|
||||
if (dir_path.isEmpty()) {
|
||||
dir_path = QDir::homePath();
|
||||
} else {
|
||||
dir_path = QFileInfo(dir_path).absolutePath();
|
||||
}
|
||||
QString dir_path = project_ -> currentDir();
|
||||
|
||||
// determine un chemin pour le pdf / ps
|
||||
QString file_name = QDir::toNativeSeparators(dir_path + "/" + doc_name);
|
||||
@@ -529,6 +528,9 @@ void ProjectView::exportProject() {
|
||||
if (!project_) return;
|
||||
|
||||
ExportDialog ed(project_, parentWidget());
|
||||
#ifdef Q_WS_MAC
|
||||
ed.setWindowsFlag(Qt::Sheet);
|
||||
#endif
|
||||
ed.exec();
|
||||
}
|
||||
|
||||
@@ -613,7 +615,11 @@ int ProjectView::cleanProject() {
|
||||
clean_elements -> setChecked(true);
|
||||
clean_categories -> setChecked(true);
|
||||
|
||||
QDialog clean_dialog;
|
||||
QDialog clean_dialog(parentWidget());
|
||||
#ifdef Q_WS_MAC
|
||||
clean_dialog.setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
|
||||
clean_dialog.setWindowTitle(tr("Nettoyer le projet", "window title"));
|
||||
QVBoxLayout *clean_dialog_layout = new QVBoxLayout();
|
||||
clean_dialog_layout -> addWidget(clean_elements);
|
||||
|
||||
@@ -739,17 +739,16 @@ void QETApp::openElementFiles(const QStringList &files_list) {
|
||||
*/
|
||||
void QETApp::configureQET() {
|
||||
// determine le widget parent a utiliser pour le dialogue
|
||||
#ifdef Q_WS_MAC
|
||||
QWidget *parent_widget = 0;
|
||||
#else
|
||||
QWidget *parent_widget = activeWindow();
|
||||
#endif
|
||||
|
||||
// cree le dialogue
|
||||
ConfigDialog cd;
|
||||
|
||||
// associe le dialogue a un eventuel widget parent
|
||||
if (parent_widget) {
|
||||
#ifdef Q_WS_MAC
|
||||
cd.setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
cd.setParent(parent_widget, cd.windowFlags());
|
||||
}
|
||||
|
||||
@@ -767,11 +766,7 @@ void QETApp::configureQET() {
|
||||
*/
|
||||
void QETApp::aboutQET() {
|
||||
// determine le widget parent a utiliser pour le dialogue
|
||||
#ifdef Q_WS_MAC
|
||||
QWidget *parent_widget = 0;
|
||||
#else
|
||||
QWidget *parent_widget = activeWindow();
|
||||
#endif
|
||||
|
||||
// cree le dialogue si cela n'a pas deja ete fait
|
||||
if (!about_dialog_) {
|
||||
@@ -780,6 +775,9 @@ void QETApp::aboutQET() {
|
||||
|
||||
// associe le dialogue a un eventuel widget parent
|
||||
if (parent_widget) {
|
||||
#ifdef Q_WS_MAC
|
||||
about_dialog_ -> setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
about_dialog_ -> setParent(parent_widget, about_dialog_ -> windowFlags());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user