Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ set(dbe_core_ui
ui/RelationshipWidgetForm.ui
ui/StringAttributeWidgetForm.ui
ui/FileInfo.ui
ui/Preferences.ui
)

qt5_wrap_ui(dbe_core_ui_header ${dbe_core_ui})
Expand All @@ -182,12 +183,14 @@ qt5_wrap_cpp(dbe_core_moc_src
include/dbe/ObjectCreator.hpp
include/dbe/ObjectEditor.hpp
include/dbe/OracleWidget.hpp
include/dbe/Preferences.hpp
)

set(dbe_core_src
internal/MainWindow.cpp
internal/StyleUtility.cpp
internal/Validator.cpp
internal/Preferences.cpp
object/CustomLineEdit.cpp
object/string_attr_text_edit.cpp
object/SearchComboBox.cpp
Expand Down
23 changes: 17 additions & 6 deletions include/dbe/BuildingBlockEditors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ class base: public QWidget

virtual QStringList getdata();

const QString c_input_placeholder{"Add a new value"};
const QString c_no_object_placeholder{"No Object currently set"};
protected:
base ( std::shared_ptr<editor_data_state> editordata, QWidget * parent =
nullptr, bool owned = false );
Expand Down Expand Up @@ -171,7 +173,8 @@ class relation: public base, private dbe::Ui::RelationshipForm
typedef dunedaq::conffwk::relationship_t t_virtue;
typedef editor_data<t_virtue> t_build_block_editor;

relation ( t_virtue const & relation, QWidget * parent = nullptr, bool owned = false );
relation ( t_virtue const & relation, QWidget * parent = nullptr,
bool owned = false, bool readonly=false );

bool GetIsMultiValue() const;

Expand All @@ -191,6 +194,7 @@ class relation: public base, private dbe::Ui::RelationshipForm
std::shared_ptr<t_build_block_editor> p_base_data_editor;

bool IsMultiValue;
bool m_readonly;

QStatusBar * StatusBar;
QStringList CurrentDataList;
Expand Down Expand Up @@ -240,7 +244,8 @@ class stringattr: public base, private Ui::StringAttributeWidgetForm
typedef dunedaq::conffwk::attribute_t t_virtue;
typedef editor_data<t_virtue> t_build_block_editor;

stringattr ( t_virtue const & attr, QWidget * parent = nullptr, bool owned = false );
stringattr ( t_virtue const & attr, QWidget * parent = nullptr,
bool owned = false, bool readonly=false );
~stringattr();

void SetEditor() override;
Expand All @@ -265,6 +270,7 @@ class stringattr: public base, private Ui::StringAttributeWidgetForm

std::shared_ptr<t_build_block_editor> m_base_data_editor;

bool m_readonly;
QString DefaultValue;
QPushButton * PopUpButton;
QDialog * Dialog;
Expand Down Expand Up @@ -294,7 +300,8 @@ class numericattr: public base, private Ui::NumericAttributeWidgetForm
typedef dunedaq::conffwk::attribute_t t_virtue;
typedef editor_data<t_virtue> t_build_block_editor;

numericattr ( t_virtue const & attr, QWidget * parent = nullptr, bool owned = false );
numericattr ( t_virtue const & attr, QWidget * parent = nullptr,
bool owned = false, bool readonly=false );

void SetEditor() override;

Expand All @@ -313,6 +320,7 @@ class numericattr: public base, private Ui::NumericAttributeWidgetForm

std::shared_ptr<t_build_block_editor> this_base_data_editor;

bool m_readonly;
int this_base;
int this_native_base;

Expand Down Expand Up @@ -341,7 +349,8 @@ class combo: public base, public Ui::EditCombo
typedef dunedaq::conffwk::attribute_t t_virtue;
typedef editor_data<t_virtue> t_build_block_editor;

combo ( t_virtue const & attr, QWidget * parent = nullptr, bool owned = false );
combo ( t_virtue const & attr, QWidget * parent = nullptr,
bool owned = false, bool readonly=false );

void SetEditor() override;

Expand All @@ -359,7 +368,7 @@ class combo: public base, public Ui::EditCombo
void SetController();

std::shared_ptr<t_build_block_editor> m_base_data_editor;

bool m_readonly;
private slots:
void TryValidate ( QString );
void ChangeDetected ( QString const & );
Expand All @@ -379,7 +388,8 @@ class multiattr: public base
typedef dunedaq::conffwk::attribute_t t_virtue;
typedef editor_data<t_virtue> t_build_block_editor;

multiattr ( t_virtue const & attr, QWidget * parent = nullptr, bool owned = false );
multiattr ( t_virtue const & attr, QWidget * parent = nullptr,
bool owned = false, bool readonly=false );

void SetEditor() override;

Expand All @@ -391,6 +401,7 @@ class multiattr: public base

std::shared_ptr<t_build_block_editor> m_base_data_editor;

bool m_readonly;
QStatusBar * StatusBar;
QPushButton * OkButton;
QPushButton * RemoveButton;
Expand Down
2 changes: 1 addition & 1 deletion include/dbe/CreateDatabaseWidget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class CreateDatabaseWidget: public QWidget, private dbe::Ui::CreateDatabaseWidge
void CanIncludeDatabase ( const QString & DatabasePath );

private:
QStatusBar * StatusBar;
QFileInfo DatabaseFile;
QFileInfo SchemaFile;
QString DirToCreate;
bool CreateToInclude;
std::list<std::string> get_includes();
bool create_database_file(std::string extra_text);
private slots:
void DefineSchema();
void DefineDatabaseFile();
Expand Down
4 changes: 4 additions & 0 deletions include/dbe/FileInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ namespace dbe
static QString prune_path(QString file);
static void parse_all_objects();
static QString check_file_includes(const QString& file);
static QString get_schema_path() {return s_schema_path;}
static QString get_data_path() {return s_data_path;}
static void set_schema_path(const QString& path) {s_schema_path=path;}
static void set_data_path(const QString& path) {s_data_path=path;}

private slots:
void accept();
Expand Down
14 changes: 8 additions & 6 deletions include/dbe/MainWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/// Including QT Headers
#include <QMap>
#include <QSet>
#include <QSettings>
#include <QString>
#include <QMessageBox>
#include <QMainWindow>
Expand Down Expand Up @@ -97,7 +98,7 @@ class MainWindow:
public:
void build_file_model();
private:
void load_settings ( bool LoadSettings = false );
void apply_settings (QSettings& setting);

void WriteSettings();
void argsparse ( QMap<QString, QString> const & );
Expand All @@ -108,7 +109,9 @@ class MainWindow:
void edit_object_at ( const QModelIndex & Index );

void update_total_objects();

void display_message_box(const QString& title, const QString& msg,
const QMessageBox::Icon& icon);
void load_default_settings();
private slots:
void slot_create_newdb();
void slot_open_database_from_file();
Expand All @@ -133,7 +136,7 @@ private slots:
void slot_launch_batchchange();
void slot_launch_batchchange_on_table();

void LoadDefaultSetting();
void reload_default_settings();

void slot_filter_query();
void slot_filter_textchange ( const QString & );
Expand Down Expand Up @@ -161,15 +164,14 @@ private slots:

void slot_loaded_db_file ( QString );

void slot_launch_preferences();
public slots:
void slot_batch_change_start();
void slot_batch_change_stop(const QList<QPair<QString, QString>>&);
void slot_debuginfo_message ( QString const, QString const );

void slot_information_message ( QString const, QString const );
void slot_notice_message ( QString const, QString const );
void slot_warning_message ( QString const, QString const );
void slot_error_message ( QString const, QString const );
void slot_failure_message ( QString const, QString const );

signals:
//void signal_rdb_found (const QString& p, const RDBMap& rdbs);
Expand Down
1 change: 1 addition & 0 deletions include/dbe/ObjectEditor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class ObjectEditor:

std::string classname;
std::unique_ptr<dref> m_object_to_edit;
bool m_readonly{false};

tref Object()
{
Expand Down
33 changes: 33 additions & 0 deletions include/dbe/Preferences.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#ifndef DBE_PREFERENCES_H
#define DBE_PREFERENCES_H

#include <QDialog>
#include <QKeyEvent>
#include <QList>
#include <QListWidgetItem>

//#include "ui_Preferences.h"

namespace dbe
{
namespace Ui
{
class Preferences;
} // namespace Ui

class Preferences : public QDialog {
Q_OBJECT
public:
explicit Preferences(QWidget* parent=0);
~Preferences() = default;
// signals:
// void settings_updated();
private slots:
void set_color(QListWidgetItem*);

private:
Ui::Preferences* m_ui;
};
} //namespace dbe

#endif // DBE_PREFERENCES_H
9 changes: 8 additions & 1 deletion include/dbe/StyleUtility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/// Including DBE
#include <QColor>
#include <QPalette>
#include <QSettings>

namespace dbe
{
Expand All @@ -15,12 +16,18 @@ class StyleUtility
static void InitColorManagement();
static QColor TableColorAttribute;
static QColor TableAttributeBackground;
static QColor TableAttributeHighlightBackground;

static QColor TableColorRelationship;
static QColor TableRelationshipBackground;

static QColor DefaultValueBackground;

static QColor FileReadOnlyForeground;
static QColor FileReadOnlyBackground;

static QColor ObjectForeground;
static QColor ObjectBackground;

static QPalette AlertStatusBarPallete;
static QPalette AlertStatusBarPalleteWindow;
static QPalette WarningStatusBarPallete;
Expand Down
2 changes: 1 addition & 1 deletion src/internal/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ dbe::actions::file::remove::remove ( std::string & db_file, std::string & includ
m_include_file ( include_file )
{
setText (
QObject::tr ( "Remove Include File %1 to %2" ).arg (
QObject::tr ( "Remove Include File %1 from %2" ).arg (
QFileInfo ( QString ( m_include_file.c_str() ) ).fileName() ).arg (
QFileInfo ( QString ( m_db_file.c_str() ) ).fileName() ) );
}
Expand Down
Loading
Loading