changed tooltip for first columns
This commit is contained in:
+43
-5
@@ -249,12 +249,12 @@ void cMainWindow::displaySeries()
|
||||
QIcon icon(":/128279.png");
|
||||
QTreeWidgetItem* lpSelected = 0;
|
||||
|
||||
for(int z = 0;z < m_serieList.count();z++)
|
||||
for(int serie = 0;serie < m_serieList.count();serie++)
|
||||
{
|
||||
cSerie* lpSerie = m_serieList.at(z);
|
||||
cSerie* lpSerie = m_serieList.at(serie);
|
||||
|
||||
QTreeWidgetItem* lp0 = new QTreeWidgetItem(ui->m_lpSeriesList);
|
||||
lp0->setText(0, QString("%1").arg(z+1));
|
||||
lp0->setText(0, QString("%1").arg(serie+1));
|
||||
lp0->setTextAlignment(0, Qt::AlignRight);
|
||||
lp0->setData(0, Qt::UserRole, QVariant::fromValue(lpSerie));
|
||||
|
||||
@@ -266,14 +266,16 @@ void cMainWindow::displaySeries()
|
||||
bool bHasProg = false;
|
||||
bool bHasDone = false;
|
||||
|
||||
QString szOpen;
|
||||
|
||||
QList<cSeason*> seasonList = lpSerie->seasonList();
|
||||
for(int z = 0;z < seasonList.count();z++)
|
||||
for(int season = 0;season < seasonList.count();season++)
|
||||
{
|
||||
QString szInit = "";
|
||||
QString szProg = "";
|
||||
QString szDone = "";
|
||||
|
||||
cSeason* lpSeason = seasonList.at(z);
|
||||
cSeason* lpSeason = seasonList.at(season);
|
||||
lp0->setData(lpSeason->number()+3-iMin, Qt::UserRole, QVariant::fromValue(lpSeason));
|
||||
|
||||
for(int y = 0;y < lpSeason->episodeList().count();y++)
|
||||
@@ -317,6 +319,17 @@ void cMainWindow::displaySeries()
|
||||
else
|
||||
szTooltip.append("open: " + szInit + "\n");
|
||||
|
||||
if(lpSeason->number())
|
||||
{
|
||||
if(szOpen.length())
|
||||
szOpen += "\n";
|
||||
|
||||
if(szInit.isEmpty())
|
||||
szOpen += QString("Season %1: none").arg(lpSeason->number(), 2, 10, QChar('0'));
|
||||
else
|
||||
szOpen += QString("Season %1: %2").arg(lpSeason->number(), 2, 10, QChar('0')).arg(szInit);
|
||||
}
|
||||
|
||||
if(szProg.isEmpty())
|
||||
szTooltip.append("in progress: none\n");
|
||||
else
|
||||
@@ -384,7 +397,12 @@ void cMainWindow::displaySeries()
|
||||
lpSelected = lp0;
|
||||
}
|
||||
}
|
||||
|
||||
lp0->setToolTip(0, szOpen);
|
||||
lp0->setToolTip(1, szOpen);
|
||||
lp0->setToolTip(2, szOpen);
|
||||
}
|
||||
|
||||
for(int z = 0;z < ui->m_lpSeriesList->columnCount();z++)
|
||||
ui->m_lpSeriesList->resizeColumnToContents(z);
|
||||
|
||||
@@ -788,3 +806,23 @@ void cMainWindow::picturesDone()
|
||||
delete m_lpMessageDialog;
|
||||
m_lpMessageDialog = 0;
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpSeriesList_pressed(const QModelIndex &index)
|
||||
{
|
||||
switch(QGuiApplication::mouseButtons())
|
||||
{
|
||||
case Qt::MiddleButton:
|
||||
if(ui->m_lpSeriesList->selectedItems().count() == 1)
|
||||
{
|
||||
cSerie* lpSerie = ui->m_lpSeriesList->selectedItems().at(0)->data(0, Qt::UserRole).value<cSerie*>();
|
||||
if(lpSerie)
|
||||
{
|
||||
if(!lpSerie->download().isEmpty())
|
||||
onActionGotoDownload();
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ private slots:
|
||||
void picturesMessage(const QString& szMessage, const qint32 &iProgress);
|
||||
void picturesAppendMessage(const QString& szMessage);
|
||||
void picturesDone();
|
||||
void on_m_lpSeriesList_pressed(const QModelIndex &index);
|
||||
|
||||
private:
|
||||
Ui::cMainWindow* ui;
|
||||
cSerieList m_serieList;
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user