Mercurial > hg > forks > UniversalIndentGUI
changeset 557:9c799c456379
For being consistent renamed some classes with the prefix UiGui* to Uigui*. Was sometimes mixed and that way is also easier to read.
git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@797 59b1889a-e5ac-428c-b0c7-476e01d41282
author | thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282> |
---|---|
date | Thu, 02 Oct 2008 20:21:32 +0000 |
parents | 6255a3c1c66c |
children | 6211dda17c26 |
files | src/indenthandler.cpp src/indenthandler.h src/main.cpp src/mainwindow.cpp src/mainwindow.h src/uiguierrormessage.cpp src/uiguierrormessage.h src/uiguisettings.cpp src/uiguisettings.h src/uiguisettingsdialog.cpp src/uiguisettingsdialog.h src/updatecheckdialog.cpp src/updatecheckdialog.h |
diffstat | 13 files changed, 60 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/src/indenthandler.cpp Thu Oct 02 19:09:37 2008 +0000 +++ b/src/indenthandler.cpp Thu Oct 02 20:21:32 2008 +0000 @@ -84,8 +84,8 @@ indenterSelectionCombobox->setProperty("connectedSettingName", "SelectedIndenter"); indenterSelectionCombobox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon); indenterSelectionCombobox->setMinimumContentsLength(20); - connect( indenterSelectionCombobox, SIGNAL(activated(int)), UiGuiSettings::getInstance(), SLOT(handleValueChangeFromExtern(int)) ); - connect( UiGuiSettings::getInstance(), SIGNAL(selectedIndenter(int)), this, SLOT(setIndenter(int)) ); + connect( indenterSelectionCombobox, SIGNAL(activated(int)), UiguiSettings::getInstance(), SLOT(handleValueChangeFromExtern(int)) ); + connect( UiguiSettings::getInstance(), SIGNAL(selectedIndenter(int)), this, SLOT(setIndenter(int)) ); hboxLayout->addWidget( indenterSelectionCombobox ); // Create the indenter parameter help button. @@ -118,10 +118,10 @@ QDir indenterDirctory = QDir(indenterDirctoryStr); if ( mainWindow != NULL ) { - errorMessageDialog = new UiGuiErrorMessage(mainWindow); + errorMessageDialog = new UiguiErrorMessage(mainWindow); } else { - errorMessageDialog = new UiGuiErrorMessage(this); + errorMessageDialog = new UiguiErrorMessage(this); } indenterIniFileList = indenterDirctory.entryList( QStringList("uigui_*.ini") );
--- a/src/indenthandler.h Thu Oct 02 19:09:37 2008 +0000 +++ b/src/indenthandler.h Thu Oct 02 20:21:32 2008 +0000 @@ -175,7 +175,7 @@ QString useCfgFileParameter; QString indenterShowHelpParameter; QWidget *mainWindow; - UiGuiErrorMessage *errorMessageDialog; + UiguiErrorMessage *errorMessageDialog; QString indenterExecutableCallString; QString indenterExecutableSuffix;
--- a/src/main.cpp Thu Oct 02 19:09:37 2008 +0000 +++ b/src/main.cpp Thu Oct 02 20:21:32 2008 +0000 @@ -106,5 +106,5 @@ return app.exec(); - UiGuiSettings::deleteInstance(); + UiguiSettings::deleteInstance(); }
--- a/src/mainwindow.cpp Thu Oct 02 19:09:37 2008 +0000 +++ b/src/mainwindow.cpp Thu Oct 02 20:21:32 2008 +0000 @@ -46,7 +46,7 @@ scrollPositionChanged = false; // Create the settings object, which loads all UiGui settings from a file. - settings = UiGuiSettings::getInstance(); + settings = UiguiSettings::getInstance(); // Initialize the language of the application. initApplicationLanguage(); @@ -78,7 +78,7 @@ connect( actionAbout_UniversalIndentGUI, SIGNAL(triggered()), this, SLOT(showAboutDialog()) ); // generate settings dialog box - settingsDialog = new UiGuiSettingsDialog(this, settings); + settingsDialog = new UiguiSettingsDialog(this, settings); connect( actionShowSettings, SIGNAL(triggered()), settingsDialog, SLOT(showDialog()) ); // If a file that should be opened on start has been handed over to the constructor exists, load it @@ -932,7 +932,7 @@ } settings->setValueByName( "MainWindowState", saveState() ); - //FIXME: Needs to be called explicit here, because the destructor of UiGuiSettings doesn't do it. + //FIXME: Needs to be called explicit here, because the destructor of UiguiSettings doesn't do it. settings->saveSettings(); // Also save the syntax highlight style for all lexers.
--- a/src/mainwindow.h Thu Oct 02 19:09:37 2008 +0000 +++ b/src/mainwindow.h Thu Oct 02 20:21:32 2008 +0000 @@ -77,7 +77,7 @@ void dropEvent(QDropEvent *event); QsciScintilla *txtedSourceCode; - UiGuiSettings *settings; + UiguiSettings *settings; QString version; QString revision; @@ -91,7 +91,7 @@ QScrollBar *textEditVScrollBar; AboutDialog *aboutDialog; AboutDialogGraphicsView *aboutDialogGraphicsView; - UiGuiSettingsDialog *settingsDialog; + UiguiSettingsDialog *settingsDialog; int textEditLastScrollPos; int currentIndenterID; bool loadLastSourceCodeFileOnStartup;
--- a/src/uiguierrormessage.cpp Thu Oct 02 19:09:37 2008 +0000 +++ b/src/uiguierrormessage.cpp Thu Oct 02 20:21:32 2008 +0000 @@ -20,9 +20,9 @@ #include "uiguierrormessage.h" /*! - \class UiGuiErrorMessage + \class UiguiErrorMessage \ingroup grp_Dialogs - \brief UiGuiErrorMessage is a child of QErrorMessage. But QErrorMessages + \brief UiguiErrorMessage is a child of QErrorMessage. But QErrorMessages "Do not show again" didn't work with my strings, so this is my own, working implementation of it. */ @@ -34,7 +34,7 @@ Retrieves the object pointer to the \a showAgainCheckBox check box, sets the dialogs modality and for a working translation sets the check box text. */ -UiGuiErrorMessage::UiGuiErrorMessage(QWidget *parent) : QErrorMessage(parent) { +UiguiErrorMessage::UiguiErrorMessage(QWidget *parent) : QErrorMessage(parent) { showAgainCheckBox = findChild<QCheckBox *>(); setWindowModality( Qt::ApplicationModal ); showAgainCheckBox->setText( tr("Show this message again") ); @@ -44,7 +44,7 @@ /*! \brief Just a lazy nothin doin destructive destructor. */ -UiGuiErrorMessage::~UiGuiErrorMessage(void) { +UiguiErrorMessage::~UiguiErrorMessage(void) { } @@ -55,7 +55,7 @@ already in that list and "Show this message again" is not checked, that message will not be shown. */ -void UiGuiErrorMessage::showMessage( const QString &title, const QString &message ) { +void UiguiErrorMessage::showMessage( const QString &title, const QString &message ) { bool showAgain = true; if ( showAgainCheckBox != 0 ) { @@ -80,6 +80,6 @@ /*! \brief For convinience, for showing a dialog box with the default title "UniversalIndentGUI". */ -void UiGuiErrorMessage::showMessage( const QString &message ) { +void UiguiErrorMessage::showMessage( const QString &message ) { showMessage( "UniversalIndentGUI", message ); }
--- a/src/uiguierrormessage.h Thu Oct 02 19:09:37 2008 +0000 +++ b/src/uiguierrormessage.h Thu Oct 02 20:21:32 2008 +0000 @@ -23,13 +23,13 @@ #include <QErrorMessage> #include <QCheckBox> -class UiGuiErrorMessage : public QErrorMessage +class UiguiErrorMessage : public QErrorMessage { Q_OBJECT public: - UiGuiErrorMessage(QWidget *parent = 0); - ~UiGuiErrorMessage(void); + UiguiErrorMessage(QWidget *parent = 0); + ~UiguiErrorMessage(void); void showMessage( const QString &message ); void showMessage( const QString &title, const QString &message );
--- a/src/uiguisettings.cpp Thu Oct 02 19:09:37 2008 +0000 +++ b/src/uiguisettings.cpp Thu Oct 02 20:21:32 2008 +0000 @@ -24,19 +24,19 @@ //! \defgroup grp_Settings All concerning the settings. /*! - \class UiGuiSettings + \class UiguiSettings \ingroup grp_Settings \brief Handles the settings of the program. Reads them on startup and saves them on exit. Is a singleton class and can only be accessed via getInstance(). */ // Inits the single class instance pointer. - UiGuiSettings* UiGuiSettings::instance = NULL; + UiguiSettings* UiguiSettings::instance = NULL; /*! \brief The constructor for the settings. */ -UiGuiSettings::UiGuiSettings() : QObject() { +UiguiSettings::UiguiSettings() : QObject() { portableMode = SettingsPaths::getPortableMode(); globalFilesDirectoryStr = SettingsPaths::getGlobalFilesPath(); @@ -58,17 +58,17 @@ /*! \brief Returns the instance of the settings class. If no instance exists, ONE will be created. */ -UiGuiSettings* UiGuiSettings::getInstance() { +UiguiSettings* UiguiSettings::getInstance() { if ( instance == NULL ) { // Create the settings object, which loads all UiGui settings from a file. - instance = new UiGuiSettings(); + instance = new UiguiSettings(); } return instance; } -void UiGuiSettings::deleteInstance() { +void UiguiSettings::deleteInstance() { if ( instance != NULL ) { delete instance; instance = NULL; @@ -79,7 +79,7 @@ /*! \brief The destructor saves the settings to a file. */ -UiGuiSettings::~UiGuiSettings() { +UiguiSettings::~UiguiSettings() { //FIXME: Is never called!! saveSettings(); } @@ -89,7 +89,7 @@ \brief Scans the translations directory for available translation files and stores them in the QList \a availableTranslations. */ -void UiGuiSettings::readAvailableTranslations() { +void UiguiSettings::readAvailableTranslations() { QString languageShort; QStringList languageFileList; @@ -115,7 +115,7 @@ /*! \brief Returns a list of the mnemonics of the available translations. */ -QStringList UiGuiSettings::getAvailableTranslations() { +QStringList UiguiSettings::getAvailableTranslations() { return availableTranslations; } @@ -126,7 +126,7 @@ According to the objects property "connectedSettingName" the corresponding setting is known and set. */ -void UiGuiSettings::handleValueChangeFromExtern(int value) { +void UiguiSettings::handleValueChangeFromExtern(int value) { if ( sender() ) { // Get the corresponding setting name from the sender objects property. QString settingName = sender()->property("connectedSettingName").toString(); @@ -149,7 +149,7 @@ According to the objects property "connectedSettingName" the corresponding setting is known and set. */ -void UiGuiSettings::handleValueChangeFromExtern(bool value) { +void UiguiSettings::handleValueChangeFromExtern(bool value) { if ( sender() ) { // Get the corresponding setting name from the sender objects property. QString settingName = sender()->property("connectedSettingName").toString(); @@ -172,7 +172,7 @@ According to the objects property "connectedSettingName" the corresponding setting is known and set. */ -void UiGuiSettings::handleValueChangeFromExtern(QDate value) { +void UiguiSettings::handleValueChangeFromExtern(QDate value) { if ( sender() ) { // Get the corresponding setting name from the sender objects property. QString settingName = sender()->property("connectedSettingName").toString(); @@ -195,7 +195,7 @@ According to the objects property "connectedSettingName" the corresponding setting is known and set. */ -void UiGuiSettings::handleValueChangeFromExtern(QByteArray value) { +void UiguiSettings::handleValueChangeFromExtern(QByteArray value) { if ( sender() ) { // Get the corresponding setting name from the sender objects property. QString settingName = sender()->property("connectedSettingName").toString(); @@ -217,7 +217,7 @@ The to \a settingsName corresponding signal is emitted, if the value has changed. */ -bool UiGuiSettings::setValueByName(QString settingName, QVariant value) { +bool UiguiSettings::setValueByName(QString settingName, QVariant value) { // Test if the named setting really exists. if ( settings.contains(settingName) ) { // Test if the new value is different to the one before. @@ -239,7 +239,7 @@ If \a settingName equals "all", all signals are emitted. This can be used to update all dependent widgets. \a value is the new value that is emitted along with the signal. */ -void UiGuiSettings::emitSignalForSetting(QString settingName) { +void UiguiSettings::emitSignalForSetting(QString settingName) { // Emit the signal for the changed value. if ( settingName == "VersionInSettingsFile" ) emit versionInSettingsFile( settings[settingName].toString() ); else if ( settingName == "WindowIsMaximized" ) emit windowIsMaximized( settings[settingName].toBool() ); @@ -284,7 +284,7 @@ \brief Calls \sa emitSignalForSetting with settingName "all" to update all widgets or whatever is connected to each setting. */ -void UiGuiSettings::updateAllDependend() { +void UiguiSettings::updateAllDependend() { emitSignalForSetting("all"); } @@ -294,7 +294,7 @@ If the named setting does not exist, 0 is being returned. */ -QVariant UiGuiSettings::getValueByName(QString settingName) { +QVariant UiguiSettings::getValueByName(QString settingName) { // Test if the named setting really exists. if ( settings.contains(settingName) ) { return settings[settingName]; @@ -308,7 +308,7 @@ Settings are for example last selected indenter, last loaded source code file and so on. */ -bool UiGuiSettings::loadSettings() { +bool UiguiSettings::loadSettings() { // Read the version string saved in the settings file. settings["VersionInSettingsFile"] = qsettings->value("UniversalIndentGUI/version", "").toString(); @@ -367,7 +367,7 @@ Settings are for example last selected indenter, last loaded source code file and so on. */ -bool UiGuiSettings::saveSettings() { +bool UiguiSettings::saveSettings() { qsettings->setValue( "UniversalIndentGUI/recentlyOpenedListSize", settings["RecentlyOpenedListSize"] ); qsettings->setValue( "UniversalIndentGUI/lastSourceCodeFile", settings["LastOpenedFiles"] ); qsettings->setValue( "UniversalIndentGUI/loadLastSourceCodeFileOnStartup", settings["LoadLastOpenedFileOnStartup"] );
--- a/src/uiguisettings.h Thu Oct 02 19:09:37 2008 +0000 +++ b/src/uiguisettings.h Thu Oct 02 20:21:32 2008 +0000 @@ -30,17 +30,17 @@ #include <QStringList> #include <QCoreApplication> -class UiGuiSettings : public QObject +class UiguiSettings : public QObject { Q_OBJECT private: - UiGuiSettings(); - static UiGuiSettings* instance; + UiguiSettings(); + static UiguiSettings* instance; public: - static UiGuiSettings* getInstance(); + static UiguiSettings* getInstance(); static void deleteInstance(); - ~UiGuiSettings(); + ~UiguiSettings(); bool loadSettings(); bool saveSettings(); bool setValueByName(QString settingName, QVariant value);
--- a/src/uiguisettingsdialog.cpp Thu Oct 02 19:09:37 2008 +0000 +++ b/src/uiguisettingsdialog.cpp Thu Oct 02 20:21:32 2008 +0000 @@ -20,7 +20,7 @@ #include "uiguisettingsdialog.h" /*! - \class UiGuiSettingsDialog + \class UiguiSettingsDialog \ingroup grp_Settings \brief Displays a dialog window with settings for UniversalIndentGUI */ @@ -28,9 +28,9 @@ /*! \brief The constructor calls the setup function for the ui created by uic. and adds */ -UiGuiSettingsDialog::UiGuiSettingsDialog(QWidget* parent, UiGuiSettings* settings) : QDialog(parent) +UiguiSettingsDialog::UiguiSettingsDialog(QWidget* parent, UiguiSettings* settings) : QDialog(parent) { - // Remember pointer to the UiGuiSettings object. + // Remember pointer to the UiguiSettings object. this->settings = settings; // Init the user interface created by the UIC. @@ -49,7 +49,7 @@ // Get all combo boxes that are used for settings. comboBoxes = findChildren<QComboBox*>( QRegExp("uiGui*") ); - // Connect the accepted signal to own function, to write values back to the UiGuiSettings object. + // Connect the accepted signal to own function, to write values back to the UiguiSettings object. connect(this, SIGNAL(accepted()), this, SLOT(writeWidgetValuesToSettings()) ); // Init the language selection combobox. @@ -63,7 +63,7 @@ Also the translation itself will be reinitialized. */ -void UiGuiSettingsDialog::initTranslationSelection() { +void UiguiSettingsDialog::initTranslationSelection() { // First empty the combo box. uiGuiLanguageSelectionComboBox->clear(); @@ -98,9 +98,9 @@ /*! \brief Displays the dialog by calling the dialogs exec function. - Before it gets all the values needed from the UiGuiSettings object. + Before it gets all the values needed from the UiguiSettings object. */ -int UiGuiSettingsDialog::showDialog() { +int UiguiSettingsDialog::showDialog() { // Get the values for the check boxes from the settings object. foreach (QCheckBox* checkBox, checkBoxes) { // Get the corresponding setting name from the check boxs property. @@ -157,9 +157,9 @@ /*! \brief This slot is called when the dialog box is closed by pressing the Ok button. - Writes all settings to the UiGuiSettings object. + Writes all settings to the UiguiSettings object. */ -void UiGuiSettingsDialog::writeWidgetValuesToSettings() { +void UiguiSettingsDialog::writeWidgetValuesToSettings() { // Write the values of the check boxes to the settings object. foreach (QCheckBox* checkBox, checkBoxes) { // Get the corresponding setting name from the check boxs property. @@ -210,7 +210,7 @@ /*! \brief Catches language change events and retranslates all needed widgets. */ -void UiGuiSettingsDialog::changeEvent(QEvent *event) { +void UiguiSettingsDialog::changeEvent(QEvent *event) { if (event->type() == QEvent::LanguageChange) { retranslateUi(this); // If this is not explicit set here, Qt < 4.3.0 does not translate the buttons.
--- a/src/uiguisettingsdialog.h Thu Oct 02 19:09:37 2008 +0000 +++ b/src/uiguisettingsdialog.h Thu Oct 02 20:21:32 2008 +0000 @@ -24,12 +24,12 @@ #include "ui_UiGuiSettingsDialog.h" #include "uiguisettings.h" -class UiGuiSettingsDialog : public QDialog, private Ui::SettingsDialog +class UiguiSettingsDialog : public QDialog, private Ui::SettingsDialog { Q_OBJECT public: - UiGuiSettingsDialog(QWidget* parent, UiGuiSettings* settings); + UiguiSettingsDialog(QWidget* parent, UiguiSettings* settings); public slots: int showDialog(); @@ -41,7 +41,7 @@ void changeEvent(QEvent *event); void initTranslationSelection(); - UiGuiSettings* settings; + UiguiSettings* settings; QList<QCheckBox*> checkBoxes; QList<QSpinBox*> spinBoxes; QList<QComboBox*> comboBoxes;
--- a/src/updatecheckdialog.cpp Thu Oct 02 19:09:37 2008 +0000 +++ b/src/updatecheckdialog.cpp Thu Oct 02 20:21:32 2008 +0000 @@ -31,7 +31,7 @@ /*! \brief Initializes member variables and stores the version of UiGui and a pointer to the settings object. */ -UpdateCheckDialog::UpdateCheckDialog(QString currentVersion, UiGuiSettings *settings, QWidget *parent) : QDialog(parent) { +UpdateCheckDialog::UpdateCheckDialog(QString currentVersion, UiguiSettings *settings, QWidget *parent) : QDialog(parent) { setupUi(this); manualUpdateRequested = false;
--- a/src/updatecheckdialog.h Thu Oct 02 19:09:37 2008 +0000 +++ b/src/updatecheckdialog.h Thu Oct 02 20:21:32 2008 +0000 @@ -38,7 +38,7 @@ Q_OBJECT public: - UpdateCheckDialog(QString currentVersion, UiGuiSettings *settings, QWidget *parent=0); + UpdateCheckDialog(QString currentVersion, UiguiSettings *settings, QWidget *parent=0); public slots: void checkForUpdateAndShowDialog(); @@ -50,7 +50,7 @@ void showNewVersionAvailableDialog(QString newVersion); void showNoNewVersionAvailableDialog(); - UiGuiSettings *settings; + UiguiSettings *settings; bool manualUpdateRequested; QHttp *http; QString currentVersion;