mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-19 14:43:30 +02:00
2021-06-19 Fred Gleason <fredg@paravelsystems.com>
* Added 'RDCartFilter::setDragEnabled()', 'RDCartFilter::showNoteBubbles()' and 'RDCartFilter::setShowNoteBubbles()' methods. * Removed 'RDCartFilter::loadConfig()' and 'RDCartFilter::saveConfig()' methods. * Added 'RDMainWindow' to rdlibrary(1). Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
5f6b72d2f4
commit
dea256d14d
@ -21927,3 +21927,10 @@
|
|||||||
* Added 'RDMainWindow' to rdcastmanager(1).
|
* Added 'RDMainWindow' to rdcastmanager(1).
|
||||||
2021-06-19 Fred Gleason <fredg@paravelsystems.com>
|
2021-06-19 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Added 'RDMainWindow' to rdcatch(1).
|
* Added 'RDMainWindow' to rdcatch(1).
|
||||||
|
2021-06-19 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Added 'RDCartFilter::setDragEnabled()',
|
||||||
|
'RDCartFilter::showNoteBubbles()' and
|
||||||
|
'RDCartFilter::setShowNoteBubbles()' methods.
|
||||||
|
* Removed 'RDCartFilter::loadConfig()' and 'RDCartFilter::saveConfig()'
|
||||||
|
methods.
|
||||||
|
* Added 'RDMainWindow' to rdlibrary(1).
|
||||||
|
@ -199,32 +199,6 @@ QSizePolicy RDCartFilter::sizePolicy() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RDCartFilter::loadConfig(RDProfile *p)
|
|
||||||
{
|
|
||||||
d_shownotes_box->setChecked(p->boolValue("RDLibrary","ShowNoteBubbles",true));
|
|
||||||
d_allowdrag_box->
|
|
||||||
setChecked(p->boolValue("RDLibrary","AllowCartDragging",false));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RDCartFilter::saveConfig(FILE *f) const
|
|
||||||
{
|
|
||||||
if(d_shownotes_box->isChecked()) {
|
|
||||||
fputs("Yes\n",f);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
fputs("No\n",f);
|
|
||||||
}
|
|
||||||
fprintf(f,"AllowCartDragging=");
|
|
||||||
if(d_allowdrag_box->isChecked()) {
|
|
||||||
fprintf(f,"Yes\n");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
fprintf(f,"No\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString RDCartFilter::filterSql(const QStringList &and_fields) const
|
QString RDCartFilter::filterSql(const QStringList &and_fields) const
|
||||||
{
|
{
|
||||||
QString sql=" where ";
|
QString sql=" where ";
|
||||||
@ -282,6 +256,12 @@ bool RDCartFilter::dragEnabled() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool RDCartFilter::showNoteBubbles() const
|
||||||
|
{
|
||||||
|
return d_shownotes_box->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
RDCart::Type RDCartFilter::showCartType() const
|
RDCart::Type RDCartFilter::showCartType() const
|
||||||
{
|
{
|
||||||
return d_show_cart_type;
|
return d_show_cart_type;
|
||||||
@ -362,6 +342,18 @@ RDLibraryModel *RDCartFilter::model() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RDCartFilter::setDragEnabled(bool state)
|
||||||
|
{
|
||||||
|
return d_allowdrag_box->setChecked(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RDCartFilter::setShowNoteBubbles(bool state)
|
||||||
|
{
|
||||||
|
d_shownotes_box->setChecked(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void RDCartFilter::setModel(RDLibraryModel *model)
|
void RDCartFilter::setModel(RDLibraryModel *model)
|
||||||
{
|
{
|
||||||
connect(this,SIGNAL(filterChanged(const QString &)),
|
connect(this,SIGNAL(filterChanged(const QString &)),
|
||||||
|
@ -41,13 +41,12 @@ class RDCartFilter : public RDWidget
|
|||||||
~RDCartFilter();
|
~RDCartFilter();
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
QSizePolicy sizePolicy() const;
|
QSizePolicy sizePolicy() const;
|
||||||
void loadConfig(RDProfile *p);
|
|
||||||
void saveConfig(FILE *f) const;
|
|
||||||
QString filterSql(const QStringList &and_fields=QStringList()) const;
|
QString filterSql(const QStringList &and_fields=QStringList()) const;
|
||||||
QString filterText() const;
|
QString filterText() const;
|
||||||
QString selectedGroup() const;
|
QString selectedGroup() const;
|
||||||
QString selectedSchedCode() const;
|
QString selectedSchedCode() const;
|
||||||
bool dragEnabled() const;
|
bool dragEnabled() const;
|
||||||
|
bool showNoteBubbles() const;
|
||||||
RDCart::Type showCartType() const;
|
RDCart::Type showCartType() const;
|
||||||
void setShowCartType(RDCart::Type type);
|
void setShowCartType(RDCart::Type type);
|
||||||
bool showTrackCarts() const;
|
bool showTrackCarts() const;
|
||||||
@ -62,6 +61,8 @@ class RDCartFilter : public RDWidget
|
|||||||
static QString typeFilter(bool incl_audio,bool incl_macro,RDCart::Type mask);
|
static QString typeFilter(bool incl_audio,bool incl_macro,RDCart::Type mask);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
void setDragEnabled(bool state);
|
||||||
|
void setShowNoteBubbles(bool state);
|
||||||
void setModel(RDLibraryModel *model);
|
void setModel(RDLibraryModel *model);
|
||||||
void setFilterText(const QString &str);
|
void setFilterText(const QString &str);
|
||||||
void setSelectedGroup(const QString &grpname);
|
void setSelectedGroup(const QString &grpname);
|
||||||
|
@ -57,6 +57,7 @@ dist_rdlibrary_SOURCES = audio_cart.cpp audio_cart.h\
|
|||||||
libraryview.cpp libraryview.h\
|
libraryview.cpp libraryview.h\
|
||||||
list_reports.cpp list_reports.h\
|
list_reports.cpp list_reports.h\
|
||||||
macro_cart.cpp macro_cart.h\
|
macro_cart.cpp macro_cart.h\
|
||||||
|
mainwindow.cpp mainwindow.h\
|
||||||
notebubble.cpp notebubble.h\
|
notebubble.cpp notebubble.h\
|
||||||
rdlibrary.cpp rdlibrary.h\
|
rdlibrary.cpp rdlibrary.h\
|
||||||
record_cut.cpp record_cut.h\
|
record_cut.cpp record_cut.h\
|
||||||
@ -73,6 +74,7 @@ nodist_rdlibrary_SOURCES = moc_audio_cart.cpp\
|
|||||||
moc_libraryview.cpp\
|
moc_libraryview.cpp\
|
||||||
moc_list_reports.cpp\
|
moc_list_reports.cpp\
|
||||||
moc_macro_cart.cpp\
|
moc_macro_cart.cpp\
|
||||||
|
moc_mainwindow.cpp\
|
||||||
moc_notebubble.cpp\
|
moc_notebubble.cpp\
|
||||||
moc_rdlibrary.cpp\
|
moc_rdlibrary.cpp\
|
||||||
moc_record_cut.cpp
|
moc_record_cut.cpp
|
||||||
|
66
rdlibrary/mainwindow.cpp
Normal file
66
rdlibrary/mainwindow.cpp
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
// mainwindow.cpp
|
||||||
|
//
|
||||||
|
// Top-level window for rdlibrary(1)
|
||||||
|
//
|
||||||
|
// (C) Copyright 2021 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
|
||||||
|
// published by the Free Software Foundation.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public
|
||||||
|
// License along with this program; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
MainWindow::MainWindow(const QString &cmdname,RDConfig *c,Qt::WindowFlags f)
|
||||||
|
: RDMainWindow(cmdname,c,f)
|
||||||
|
{
|
||||||
|
d_show_note_bubbles=false;
|
||||||
|
d_drag_enabled=false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool MainWindow::showNoteBubbles() const
|
||||||
|
{
|
||||||
|
return d_show_note_bubbles;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::setShowNoteBubbles(bool state)
|
||||||
|
{
|
||||||
|
d_show_note_bubbles=state;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool MainWindow::dragEnabled() const
|
||||||
|
{
|
||||||
|
return d_drag_enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::setDragEnabled(bool state)
|
||||||
|
{
|
||||||
|
d_drag_enabled=state;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::loadLocalSettings(RDProfile *p)
|
||||||
|
{
|
||||||
|
d_show_note_bubbles=p->intValue(commandName(),"ShowNoteBubbles");
|
||||||
|
d_drag_enabled=p->intValue(commandName(),"DragEnabled");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::saveLocalSettings(FILE *f) const
|
||||||
|
{
|
||||||
|
fprintf(f,"ShowNoteBubbles=%d\n",d_show_note_bubbles);
|
||||||
|
fprintf(f,"DragEnabled=%d\n",d_drag_enabled);
|
||||||
|
}
|
46
rdlibrary/mainwindow.h
Normal file
46
rdlibrary/mainwindow.h
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
// mainwindow.h
|
||||||
|
//
|
||||||
|
// Top-level window for rdlibrary(1)
|
||||||
|
//
|
||||||
|
// (C) Copyright 2021 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
|
||||||
|
// published by the Free Software Foundation.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public
|
||||||
|
// License along with this program; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef MAINWINDOW_H
|
||||||
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
|
#include <rdmainwindow.h>
|
||||||
|
|
||||||
|
class MainWindow : public RDMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT;
|
||||||
|
public:
|
||||||
|
MainWindow(const QString &cmdname,RDConfig *c,Qt::WindowFlags f=0);
|
||||||
|
bool showNoteBubbles() const;
|
||||||
|
void setShowNoteBubbles(bool state);
|
||||||
|
bool dragEnabled() const;
|
||||||
|
void setDragEnabled(bool state);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void loadLocalSettings(RDProfile *p);
|
||||||
|
void saveLocalSettings(FILE *f) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool d_show_note_bubbles;
|
||||||
|
bool d_drag_enabled;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // MAINWINDOW_H
|
@ -55,7 +55,7 @@ bool audio_changed;
|
|||||||
void SigHandler(int signo);
|
void SigHandler(int signo);
|
||||||
|
|
||||||
MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||||
: RDWidget(c,parent)
|
: MainWindow("rdlibrary",c)
|
||||||
{
|
{
|
||||||
QString err_msg;
|
QString err_msg;
|
||||||
|
|
||||||
@ -844,36 +844,20 @@ QString MainWidget::GeometryFile() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWidget::LoadGeometry()
|
void MainWidget::LoadGeometry()
|
||||||
{
|
{
|
||||||
QString geometry_file=GeometryFile();
|
loadSettings(true);
|
||||||
if(geometry_file.isEmpty()) {
|
lib_cart_filter->setDragEnabled(dragEnabled());
|
||||||
return;
|
lib_cart_filter->setShowNoteBubbles(showNoteBubbles());
|
||||||
}
|
|
||||||
RDProfile *profile=new RDProfile();
|
|
||||||
profile->setSource(geometry_file);
|
|
||||||
resize(profile->intValue("RDLibrary","Width",sizeHint().width()),
|
|
||||||
profile->intValue("RDLibrary","Height",sizeHint().height()));
|
|
||||||
lib_cart_filter->loadConfig(profile);
|
|
||||||
|
|
||||||
delete profile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWidget::SaveGeometry()
|
void MainWidget::SaveGeometry()
|
||||||
{
|
{
|
||||||
QString geometry_file=GeometryFile();
|
setDragEnabled(lib_cart_filter->dragEnabled());
|
||||||
FILE *file=fopen(geometry_file.toUtf8(),"w");
|
setShowNoteBubbles(lib_cart_filter->showNoteBubbles());
|
||||||
if(file==NULL) {
|
saveSettings();
|
||||||
return;
|
|
||||||
}
|
|
||||||
fprintf(file,"[RDLibrary]\n");
|
|
||||||
fprintf(file,"Width=%d\n",geometry().width());
|
|
||||||
fprintf(file,"Height=%d\n",geometry().height());
|
|
||||||
fprintf(file,"ShowNoteBubbles=");
|
|
||||||
lib_cart_filter->saveConfig(file);
|
|
||||||
|
|
||||||
fclose(file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include "disk_gauge.h"
|
#include "disk_gauge.h"
|
||||||
#include "libraryview.h"
|
#include "libraryview.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
#define RDLIBRARY_GEOMETRY_FILE ".rdlibrary"
|
#define RDLIBRARY_GEOMETRY_FILE ".rdlibrary"
|
||||||
#define RDLIBRARY_STEP_SIZE 5000
|
#define RDLIBRARY_STEP_SIZE 5000
|
||||||
@ -47,7 +48,7 @@
|
|||||||
|
|
||||||
#define RDLIBRARY_USAGE "[--profile-ripping]\n\n--profile-ripping\n Print profiling information to stdout when performing rips from\n optical media.\n\n"
|
#define RDLIBRARY_USAGE "[--profile-ripping]\n\n--profile-ripping\n Print profiling information to stdout when performing rips from\n optical media.\n\n"
|
||||||
|
|
||||||
class MainWidget : public RDWidget
|
class MainWidget : public MainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user