1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

Fixed merge conflicts with saving branch

This commit is contained in:
graffy76 2013-10-25 19:23:03 -05:00
parent 9ce4a04a2d
commit ba365ff49e
7 changed files with 31 additions and 68 deletions

View File

@ -161,42 +161,8 @@ void Launcher::DataFilesPage::slotProfileDeleted (const QString &item)
void Launcher::DataFilesPage::slotProfileChangedByUser(const QString &previous, const QString &current) void Launcher::DataFilesPage::slotProfileChangedByUser(const QString &previous, const QString &current)
{ {
<<<<<<< HEAD
setProfile(previous, current, true); setProfile(previous, current, true);
emit signalProfileChanged (ui.profilesComboBox->findText(current)); emit signalProfileChanged (ui.profilesComboBox->findText(current));
=======
if (mContentModel->rowCount() < 1)
return;
QString profile = mLauncherSettings.value(QString("Profiles/currentprofile"));
if (profile.isEmpty()) {
profile = profilesComboBox->currentText();
mLauncherSettings.setValue(QString("Profiles/currentprofile"), profile);
}
mLauncherSettings.remove(QString("Profiles/") + profile + QString("/master"));
mLauncherSettings.remove(QString("Profiles/") + profile + QString("/plugin"));
mGameSettings.remove(QString("master"));
mGameSettings.remove(QString("plugins"));
mGameSettings.remove(QString("content"));
ContentSelectorModel::ContentFileList items = mContentModel->checkedItems();
foreach(const ContentSelectorModel::EsmFile *item, items) {
if (item->gameFiles().size() == 0) {
mLauncherSettings.setMultiValue(QString("Profiles/") + profile + QString("/master"), item->fileName());
mGameSettings.setMultiValue(QString("content"), item->fileName());
} else {
mLauncherSettings.setMultiValue(QString("Profiles/") + profile + QString("/plugin"), item->fileName());
mGameSettings.setMultiValue(QString("content"), item->fileName());
}
}
>>>>>>> 3146af34d642a28b15b55f7eb9999d8ac50168a0
} }
void Launcher::DataFilesPage::slotProfileRenamed(const QString &previous, const QString &current) void Launcher::DataFilesPage::slotProfileRenamed(const QString &previous, const QString &current)

View File

@ -10,6 +10,7 @@
#include "model/world/data.hpp" #include "model/world/data.hpp"
#include <iostream> #include <iostream>
#include <QDebug>
CS::Editor::Editor() CS::Editor::Editor()
: mDocumentManager (mCfgMgr), mViewManager (mDocumentManager) : mDocumentManager (mCfgMgr), mViewManager (mDocumentManager)
@ -19,7 +20,6 @@ CS::Editor::Editor()
setupDataFiles(); setupDataFiles();
mNewGame.setLocalData (mLocal); mNewGame.setLocalData (mLocal);
mFileDialog.setLocalData (mLocal);
connect (&mViewManager, SIGNAL (newGameRequest ()), this, SLOT (createGame ())); connect (&mViewManager, SIGNAL (newGameRequest ()), this, SLOT (createGame ()));
connect (&mViewManager, SIGNAL (newAddonRequest ()), this, SLOT (createAddon ())); connect (&mViewManager, SIGNAL (newAddonRequest ()), this, SLOT (createAddon ()));
@ -32,8 +32,8 @@ CS::Editor::Editor()
connect (&mStartup, SIGNAL (editConfig()), this, SLOT (showSettings ())); connect (&mStartup, SIGNAL (editConfig()), this, SLOT (showSettings ()));
connect (&mFileDialog, SIGNAL(openFiles()), this, SLOT(openFiles())); connect (&mFileDialog, SIGNAL(openFiles()), this, SLOT(openFiles()));
connect (&mFileDialog, SIGNAL(createNewFile (const boost::filesystem::path&)), connect (&mFileDialog, SIGNAL(createNewFile ()),
this, SLOT(createNewFile (const boost::filesystem::path&))); this, SLOT(createNewFile ()));
connect (&mNewGame, SIGNAL (createRequest (const boost::filesystem::path&)), connect (&mNewGame, SIGNAL (createRequest (const boost::filesystem::path&)),
this, SLOT (createNewGame (const boost::filesystem::path&))); this, SLOT (createNewGame (const boost::filesystem::path&)));
@ -141,7 +141,7 @@ void CS::Editor::openFiles()
mFileDialog.hide(); mFileDialog.hide();
} }
void CS::Editor::createNewFile (const boost::filesystem::path& savePath) void CS::Editor::createNewFile ()
{ {
std::vector<boost::filesystem::path> files; std::vector<boost::filesystem::path> files;

View File

@ -60,7 +60,7 @@ namespace CS
void loadDocument(); void loadDocument();
void openFiles(); void openFiles();
void createNewFile (const boost::filesystem::path& savePath); void createNewFile ();
void createNewGame (const boost::filesystem::path& file); void createNewGame (const boost::filesystem::path& file);
void showStartup(); void showStartup();

View File

@ -2246,7 +2246,7 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration, co
mData.setAuthor (""); mData.setAuthor ("");
} }
/// \todo un-outcomment the else, once loading an existing content file works properly again. /// \todo un-outcomment the else, once loading an existing content file works properly again.
// else else
{ {
if (boost::filesystem::exists (mProjectPath)) if (boost::filesystem::exists (mProjectPath))
{ {

View File

@ -111,7 +111,7 @@ namespace CSMWorld
else else
{ {
record.mState = RecordBase::State_Deleted; record.mState = RecordBase::State_Deleted;
setRecord (index, record); this->setRecord (index, record);
} }
return true; return true;

View File

@ -17,8 +17,6 @@
#include "filewidget.hpp" #include "filewidget.hpp"
#include "adjusterwidget.hpp" #include "adjusterwidget.hpp"
#include <QDebug>
CSVDoc::FileDialog::FileDialog(QWidget *parent) : CSVDoc::FileDialog::FileDialog(QWidget *parent) :
QDialog(parent), mSelector (0) QDialog(parent), mSelector (0)
{ {
@ -61,6 +59,13 @@ void CSVDoc::FileDialog::showDialog(DialogType dialogType)
break; break;
} }
//connections common to both dialog view flavors
connect (mSelector, SIGNAL (signalCurrentGamefileIndexChanged (int)),
this, SLOT (slotUpdateAcceptButton (int)));
connect (ui.projectButtonBox, SIGNAL (accepted()), this, SIGNAL (createNewFile()));
connect (ui.projectButtonBox, SIGNAL (rejected()), this, SLOT (slotRejected()));
show(); show();
raise(); raise();
activateWindow(); activateWindow();
@ -82,13 +87,7 @@ void CSVDoc::FileDialog::buildNewFileView()
ui.projectGroupBoxLayout->insertWidget (0, mFileWidget); ui.projectGroupBoxLayout->insertWidget (0, mFileWidget);
connect (mFileWidget, SIGNAL (nameChanged(const QString &, bool)), connect (mFileWidget, SIGNAL (nameChanged(const QString &, bool)),
this, SLOT (slotUpdateCreateButton(const QString &, bool))); this, SLOT (slotUpdateAcceptButton(const QString &, bool)));
connect (mSelector, SIGNAL (signalCurrentGamefileIndexChanged (int)),
this, SLOT (slotUpdateCreateButton (int)));
connect (ui.projectButtonBox, SIGNAL (accepted()), this, SIGNAL (createNewFile()));
connect (ui.projectButtonBox, SIGNAL (rejected()), this, SLOT (slotRejected()));
} }
void CSVDoc::FileDialog::buildOpenFileView() void CSVDoc::FileDialog::buildOpenFileView()
@ -96,21 +95,25 @@ void CSVDoc::FileDialog::buildOpenFileView()
setWindowTitle(tr("Open")); setWindowTitle(tr("Open"));
ui.projectGroupBox->setTitle (QString("")); ui.projectGroupBox->setTitle (QString(""));
connect (ui.projectButtonBox, SIGNAL (accepted()), this, SIGNAL (openFiles())); ui.projectButtonBox->button(QDialogButtonBox::Ok)->setEnabled (false);
connect (ui.projectButtonBox, SIGNAL (rejected()), this, SLOT (slotRejected()));
} }
void CSVDoc::FileDialog::slotUpdateCreateButton (int) void CSVDoc::FileDialog::slotUpdateAcceptButton (int)
{ {
slotUpdateCreateButton (mFileWidget->getName(), true); QString name = "";
if (mDialogType == DialogType_New)
name = mFileWidget->getName();
slotUpdateAcceptButton (name, true);
} }
void CSVDoc::FileDialog::slotUpdateCreateButton(const QString &name, bool) void CSVDoc::FileDialog::slotUpdateAcceptButton(const QString &name, bool)
{ {
if (!(mDialogType == DialogType_New)) bool success = (mSelector->selectedFiles().size() > 0);
return;
bool success = (!name.isEmpty() && mSelector->selectedFiles().size() > 0); if (mDialogType == DialogType_New)
success = success && !(name.isEmpty());
ui.projectButtonBox->button (QDialogButtonBox::Ok)->setEnabled (success); ui.projectButtonBox->button (QDialogButtonBox::Ok)->setEnabled (success);
} }
@ -128,8 +131,3 @@ void CSVDoc::FileDialog::slotRejected()
emit rejected(); emit rejected();
close(); close();
} }
void CSVDoc::FileDialog::createNewFile()
{
emit createNewFile (mAdjusterWidget->getPath());
}

View File

@ -55,15 +55,14 @@ namespace CSVDoc
signals: signals:
void openFiles(); void openFiles();
void createNewFile (const boost::filesystem::path& savePath); void createNewFile ();
void signalUpdateCreateButton (bool, int); void signalUpdateAcceptButton (bool, int);
void signalUpdateCreateButtonFlags(int);
private slots: private slots:
void slotUpdateCreateButton (int); void slotUpdateAcceptButton (int);
void slotUpdateCreateButton (const QString &, bool); void slotUpdateAcceptButton (const QString &, bool);
void slotRejected(); void slotRejected();
}; };
} }