Read about our upcoming Code of Conduct on this issue

Commit be059788 authored by vlad_burin's avatar vlad_burin
Browse files

Added features to GUI for working with "rebuilding" Storage.

Added mock-classes display in ClassesList

--HG--
branch : MockCompsTest
parent d18fd1fd844e
......@@ -293,6 +293,28 @@ void UClassesListWidget::tab0_textChanged(const QString &arg1)
RTclassesNames += libClasses;
}
// Mock
storage->GetMocklibsNameList(buff);
QStringList MockLibsNames = QString(buff.c_str()).split(",");
// Mock
QStringList MockClassesNames;
foreach(str, MockLibsNames)
{
const char * stringBuff;
stringBuff = Storage_GetLibraryClassNames(str.toLocal8Bit());
//
if((stringBuff[0] == '\0'))
{
Engine_FreeBufString(stringBuff);
continue;
}
QStringList libClasses = QString(stringBuff).split(",");
Engine_FreeBufString(stringBuff);
MockClassesNames += libClasses;
}
//
const char * stringBuff = Storage_GetClassesNameList();
......@@ -306,6 +328,10 @@ void UClassesListWidget::tab0_textChanged(const QString &arg1)
if (str.contains(arg1, Qt::CaseInsensitive))
{
QListWidgetItem* item = new QListWidgetItem(ui->listWidgetStorageByName);
if(MockClassesNames.indexOf(str)!=-1)
item->setTextColor(Qt::darkYellow);
if(RTclassesNames.indexOf(str)!=-1)
item->setTextColor(Qt::darkCyan);
item->setText(str);
......@@ -344,17 +370,48 @@ void UClassesListWidget::tab1_textChanged(const QString &arg1)
RTclassesNames += libClasses;
}
//
// Mock
storage->GetMocklibsNameList(buff);
QStringList MockLibsNames = QString(buff.c_str()).split(",");
// Mock
QStringList MockClassesNames;
foreach(str, MockLibsNames)
{
const char * stringBuff;
stringBuff = Storage_GetLibraryClassNames(str.toLocal8Bit());
//
if((stringBuff[0] == '\0'))
{
Engine_FreeBufString(stringBuff);
continue;
}
QStringList libClasses = QString(stringBuff).split(",");
Engine_FreeBufString(stringBuff);
MockClassesNames += libClasses;
}
//
const char * stringBuff = Storage_GetClassLibrariesList();
QStringList componentNames = QString(stringBuff).split(",");
Engine_FreeBufString(stringBuff);
bool isRTlib = false;
bool isMocklib = false;
foreach(str, componentNames)
{
if(str != "")
{
isMocklib = false;
isRTlib = false;
// Mock
if(MockLibsNames.indexOf(str)!=-1)
isMocklib = true;
// RT
if(RTlibsNames.indexOf(str)!=-1)
isRTlib = true;
......@@ -364,6 +421,8 @@ void UClassesListWidget::tab1_textChanged(const QString &arg1)
QTreeWidgetItem* item = new QTreeWidgetItem(ui->treeWidgetStorageByLibs);
item->setExpanded(true);
item->setText(0, str);
if(isMocklib)
item->setTextColor(0,Qt::darkMagenta);
if(isRTlib)
item->setTextColor(0,Qt::darkBlue);
stringBuff = Storage_GetLibraryClassNames(str.toLocal8Bit());
......@@ -376,6 +435,8 @@ void UClassesListWidget::tab1_textChanged(const QString &arg1)
{
QTreeWidgetItem* classItem = new QTreeWidgetItem(item);
classItem->setText(0, className);
if(isMocklib)
classItem->setTextColor(0,Qt::darkYellow);
if(isRTlib)
classItem->setTextColor(0,Qt::darkCyan);
}
......@@ -388,6 +449,8 @@ void UClassesListWidget::tab1_textChanged(const QString &arg1)
bool isLibFind = false;
item->setExpanded(true);
item->setText(0, str);
if(isMocklib)
item->setTextColor(0,Qt::darkMagenta);
if(isRTlib)
item->setTextColor(0,Qt::darkBlue);
stringBuff = Storage_GetLibraryClassNames(str.toLocal8Bit());
......@@ -401,6 +464,8 @@ void UClassesListWidget::tab1_textChanged(const QString &arg1)
isLibFind = true;
QTreeWidgetItem* classItem = new QTreeWidgetItem(item);
classItem->setText(0, className);
if(isMocklib)
classItem->setTextColor(0,Qt::darkYellow);
if(isRTlib)
classItem->setTextColor(0,Qt::darkCyan);
}
......@@ -817,3 +882,8 @@ DeleteDialog::DeleteDialog(QString title, QString message, QWidget* pwgt)
vbox_layout->addLayout(hbox_layout);
setLayout(vbox_layout);
}
void UClassesListWidget::on_tabWidget_currentChanged(int index)
{
on_lineEditSearch_textChanged("");
}
......@@ -62,7 +62,6 @@ private slots:
void tab1_textChanged(const QString &arg1);
void tab2_textChanged(const QString &arg1);
public slots:
//
// /
......@@ -73,6 +72,8 @@ public slots:
void AddNewClass(QString cur_lib = "");
void DeleteClass();
void on_tabWidget_currentChanged(int index);
private:
UDrawEngineImageWidget* ModelScheme;
Ui::UClassesListWidget *ui;
......
......@@ -10,7 +10,7 @@ UDrawEngineWidget::UDrawEngineWidget(QWidget *parent, RDK::UApplication *app) :
CheckModelFlag=false;
ui->setupUi(this);
classesList = new UClassesListWidget(this);
classesList = new UClassesListWidget(this,app);
ui->verticalLayoutForClassesList->addWidget(classesList);
// QRect rect= classesList->geometry();
......@@ -109,3 +109,8 @@ void UDrawEngineWidget::updateScheme(bool reloadXml)
{
modelScheme->reDrawScheme(reloadXml);
}
void UDrawEngineWidget::updateClassesList()
{
classesList->on_tabWidget_currentChanged(0);
}
......@@ -40,6 +40,7 @@ public slots:
void componentSingleClick(QString name);
void updateScheme(bool reloadXml);
void updateClassesList();
signals:
void componentSelectedFromScheme(QString name);
......
......@@ -147,6 +147,12 @@ UGEngineControllWidget::UGEngineControllWidget(QWidget *parent, RDK::UApplicatio
connect(ui->actionConfigOptions, SIGNAL(triggered(bool)), this, SLOT(actionConfigOptions()));
updateShemeClassesList();
connect(ui->actionBuildMode1, SIGNAL(triggered(bool)), this, SLOT(actionBuildMode1()));
connect(ui->actionBuildMode2, SIGNAL(triggered(bool)), this, SLOT(actionBuildMode2()));
connect(ui->actionBuildMode3, SIGNAL(triggered(bool)), this, SLOT(actionBuildMode3()));
connect(ui->actionCreateSaveMockLibs, SIGNAL(triggered(bool)), this, SLOT(actionCreateSaveMockLibs()));
connect(ui->actionExit, SIGNAL(triggered(bool)), this, SLOT(actionExit()));
......@@ -379,6 +385,69 @@ void UGEngineControllWidget::actionConfigOptions()
createConfigurationWizardWidget->show();
}
void UGEngineControllWidget::actionCreateSaveMockLibs()
{
RDK::UELockPtr<RDK::UStorage> storage = RDK::GetStorageLock();
if(!storage)
return;
storage->CreateMockLibs();
storage->SaveMockLibs();
}
void UGEngineControllWidget::updateShemeClassesList()
{
drawEngine->updateScheme(true);
drawEngine->updateClassesList();
int build_mode = application->GetStorageBuildMode();
ui->menuChooseBuildStorageMode->setTitle("Choose Build Storage Mode [" + QString::number(build_mode) +"]");
}
void UGEngineControllWidget::actionBuildMode1()
{
int build_mode = application->GetStorageBuildMode();
if(build_mode == 1)
{
return;
}
else
{
application->SetStorageBuildMode(1);
updateShemeClassesList();
}
}
void UGEngineControllWidget::actionBuildMode2()
{
int build_mode = application->GetStorageBuildMode();
if(build_mode == 2)
{
return;
}
else
{
application->SetStorageBuildMode(2);
updateShemeClassesList();
}
}
void UGEngineControllWidget:: actionBuildMode3()
{
int build_mode = application->GetStorageBuildMode();
if(build_mode == 3)
{
return;
}
else
{
application->SetStorageBuildMode(3);
updateShemeClassesList();
}
}
//chanels menu actions:
void UGEngineControllWidget::actionAddNew()
{
......
......@@ -105,6 +105,10 @@ public slots:
void actionCopyConfig();
void actionExit();
void actionConfigOptions();
void actionCreateSaveMockLibs();
void actionBuildMode1();
void actionBuildMode2();
void actionBuildMode3();
//chanels menu
void actionAddNew();
......@@ -204,6 +208,11 @@ private:
///
void delWatchesWidged(size_t index);
/// ,
/// Choose Storage Build Mode [N]
/// ()
void updateShemeClassesList();
};
/// QMdiSubwindow
......
......@@ -73,6 +73,14 @@
<property name="title">
<string>File</string>
</property>
<widget class="QMenu" name="menuChooseBuildStorageMode">
<property name="title">
<string>Choose Build Storage Mode</string>
</property>
<addaction name="actionBuildMode1"/>
<addaction name="actionBuildMode2"/>
<addaction name="actionBuildMode3"/>
</widget>
<addaction name="actionCreateConfig"/>
<addaction name="actionLoadConfig"/>
<addaction name="actionSaveConfig"/>
......@@ -83,6 +91,8 @@
<addaction name="actionApplicationOptions"/>
<addaction name="actionClassesDescriptio"/>
<addaction name="separator"/>
<addaction name="menuChooseBuildStorageMode"/>
<addaction name="separator"/>
<addaction name="actionCreateModel"/>
<addaction name="actionLoadModel"/>
<addaction name="actionSaveModel"/>
......@@ -96,6 +106,8 @@
<addaction name="actionSaveCommonDescriptions"/>
<addaction name="actionSaveClassesDescriptions"/>
<addaction name="separator"/>
<addaction name="actionCreateSaveMockLibs"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menuChannels">
......@@ -671,6 +683,29 @@
<string>TcpServer</string>
</property>
</action>
<action name="actionCreateSaveMockLibs">
<property name="text">
<string>Create and Save Mock Libs</string>
</property>
<property name="toolTip">
<string>Create and Save Mock Libs</string>
</property>
</action>
<action name="actionBuildMode1">
<property name="text">
<string>Build Mode 1 (Static -&gt; RT)</string>
</property>
</action>
<action name="actionBuildMode2">
<property name="text">
<string>Build Mode 2 (Static -&gt; Mock -&gt; RT)</string>
</property>
</action>
<action name="actionBuildMode3">
<property name="text">
<string>Build Mode 3 (Mock -&gt; RT)</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment