Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/download'
Browse files Browse the repository at this point in the history
  • Loading branch information
dridk committed Sep 15, 2013
2 parents 00988ce + 1cca8eb commit 33f3930
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 18 deletions.
17 changes: 11 additions & 6 deletions gui/common/abstractmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,25 @@ AbstractMainWindow::AbstractMainWindow(QWidget *parent) :
mStatusLabel->setPixmap(QPixmap(":low"));
statusBar()->addPermanentWidget(mStatusLabel);

setAttribute(Qt::WA_DeleteOnClose);

}

AbstractMainWindow::~AbstractMainWindow()
{
delete mFbx;
delete mStatusLabel;
}

void AbstractMainWindow::login()
{

qDebug()<<qApp->applicationName();
fbx()->setApplicationId("org.labsquare" + qApp->applicationName());
fbx()->requestLogin();
fbx()->loadApplicationToken();
if (fbx()->applicationToken().isEmpty())
authorize();
else {
fbx()->setApplicationId("org.labsquare" + qApp->applicationName());
fbx()->requestLogin();
}
}

void AbstractMainWindow::authorize()
Expand Down Expand Up @@ -93,8 +98,8 @@ void AbstractMainWindow::showAboutDialog()

void AbstractMainWindow::showAccountDialog()
{
// AccountListDialog dialog(this);
// dialog.exec();
// AccountListDialog dialog(this);
// dialog.exec();

}

Expand Down
35 changes: 26 additions & 9 deletions gui/common/launcherwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,47 @@ LauncherWidget::LauncherWidget(QWidget *parent) :
setMovement(QListView::Static);
setFlow(QListView::LeftToRight);

addView(new FSMainWindow);
addView(new DLMainWindow);


setWindowTitle("freebox-desktop");
resize(480,300);
setIconSize(QSize(80,80));
setSpacing(10);

connect(this,SIGNAL(doubleClicked(QModelIndex)),
this,SLOT(launch(QModelIndex)));

QListWidgetItem * item1 = new QListWidgetItem;
item1->setText("Téléchargement");
item1->setIcon(QIcon(":main_dl.png"));
addItem(item1);

QListWidgetItem * item2 = new QListWidgetItem;
item2->setText("Explorateur de fichiers");
item2->setIcon(QIcon(":main_fs.png"));
addItem(item2);



connect(this,SIGNAL(doubleClicked(QModelIndex)), this,SLOT(launch(QModelIndex)));

}

void LauncherWidget::launch(const QModelIndex &index)
{
if (index.row() == 0)
{
FSMainWindow * win = new FSMainWindow;
win->show();
return;
}

if (index.row() < mViews.count()){

mViews.at(index.row())->show();

if (index.row() == 1)
{
DLMainWindow * win = new DLMainWindow;
win->show();
return;
}



}

void LauncherWidget::addView(AbstractMainWindow *view)
Expand Down
12 changes: 9 additions & 3 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,29 @@ int main(int argc, char *argv[])
QCoreApplication::setOrganizationName("labsquare");
QCoreApplication::setOrganizationDomain("org.labsquare");
QCoreApplication::setApplicationName("Freebox Desktop");
QCoreApplication::setApplicationVersion("beta");
QCoreApplication::setApplicationVersion("alpha test");

LauncherWidget launcherWindow ;
DLMainWindow downloadWindow ;


if (QCoreApplication::arguments().count() > 1)
{

QString path = QCoreApplication::arguments().value(1);
DLMainWindow downloadWindow ;

downloadWindow.addFile(path);
downloadWindow.show();

}

else
else {
// LauncherWidget * launcherWindow ;
// launcherWindow->show();

launcherWindow.show();

}



Expand Down

0 comments on commit 33f3930

Please sign in to comment.