Remember most recently used printer. (#215)
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "Settings.h"
|
||||
|
||||
#include <QLocale>
|
||||
#include <QPrinterInfo>
|
||||
#include <QString>
|
||||
#include <QtDebug>
|
||||
|
||||
@@ -356,5 +357,23 @@ namespace glabels
|
||||
emit mInstance->changed();
|
||||
}
|
||||
|
||||
|
||||
QString Settings::recentPrinter()
|
||||
{
|
||||
mInstance->beginGroup( "Recent" );
|
||||
QString printer = mInstance->value( "printer", QPrinterInfo::defaultPrinterName() ).toString();
|
||||
mInstance->endGroup();
|
||||
|
||||
return printer;
|
||||
}
|
||||
|
||||
|
||||
void Settings::setRecentPrinter( const QString& printer )
|
||||
{
|
||||
mInstance->beginGroup( "Recent" );
|
||||
mInstance->setValue( "printer", printer );
|
||||
mInstance->endGroup();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,6 +98,9 @@ namespace glabels
|
||||
static QStringList recentFileList();
|
||||
static void addToRecentFileList( const QString& filePath );
|
||||
|
||||
static QString recentPrinter();
|
||||
static void setRecentPrinter( const QString& printer );
|
||||
|
||||
|
||||
private:
|
||||
static Settings* mInstance;
|
||||
|
||||
Reference in New Issue
Block a user