Code Review
/
staging
/
HomeScreen.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
improve AppInfo class
[staging/HomeScreen.git]
/
HomeScreen
/
src
/
applauncherwidget.cpp
diff --git
a/HomeScreen/src/applauncherwidget.cpp
b/HomeScreen/src/applauncherwidget.cpp
index
94dd357
..
efa4c2a
100644
(file)
--- a/
HomeScreen/src/applauncherwidget.cpp
+++ b/
HomeScreen/src/applauncherwidget.cpp
@@
-18,32
+18,33
@@
#include "ui_applauncherwidget.h"
#include <include/daynightmode.hpp>
#include <QSettings>
#include "ui_applauncherwidget.h"
#include <include/daynightmode.hpp>
#include <QSettings>
+#ifdef __i386__
+ #include <QProcess>
+#endif
#define APP_LIST_COLUMN_COUNT 5
AppLauncherWidget::AppLauncherWidget(QWidget *parent) :
QWidget(parent),
mp_ui(new Ui::AppLauncherWidget),
#define APP_LIST_COLUMN_COUNT 5
AppLauncherWidget::AppLauncherWidget(QWidget *parent) :
QWidget(parent),
mp_ui(new Ui::AppLauncherWidget),
- m
p_appList(new QList<AppInfo>()
),
+ m
_appList(
),
mp_appTable(0),
mp_dBusAppFrameworkProxy()
{
mp_ui->setupUi(this);
mp_appTable(0),
mp_dBusAppFrameworkProxy()
{
mp_ui->setupUi(this);
- AppInfo ai;
+
/*
AppInfo ai;
for (int i = 0; i < 100; ++i)
{
ai.setName("test" + QString::number(i));
mp_appList->append(ai);
for (int i = 0; i < 100; ++i)
{
ai.setName("test" + QString::number(i));
mp_appList->append(ai);
- }
+ }
*/
- qDebug("D-Bus: connect to org.agl.homescreenappframeworkbinder
tizen
/AppFramework");
- mp_dBusAppFrameworkProxy = new org::agl::appframework("org.agl.homescreenappframeworkbinder
tizen
",
+ qDebug("D-Bus: connect to org.agl.homescreenappframeworkbinder /AppFramework");
+ mp_dBusAppFrameworkProxy = new org::agl::appframework("org.agl.homescreenappframeworkbinder",
"/AppFramework",
QDBusConnection::sessionBus(),
0);
"/AppFramework",
QDBusConnection::sessionBus(),
0);
-
- populateAppList();
}
AppLauncherWidget::~AppLauncherWidget()
}
AppLauncherWidget::~AppLauncherWidget()
@@
-53,7
+54,6
@@
AppLauncherWidget::~AppLauncherWidget()
{
delete mp_appTable;
}
{
delete mp_appTable;
}
- delete mp_appList;
delete mp_ui;
}
delete mp_ui;
}
@@
-64,23
+64,24
@@
void AppLauncherWidget::updateColorScheme()
"/colorschemes/" +
settings.value("systemsettings/colorscheme", "default").toString() +
"/" +
"/colorschemes/" +
settings.value("systemsettings/colorscheme", "default").toString() +
"/" +
+ QString::number(settings.value("systemsettings/proximityobjectdetected", false).toBool()) +
+ "/" +
QString::number(settings.value("systemsettings/daynightmode", SystemDayNight::DAYNIGHTMODE_DAY).toInt()) +
".ini",
QSettings::IniFormat);
QString::number(settings.value("systemsettings/daynightmode", SystemDayNight::DAYNIGHTMODE_DAY).toInt()) +
".ini",
QSettings::IniFormat);
- mp_ui->widget_Background->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Background").toString());
- mp_ui->widget_Home_Icon->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Home_Icon").toString());
+ mp_ui->widget_background->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Background").toString());
+ mp_ui->widget_homeIcon->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Home_Icon").toString());
+
+ setStyleSheet(settings_cs.value("AppLauncherWidget/common_css").toString());
}
void AppLauncherWidget::populateAppList()
{
}
void AppLauncherWidget::populateAppList()
{
- setStyleSheet("QTableWidget {background-color: transparent;}"
- "QTableCornerButton::section {background-color: transparent;}");
-
if (0 == mp_appTable)
{
mp_appTable = new QTableWidget(this);
if (0 == mp_appTable)
{
mp_appTable = new QTableWidget(this);
- QObject::connect(mp_appTable, SIGNAL(cellClicked(int,
int)), this, SLOT(on_tableView_clicked(int,
int)));
+ QObject::connect(mp_appTable, SIGNAL(cellClicked(int,
int)), this, SLOT(on_tableView_clicked(int,
int)));
}
else
{
}
else
{
@@
-99,12
+100,11
@@
void AppLauncherWidget::populateAppList()
int i;
int i;
- QStringList apps = mp_dBusAppFrameworkProxy->getAvailableAppNames();
- mp_appList->clear();
+ m_appList = mp_dBusAppFrameworkProxy->getAvailableApps();
- mp_appTable->setRowCount((
apps
.size() + (APP_LIST_COLUMN_COUNT - 1)) / APP_LIST_COLUMN_COUNT);
+ mp_appTable->setRowCount((
m_appList
.size() + (APP_LIST_COLUMN_COUNT - 1)) / APP_LIST_COLUMN_COUNT);
- if (
apps
.size() >= (9 * APP_LIST_COLUMN_COUNT))
+ if (
m_appList
.size() >= (9 * APP_LIST_COLUMN_COUNT))
{
mp_appTable->resize(1000, 1920 - 40 - 40 - 60 - 60);
}
{
mp_appTable->resize(1000, 1920 - 40 - 40 - 60 - 60);
}
@@
-120,34
+120,29
@@
void AppLauncherWidget::populateAppList()
mp_appTable->horizontalHeader()->resizeSection(i, 190);
}
mp_appTable->horizontalHeader()->resizeSection(i, 190);
}
- AppInfo ai;
- for (i = 0; i < apps.size(); ++i)
- {
- qDebug("new app: %s", apps.at(i).toStdString().c_str());
- ai.setName(apps.at(i));
- mp_appList->append(ai);
- }
-
- for (i = 0; i < mp_appList->size(); i++)
+ for (i = 0; i < m_appList.size(); i++)
{
mp_appTable->setItem(i / APP_LIST_COLUMN_COUNT,
i % APP_LIST_COLUMN_COUNT,
{
mp_appTable->setItem(i / APP_LIST_COLUMN_COUNT,
i % APP_LIST_COLUMN_COUNT,
- new QTableWidgetItem(m
p_appList->at(i).getN
ame()));
+ new QTableWidgetItem(m
_appList.at(i).n
ame()));
mp_appTable->item(i / APP_LIST_COLUMN_COUNT,
i % APP_LIST_COLUMN_COUNT)->setFlags(Qt::ItemIsEnabled);
mp_appTable->item(i / APP_LIST_COLUMN_COUNT,
i % APP_LIST_COLUMN_COUNT)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
}
mp_appTable->item(i / APP_LIST_COLUMN_COUNT,
i % APP_LIST_COLUMN_COUNT)->setFlags(Qt::ItemIsEnabled);
mp_appTable->item(i / APP_LIST_COLUMN_COUNT,
i % APP_LIST_COLUMN_COUNT)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
}
-
-
}
void AppLauncherWidget::on_tableView_clicked(int row, int col)
{
}
void AppLauncherWidget::on_tableView_clicked(int row, int col)
{
- if (m
p_appList->
size() > row * APP_LIST_COLUMN_COUNT + col)
+ if (m
_appList.
size() > row * APP_LIST_COLUMN_COUNT + col)
{
{
- int pid = mp_dBusAppFrameworkProxy->launchApp(m
p_appList->at(row * APP_LIST_COLUMN_COUNT + col).getName
());
- qDebug("%d, %d: start app %s", row, col, m
p_appList->at(row * APP_LIST_COLUMN_COUNT + col).getName
().toStdString().c_str());
+ int pid = mp_dBusAppFrameworkProxy->launchApp(m
_appList.at(row * APP_LIST_COLUMN_COUNT + col).id
());
+ qDebug("%d, %d: start app %s", row, col, m
_appList.at(row * APP_LIST_COLUMN_COUNT + col).id
().toStdString().c_str());
qDebug("pid: %d", pid);
qDebug("pid: %d", pid);
+
+ // the new app wants to be visible by default
+ newRequestsToBeVisibleApp(pid);
+
+ showAppLayer();
}
}
}
}