setupShuffleList();
setupActions();
setupMenus();
- setupUi();
+/* if (settings.value("uiflipped", false).toBool())
+ setupUiFlipped();
+ else*/
+ setupUi ();
show ();
timeLcd->display("00:00:00");
plman.addStringList(settings.value("lastPlaylist").toStringList());
"(c) 2010 Tamas Marki <tmarki@gmail.com>\n\n"
"Please send comments and bug reports to the above e-mail address.\n\n"
"Icons by http://itweek.deviantart.com/\n\n"
- "Thanks to Attila Csipa for the Diablo build"));
+ "Special thanks to Attila Csipa"));
}
void MainWindow::stateChanged(Phonon::State newState, Phonon::State /* oldState */)
playAction->setEnabled(false);
pauseAction->setEnabled(true);
stopAction->setEnabled(true);
- //lastPlayed = plman.indexOf(mediaObject->currentSource());
+ unhighlightRow(lastPlayed);
+ lastPlayed = plman.indexOf(mediaObject->currentSource());
+ highlightRow(plman.indexOf(mediaObject->currentSource()));
+ musicTable->selectRow(plman.indexOf(mediaObject->currentSource()));
break;
case Phonon::StoppedState:
setWindowTitle("TomAmp");
{
if (i < plman.size() && i >= 0)
{
- if (lastPlayed >= 0)
- unhighlightRow(lastPlayed);
+/* if (lastPlayed >= 0)
+ unhighlightRow(lastPlayed);*/
if (shuffle)
{
mediaObject->setCurrentSource(plman.at (shuffleList[i]));
shuffleAction->setCheckable(true);
shuffleAction->setChecked(shuffle);
shuffleAction->setShortcut(tr("Ctrl+H"));
+ enqueueActionButton = new QAction (tr ("E"), this);
volumeAction = new QAction(QIcon (QPixmap (":images/volume")), "", this);
volumeAction->setCheckable(true);
volumeAction->setShortcut(tr("Ctrl+V"));
connect(repeatAction, SIGNAL(triggered()), this, SLOT(repeatToggle()));
connect(shuffleAction, SIGNAL(triggered()), this, SLOT(shuffleToggle()));
connect(volumeAction, SIGNAL(triggered()), this, SLOT(volumeToggle()));
+ connect(enqueueActionButton, SIGNAL(triggered()), this, SLOT(enqueueSelected()));
connect(addFilesAction, SIGNAL(triggered()), this, SLOT(addFiles()));
connect(addFoldersAction, SIGNAL(triggered()), this, SLOT(addFolder()));
void MainWindow::play()
{
mediaObject->play();
- lastPlayed = plman.indexOf(mediaObject->currentSource());
+// lastPlayed = plman.indexOf(mediaObject->currentSource());
highlightRow(lastPlayed);
isPlaying = true;
}
void MainWindow::setupUi()
{
QToolBar *bar = new QToolBar;
+ bool flip = settings.value("uiflipped", false).toBool();
- bar->setOrientation(Qt::Vertical);
+ if(!flip) bar->setOrientation(Qt::Vertical);
bar->setStyleSheet("padding:7px");
- //bar->addAction(volumeAction);
seekSlider = new Phonon::SeekSlider(this);
seekSlider->setMediaObject(mediaObject);
+ if (flip) seekSlider->setOrientation(Qt::Vertical);
volumeSlider = new Phonon::VolumeSlider(this);
volumeSlider->setAudioOutput(audioOutput);
volumeSlider->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
- volumeSlider->setOrientation(Qt::Horizontal);
+ if (flip) volumeSlider->setOrientation(Qt::Vertical);
volumeSlider->setMuteVisible(false);
-// volumeAddedAction = bar->addWidget(volumeSlider);
-// volumeAddedAction->setVisible(false);
bar->addAction(playAction);
bar->addAction(pauseAction);
bar->addAction(stopAction);
bar->addAction(upAction);
bar->addAction(downAction);
bar->addAction(delAction);
+ bar->addAction(enqueueActionButton);
contextMenu = new QMenu (this);
enqueueAction = contextMenu->addAction(tr ("Enqueue"));
}
- QHBoxLayout *seekerLayout = new QHBoxLayout;
+ QLayout *seekerLayout;
+ QLayout *playbackLayout;
+ if (flip)
+ {
+ seekerLayout = new QVBoxLayout;
+ playbackLayout = new QHBoxLayout;
+ bar->addWidget(timeLcd);
+ }
+ else
+ {
+ seekerLayout = new QHBoxLayout;
+ playbackLayout = new QVBoxLayout;
+ }
QToolBar* bar2 = new QToolBar;
bar2->addAction(volumeAction);
seekerLayout->addWidget(bar2);
seekerLayout->addWidget(volumeSlider);
seekerLayout->addWidget(seekSlider);
- seekerLayout->addWidget(timeLcd);
-
- QVBoxLayout *playbackLayout = new QVBoxLayout;
+ if (!flip)
+ seekerLayout->addWidget(timeLcd);
volumeSlider->hide ();
playbackLayout->addWidget(bar);
QVBoxLayout *seekAndTableLayout = new QVBoxLayout;
seekAndTableLayout->addWidget(musicTable);
- seekAndTableLayout->addLayout(seekerLayout);
-
QHBoxLayout *mainLayout = new QHBoxLayout;
mainLayout->addLayout(seekAndTableLayout);
- mainLayout->addLayout(playbackLayout);
+ if (flip)
+ {
+ seekAndTableLayout->addLayout(playbackLayout);
+ mainLayout->addLayout(seekerLayout);
+ }
+ else
+ {
+ seekAndTableLayout->addLayout(seekerLayout);
+ mainLayout->addLayout(playbackLayout);
+ }
+
QWidget *widget = new QWidget;
widget->setLayout(mainLayout);
void MainWindow::showOptions ()
{
+ bool flip = settings.value("uiflipped", false).toBool();
OptionDialog* dlg = new OptionDialog (this, settings);
dlg->exec();
delete dlg;
+ if (flip != settings.value("uiflipped", false).toBool())
+ {
+ delete centralWidget();
+ setupUi ();
+ }
setOrientation ();
if (headers != settings.value("headers", QStringList ()).toStringList())
{