//
// QPerforce is a gui interface to the perforce revision control
// system. It is based on the qt library, and should be easily portable
// across any platform that has this toolkit available.
//
// Copyright (C) 2002 Jacob Gladish
//
#ifndef __CONFIG_OPTIONS_H__
#define __CONFIG_OPTIONS_H__
#include <qapplication.h>
#include <qstring.h>
class ConfigOptionsDialogImpl;
class ConfigOptions
{
public:
friend ConfigOptionsDialogImpl;
bool showP4Commands();
inline const QString& getImageDir() const
{ return _application._imageDir;}
inline const QString& getCurrentClient() const
{ return _env._currClientName; }
static ConfigOptions* getInstance();
private:
ConfigOptions();
virtual ~ConfigOptions();
static ConfigOptions* _instance;
//======================================================================
// options here.
//
private:
struct Display {
bool _showDeletedDepotFiles;
bool _showPerforeFileTypesInDepotAndChangelistPanes;
bool _showOpenActionInChangelistPane;
bool _showPartialChangeDescriptionsInChangelistPane;
bool _alwaysShowConnectionSettingsInTitleBar;
bool _showP4CommandsInStatusPane;
bool _showLocalPathForDepotFiles;
bool _outlineDepotFileUnderCursor;
bool _showTimestampForStatusMessages;
bool _preserveFormattingForTextFieldsInAllSpecDialogs;
bool _listLabelFilesInaDialogBox;
bool _expandPendingChnagelistsWhen;
bool _enableIncludingIntegrationsWhenFiltering;
bool _enableDisplayingBranchingHistoryInRevision;
};
struct DoubleClickOption {
bool _viewUnopenedFilesEditOpenedFiles;
bool _openForEdit;
bool _openAndEditFileUsingAssocEditor;
bool _viewHeadRevUsingAssocEditor;
bool _syncToHeadRevision;
bool _diffVsHeadRevInDepotPane;
bool _displayPropertiesDialogInBoth;
bool _displayRevisionHistoryInBoth;
};
struct Application {
Application();
QString _imageDir;
};
struct P4Environment {
P4Environment();
QString _currClientName;
};
struct Connection {
char* _p4Port;
bool _rememberAsDefault;
bool _pollServerForUpdates;
int _pollInterval;
bool _pollWhenActive;
bool _autoReloadDepotAndChangelists;
bool _autoReloadPaneWhenUncovered;
int _autoReloadPaneInterval;
bool _autoFetchAllSubmitted;
bool _autoFetchLast;
int _authFetchLastCount;
bool _displayAllFilteredOrUnfiltered;
bool _pollForJobUpdates;
bool _displayMaximumJobs;
bool _displayMaximumJobsCount;
bool _automaticallyFetchAllRevisionHistRecords;
bool _automaticallyFetchLast;
bool _automaticallyFetchLastCount;
};
Display _display;
Application _application;
DoubleClickOption _doubleClickOption;
P4Environment _env;
Connection _connection;
};
#endif