mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-09 14:33:28 +02:00
2020-05-22 Fred Gleason <fredg@paravelsystems.com>
* Added 'RDListView::NumericSort' to the 'RDListView::SortType' enumeration. * Fixed a bug in rdlibrary(1) that caused cuts to be incorrectly sorted when scheduled 'By Specified Order'.
This commit is contained in:
parent
0ba49d3e28
commit
f51f39be11
@ -19838,3 +19838,8 @@
|
||||
Sound Panel panels by means of the mouse wheel.
|
||||
2020-05-19 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Incremented the package version to 3.4.0.
|
||||
2020-05-22 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added 'RDListView::NumericSort' to the 'RDListView::SortType'
|
||||
enumeration.
|
||||
* Fixed a bug in rdlibrary(1) that caused cuts to be incorrectly
|
||||
sorted when scheduled 'By Specified Order'.
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A contiguous-selection only QListView widget for Rivendell
|
||||
//
|
||||
// (C) Copyright 2002-2003,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -31,7 +31,7 @@ class RDListView : public Q3ListView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum SortType {NormalSort=0,TimeSort=1,LineSort=2,GpioSort=3};
|
||||
enum SortType {NormalSort=0,TimeSort=1,LineSort=2,GpioSort=3,NumericSort=4};
|
||||
RDListView(QWidget *parent);
|
||||
int hardSortColumn() const;
|
||||
void setHardSortColumn(int col);
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A color-selectable QListViewItem class for Rivendell
|
||||
//
|
||||
// (C) Copyright 2002-2004,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -174,6 +174,8 @@ int RDListViewItem::compare(Q3ListViewItem *i,int col,bool ascending) const
|
||||
int length;
|
||||
QStringList fields;
|
||||
QStringList prev_fields;
|
||||
int this_num;
|
||||
int that_num;
|
||||
|
||||
if((hard_column=list_parent->hardSortColumn())<0) {
|
||||
switch(list_parent->columnSortType(col)) {
|
||||
@ -207,6 +209,17 @@ int RDListViewItem::compare(Q3ListViewItem *i,int col,bool ascending) const
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case RDListView::NumericSort:
|
||||
this_num=text(col).toInt();
|
||||
that_num=i->text(col).toInt();
|
||||
if(this_num>that_num) {
|
||||
return 1;
|
||||
}
|
||||
if(this_num<that_num) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case RDListView::NormalSort:
|
||||
return Q3ListViewItem::compare(i,col,ascending);
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// The audio cart editor for RDLibrary.
|
||||
//
|
||||
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -102,7 +102,7 @@ AudioCart::AudioCart(AudioControls *controls,RDCart *cart,QString *path,
|
||||
rdcart_cut_list->setAllColumnsShowFocus(true);
|
||||
rdcart_cut_list->setSelectionMode(Q3ListView::Extended);
|
||||
rdcart_cut_list->setItemMargin(5);
|
||||
rdcart_cut_list->setSorting(11);
|
||||
rdcart_cut_list->setSorting(12);
|
||||
connect(rdcart_cut_list,
|
||||
SIGNAL(doubleClicked(Q3ListViewItem *,const QPoint &,int)),
|
||||
this,
|
||||
@ -110,7 +110,7 @@ AudioCart::AudioCart(AudioControls *controls,RDCart *cart,QString *path,
|
||||
|
||||
rdcart_cut_list->addColumn(tr("Wt"));
|
||||
rdcart_cut_list->setColumnAlignment(0,Qt::AlignHCenter);
|
||||
rdcart_cut_list->setColumnSortType(0,RDListView::LineSort);
|
||||
rdcart_cut_list->setColumnSortType(0,RDListView::NumericSort);
|
||||
|
||||
rdcart_cut_list->addColumn(tr("Description"));
|
||||
rdcart_cut_list->setColumnAlignment(1,Qt::AlignLeft);
|
||||
@ -268,9 +268,11 @@ void AudioCart::changeCutScheduling(int sched)
|
||||
}
|
||||
if(sched) {
|
||||
rdcart_cut_list->setColumnText(0,tr("Wt"));
|
||||
rdcart_cut_list->setSortColumn(12);
|
||||
}
|
||||
else {
|
||||
rdcart_cut_list->setColumnText(0,tr("Ord"));
|
||||
rdcart_cut_list->setSortColumn(0);
|
||||
}
|
||||
rdcart_use_weighting=sched!=0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user