Changeset e51c78af27 in tspsg for src/mainwindow.cpp


Ignore:
Timestamp:
Apr 30, 2010, 3:45:55 AM (15 years ago)
Author:
Oleksii Serdiuk
Branches:
0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
Children:
e3533af1cf
Parents:
0773f1b65f
git-author:
Oleksii Serdiuk <contacts@…> (04/30/10 03:45:55)
git-committer:
Oleksii Serdiuk <contacts@…> (06/29/12 19:41:42)
Message:

+ Added a checkbox to the "Settings" menu to be able to show/hide Toolbar.

  • "Save" Toolbar button now has an arrow that calls "Save As..." popup menu.
  • Fixed a bug: "Autosize" setting was never saved and was always on.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mainwindow.cpp

    r0773f1b65f re51c78af27  
    5151        connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(desktopResized(int)));
    5252#endif // Q_OS_WINCE_WM
    53         connect(actionFileNew,SIGNAL(triggered()),this,SLOT(actionFileNewTriggered()));
    54         connect(actionFileOpen,SIGNAL(triggered()),this,SLOT(actionFileOpenTriggered()));
    55         connect(actionFileSave,SIGNAL(triggered()),this,SLOT(actionFileSaveTriggered()));
    56         connect(actionFileSaveAsTask,SIGNAL(triggered()),this,SLOT(actionFileSaveAsTaskTriggered()));
    57         connect(actionFileSaveAsSolution,SIGNAL(triggered()),this,SLOT(actionFileSaveAsSolutionTriggered()));
     53        connect(actionFileNew, SIGNAL(triggered()), SLOT(actionFileNewTriggered()));
     54        connect(actionFileOpen, SIGNAL(triggered()), SLOT(actionFileOpenTriggered()));
     55        connect(actionFileSave, SIGNAL(triggered()), SLOT(actionFileSaveTriggered()));
     56        connect(actionFileSaveAsTask, SIGNAL(triggered()), SLOT(actionFileSaveAsTaskTriggered()));
     57        connect(actionFileSaveAsSolution, SIGNAL(triggered()), SLOT(actionFileSaveAsSolutionTriggered()));
    5858#ifndef QT_NO_PRINTER
    59         connect(actionFilePrintPreview,SIGNAL(triggered()),this,SLOT(actionFilePrintPreviewTriggered()));
    60         connect(actionFilePrint,SIGNAL(triggered()),this,SLOT(actionFilePrintTriggered()));
     59        connect(actionFilePrintPreview, SIGNAL(triggered()), SLOT(actionFilePrintPreviewTriggered()));
     60        connect(actionFilePrint, SIGNAL(triggered()), SLOT(actionFilePrintTriggered()));
    6161#endif // QT_NO_PRINTER
    62         connect(actionSettingsPreferences,SIGNAL(triggered()),this,SLOT(actionSettingsPreferencesTriggered()));
     62        connect(actionSettingsPreferences, SIGNAL(triggered()), SLOT(actionSettingsPreferencesTriggered()));
    6363#ifdef Q_OS_WIN32
    6464        connect(actionHelpCheck4Updates, SIGNAL(triggered()), SLOT(actionHelpCheck4UpdatesTriggered()));
    6565#endif // Q_OS_WIN32
    66         connect(actionSettingsLanguageAutodetect,SIGNAL(triggered(bool)),this,SLOT(actionSettingsLanguageAutodetectTriggered(bool)));
    67         connect(groupSettingsLanguageList,SIGNAL(triggered(QAction *)),this,SLOT(groupSettingsLanguageListTriggered(QAction *)));
    68         connect(actionHelpAboutQt,SIGNAL(triggered()),qApp,SLOT(aboutQt()));
    69         connect(actionHelpAbout,SIGNAL(triggered()),this,SLOT(actionHelpAboutTriggered()));
    70 
    71         connect(buttonSolve,SIGNAL(clicked()),this,SLOT(buttonSolveClicked()));
    72         connect(buttonRandom,SIGNAL(clicked()),this,SLOT(buttonRandomClicked()));
    73         connect(buttonBackToTask,SIGNAL(clicked()),this,SLOT(buttonBackToTaskClicked()));
    74         connect(spinCities,SIGNAL(valueChanged(int)),this,SLOT(spinCitiesValueChanged(int)));
     66        connect(actionSettingsLanguageAutodetect, SIGNAL(triggered(bool)), SLOT(actionSettingsLanguageAutodetectTriggered(bool)));
     67        connect(groupSettingsLanguageList, SIGNAL(triggered(QAction *)), SLOT(groupSettingsLanguageListTriggered(QAction *)));
     68        connect(actionHelpAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
     69        connect(actionHelpAbout, SIGNAL(triggered()), SLOT(actionHelpAboutTriggered()));
     70
     71        connect(buttonSolve, SIGNAL(clicked()), SLOT(buttonSolveClicked()));
     72        connect(buttonRandom, SIGNAL(clicked()), SLOT(buttonRandomClicked()));
     73        connect(buttonBackToTask, SIGNAL(clicked()), SLOT(buttonBackToTaskClicked()));
     74        connect(spinCities, SIGNAL(valueChanged(int)), SLOT(spinCitiesValueChanged(int)));
    7575
    7676#ifndef HANDHELD
     
    8686                settings->endGroup();
    8787        }
    88 #else
    89         setWindowState(Qt::WindowMaximized);
    9088#endif // HANDHELD
    9189
    9290        tspmodel = new CTSPModel(this);
    9391        taskView->setModel(tspmodel);
    94         connect(tspmodel,SIGNAL(numCitiesChanged(int)),this,SLOT(numCitiesChanged(int)));
    95         connect(tspmodel,SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),this,SLOT(dataChanged(const QModelIndex &, const QModelIndex &)));
    96         connect(tspmodel,SIGNAL(layoutChanged()),this,SLOT(dataChanged()));
     92        connect(tspmodel, SIGNAL(numCitiesChanged(int)), SLOT(numCitiesChanged(int)));
     93        connect(tspmodel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), SLOT(dataChanged(const QModelIndex &, const QModelIndex &)));
     94        connect(tspmodel, SIGNAL(layoutChanged()), SLOT(dataChanged()));
    9795        if ((QCoreApplication::arguments().count() > 1) && (tspmodel->loadTask(QCoreApplication::arguments().at(1))))
    9896                setFileName(QCoreApplication::arguments().at(1));
     
    944942                        name = t.translate("--------", "LANGNAME", "Please, provide a native name of your translation language here.");
    945943                        a = menuSettingsLanguage->addAction(name);
    946                         a->setStatusTip(QString("Set application language to %1").arg(name));
     944                        a->setStatusTip(tr("Set application language to %1").arg(name));
    947945                        a->setData(lang.completeBaseName().mid(6));
    948946                        a->setCheckable(true);
     
    11691167
    11701168        //! \hack HACK: A little hack for toolbar icons to have a sane size.
    1171 #ifdef Q_OS_WINCE_WM
     1169#ifdef HANDHELD
    11721170        toolBar->setIconSize(QSize(logicalDpiX() / 4, logicalDpiY() / 4));
    1173 #elif defined(Q_OS_SYMBIAN)
    1174         toolBar->setIconSize(QSize(logicalDpiX() / 5, logicalDpiY() / 5));
    1175 #endif // Q_OS_WINCE_WM
     1171#endif // HANDHELD
     1172        static_cast<QToolButton *>(toolBar->widgetForAction(actionFileSave))->setMenu(menuFileSaveAs);
     1173        static_cast<QToolButton *>(toolBar->widgetForAction(actionFileSave))->setPopupMode(QToolButton::MenuButtonPopup);
    11761174
    11771175        solutionText->document()->setDefaultFont(settings->value("Output/Font", QFont(DEF_FONT_FAMILY, DEF_FONT_SIZE)).value<QFont>());
     
    11951193        toolBar->insertAction(actionSettingsPreferences,actionFilePrint);
    11961194#endif // QT_NO_PRINTER
     1195
     1196        menuSettings->insertAction(actionSettingsPreferences, toolBar->toggleViewAction());
     1197        menuSettings->insertSeparator(actionSettingsPreferences);
     1198
    11971199#ifdef Q_OS_WIN32
    11981200        actionHelpCheck4Updates = new QAction(this);
Note: See TracChangeset for help on using the changeset viewer.