[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kolor-manager] /: add Synnefo dependency
From: Kai-Uwe Behrmann <ku.b () gmx ! de>
Date: 2014-11-11 10:49:56
Message-ID: E1Xo91I-0005mD-5F () scm ! kde ! org
[Download RAW message or body]
Git commit 7ff2316bfef735d7226a692178222e3ffe95fd27 by Kai-Uwe Behrmann.
Committed on 15/09/2014 at 01:46.
Pushed by behrmann into branch 'master'.
add Synnefo dependency
M +5 -3 CMakeLists.txt
M +1 -2 README
M +3 -10 devices/CMakeLists.txt
M +8 -678 devices/kmdevices.cpp
M +3 -143 devices/kmdevices.h
D +0 -188 devices/kmdevices.ui
M +1 -10 information/CMakeLists.txt
M +8 -511 information/kminfo.cpp
M +3 -80 information/kminfo.h
D +0 -738 information/kminfo.ui
M +3 -10 settings/CMakeLists.txt
M +7 -668 settings/kmsettings.cpp
M +3 -99 settings/kmsettings.h
D +0 -860 settings/kmsettings.ui
http://commits.kde.org/kolor-manager/7ff2316bfef735d7226a692178222e3ffe95fd27
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a227fa8..aa8cd0b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,16 +9,18 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
# project version
SET( ${PROJECT_NAME}_MAJOR_VERSION 1)
-SET( ${PROJECT_NAME}_MINOR_VERSION 0)
-SET( ${PROJECT_NAME}_MICRO_VERSION 2)
+SET( ${PROJECT_NAME}_MINOR_VERSION 1)
+SET( ${PROJECT_NAME}_MICRO_VERSION 0)
SET( ${PROJECT_NAME}_VERSION \
${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_MICRO_VERSION} \
)
FIND_PACKAGE(KDE4 REQUIRED )
FIND_PACKAGE(Oyranos REQUIRED)
FIND_PACKAGE(Xcm REQUIRED) # for KolorServer
+FIND_PACKAGE(Synnefo REQUIRED)
+
-INCLUDE_DIRECTORIES(${KDE4_INCLUDES} ${OYRANOS_INCLUDE_DIRS} ${XCM_INCLUDE_DIRS})
+INCLUDE_DIRECTORIES(${KDE4_INCLUDES} ${OYRANOS_INCLUDE_DIRS} ${XCM_INCLUDE_DIRS} \
${SYNNEFO_INCLUDE_DIR}) LINK_DIRECTORIES(
${KDE4_LIBRARY_DIRS}
${OYRANOS_LIBRARY_DIRS}
diff --git a/README b/README
index fa946af..50f118d 100644
--- a/README
+++ b/README
@@ -15,6 +15,7 @@ KolorServer maintained by Casian Andrei 2012
- The v1.0.2 tagged release builds fine using Oyranos-0.9.5 .
- Actual git should the latest Oyranos from it's git repository. KolorManager gets \
updated pretty quick to Oyranos changes. +- Synnefo's libsynnefo is used for the \
program logic
-----INSTALLATION----------------------------------------------------
@@ -83,8 +84,6 @@ kquitapp kded; sleep 1s; kdeinit4_wrapper kded4
-----MAJOR CHANGES FROM LAST TEST BUILDS---------------------------------------
GENERAL
--Icons should now be visible (kmdevices/kminfo)
--Column widths are now tidied up.
-----CURRENT ISSUES (FIXME)----------------------------------------------------
diff --git a/devices/CMakeLists.txt b/devices/CMakeLists.txt
index 0ed2f31..ef386c1 100644
--- a/devices/CMakeLists.txt
+++ b/devices/CMakeLists.txt
@@ -1,9 +1,6 @@
-
-find_package(KDE4 REQUIRED)
-include_directories(${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
-
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
INCLUDE( ${QT_USE_FILE} )
-
+
set(kmdevices_PART_SRCS
kmdevices.cpp
)
@@ -13,14 +10,10 @@ set(kmdevices_RCCS
QT4_ADD_RESOURCES(kmdevices_RCC_SRCS ${kmdevices_RCCS})
-kde4_add_ui_files(kmdevices_PART_SRCS kmdevices.ui)
-
kde4_add_plugin(kmdevices ${kmdevices_PART_SRCS} ${kmdevices_RCC_SRCS})
-target_link_libraries(kmdevices ${KDE4_KFILE_LIBS} ${KDE4_KNEWSTUFF2_LIBS} \
${KDE4_KDEUI_LIBS} ${OYRANOS_LIBRARIES} ${QT_LIBRARIES} ) \
+target_link_libraries(kmdevices ${SYNNEFO_LIBRARIES} ${KDE4_KDEUI_LIBS} \
${QT_LIBRARIES} )
install(TARGETS kmdevices DESTINATION ${PLUGIN_INSTALL_DIR})
install( FILES kmdevices.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
-
-
diff --git a/devices/kmdevices.cpp b/devices/kmdevices.cpp
index 01c7dea..10371cd 100644
--- a/devices/kmdevices.cpp
+++ b/devices/kmdevices.cpp
@@ -26,36 +26,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "kmdevices.h"
-#include <KComponentData>
#include <KGenericFactory>
-#include <KGlobal>
-#include <KGlobalSettings>
-#include <KInputDialog>
-#include <KListWidget>
-#include <KMessageBox>
-#include <KStandardDirs>
-#include <kio/netaccess.h>
-#include <knewstuff2/engine.h>
-#include <KPluginFactory>
-#include <KPluginLoader>
-#include <QFileDialog>
-#include <QMouseEvent>
-#include <QDesktopWidget>
-#include <KSharedConfigPtr>
#include <KAboutData>
-#include <QThread> // sleep
-#include <QTimer>
-#include <oyranos.h>
-#include <oyranos_icc.h>
-#include <oyranos_devices.h>
-#include <oyFilterNode_s.h>
-#include <oyProfiles_s.h>
-#include <oyObject_s.h>
+#include <oyranos.h> // oyMessageFuncSet()
-#include <unistd.h> //for usleep()
-
-#define CONFIG_REGISTRATION ("//" OY_TYPE_STD "/config/command")
// Code to provide KDE module functionality for color manager.
K_PLUGIN_FACTORY( kmdevicesFactory,
@@ -63,17 +38,6 @@ K_PLUGIN_FACTORY( kmdevicesFactory,
)
K_EXPORT_PLUGIN( kmdevicesFactory("kmdevices") )
-
-void kmdevices::load()
-{
-
-}
-
-void kmdevices::save()
-{
-
-}
-
kmdevices::kmdevices(QWidget *parent, const QVariantList &) :
KCModule( kmdevicesFactory::componentData(), parent)
{
@@ -91,653 +55,19 @@ kmdevices::kmdevices(QWidget *parent, const QVariantList &) :
setAboutData( about );
- currentDevice = 0;
- current_device_name = 0;
- current_device_class = 0;
-
- listModified = false; // avoid action on signals
-
- /* select profiles matching actual capabilities */
- icc_profile_flags = oyICCProfileSelectionFlagsFromOptions( OY_CMM_STD, "//" \
OY_TYPE_STD "/icc_color", NULL, 0 );
-
- setupUi(this); // Load Gui.
-
- msgWidget->setCloseButtonVisible(false);
- msgWidget->setWordWrap(true);
- msgWidget->setMessageType(KMessageWidget::Information);
- msgWidget->setText(i18n("You have not selected any device"));
-
- // Disable all buttons
- deviceProfileComboBox->setEnabled(false);
-
- // Load directories and device listing
- populateDeviceListing();
-
- // Expand list for user.
- deviceList->expandAll();
-
- // Set column width of device list.
- for(int i = 0; i < deviceList->columnCount(); i++)
- deviceList->resizeColumnToContents(i);
-
- installProfileButton->setEnabled(false);
-
- // QT-related Signal/Slot calls (for button-press and item selection events)si.
- connect( deviceList, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
- this, SLOT(changeDeviceItem(QTreeWidgetItem*)) );
- connect( relatedDeviceCheckBox, SIGNAL(stateChanged(int)),
- this, SLOT(changeDeviceItem(int)) );
- connect( deviceProfileComboBox, SIGNAL(activated(int)),
- this, SLOT(selectLocalProfile(int)) );
- connect( installProfileButton, SIGNAL(clicked()),
- this, SLOT(installTaxiProfile()));
-}
-
-// small helper to obtain a profile from a device
-int kmDeviceGetProfile( oyConfig_s * device, oyProfile_s ** profile )
-{
- oyOptions_s * options = 0;
- oyOptions_SetFromText( &options,
- "//"OY_TYPE_STD"/config/icc_profile.x_color_region_target",
- "yes", OY_CREATE_NEW );
- int error = oyDeviceGetProfile( device, options, profile );
- oyOptions_Release( &options );
- return error;
-}
-
-
-// Populate devices and profiles.
-void kmdevices::populateDeviceListing()
-{
- // TODO Work out a solution to use raw/camera stuff.
- detectRaw();
-
- uint32_t count = 0, i = 1,
- * rank_list = 0;
- char ** texts = 0;
- int error = 0;
-
- // get all configuration filters
- oyConfigDomainList( "//"OY_TYPE_STD"/config.device.icc_profile",
- &texts, &count, &rank_list ,0 );
-
- for (i = 0; i < count; ++i)
- {
- error = detectDevices( texts[i] );
- }
- Q_UNUSED(error);
-}
-
-// NEW General function to detect and retrieve devices via the Oyranos CMM backend.
-int kmdevices::detectDevices(const char * device_type)
-{
- int error = 0;
- oyConfigs_s * device_list = 0;
- oyOptions_s * options = oyOptions_New(0);
- oyConfDomain_s * d = oyConfDomain_FromReg( device_type, 0 );
- const char * reg_app = strrchr(device_type,'/')+1;
- const char * device_class = oyConfDomain_GetText( d, "device_class",
- oyNAME_NICK );
-
- oyOptions_SetFromText(&options, "//" OY_TYPE_STD "/config/command",
- "properties", OY_CREATE_NEW);
-
- oyDevicesGet( OY_TYPE_STD, reg_app, 0, &device_list);
-
- int j = 0,
- device_num = oyConfigs_Count(device_list);
-
- // Must have at least one device detected to add to the list.
- if(device_num > 0)
- {
- // Set up Kolor Manager gui "logistics" for a specified device.
- QTreeWidgetItem * parent_item = new QTreeWidgetItem;
- parent_item->setText(0, oyConfDomain_GetText( d, "device_class",
- oyNAME_NAME ));
- QVariant v( device_class );
- parent_item->setData( 0, Qt::UserRole, v );
- deviceList->insertTopLevelItem(0, parent_item);
-
- QIcon device_icon;
- QSize icon_size(30, 30);
- QString icon;
- icon = QString(":/resources/") + device_class + ".png";
- device_icon.addFile( icon.toLower(), icon_size , QIcon::Normal, QIcon::On);
-
- // Traverse through the available devices
- for (j = 0; j < device_num; ++j)
- {
- QString deviceItemString, deviceProfileDescription;
-
- oyConfig_s * device = oyConfigs_Get(device_list, j);
- error = oyDeviceBackendCall(device, options);
-
- const char * device_manufacturer = 0;
- const char * device_model = 0;
- const char * device_serial = 0;
- char * device_designation = 0;
-
- const char * profile_filepath = 0;
- const char * profile_filename = 0;
- oyProfile_s * profile = 0;
-
- device_manufacturer = oyConfig_FindString( device,"manufacturer",0);
- device_model = oyConfig_FindString( device, "model", 0);
- device_serial = oyConfig_FindString( device, "serial", 0);
+ oyMessageFuncSet( oyGuiMessageFunc );
- // Get device designation.
- error = oyDeviceGetInfo(device, oyNAME_NICK, 0, &device_designation, \
malloc); + devicesModule = new SyDevicesModule(0); // "Synnefo Devices"
- // A printer will only take a "device model"
- if (strcmp(device_class,"printer") != 0)
- {
- deviceItemString.append(device_manufacturer);
- deviceItemString.append(" ");
- }
-
- deviceItemString.append(device_model);
- deviceItemString.append(" ");
- deviceItemString.append(device_serial);
-
- error = kmDeviceGetProfile(device, &profile);
- profile_filepath = oyProfile_GetFileName(profile, 0);
-
- deviceListPointer = new QTreeWidgetItem();
-
- if (profile_filepath == NULL)
- {
- deviceProfileDescription = oyProfile_GetText( profile, \
oyNAME_DESCRIPTION );
- if(!deviceProfileDescription.count())
- deviceProfileDescription = i18n("(No Profile Installed)");
- profile_filename = "------";
- }
- else
- {
- deviceProfileDescription = \
convertFilenameToDescription(profile_filepath);
- profile_filename = strrchr(profile_filepath, '/')+1;
- }
-
- deviceListPointer->setIcon(0, device_icon);
- deviceListPointer->setText(DEVICE_DESCRIPTION, deviceItemString);
- deviceListPointer->setText(DEVICE_NAME, device_designation);
- deviceListPointer->setText(PROFILE_DESCRIPTION, \
deviceProfileDescription);
- deviceListPointer->setText(PROFILE_FILENAME, profile_filename);
-
- parent_item->addChild(deviceListPointer);
-
- oyConfig_Release(&device);
- }
-
- }
- else
- error = -1;
-
- oyOptions_Release ( &options );
- oyConfigs_Release ( &device_list );
- oyConfDomain_Release( &d );
-
- return error;
-}
-
-// Display an item that will open a dialog to use camera functionality.
-void kmdevices::detectRaw()
-{
-}
-
-
-// ** SIGNAL/SLOT Related Functions **
-// Hitting the "Show only device related ICC profiles" button
-// relatedDeviceCheckBox.
-void kmdevices::changeDeviceItem(int /*state*/)
-{
- changeDeviceItem( currentDevice );
-}
-
-// When the user clicks on an item in the devices tree list.
-void kmdevices::updateLocalProfileList(QTreeWidgetItem * selected_device,
- bool new_device)
-{
- if(!selected_device)
- {
- deviceProfileComboBox->clear();
- deviceProfileTaxiDBComboBox->clear();
- deviceProfileComboBox->setEnabled(false);
- deviceProfileTaxiDBComboBox->setEnabled(false);
-
- return;
- }
-
- // Don't count top parent items as a "selected device".
- if (selected_device->parent() == deviceListPointer)
- {
- deviceProfileComboBox->setEnabled(false);
- deviceProfileTaxiDBComboBox->setEnabled(false);
-
- return;
- }
-
- // The user modifies the list, but clicks away from the selected device item.
- listModified = false;
-
- // If we click on a device item, the current device is stored and options are \
available.
- deviceProfileComboBox->setEnabled(true);
- deviceProfileTaxiDBComboBox->setEnabled(true);
-
- currentDevice = selected_device;
-
- // Convert QString to proper C string.
- QByteArray raw_string;
- raw_string = (currentDevice->text(DEVICE_NAME)).toLatin1();
- setCurrentDeviceName(raw_string.data());
-
- char * device_class = 0;
- if(selected_device && selected_device->parent())
- {
- QVariant v = selected_device->parent()->data( 0, Qt::UserRole );
- QString qs_device_class = v.toString();
- QByteArray raw_string;
- raw_string = qs_device_class.toLatin1();
- device_class = strdup(raw_string.data());
- }
-
- // Change "Available Device Profiles" combobox to device-related profiles.
- if ( device_class )
- {
- oyConfDomain_s * d = oyConfDomain_FromReg( device_class, 0 );
- const char * icc_profile_class = oyConfDomain_GetText( d,
- "icc_profile_class", oyNAME_NICK );
- setCurrentDeviceClass(device_class);
-
- if(icc_profile_class && strcmp(icc_profile_class,"display") == 0)
- populateLocalProfileComboBox(icSigDisplayClass, new_device);
- else if(icc_profile_class && strcmp(icc_profile_class,"output") == 0)
- populateLocalProfileComboBox(icSigOutputClass, new_device);
- else if(icc_profile_class && strcmp(icc_profile_class,"input") == 0)
- populateLocalProfileComboBox(icSigInputClass, new_device);
-
- oyConfDomain_Release( &d );
- free(device_class); device_class = 0;
- }
-
- // Get the device that the user selected.
-
- // TODO - remove it because this code does nothing
- oyConfig_s * device = 0;
- device = getCurrentDevice();
-
- oyConfig_Release(&device);
-}
-
-// When the user clicks on an item in the devices tree list.
-void kmdevices::changeDeviceItem(QTreeWidgetItem * selected_device)
-{
- updateLocalProfileList( selected_device, true );
-}
-
-void kmdevices::installTaxiProfile()
-{
- msgWidget->setMessageType(KMessageWidget::Information);
- msgWidget->setText(i18n("Downloading Profile from Taxi DB ..."));
-
- QTimer::singleShot(100, this, SLOT(downloadFromTaxiDB()));
-}
-
-void kmdevices::downloadFromTaxiDB( )
-{
- oyProfile_s * ip = 0;
- oyOptions_s * options = 0;
- char * id = (char*)calloc(sizeof(char), 1024);
-
- snprintf(id, 1024, "%s/0", \
deviceProfileTaxiDBComboBox->itemData(deviceProfileTaxiDBComboBox->currentIndex()).toString().toStdString().c_str());
-
- oyOptions_SetFromText(&options, "//" OY_TYPE_STD "/db/TAXI_id",
- id,
- OY_CREATE_NEW);
-
- ip = oyProfile_FromTaxiDB(options, NULL);
-
- oyOptions_Release(&options);
-
- oyOptions_SetFromText(&options,
- "////device", "1",
- OY_CREATE_NEW);
-
- int error = oyProfile_Install(ip, options);
-
- if(!ip) {
- msgWidget->setMessageType(KMessageWidget::Information);
- msgWidget->setText(i18n("No valid profile obtained"));
- }
-
- if(error == oyERROR_DATA_AMBIGUITY) {
- msgWidget->setMessageType(KMessageWidget::Information);
- msgWidget->setText(i18n("Profile already installed"));
- setProfile( QString(oyProfile_GetFileName( ip, 0 )) );
- updateLocalProfileList( currentDevice, false );
- } else if(error == oyERROR_DATA_WRITE) {
- msgWidget->setMessageType(KMessageWidget::Error);
- msgWidget->setText(i18n("User Path can not be written"));
- } else if(error == oyCORRUPTED) {
- msgWidget->setMessageType(KMessageWidget::Error);
- msgWidget->setText(i18n("Profile not useable"));
- } else if(error > 0) {
- QString text = i18n("Internal error") + " - " + QString::number(error);
- msgWidget->setMessageType(KMessageWidget::Error);
- msgWidget->setText(text);
- } else {
- msgWidget->setMessageType(KMessageWidget::Positive);
- msgWidget->setText(i18n("Profile has been installed"));
- setProfile( QString(oyProfile_GetFileName( ip, 0 )) );
- updateLocalProfileList( currentDevice, false );
- }
-
- oyOptions_Release(&options);
- oyProfile_Release(&ip);
-}
-
-// Populate "Assign Profile" combobox. Depending on the device selected, the \
profile list will vary.
-void kmdevices::populateLocalProfileComboBox(icProfileClassSignature \
deviceSignature, bool new_device)
-{
- int size, i, current = -1, current_tmp = 0, pos = 0;
- oyProfile_s * profile = 0, * temp_profile = 0;
- oyProfiles_s * patterns = oyProfiles_New(0),
- * iccs = 0;
- oyConfig_s * device = getCurrentDevice();
- const char * profile_file_name = 0;
-
- profile = oyProfile_FromSignature( deviceSignature, oySIGNATURE_CLASS, 0 );
- oyProfiles_MoveIn( patterns, &profile, -1 );
-
- iccs = oyProfiles_Create( patterns, icc_profile_flags, 0 );
- oyProfiles_Release( &patterns );
-
- QString getProfileDescription;
-
- size = oyProfiles_Count(iccs);
- int32_t * rank_list = (int32_t*) malloc( oyProfiles_Count(iccs) *
- sizeof(int32_t) );
- oyProfiles_DeviceRank( iccs, device, rank_list );
-
- size = oyProfiles_Count(iccs);
-
- deviceProfileComboBox->clear();
-
- kmDeviceGetProfile( device, &profile ); /* reget profile */
- profile_file_name = oyProfile_GetFileName( profile, 0 );
-
- Qt::CheckState show_only_device_related =
- relatedDeviceCheckBox->checkState();
- int empty_added = -1;
-
- for( i = 0; i < size; ++i)
- {
- const char * temp_profile_file_name;
- {
- temp_profile = oyProfiles_Get( iccs, i );
- // show rank number
- getProfileDescription = "[" + QString::number(rank_list[i]) + "] ";
-
- getProfileDescription += oyProfile_GetText( temp_profile, \
oyNAME_DESCRIPTION );
- temp_profile_file_name = oyProfile_GetFileName( temp_profile, 0);
-
- current_tmp = -1;
-
- if(profile_file_name && temp_profile_file_name &&
- strcmp( profile_file_name, temp_profile_file_name ) == 0)
- current_tmp = pos;
-
- if(current == -1 && current_tmp != -1)
- current = current_tmp;
-
- if(empty_added == -1 &&
- rank_list[i] < 1)
- {
- deviceProfileComboBox->addItem(i18n("automatic"));
- empty_added = pos;
- if(current != -1 &&
- current == pos)
- ++current;
- ++pos;
- }
-
- if(show_only_device_related == Qt::Unchecked ||
- rank_list[i] > 0 ||
- current_tmp != -1)
- {
- getProfileDescription.append("\t(");
- getProfileDescription.append(temp_profile_file_name);
- getProfileDescription.append(")");
- deviceProfileComboBox->addItem(getProfileDescription);
- ++pos;
- }
- }
- oyProfile_Release( &temp_profile );
- }
-
- if (empty_added == -1)
- {
- deviceProfileComboBox->addItem(i18n("automatic"));
- ++pos;
- if(current == -1 && current_tmp != -1)
- current = pos;
- }
-
- deviceProfileComboBox->setCurrentIndex( current );
-
- // asynchronous Taxi DB query
- if(new_device)
- {
- deviceProfileTaxiDBComboBox->clear();
-
- msgWidget->setMessageType(KMessageWidget::Information);
- msgWidget->setText(i18n("Looking for Device Profiles in Taxi DB ..."));
- installProfileButton->setEnabled(false);
-
- TaxiLoad * loader = new TaxiLoad( oyConfig_Copy( device, oyObject_New() ) );
- connect(loader, SIGNAL(finishedSignal( char *, oyConfigs_s * )), this, SLOT( \
getTaxiSlot( char*, oyConfigs_s* )));
- loader->start();
- }
-
- oyConfig_Release(&device);
- oyProfile_Release(&profile);
- oyProfiles_Release(&iccs);
-}
-
-// obtain the Taxi DB query result
-void kmdevices::getTaxiSlot( char * for_device, oyConfigs_s * taxi_devices )
-{
- int count = oyConfigs_Count(taxi_devices);
-
- int32_t rank = 0;
- oyConfig_s * taxi_device;
- oyConfig_s * device = getCurrentDevice();
-
- if(!oyConfig_FindString( device, "device_name", for_device) )
- {
- QString text = i18n("wrong device") + " ... " + QString(for_device);
- if(oy_debug)
- msgWidget->setText(text);
- goto clean_getTaxiSlot;
- }
-
- for (int i = 0; i < count; i++) {
- taxi_device = oyConfigs_Get( taxi_devices, i );
-
- oyConfig_Compare(device, taxi_device, &rank);
-
- if (rank > 0) {
- QString text = "[" + QString::number(rank) + "]";
- text += " ";
- text += oyConfig_FindString(taxi_device, "TAXI_profile_description", 0);
- deviceProfileTaxiDBComboBox->addItem(text, oyConfig_FindString(taxi_device, \
"TAXI_id", 0));
- }
- oyConfig_Release(&taxi_device);
- }
-
- msgWidget->setMessageType(KMessageWidget::Information);
- if (deviceProfileTaxiDBComboBox->count() > 0) {
- msgWidget->setText(i18n("You can select and install a profile"));
- installProfileButton->setEnabled(true);
- } else {
- msgWidget->setText(i18n("Not found any profile for the selected device in Taxi \
DB"));
- installProfileButton->setEnabled(false);
- }
-
- clean_getTaxiSlot:
- oyConfigs_Release(&taxi_devices);
- oyConfig_Release(&device);
- if( for_device ) free( for_device );
-}
-
-// Add a new profile to the list.
-void kmdevices::selectLocalProfile(int /*index*/)
-{
- QString baseFileName = deviceProfileComboBox->currentText();
- int parenthesis_index = 0, base_filename_index = 0, str_size = 0;
-
- if(QString::localeAwareCompare( baseFileName, i18n("automatic")))
- {
- parenthesis_index = baseFileName.indexOf("\t(");
-
- // Clean-up full text in the deviceComboBox (we will only use the file name to
- // add to the profiles list).
- str_size = baseFileName.size();
- baseFileName.remove(0, parenthesis_index + 2);
- baseFileName.remove(str_size - 2, 1);
- parenthesis_index = baseFileName.indexOf(")");
- baseFileName.remove(parenthesis_index, parenthesis_index + 1);
- base_filename_index = baseFileName.lastIndexOf("/");
- baseFileName.remove(0, base_filename_index + 1);
- }
-
- setProfile( baseFileName );
-}
-
-// Set a new Profile and update UI.
-void kmdevices::setProfile( QString baseFileName )
-{
- emit changed(true);
- listModified = true;
-
- assignProfile( baseFileName );
-
- // Convert QString to proper C string.
- QByteArray raw_string;
- raw_string = (currentDevice->text(DEVICE_NAME)).toLatin1();
- setCurrentDeviceName(raw_string.data());
-
- // Update column width of device list.
- for(int i = 0; i < deviceList->columnCount(); i++)
- deviceList->resizeColumnToContents(i);
-
- // Get the device that the user selected.
- oyConfig_s * device = 0;
- device = getCurrentDevice();
-
- oyConfig_Release(&device);
-}
-
-oyConfig_s * kmdevices::getCurrentDevice( void )
-{
- oyConfig_s * device = 0;
- int error = 0;
-
- oyOptions_s * options = 0;
- oyOptions_SetFromText( &options, "//" OY_TYPE_STD "/config/command",
- "properties", OY_CREATE_NEW );
- oyOptions_SetFromText( &options,
- "//"OY_TYPE_STD"/config/icc_profile.x_color_region_target",
- "yes", OY_CREATE_NEW );
- if(current_device_class && current_device_name)
- error = oyDeviceGet( OY_TYPE_STD, current_device_class, current_device_name,
- options, &device );
- Q_UNUSED(error);
-
- /* clear */
- oyOptions_Release( &options );
-
- return device;
-}
-
-class kmSleep : public QThread
-{
- public:
- static void sleep(double seconds)
- { QThread::msleep((long unsigned int)(seconds*1000)); }
-};
-
-// Set default profile.
-void kmdevices::assignProfile( QString & profile_name )
-{
- oyProfile_s * profile = NULL;
- QString description;
-
- // If current device pointer points to a MONITOR item, save default profile to \
Oyranos.
-
- {
- int error= 0;
- oyConfig_s * device = getCurrentDevice();
- std::string t = profile_name.toStdString();
- const char * profilename = t.c_str();
- char * pn = strdup(profilename);
-
-
- /* store a existing profile in DB */
- if(strlen(pn) && QString::localeAwareCompare( QString(pn), \
i18n("automatic")))
- error = oyDeviceSetProfile ( device, pn );
- error = oyDeviceUnset( device ); /* unset the device */
- /* completely unset the actual profile from DB */
- if(!strlen(pn) || !QString::localeAwareCompare(QString(pn), \
i18n("automatic")))
- {
- error = oyConfig_EraseFromDB( device );
- oyConfig_Release( &device );
- /* reopen the device to forget about the "profile_name" key */
- device = getCurrentDevice();
- }
- error = oyDeviceSetup( device ); /* reinitialise */
- /* compiz needs some time to exchange the profiles,
- immediately we would get the old colour server profile */
- kmSleep::sleep(0.3);
- error = kmDeviceGetProfile( device, &profile ); /* reget profile */
- Q_UNUSED(error);
- /* clear */
- oyConfig_Release( &device );
- if(pn) free(pn); pn = 0;
- }
-
- // Convert profile into description name...
- description = oyProfile_GetText( profile, oyNAME_DESCRIPTION);
-
- if(!description.count())
- description = i18n("(No Profile Installed)");
-
- // Set third column of the device list with the profile description.
- currentDevice->setText(PROFILE_DESCRIPTION, description);
-
- if(!profile_name.count())
- profile_name = "------";
- currentDevice->setText(PROFILE_FILENAME, profile_name);
+ QGridLayout *gridLayout;
+ gridLayout = new QGridLayout(this);
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+ gridLayout->addWidget(devicesModule, 0, 0, 0, 0);
}
kmdevices::~kmdevices()
{
-
+ delete devicesModule;
}
-/*
- ************* Oyranos DB Settings *************
-*/
-
-// This is so we can obtain a profile name description from a profile file name.
-QString kmdevices::convertFilenameToDescription(QString profileFilename)
-{
- QString profileDescriptionName;
- oyProfile_s * profile_name = NULL;
-
- std::string t = profileFilename.toStdString();
- profile_name = oyProfile_FromFile( t.c_str(), 0, 0);
- profileDescriptionName = oyProfile_GetText( profile_name, oyNAME_DESCRIPTION );
-
- return profileDescriptionName;
-}
diff --git a/devices/kmdevices.h b/devices/kmdevices.h
index f8be2be..c7a8f8a 100644
--- a/devices/kmdevices.h
+++ b/devices/kmdevices.h
@@ -27,27 +27,15 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef KMDEVICES_H
#define KMDEVICES_H
-#include <QtGui/QDialogButtonBox>
#include <KCModule>
-#include <KColorScheme>
-#include <KPushButton>
-#include <QThread>
-
-class QPushButton;
-class QListWidget;
-class QListWidgetItem;
-class QTreeWidget;
-class QTreeWidgetItem;
-
-#include "ui_kmdevices.h" // Gui header.
-#include <oyranos_devices.h>
+#include <sy_devices.h>
/*****************************************************************
KMDevices Class Definition *
******************************************************************/
-class kmdevices : public KCModule, Ui::kmdevices
+class kmdevices : public KCModule
{
Q_OBJECT
@@ -55,142 +43,14 @@ public:
kmdevices(QWidget *parent, const QVariantList &);
~kmdevices();
-public Q_SLOTS:
-
- // load the settings from the config
- virtual void load();
-
- // save the current settings
- virtual void save();
-
// User-defined QT slots.
private slots:
- // When the "Assign Profile" button is pressed
- void selectLocalProfile(int index);
-
- // When user clicks on a device tree item.
- void changeDeviceItem( QTreeWidgetItem* );
-
- // Hitting the "Show only device related ICC profiles" button.
- void changeDeviceItem( int state );
-
- void installTaxiProfile();
-
- // obtain the Taxi DB finished event
- void getTaxiSlot( char * for_device, oyConfigs_s * taxi_devices );
-
- // get the ICC profile
- void downloadFromTaxiDB( );
-
private:
-
- // General device detection
- int detectDevices(const char * device_type);
-
- // Detect camera
- void detectRaw();
-
- // Function to detect all devices/directories.
- void populateDeviceListing();
-
- // Populate device-specified profile combo box listing.
- void populateLocalProfileComboBox(icProfileClassSignature deviceSignature, bool \
new_device);
-
- // Function to convert directory string of a profile into a file name.
- void changeDefaultItem(QString selected_profile);
-
- // Update the Profile list.
- void updateLocalProfileList(QTreeWidgetItem * selected_device, bool new_device);
-
- // Function to refresh device list and node with the new default profile.
- void setDefaultProfile(QString new_default_profile);
-
- // Set the new profile to a Oyranos device
- void assignProfile( QString & profile_name );
-
- // Set new profile and update UI
- void setProfile( QString baseFileName );
-
- // Get the actual device from currentDevice
- oyConfig_s * getCurrentDevice( void );
-
- // Convert profile filename into profile description (using Oyranos).
- QString convertFilenameToDescription(QString profileFilename);
-
- // Oyranos calls to save, load, and delete associated profiles.
- void addNewDeviceConfig(QString device_name);
- void addDeviceProfile(QString device_name, QString profile);
- bool isProfileDuplicate(QString, QStringList);
- void saveDeviceType(QString device_name, QString deviceType);
- void saveProfileSettings(QString device_name);
-
- // Functions to save and load "display" information for Oyranos monitor.
- void saveMonitorLocationInfo (QString device_name, const char * display);
- const char * loadMonitorLocationInfo(QString device_name);
-
-
// PRIVATE DATA MEMBERS
// -----------------------------------------------
- // String used when user wants to add a new profile
- QString recentlyAddedProfile;
-
- // Directory name variables.
- QString profileDirectoryDefault;
-
- // Pointer used to store address of 'initial' device item widget.
- QTreeWidgetItem * deviceListPointer;
- enum {
- DEVICE_DESCRIPTION,
- DEVICE_NAME,
- PROFILE_DESCRIPTION,
- PROFILE_FILENAME
- };
- // Pointer used to store address of 'recently clicked' device item widget.
- QTreeWidgetItem * currentDevice;
-
- bool listModified; // Was the list changed by the user?
-
- int icc_profile_flags; // profile selection flags from oyProfile_s.h
-
- // Global string values for Oyranos device identification
- char * current_device_name;
- char * current_device_class;
- void setCurrentDeviceName(const char * name)
- { if(current_device_name) free(current_device_name);
- current_device_name = strdup(name); }
- void setCurrentDeviceClass(const char * name)
- { if(current_device_name) free(current_device_class);
- current_device_class = strdup(name); }
-};
-
-class TaxiLoad : public QThread
-{
- Q_OBJECT
-
- oyConfig_s * d_;
-
- TaxiLoad( ) { d_ = 0; }
- public:
- TaxiLoad( oyConfig_s * device ) { d_ = device; }
- ~TaxiLoad( ) { }
-
- signals:
- void finishedSignal( char * device_name, oyConfigs_s * taxi_devices );
-
- protected:
- void run() {
- oyConfigs_s * taxi_devices = 0;
- char * device_name = 0;
- if(d_)
- {
- oyDevicesFromTaxiDB( d_, 0, &taxi_devices, 0);
- device_name = strdup(oyConfig_FindString( d_, "device_name", NULL ));
- }
- oyConfig_Release( &d_ );
- emit finishedSignal( device_name, taxi_devices );
- }
+ SyDevicesModule* devicesModule;
};
#endif
diff --git a/devices/kmdevices.ui b/devices/kmdevices.ui
deleted file mode 100644
index 719f247..0000000
--- a/devices/kmdevices.ui
+++ /dev/null
@@ -1,188 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>kmdevices</class>
- <widget class="QWidget" name="kmdevices">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>892</width>
- <height>624</height>
- </rect>
- </property>
- <layout class="QGridLayout" name="gridLayout_4">
- <item row="2" column="0">
- <widget class="QGroupBox" name="groupBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Available Device Profiles from Taxi DB</string>
- </property>
- <property name="flat">
- <bool>false</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="5,3">
- <item>
- <widget class="QComboBox" name="deviceProfileTaxiDBComboBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>27</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="installProfileButton">
- <property name="text">
- <string> Install selected profile</string>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <widget class="KMessageWidget" name="msgWidget"/>
- </item>
- </layout>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QGroupBox" name="deviceGroupBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="contextMenuPolicy">
- <enum>Qt::ActionsContextMenu</enum>
- </property>
- <property name="whatsThis">
- <string/>
- </property>
- <property name="title">
- <string>Detected Devices</string>
- </property>
- <property name="flat">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="1" column="0">
- <widget class="QTreeWidget" name="deviceList">
- <property name="toolTip">
- <string>List of installed input/output devices and their default \
profiles.</string>
- </property>
- <property name="iconSize">
- <size>
- <width>32</width>
- <height>32</height>
- </size>
- </property>
- <property name="uniformRowHeights">
- <bool>false</bool>
- </property>
- <property name="allColumnsShowFocus">
- <bool>false</bool>
- </property>
- <property name="headerHidden">
- <bool>false</bool>
- </property>
- <column>
- <property name="text">
- <string>Device Name</string>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Designation</string>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Profile Description</string>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Profile Filename</string>
- </property>
- </column>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QGroupBox" name="groupBox_2">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title">
- <string>Available Device Profiles</string>
- </property>
- <property name="flat">
- <bool>false</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <layout class="QHBoxLayout" name="horizontalLayout_3" stretch="5,3">
- <item>
- <widget class="QComboBox" name="deviceProfileComboBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>27</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="relatedDeviceCheckBox">
- <property name="text">
- <string>Show only device related ICC profiles</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- <property name="tristate">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <resources>
- <include location="icons.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/information/CMakeLists.txt b/information/CMakeLists.txt
index f126170..3faf893 100644
--- a/information/CMakeLists.txt
+++ b/information/CMakeLists.txt
@@ -1,8 +1,3 @@
-
-
-find_package(KDE4 REQUIRED)
-include_directories(${KDE4_INCLUDES} ${kolor_manager_SOURCE_DIR} \
${CMAKE_CURRENT_BINARY_DIR})
-
INCLUDE( "../settings")
set(kminfo_PART_SRCS
@@ -14,14 +9,10 @@ set(kmdevices_RCCS
QT4_ADD_RESOURCES(kminfo_RCC_SRCS ${kmdevices_RCCS})
-kde4_add_ui_files(kminfo_PART_SRCS kminfo.ui)
-
kde4_add_plugin(kminfo ${kminfo_PART_SRCS} ${kminfo_RCC_SRCS})
-target_link_libraries(kminfo ${KDE4_KFILE_LIBS} ${KDE4_KNEWSTUFF2_LIBS} \
${KDE4_KDEUI_LIBS} ${OYRANOS_LIBRARIES} ${ELEKTRA_LIBRARIES} ${QT_LIBRARIES}) \
+target_link_libraries(kminfo ${SYNNEFO_LIBRARIES} ${KDE4_KDEUI_LIBS})
install(TARGETS kminfo DESTINATION ${PLUGIN_INSTALL_DIR})
install( FILES kminfo.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
-
-
diff --git a/information/kminfo.cpp b/information/kminfo.cpp
index 9652cae..b16a97c 100644
--- a/information/kminfo.cpp
+++ b/information/kminfo.cpp
@@ -29,29 +29,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "kminfo.h"
#include <KAboutData>
-#include <KComponentData>
#include <KGenericFactory>
-#include <KGlobal>
-#include <KGlobalSettings>
-#include <KInputDialog>
-#include <KListWidget>
-#include <KMessageBox>
-#include <KStandardDirs>
-#include <kio/netaccess.h>
-#include <knewstuff2/engine.h>
-#include <KPluginFactory>
-#include <KPluginLoader>
-#include <QFileDialog>
-#include <QDesktopWidget>
-#include <QString>
-#include <QTemporaryFile>
-#include <KRun>
-#include <KProcess>
#include <oyranos.h>
-#include <oyranos_config.h>
-#include <oyranos_devices.h>
-#include <oyFilterNode_s.h>
+#include <sy_info.h>
// Code to provide KDE module functionality for color manager
@@ -60,66 +41,6 @@ K_PLUGIN_FACTORY( kminfoFactory,
)
K_EXPORT_PLUGIN( kminfoFactory("kminfo") )
-// Detect iccexamin for integrated 3D Profile support
-bool kminfo::iccExaminIsInstalled(QString &iccExaminPath)
-{
-
-# ifdef __WIN32__
- QChar pathSep = QChar::fromLatin1(';');
- const QString iccExamin = QString::fromLocal8Bit("iccexamin.exe");
-#elif defined (__APPLE__)
- QChar pathSep = QChar::fromLatin1(':');
- const QString iccExamin = \
QString::fromLocal8Bit("iccexamin.app/Contents/MacOS/ICC Examin");
-# else
- QChar pathSep = QChar::fromLatin1(':');
- const QString iccExamin = QString::fromLocal8Bit("iccexamin");
-# endif /* __WIN32__ */
-
- QString Path = QString::fromLocal8Bit(qgetenv("PATH"));
- QFileInfo fileinfo;
-
- bool done = false;
- bool found = false;
-
- while (!done)
- {
- if (!Path.length() > 0) // still more paths to look at
- done=true;
- else
- {
- // get next path
- iccExaminPath = Path.left(Path.indexOf(pathSep, 0, Qt::CaseSensitive)) \
+
- QString::fromLocal8Bit("/") + iccExamin ;
- // remove the path we are about to check from path
- Path = Path.right(Path.length() - Path.indexOf(pathSep, 0, \
Qt::CaseSensitive) - 1);
- // apend executable name to path
- fileinfo.setFile(iccExaminPath);
- // check to see if it exists
- if (fileinfo.exists())
- {
- done = true;
- found = true;
-
- }
- // check to see if this was last path
- if (Path.length() <= iccExaminPath.length())
- done = true;
- }
- }
-
- return found;
-}
-
-void kminfo::load()
-{
-
-}
-
-void kminfo::save()
-{
- installedProfilesTree->clear();
- populateInstalledProfileList();
-}
kminfo::kminfo(QWidget *parent, const QVariantList &) :
KCModule( kminfoFactory::componentData(), parent)
@@ -135,444 +56,20 @@ kminfo::kminfo(QWidget *parent, const QVariantList &) :
"ku.b@gmx.de" );
setAboutData( about );
- current_profile = 0;
-
- /* select profiles matching actual capabilities */
- icc_profile_flags = oyICCProfileSelectionFlagsFromOptions( OY_CMM_STD, "//" \
OY_TYPE_STD "/icc_color", NULL, 0 );
-
- setupUi(this); // Load Gui.
-
- installedProfilesTree->setColumnWidth(0, 350);
- installedProfilesTree->setColumnWidth(1, 150);
-
- // Save tree list parents to QTreeWidgetItem pointers.
- devicesParentTree = installedProfilesTree->topLevelItem(0);
- const char * g_name = NULL;
- QString name;
- editingCsTree = installedProfilesTree->topLevelItem(1);
- oyWidgetTitleGet( oyWIDGET_GROUP_DEFAULT_PROFILES_EDIT, NULL, &g_name,
- NULL, NULL );
- editingCsTree->setText(0, name.fromUtf8(g_name));
- assumedCsTree = installedProfilesTree->topLevelItem(2);
- oyWidgetTitleGet( oyWIDGET_GROUP_DEFAULT_PROFILES_ASSUMED, NULL, &g_name,
- NULL, NULL );
- assumedCsTree->setText(0, name.fromUtf8(g_name));
-
- // For convenience, we expand colorspace trees.
- installedProfilesTree->expandItem(editingCsTree);
- installedProfilesTree->expandItem(assumedCsTree);
-
- installedProfilesTree->expandAll();
-
- // Display oyEDITING_XYZ info for now.
- populateInstalledProfileList();
- profileInfoGroupBox -> setEnabled(false);
-
- if (iccExaminIsInstalled(iccExaminCommand))
- launchICCExaminButton->show();
- else
- launchICCExaminButton->hide();
-
- scrollArea->setWidget(scrollAreaWidgetContents);
- scrollArea->setWidgetResizable(true);
-
- for(int i = 0; i < installedProfilesTree->columnCount(); i++)
- installedProfilesTree->resizeColumnToContents(i);
-
- // Info panel will initially be hiding.
- setProfileInfoPanelHiding(true);
-
- // Whenever the user clicks on a QTreeWidget child, the description changes.
- connect( installedProfilesTree, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
- this, SLOT(changeProfileTreeItem(QTreeWidgetItem*)));
- connect( launchICCExaminButton, SIGNAL(clicked()), this, \
SLOT(launchICCExamin()));
-}
-
-void kminfo::launchICCExamin()
-{
- QString exec;
-
- if(!directoryListingTag->text().isNull())
- exec = iccExaminCommand + " -g \"" + directoryListingTag->text() + "\"&";
- else
- {
- // Write to a temporary file.
- size_t size = 0;
- oyPointer data = oyProfile_GetMem( current_profile, &size, 0, malloc );
- if(data)
- {
- // The disadvantage is, any previous ICC Examin session for the same
- // file name will update its view to the newly written one.
- QFile file("/tmp/icc_examin_temp.icc");
- file.open( QIODevice::WriteOnly );
- file.write( (const char*)data, size );
- file.flush();
- file.close();
- free(data); data = 0;
- exec = iccExaminCommand + " -g /tmp/icc_examin_temp.icc&";
- } else
- return;
- }
- std::string t = exec.toStdString();
- system(t.c_str());
-}
-
-// Populate the tree with detected profile items.
-void kminfo::populateInstalledProfileList()
-{
- devicesParentTree = installedProfilesTree->topLevelItem(0);
- editingCsTree = installedProfilesTree->topLevelItem(1);
- assumedCsTree = installedProfilesTree->topLevelItem(2);
-
-
- populateDeviceProfiles( devicesParentTree );
- installedProfilesTree->expandAll();
-
- const char * g_name = NULL;
- QString name;
-
- // Populate colorspace items.
- oyWidgetTitleGet( (oyWIDGET_e)oyEDITING_RGB, NULL, &g_name, NULL, NULL );
- if (strlen(g_name) > 0)
- addProfileTreeItem( oyEDITING_RGB, name.fromUtf8(g_name), editingCsTree);
- oyWidgetTitleGet( (oyWIDGET_e)oyEDITING_CMYK, NULL, &g_name, NULL,NULL );
- if (strlen(g_name) > 0)
- addProfileTreeItem( oyEDITING_CMYK, name.fromUtf8(g_name), editingCsTree);
- oyWidgetTitleGet( (oyWIDGET_e)oyEDITING_XYZ, NULL, &g_name, NULL, NULL );
- if (strlen(g_name) > 0)
- addProfileTreeItem( oyEDITING_XYZ, name.fromUtf8(g_name), editingCsTree );
- oyWidgetTitleGet( (oyWIDGET_e)oyEDITING_LAB, NULL, &g_name, NULL, NULL );
- if (strlen(g_name) > 0)
- addProfileTreeItem( oyEDITING_LAB, name.fromUtf8(g_name), editingCsTree );
- oyWidgetTitleGet( (oyWIDGET_e)oyEDITING_GRAY, NULL, &g_name, NULL, NULL );
- if (strlen(g_name) > 0)
- addProfileTreeItem( oyEDITING_GRAY, name.fromUtf8(g_name), editingCsTree );
- oyWidgetTitleGet( (oyWIDGET_e)oyASSUMED_RGB, NULL, &g_name, NULL, NULL );
- if (strlen(g_name) > 0)
- addProfileTreeItem( oyASSUMED_RGB, name.fromUtf8(g_name), assumedCsTree );
- oyWidgetTitleGet( (oyWIDGET_e)oyASSUMED_CMYK, NULL, &g_name, NULL,NULL );
- if (strlen(g_name) > 0)
- addProfileTreeItem( oyASSUMED_CMYK, name.fromUtf8(g_name), assumedCsTree );
- oyWidgetTitleGet( (oyWIDGET_e)oyASSUMED_XYZ, NULL, &g_name, NULL, NULL );
- if (strlen(g_name) > 0)
- addProfileTreeItem( oyASSUMED_XYZ, name.fromUtf8(g_name), assumedCsTree );
- oyWidgetTitleGet( (oyWIDGET_e)oyASSUMED_LAB, NULL, &g_name, NULL, NULL );
- if (strlen(g_name) > 0)
- addProfileTreeItem( oyASSUMED_LAB, name.fromUtf8(g_name), assumedCsTree );
- oyWidgetTitleGet( (oyWIDGET_e)oyASSUMED_GRAY, NULL, &g_name, NULL, NULL );
- if (strlen(g_name) > 0)
- addProfileTreeItem( oyASSUMED_GRAY, name.fromUtf8(g_name), assumedCsTree );
-}
-
-void kminfo::populateDeviceProfiles( QTreeWidgetItem * deviceListTree )
-{
- int n = 0;
- QIcon device_icon("");
-
- uint32_t count = 0, i,j,
- * rank_list = 0;
- char ** texts = 0;
- const char * device_class = 0;
- oyConfDomain_s * d = 0;
- int error = 0;
-
- // get all configuration filters
- oyConfigDomainList( "//"OY_TYPE_STD"/config.device.icc_profile",
- &texts, &count, &rank_list ,0 );
-
- for (i = 0; i < count; ++i)
- {
- oyConfigs_s * devices = 0;
- const char * reg_app = strrchr(texts[i],'/')+1;
- error = oyDevicesGet( OY_TYPE_STD, reg_app, 0, &devices );
- Q_UNUSED(error);
- n = oyConfigs_Count( devices );
- d = oyConfDomain_FromReg( texts[i], 0 );
-
- // Setup icons for devices parent item.
- if(strstr(reg_app,"monitor"))
- device_icon = QIcon(":/resources/monitor.png");
- else if(strstr(reg_app,"printer"))
- device_icon = QIcon(":/resources/printer.png");
- else if(strstr(reg_app,"scanner"))
- device_icon = QIcon(":/resources/scanner.png");
-
- // pick the modules device class nick name
- device_class = oyConfDomain_GetText( d, "device_class", oyNAME_NAME );
-
- QTreeWidgetItem * device_list_sub_tree = new QTreeWidgetItem;
- device_list_sub_tree->setText(0, device_class);
- deviceListTree->addChild(device_list_sub_tree);
-
- for(j = 0; j < (uint32_t)n; ++j)
- {
- oyConfig_s * device = oyConfigs_Get( devices, j );
- char * device_info = 0;
-
- // get expensive information to see the "model" option
- error = oyDeviceGetInfo( device, oyNAME_DESCRIPTION, 0,
- &device_info, malloc );
- error = oyDeviceGetInfo( device, oyNAME_NAME, 0,
- &device_info, malloc );
-
- QTreeWidgetItem * device_child = new QTreeWidgetItem;
- QString device_item_string;
- const char * device_manufacturer = 0;
- const char * device_model = 0;
- const char * device_serial = 0;
-
- device_manufacturer = oyConfig_FindString( device, "manufacturer", 0);
- device_model = oyConfig_FindString( device, "model", 0);
- device_serial = oyConfig_FindString( device, "serial", 0);
-
- device_item_string.append(device_manufacturer);
- device_item_string.append(" ");
- device_item_string.append(device_model);
- device_item_string.append(" ");
- device_item_string.append(device_serial);
-
- char * model = strdup(device_item_string.toUtf8());
- if(!model)
- {
- const char * m = oyConfig_FindString( device, "device_name", 0);
- if(m)
- model = strdup(m);
- }
-
-#if 0
- if(device_info)
- device_child->setText(0, QString("\"") + model + "\" "
- + QString(device_info));
- else
-#endif
- device_child->setText(0, QString(model));
- if(model) free(model); model = 0;
- device_child->setIcon(0, device_icon);
- device_list_sub_tree->addChild(device_child);
-
- oyProfile_s * p = 0;
- oyOptions_s * options = 0;
- error = oyOptions_SetFromText( &options,
- \
"//"OY_TYPE_STD"/config/icc_profile.x_color_region_target",
- "yes", OY_CREATE_NEW );
- oyOptions_SetFromInt( &options, "///icc_profile_flags", icc_profile_flags, \
0, OY_CREATE_NEW );
- oyDeviceGetProfile( device, options, &p );
- oyOptions_Release( &options );
-
- if(p)
- {
- QTreeWidgetItem * profile_child = new QTreeWidgetItem;
- const char* profile_name = oyProfile_GetText( p, oyNAME_DESCRIPTION );
- const char* file_path = oyProfile_GetFileName( p, -1 );
- if(file_path)
- {
- const char* file_name = strrchr(file_path, '/')+1;
- profile_child->setText(1, QString(file_name));
- }
- else
- profile_child->setText(1, i18n("in memory"));
- profile_child->setText(0, profile_name);
-
- // attach the profile to the widget
- QVariant v((qulonglong) oyProfile_Copy(p,0));
- profile_child->setData( 0, Qt::UserRole, v );
- device_child->addChild(profile_child);
- }
-
- //oyProfile_Release( &p );
- oyConfig_Release( &device );
- }
- oyConfigs_Release( &devices );
- oyConfDomain_Release( &d );
- }
-}
-
-// Function to add profile items into the tree listing.
-void kminfo::addProfileTreeItem( oyPROFILE_e profile_type, QString description,
- QTreeWidgetItem * parent_item )
-{
- oyProfile_s * profile = oyProfile_FromStd( profile_type, icc_profile_flags, 0 \
);
- const char * text = oyProfile_GetText( profile, oyNAME_DESCRIPTION );
-
- // Add new item.
- QTreeWidgetItem * new_child = new QTreeWidgetItem();
- new_child->setText(1, description);
- new_child->setText(0, text);
-
- // attach the profile to the widget
- QVariant v((qulonglong) oyProfile_Copy(profile,0));
- new_child->setData( 0, Qt::UserRole, v );
-
- parent_item->addChild(new_child);
- oyProfile_Release( &profile );
-}
-
-// Whenever a user clicks on a child in the tree list, the "profile information"
-// window is updated.
-void kminfo::changeProfileTreeItem(QTreeWidgetItem* currentProfileItem)
-{
- // get the profile from the widget
- QVariant v = currentProfileItem->data( 0, Qt::UserRole );
- oyProfile_s * p = (oyProfile_s *) v.toULongLong();
-
- if(p && p->type_ == oyOBJECT_PROFILE_S)
- {
- populateDeviceProfileDescriptions(p, true);
- profileInfoGroupBox->setEnabled(true);
- return;
- }
-
- populateDeviceProfileDescriptions(NULL, false);
- profileInfoGroupBox -> setEnabled(false);
- // set default fram size
- frame -> setMinimumSize(QSize(250,250));
-}
-
-// Refresh profile information list.
-void kminfo::populateDeviceProfileDescriptions(oyProfile_s * profile, bool valid)
-{
- if (valid)
- {
- // Output Oyranos-specified profile descriptions.
- setTagDescriptions(profile, icSigCopyrightTag, copyrightTagLabel);
-
- setTagDescriptions(profile, icSigDeviceMfgDescTag, mfgTagLabel);
-
- setTagDescriptions(profile, icSigDeviceModelDescTag, modelTagLabel);
-
- setTagDescriptions(profile, icSigProfileDescriptionTag, descriptionTagLabel);
-
- setDateTag(profile, dateTagLabel);
-
- setCSpaceTag(profile, colorspaceTagLabel);
-
- setIccsTag(profile, iccVerTagLabel);
-
- setPcsTag(profile, pcsTagLabel);
-
- setDeviceClassTag(profile, deviceClassTagLabel);
-
- QString profilePathName = oyProfile_GetFileName( profile, -1 );
- directoryListingTag->setText(profilePathName);
-
- oyProfile_Release( ¤t_profile );
- current_profile = oyProfile_Copy( profile, 0 );
-
- setProfileInfoPanelHiding(false);
-
- m_tempFile.open();
-
- KProcess * process = new KProcess();
- connect(process, SIGNAL(finished(int)), SLOT(loadProfileGraph()));
-
- QString program = QString("oyranos-profile-graph -o \"%1\" -w 200 \
\"%2\"").arg(m_tempFile.fileName()).arg(profilePathName);
- process->setShellCommand(program);
- process->start();
- }
- else
- {
- setProfileInfoPanelHiding(true);
- }
-}
-
-void kminfo::loadProfileGraph()
-{
- QPixmap mypix(m_tempFile.fileName());
- launchICCExaminButton->setIcon(QIcon(mypix));
-
- m_tempFile.close();
-}
-
-
-// Set visibility of the profile information box based on the
-// "Display profile information" checkbox.
-void kminfo::setProfileInfoPanelHiding(bool isHidden)
-{
- profileInfoGroupBox->setHidden(isHidden);
-}
-
-void kminfo::setIccsTag(oyProfile_s * profile, QLabel * iccsLabel)
-{
- QString field1, field2, field3;
-
- icSignature vs = oyValueUInt32( oyProfile_GetSignature(profile, \
oySIGNATURE_VERSION) );
- char * v = (char*)&vs;
-
- field1 = (((int)v[0]));
- field2 = ((int)v[1]/16);
- field3 = ((int)v[1]%16);
-
- iccsLabel->setText(field1.setNum(((int)v[0])) + '.' + \
field2.setNum(((int)v[1]/16)) + '.' +
- field3.setNum(((int)v[1]%16)));
-}
-
-void kminfo::setDeviceClassTag(oyProfile_s * profile, QLabel * devClassLabel)
-{
- QString string;
- string = oyICCDeviceClassDescription( (icProfileClassSignature)
- oyProfile_GetSignature(profile, oySIGNATURE_CLASS) );
- devClassLabel->setText(string);
-}
-
-void kminfo::setPcsTag(oyProfile_s * profile, QLabel * pcsLabel)
-{
- QString tagString;
- tagString = oyICCColorSpaceGetName( (icColorSpaceSignature)
- oyProfile_GetSignature(profile, oySIGNATURE_PCS) );
- pcsLabel->setText("CIE" + tagString);
-}
-
-void kminfo::setCSpaceTag(oyProfile_s * profile, QLabel * cSpaceLabel)
-{
- QString tagString;
- tagString = oyICCColorSpaceGetName( (icColorSpaceSignature)
- oyProfile_GetSignature(profile, oySIGNATURE_COLOR_SPACE) );
- cSpaceLabel->setText(tagString);
-}
-
-void kminfo::setDateTag(oyProfile_s * profile, QLabel * dateLabel)
-{
- uint year, month, day;
- //uint hours, minutes, seconds;
- year = oyProfile_GetSignature(profile, oySIGNATURE_DATETIME_YEAR);
- month = oyProfile_GetSignature(profile, oySIGNATURE_DATETIME_MONTH);
- day = oyProfile_GetSignature(profile, oySIGNATURE_DATETIME_DAY);
+ oyMessageFuncSet( oyGuiMessageFunc );
- // NOTE (If we need hours/minutes/seconds, uncomment)
- //hours = oyProfile_GetSignature(profile, oySIGNATURE_DATETIME_HOURS);
- //minutes = oyProfile_GetSignature(profile, oySIGNATURE_DATETIME_MINUTES);
- //seconds = oyProfile_GetSignature(profile, oySIGNATURE_DATETIME_SECONDS);
+ module = new SyInfoModule(0); // "Synnefo Info"
- QString date = QString("%1-%2-%3").arg( year ).arg( month ).arg( day );
- dateLabel->setText( date );
+ QGridLayout *gridLayout;
+ gridLayout = new QGridLayout(this);
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+ gridLayout->addWidget(module, 0, 0, 0, 0);
}
-// Function to write signature head, based on profile, tag type, and QT Label.
-void kminfo::setTagDescriptions(oyProfile_s * profile_name, icTagSignature tagType, \
QLabel * tagLabel )
-{
- int text_n;
- bool error;
-
- //oyObject_s object;
- char** tagText = 0;
- oyProfileTag_s * tagID;
-
- tagID = oyProfile_GetTagById( profile_name, tagType );
-
- error = !tagID;
-
- if(!error)
- tagText = oyProfileTag_GetText( tagID, &text_n, 0,0, 0, 0 );
-
- if(text_n && tagText && tagText[0])
- tagLabel->setText(*tagText);
- else
- tagLabel->setText("-----");
-}
kminfo::~kminfo()
{
-
+ delete module;
}
diff --git a/information/kminfo.h b/information/kminfo.h
index d4b4d6f..ddedde4 100644
--- a/information/kminfo.h
+++ b/information/kminfo.h
@@ -28,20 +28,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef KMINFO_H
#define KMINFO_H
-#include <QtGui/QDialogButtonBox>
#include <KCModule>
-#include <KColorScheme>
-#include <KPushButton>
-#include <QTemporaryFile>
-
-#include <oyranos_icc.h>
-#include <oyProfiles_s.h>
-
-class QPushButton;
-class QListWidget;
-class QListWidgetItem;
-
-#include "ui_kminfo.h" // Gui header.
+#include <sy_info.h>
/******************************************************************
KM Information Class Definition *
@@ -49,7 +37,7 @@ class QListWidgetItem;
// "kminfo" - Class to view profile information.
-class kminfo : public KCModule, Ui::kminfo
+class kminfo : public KCModule
{
Q_OBJECT
@@ -57,73 +45,8 @@ public:
kminfo(QWidget *parent, const QVariantList &);
~kminfo();
-QString iccExaminCommand;
-public Q_SLOTS:
-
- // load the settings from the config
- virtual void load();
-
- // save the current settings
- virtual void save();
-
-
-// User-defined QT slots.
-private slots:
-
- // Function to change profile information description
- void changeProfileTreeItem(QTreeWidgetItem*);
-
- // If "Analyze profile" button is un-hidden, launch iccexamin.
- void launchICCExamin();
-
- void loadProfileGraph();
-
private:
-
- // Build profile listing tree.
- void populateInstalledProfileList();
-
- // Add an item to the tree.
- void addProfileTreeItem( oyPROFILE_e, QString description, QTreeWidgetItem * \
parent_item );
-
- // Populate tree list items relating to device-specific profiles (printers, \
monitors, etc.)
- void populateDeviceProfiles( /*QStringList listOfDevices,*/ QTreeWidgetItem * \
deviceListSubTree /*, QIcon device_icon*/);
-
- // Populate tag descriptions for device-specific profiles.
- void populateDeviceProfileDescriptions(oyProfile_s * profile, bool valid);
-
- // Function to write tag descriptions to individual labels
- void setTagDescriptions(oyProfile_s *, icTagSignature, QLabel *);
-
- // Sets the profile information labels as hidden or unhidden.
- void setInfoPanelLabelHiding(bool);
-
- // The following provide additional tags to be displayed.
- void setPcsTag(oyProfile_s * profile, QLabel * pcsLabel);
- void setCSpaceTag(oyProfile_s * profile, QLabel * cSpaceLabel);
- void setIccsTag(oyProfile_s * profile, QLabel * iccsLabel);
- void setDeviceClassTag(oyProfile_s * profile, QLabel * devClassLabel);
-
- // Function to write date tag to a label.
- void setDateTag(oyProfile_s *, QLabel *);
-
- // Check for iccexamin functionality on user system.
- bool iccExaminIsInstalled(QString &iccExaminPath);
-
- // Hides/Unhides information panel.
- void setProfileInfoPanelHiding(bool);
-
- // Pointers to current QTreeWidget parents (Devices, Editing Space, Assumed \
Space)
- QTreeWidgetItem * assumedCsTree;
- QTreeWidgetItem * editingCsTree;
- QTreeWidgetItem * devicesParentTree;
-
- // Pointers to device-specific (parent) items on list
- oyProfile_s * current_profile;
-
- QTemporaryFile m_tempFile;
-
- int icc_profile_flags; ///< profile selection flags from \
oyProfile_s.h + SyInfoModule* module;
};
#endif
diff --git a/information/kminfo.ui b/information/kminfo.ui
deleted file mode 100644
index d1962ce..0000000
--- a/information/kminfo.ui
+++ /dev/null
@@ -1,738 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>kminfo</class>
- <widget class="QWidget" name="kminfo">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>949</width>
- <height>684</height>
- </rect>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="QSplitter" name="splitter">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="opaqueResize">
- <bool>true</bool>
- </property>
- <property name="childrenCollapsible">
- <bool>false</bool>
- </property>
- <widget class="QTreeWidget" name="installedProfilesTree">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>0</height>
- </size>
- </property>
- <property name="autoScroll">
- <bool>false</bool>
- </property>
- <property name="alternatingRowColors">
- <bool>false</bool>
- </property>
- <property name="selectionMode">
- <enum>QAbstractItemView::SingleSelection</enum>
- </property>
- <property name="textElideMode">
- <enum>Qt::ElideRight</enum>
- </property>
- <property name="uniformRowHeights">
- <bool>false</bool>
- </property>
- <property name="allColumnsShowFocus">
- <bool>false</bool>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- <attribute name="headerCascadingSectionResizes">
- <bool>false</bool>
- </attribute>
- <attribute name="headerShowSortIndicator" stdset="0">
- <bool>false</bool>
- </attribute>
- <column>
- <property name="text">
- <string>Installed Profiles</string>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Description</string>
- </property>
- </column>
- <item>
- <property name="text">
- <string>Devices</string>
- </property>
- <property name="text">
- <string/>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Editing Space</string>
- </property>
- <property name="text">
- <string/>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Assumed Space</string>
- </property>
- <property name="text">
- <string/>
- </property>
- </item>
- </widget>
- <widget class="QGroupBox" name="profileInfoGroupBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>340</width>
- <height>0</height>
- </size>
- </property>
- <property name="flat">
- <bool>false</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout_3">
- <property name="topMargin">
- <number>0</number>
- </property>
- <item row="3" column="1">
- <widget class="QScrollArea" name="scrollArea">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="verticalScrollBarPolicy">
- <enum>Qt::ScrollBarAlwaysOff</enum>
- </property>
- <property name="widgetResizable">
- <bool>true</bool>
- </property>
- <widget class="QWidget" name="scrollAreaWidgetContents">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>510</width>
- <height>666</height>
- </rect>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="1" column="0">
- <layout class="QVBoxLayout" name="verticalLayout_3">
- <item>
- <widget class="QFrame" name="frame">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
- <horstretch>98</horstretch>
- <verstretch>99</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>150</width>
- <height>300</height>
- </size>
- </property>
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_9">
- <property name="topMargin">
- <number>3</number>
- </property>
- <property name="bottomMargin">
- <number>3</number>
- </property>
- <item>
- <widget class="QLabel" name="descriptionTagLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>25</height>
- </size>
- </property>
- <property name="font">
- <font>
- <pointsize>13</pointsize>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>ICCDescriptionLabel</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignHCenter|Qt::AlignTop</set>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="Line" name="infoPanelLineSeperator">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="copyrightTagLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>30</height>
- </size>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
- </property>
- <property name="lineWidth">
- <number>1</number>
- </property>
- <property name="text">
- <string>(Copyright not available)</string>
- </property>
- <property name="scaledContents">
- <bool>false</bool>
- </property>
- <property name="alignment">
- <set>Qt::AlignHCenter|Qt::AlignTop</set>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="dateTextLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>116</width>
- <height>0</height>
- </size>
- </property>
- <property name="font">
- <font>
- <weight>75</weight>
- <italic>false</italic>
- <bold>true</bold>
- <underline>false</underline>
- </font>
- </property>
- <property name="text">
- <string>Date Created:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="dateTagLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Ignored" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>50</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>----</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="dcTextLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>113</width>
- <height>0</height>
- </size>
- </property>
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>Device Class:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLabel" name="deviceClassTagLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Ignored" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>50</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>----</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="manufacturerLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>118</width>
- <height>0</height>
- </size>
- </property>
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>Manufacturer:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLabel" name="mfgTagLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Ignored" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>50</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>----</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignJustify|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="modelTexLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>55</width>
- <height>0</height>
- </size>
- </property>
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>Model:</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QLabel" name="modelTagLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Ignored" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>50</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>----</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignJustify|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="iccVersionLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>101</width>
- <height>0</height>
- </size>
- </property>
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>ICC Version:</string>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="QLabel" name="iccVerTagLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Ignored" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>50</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>----</string>
- </property>
- </widget>
- </item>
- <item row="5" column="0">
- <widget class="QLabel" name="colorspaceLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>104</width>
- <height>0</height>
- </size>
- </property>
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>Color Space:</string>
- </property>
- </widget>
- </item>
- <item row="5" column="1">
- <widget class="QLabel" name="colorspaceTagLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Ignored" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>50</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>----</string>
- </property>
- </widget>
- </item>
- <item row="6" column="0">
- <widget class="QLabel" name="pcsTypeLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>84</width>
- <height>0</height>
- </size>
- </property>
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>PCS Type:</string>
- </property>
- </widget>
- </item>
- <item row="6" column="1">
- <widget class="QLabel" name="pcsTagLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Ignored" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>50</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>----</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_10">
- <property name="spacing">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>3</number>
- </property>
- <property name="bottomMargin">
- <number>3</number>
- </property>
- <item>
- <widget class="QLabel" name="profilePathLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>102</width>
- <height>0</height>
- </size>
- </property>
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- <underline>false</underline>
- </font>
- </property>
- <property name="text">
- <string>Profile Path:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="directoryListingTag">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Ignored" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="font">
- <font>
- <weight>50</weight>
- <italic>false</italic>
- <bold>false</bold>
- </font>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
- </property>
- <property name="lineWidth">
- <number>1</number>
- </property>
- <property name="midLineWidth">
- <number>0</number>
- </property>
- <property name="text">
- <string>---</string>
- </property>
- <property name="textFormat">
- <enum>Qt::AutoText</enum>
- </property>
- <property name="scaledContents">
- <bool>false</bool>
- </property>
- <property name="alignment">
- <set>Qt::AlignJustify|Qt::AlignVCenter</set>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- <property name="textInteractionFlags">
- <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QPushButton" name="launchICCExaminButton">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>200</height>
- </size>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="iconSize">
- <size>
- <width>200</width>
- <height>200</height>
- </size>
- </property>
- <property name="flat">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/settings/CMakeLists.txt b/settings/CMakeLists.txt
index 8b12911..79f1b02 100644
--- a/settings/CMakeLists.txt
+++ b/settings/CMakeLists.txt
@@ -1,20 +1,13 @@
-
-
-find_package(KDE4 REQUIRED)
-include_directories(${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
set(kmsettings_PART_SRCS
- kmsettings.cpp
+ kmsettings.cpp
)
-kde4_add_ui_files(kmsettings_PART_SRCS kmsettings.ui)
-
kde4_add_plugin(kmsettings ${kmsettings_PART_SRCS})
-target_link_libraries(kmsettings ${KDE4_KFILE_LIBS} ${KDE4_KNEWSTUFF2_LIBS} \
${KDE4_KDEUI_LIBS} ${OYRANOS_LIBRARIES} ${ELEKTRA_LIBRARIES}) \
+target_link_libraries(kmsettings ${SYNNEFO_LIBRARIES} ${KDE4_KDEUI_LIBS})
install(TARGETS kmsettings DESTINATION ${PLUGIN_INSTALL_DIR})
install( FILES kmsettings.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
-
-
diff --git a/settings/kmsettings.cpp b/settings/kmsettings.cpp
index 4b77d38..ab283f3 100644
--- a/settings/kmsettings.cpp
+++ b/settings/kmsettings.cpp
@@ -28,35 +28,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "kmsettings.h"
-#include <KDebug>
#include <KAboutData>
-#include <KComponentData>
#include <KGenericFactory>
-#include <KGlobal>
-#include <KGlobalSettings>
-#include <KInputDialog>
-#include <KListWidget>
-#include <KMessageBox>
-#include <KStandardDirs>
-#include <kio/netaccess.h>
-#include <knewstuff2/engine.h>
-#include <KPluginFactory>
-#include <KPluginLoader>
-#include <QFileDialog>
-#include <QInputDialog>
-#include <QDataStream>
-#include <KSharedConfig>
-
-#include <oyranos.h>
-#include <oyranos_config.h>
-#include <oyranos_devices.h>
-#include <oyFilterNode_s.h>
-#include <oyProfiles_s.h>
-#include <locale.h>
-
-// The number of policies that are available in KM by default.
-// NOTE These are listed *before* the user-defined policies.
-const int internalPolicyCount = 4;
// Code to provide KDE module functionality for Kolor Management.
K_PLUGIN_FACTORY( kmsettingsFactory,
@@ -65,17 +38,6 @@ K_PLUGIN_FACTORY( kmsettingsFactory,
K_EXPORT_PLUGIN( kmsettingsFactory("kmsettings") )
-void kmsettings::load()
-{
- loadPolicy();
-}
-
-void kmsettings::save()
-{
- saveCustomXmlFile();
- settingsChanged = false;
-}
-
// Register the panel and initialise fro Oyranos.
kmsettings::kmsettings(QWidget *parent, const QVariantList &) :
KCModule( kmsettingsFactory::componentData(), parent)
@@ -93,641 +55,18 @@ kmsettings::kmsettings(QWidget *parent, const QVariantList &) :
setAboutData( about );
- /* select profiles matching actual capabilities */
- icc_profile_flags = oyICCProfileSelectionFlagsFromOptions( OY_CMM_STD, "//" \
OY_TYPE_STD "/icc_color", NULL, 0 );
-
- setupUi(this); // Load Gui.
-
- removePolicyButton->setEnabled(false);
-
- loadEditableItems(); // Store all setting widgets into a convenient list \
structure.
-
- populateProfiles(); // Load all Oyranos-specified profiles
- // into each combobox in the "Default Profiles" tab.
-
-
- settingsChanged = false;
-
- /* i18n */
- QString qs;
- int i;
- int count = 0,
- current = 0,
- flags = 0;
- const char * tooltip = NULL;
- const char ** names = NULL;
- const char * label = NULL;
- oyWIDGET_TYPE_e type = oyWIDGETTYPE_START;
-
- // Get widget strings.
- type = oyWidgetTitleGet( oyWIDGET_POLICY, NULL, &label, &tooltip, &flags );
- qs = QString::fromLocal8Bit(label);
- policySettingsBox->setTitle(qs);
- kmsettingsTab->setTabText(0,qs);
- qs = QString::fromLocal8Bit( tooltip );
- policyLabel->setText(qs);
-
- type = oyWidgetTitleGet( oyWIDGET_GROUP_DEFAULT_PROFILES, NULL, &label, &tooltip, \
&flags );
- Q_UNUSED(type);
- qs = QString::fromLocal8Bit(label);
- kmsettingsTab->setTabText(1,qs);
-
- type = oyWidgetTitleGet( oyWIDGET_GROUP_BEHAVIOUR, NULL, &label, &tooltip, &flags \
);
- Q_UNUSED(type);
- qs = QString::fromLocal8Bit(label,-1);
- kmsettingsTab->setTabText(2,qs);
-
-#define SET_OY_PROFILE_WIDGET( widget ) \
- oyWidgetTitleGet( oyWIDGET_##widget, NULL, &label, &tooltip, &flags ); \
- qs = QString::fromLocal8Bit(label); \
- label_##widget->setText( qs ); \
- qs = QString::fromLocal8Bit( tooltip ); \
- label_##widget->setToolTip( qs ); \
- combo_##widget->setToolTip( qs );
-
-#define SET_OY_BOX_WIDGET( widget ) \
- oyWidgetTitleGet( oyWIDGET_##widget, NULL, &label, &tooltip, &flags ); \
- qs = QString::fromLocal8Bit(label); \
- box_##widget->setTitle( qs ); \
- qs = QString::fromLocal8Bit( tooltip ); \
- box_##widget->setToolTip( qs );
-
-#define SET_OY_COMBO_WIDGET( widget ) \
- oyWidgetTitleGet( oyWIDGET_##widget, NULL, &label, &tooltip, &flags ); \
- oyOptionChoicesGet( oyWIDGET_##widget, &count, &names, ¤t ); \
- qs = QString::fromLocal8Bit( tooltip ); \
- combo_##widget->setToolTip( qs ); \
- combo_##widget->clear(); \
- for(i = 0; i < count; ++i) \
- { \
- qs = QString::fromLocal8Bit( names[i] ); \
- combo_##widget->addItem( qs ); \
- }
-
-#define SET_OY_CHECK_WIDGET( widget ) \
- oyWidgetTitleGet( oyWIDGET_##widget, NULL, &label, &tooltip, &flags ); \
- qs = QString::fromLocal8Bit( label ); \
- check_##widget->setText( qs ); \
- qs = QString::fromLocal8Bit( tooltip ); \
- check_##widget->setToolTip( qs );
-
-#define SET_OY_LABEL_WIDGET( widget ) \
- oyWidgetTitleGet( oyWIDGET_##widget, NULL, &label, &tooltip, &flags ); \
- qs = QString::fromLocal8Bit(label); \
- label_##widget->setText( qs ); \
- qs = QString::fromLocal8Bit( tooltip ); \
- label_##widget->setToolTip( qs );
-
- SET_OY_PROFILE_WIDGET( EDITING_RGB );
- SET_OY_PROFILE_WIDGET( EDITING_CMYK );
- SET_OY_PROFILE_WIDGET( EDITING_LAB );
- SET_OY_PROFILE_WIDGET( EDITING_XYZ );
- SET_OY_PROFILE_WIDGET( EDITING_GRAY );
- SET_OY_PROFILE_WIDGET( ASSUMED_RGB );
- SET_OY_PROFILE_WIDGET( ASSUMED_CMYK );
- SET_OY_PROFILE_WIDGET( ASSUMED_LAB );
- SET_OY_PROFILE_WIDGET( ASSUMED_XYZ );
- SET_OY_PROFILE_WIDGET( ASSUMED_GRAY );
- SET_OY_PROFILE_WIDGET( ASSUMED_WEB );
- SET_OY_PROFILE_WIDGET( PROFILE_PROOF );
- SET_OY_BOX_WIDGET( GROUP_BEHAVIOUR_RENDERING );
- SET_OY_BOX_WIDGET( GROUP_BEHAVIOUR_MIXED_MODE_DOCUMENTS );
- SET_OY_BOX_WIDGET( GROUP_BEHAVIOUR_MISSMATCH );
- SET_OY_BOX_WIDGET( GROUP_BEHAVIOUR_PROOF );
- SET_OY_COMBO_WIDGET( ACTION_UNTAGGED_ASSIGN );
- SET_OY_LABEL_WIDGET( ACTION_UNTAGGED_ASSIGN );
- SET_OY_COMBO_WIDGET( ACTION_OPEN_MISMATCH_RGB );
- SET_OY_LABEL_WIDGET( ACTION_OPEN_MISMATCH_RGB );
- SET_OY_COMBO_WIDGET( ACTION_OPEN_MISMATCH_CMYK );
- SET_OY_LABEL_WIDGET( ACTION_OPEN_MISMATCH_CMYK );
- SET_OY_COMBO_WIDGET( MIXED_MOD_DOCUMENTS_PRINT );
- SET_OY_LABEL_WIDGET( MIXED_MOD_DOCUMENTS_PRINT );
- SET_OY_COMBO_WIDGET( MIXED_MOD_DOCUMENTS_SCREEN );
- SET_OY_LABEL_WIDGET( MIXED_MOD_DOCUMENTS_SCREEN );
- SET_OY_COMBO_WIDGET( RENDERING_INTENT );
- SET_OY_COMBO_WIDGET( RENDERING_INTENT_PROOF );
- SET_OY_LABEL_WIDGET( RENDERING_INTENT_PROOF );
- SET_OY_CHECK_WIDGET( RENDERING_BPC );
- SET_OY_CHECK_WIDGET( PROOF_SOFT );
- SET_OY_CHECK_WIDGET( PROOF_HARD );
- SET_OY_CHECK_WIDGET( RENDERING_GAMUT_WARNING );
-
- // Load behavior settings and display current default policy.
- populateBehaviorSettings();
- refreshProfileSettings(); // Refresh comboboxes in "Default Profiles"
- refreshPolicySettings();
-
- // We want to be able to observe changes of single settings and display
- // the actual used policy. So track them.
- // QT-related SIGNAL/SLOT functions, such as button presses and clicking
- // on a particular item.
- connect(policySettingsList, SIGNAL(currentRowChanged(int)),
- this, SLOT(selectPolicy(int)));
- connect(addNewPolicyButton, SIGNAL(clicked()), this, SLOT(addNewPolicy()));
- connect(removePolicyButton, SIGNAL(clicked()), this, SLOT(removeCustomPolicy()));
-
- int k = 0, n = editableComboItems.size();
- // When a user clicks on any combo box, the "Apply" button will be enabled.
- for(k = 0; k < n; ++k)
- connect(editableComboItems.value(k), SIGNAL(activated(int)), this, \
SLOT(emitChanged()));
-
- n = editableCheckBoxItems.size();
- // When a user clicks on a radio box, the "Apply" button will be enabled.
- for(k = 0; k < n; ++k)
- connect(editableCheckBoxItems.value(k), SIGNAL(clicked()), this, \
SLOT(emitChanged()));
-
-
-}
-
-
-// Load editable comboboxe and checkbox items into a list
-// (this is convenient to detect each settings change by the user).
-void kmsettings::loadEditableItems()
-{
- editableComboItems.push_front(combo_EDITING_RGB);
- editableComboItems.push_front(combo_EDITING_CMYK);
- editableComboItems.push_front(combo_EDITING_XYZ);
- editableComboItems.push_front(combo_EDITING_LAB);
- editableComboItems.push_front(combo_ASSUMED_RGB);
- editableComboItems.push_front(combo_ASSUMED_CMYK);
- editableComboItems.push_front(combo_ASSUMED_XYZ);
- editableComboItems.push_front(combo_ASSUMED_LAB);
-
- editableComboItems.push_front(combo_EDITING_GRAY);
- editableComboItems.push_front(combo_ASSUMED_GRAY);
-
- editableComboItems.push_front(combo_RENDERING_INTENT);
- editableComboItems.push_front(combo_ACTION_UNTAGGED_ASSIGN);
- editableComboItems.push_front(combo_ACTION_OPEN_MISMATCH_RGB);
- editableComboItems.push_front(combo_ACTION_OPEN_MISMATCH_CMYK);
- editableComboItems.push_front(combo_RENDERING_INTENT_PROOF);
- editableComboItems.push_front(combo_MIXED_MOD_DOCUMENTS_SCREEN);
- editableComboItems.push_front(combo_MIXED_MOD_DOCUMENTS_PRINT);
- editableComboItems.push_front(combo_PROFILE_PROOF);
-
- editableCheckBoxItems.push_front(check_PROOF_SOFT);
- editableCheckBoxItems.push_front(check_PROOF_HARD);
- editableCheckBoxItems.push_front(check_RENDERING_BPC);
- editableCheckBoxItems.push_front(check_RENDERING_GAMUT_WARNING);
-
-}
-
-// Fill the combo boxes in the "Default Profiles" tab with Oyranos-installed \
profiles.
-void kmsettings::populateProfiles()
-{
- // Fill comboboxes with each 'filtered' profile.
- fillProfileComboBoxes(oyEDITING_RGB, combo_EDITING_RGB);
- fillProfileComboBoxes(oyEDITING_CMYK, combo_EDITING_CMYK);
- fillProfileComboBoxes(oyEDITING_LAB, combo_EDITING_LAB);
- fillProfileComboBoxes(oyEDITING_XYZ, combo_EDITING_XYZ);
- fillProfileComboBoxes(oyEDITING_GRAY, combo_EDITING_GRAY);
-
- fillProfileComboBoxes(oyASSUMED_RGB, combo_ASSUMED_RGB);
- fillProfileComboBoxes(oyASSUMED_CMYK, combo_ASSUMED_CMYK);
- fillProfileComboBoxes(oyASSUMED_LAB, combo_ASSUMED_LAB);
- fillProfileComboBoxes(oyASSUMED_XYZ, combo_ASSUMED_XYZ);
- fillProfileComboBoxes(oyASSUMED_GRAY, combo_ASSUMED_GRAY);
-
- fillProfileComboBoxes(oyPROFILE_PROOF, combo_PROFILE_PROOF);
-}
-
-// Filter comboboxes in 'Default Profiles' with appropriate profiles.
-void kmsettings::fillProfileComboBoxes(oyPROFILE_e profile_type, QComboBox * \
profile_combobox)
-{
- int current = 0, size, i,
- sizeofProfilename,
- indexofProfilename;
- oyProfile_s * temp_prof = 0;
- oyProfiles_s * iccs;
-
- QString profile_text, profile_filename;
-
- iccs = oyProfiles_ForStd( profile_type, icc_profile_flags, ¤t, 0 );
-
- size = oyProfiles_Count(iccs);
- for( i = 0; i < size; ++i)
- {
- temp_prof = oyProfiles_Get( iccs, i );
- profile_text = oyProfile_GetText( temp_prof, oyNAME_DESCRIPTION );
- profile_filename = oyProfile_GetFileName(temp_prof, 0);
+ oyMessageFuncSet( oyGuiMessageFunc );
- sizeofProfilename = profile_filename.size();
- indexofProfilename = profile_filename.lastIndexOf( "/", sizeofProfilename - \
1);
- profile_filename.remove(0, indexofProfilename + 1);
+ module = new SySettingsModule(0); // "Synnefo Settings"
- profile_combobox->insertItem(i, profile_filename, 0);
-
- oyProfile_Release( &temp_prof );
- }
-}
-
-
-// Populate each setting in "Behavior Settings".
-void kmsettings::populateBehaviorSettings()
-{
- int behavior_setting;
-
- behavior_setting = oyGetBehaviour(oyBEHAVIOUR_RENDERING_INTENT);
- combo_RENDERING_INTENT->setCurrentIndex(behavior_setting);
-
-// Populate Mismatch Handling Settings
-
- behavior_setting = oyGetBehaviour(oyBEHAVIOUR_ACTION_UNTAGGED_ASSIGN);
- combo_ACTION_UNTAGGED_ASSIGN->setCurrentIndex(behavior_setting);
-
- behavior_setting = oyGetBehaviour(oyBEHAVIOUR_ACTION_OPEN_MISMATCH_RGB);
- combo_ACTION_OPEN_MISMATCH_RGB->setCurrentIndex(behavior_setting);
-
- behavior_setting = oyGetBehaviour(oyBEHAVIOUR_ACTION_OPEN_MISMATCH_CMYK);
- combo_ACTION_OPEN_MISMATCH_CMYK->setCurrentIndex(behavior_setting);
-
-// Set up Proofing Settings
-
- behavior_setting = oyGetBehaviour(oyBEHAVIOUR_RENDERING_INTENT_PROOF);
- combo_RENDERING_INTENT_PROOF->setCurrentIndex(behavior_setting);
-
- behavior_setting = oyGetBehaviour(oyBEHAVIOUR_RENDERING_BPC);
- if(behavior_setting == 1)
- check_RENDERING_BPC->setChecked(true);
- else
- check_RENDERING_BPC->setChecked(false);
-
- behavior_setting = oyGetBehaviour(oyBEHAVIOUR_RENDERING_GAMUT_WARNING);
- if(behavior_setting == 1)
- check_RENDERING_GAMUT_WARNING->setChecked(true);
- else
- check_RENDERING_GAMUT_WARNING->setChecked(false);
-
- behavior_setting = oyGetBehaviour(oyBEHAVIOUR_PROOF_SOFT);
- if(behavior_setting == 1)
- check_PROOF_SOFT->setChecked(true);
- else
- check_PROOF_SOFT->setChecked(false);
-
- behavior_setting = oyGetBehaviour(oyBEHAVIOUR_PROOF_HARD);
-
- if(behavior_setting == 1)
- check_PROOF_HARD->setChecked(true);
- else
- check_PROOF_HARD->setChecked(false);
-
-// Set up Mixed Color Settings
-
- behavior_setting = oyGetBehaviour(oyBEHAVIOUR_MIXED_MOD_DOCUMENTS_SCREEN);
- combo_MIXED_MOD_DOCUMENTS_SCREEN->setCurrentIndex(behavior_setting);
-
- behavior_setting = oyGetBehaviour(oyBEHAVIOUR_MIXED_MOD_DOCUMENTS_PRINT);
- combo_MIXED_MOD_DOCUMENTS_PRINT->setCurrentIndex(behavior_setting);
-}
-
-// Last "clicked on" policy by the user.
-void kmsettings::selectPolicy(int rowIndex)
-{
- QListWidgetItem * selectedPolicyItem = policySettingsList->item(rowIndex);
-
- // If user makes a settings change, and then clicks on a different policy...
- if (settingsChanged == true && isCustom == true)
- {
- if(KMessageBox::questionYesNo(this,
- i18n("The policy settings for '%1' have changed.\nDo you wish to save \
them?", selected_policy),
- i18n("Policy settings have been modified.")) == KMessageBox::Yes)
-
- save();
-
- settingsChanged = false;
- changed(false);
- }
-
- if(!selectedPolicyItem)
- return;
-
- selected_policy = selectedPolicyItem->text();
-
- char * full_name = 0;
- std::string t = selected_policy.toStdString();
- oyPolicyFileNameGet( t.c_str(), &full_name, malloc );
- t.clear();
- QFile file( full_name );
- if(file.permissions() & QFile::WriteOwner)
- {
- isCustom = true; // This is a custom policy.
-
- removePolicyButton->setEnabled(true);
- t = selectedPolicyItem->text().toStdString();
- oyPolicySet( t.c_str(), 0 );
- }
- if(full_name) free( full_name );
-
- // Do not remove "built-in" policies ('Office', 'Photographer', etc.)
- if (rowIndex < internalPolicyCount)
- removePolicyButton->setEnabled(false);
- else
- removePolicyButton->setEnabled(true);
-
- populateBehaviorSettings(); // Refresh settings in "Behavior Settings"
- refreshProfileSettings(); // Refresh comboboxes in "Default Profiles"
- refreshPolicySettings();
-
- setEditableItems(isCustom);
-}
-
-// Refresh profile combo boxes with profiles associated with the current policy.
-void kmsettings::refreshProfileSettings()
-{
- int profileSearchIndex; // Index to match profile stored in a combobox.
-
- QString xmlToString; // String used to grab each default colorspace
- // profile from Oyranos.
-
- /* Each item will grab the default profile, and match it with an available \
profile
- under each combo box in "Default Profiles". The combobox will then display
- the default profile. */
- xmlToString = oyGetDefaultProfileName (oyEDITING_RGB, 0);
- profileSearchIndex = combo_EDITING_RGB->findText( xmlToString, \
Qt::MatchExactly);
- combo_EDITING_RGB->setCurrentIndex(profileSearchIndex);
-
- xmlToString = oyGetDefaultProfileName (oyEDITING_CMYK, 0);
- profileSearchIndex = combo_EDITING_CMYK->findText( xmlToString, \
Qt::MatchExactly);
- combo_EDITING_CMYK->setCurrentIndex(profileSearchIndex);
-
- xmlToString = oyGetDefaultProfileName (oyEDITING_XYZ, 0);
- profileSearchIndex = combo_EDITING_XYZ->findText( xmlToString, \
Qt::MatchExactly);
- combo_EDITING_XYZ->setCurrentIndex(profileSearchIndex);
-
- xmlToString = oyGetDefaultProfileName (oyEDITING_LAB, 0);
- profileSearchIndex = combo_EDITING_LAB->findText( xmlToString, \
Qt::MatchExactly);
- combo_EDITING_LAB->setCurrentIndex(profileSearchIndex);
-
- xmlToString = oyGetDefaultProfileName (oyEDITING_GRAY, 0);
- profileSearchIndex = combo_EDITING_GRAY->findText( xmlToString, \
Qt::MatchExactly);
- combo_EDITING_GRAY->setCurrentIndex(profileSearchIndex);
-
- xmlToString = oyGetDefaultProfileName (oyASSUMED_RGB, 0);
- profileSearchIndex = combo_ASSUMED_RGB->findText( xmlToString, \
Qt::MatchExactly);
- combo_ASSUMED_RGB->setCurrentIndex(profileSearchIndex);
-
- xmlToString = oyGetDefaultProfileName (oyASSUMED_CMYK, 0);
- profileSearchIndex = combo_EDITING_CMYK->findText( xmlToString, \
Qt::MatchExactly);
- combo_ASSUMED_CMYK->setCurrentIndex(profileSearchIndex);
-
- xmlToString = oyGetDefaultProfileName (oyASSUMED_XYZ, 0);
- profileSearchIndex = combo_EDITING_XYZ->findText( xmlToString, \
Qt::MatchExactly);
- combo_ASSUMED_XYZ->setCurrentIndex(profileSearchIndex);
-
- xmlToString = oyGetDefaultProfileName (oyASSUMED_LAB, 0);
- profileSearchIndex = combo_ASSUMED_LAB->findText( xmlToString, \
Qt::MatchExactly);
- combo_ASSUMED_LAB->setCurrentIndex(profileSearchIndex);
-
- xmlToString = oyGetDefaultProfileName (oyASSUMED_GRAY, 0);
- profileSearchIndex = combo_ASSUMED_GRAY->findText( xmlToString, \
Qt::MatchExactly);
- combo_ASSUMED_GRAY->setCurrentIndex(profileSearchIndex);
-
- xmlToString = oyGetDefaultProfileName (oyPROFILE_PROOF, 0);
- profileSearchIndex = combo_PROFILE_PROOF->findText( xmlToString, \
Qt::MatchExactly);
- combo_PROFILE_PROOF->setCurrentIndex(profileSearchIndex);
-}
-
-// Show the actual policy name after changes applied to Oyranos options.
-void kmsettings::refreshPolicySettings()
-{
- // Load policy.
- int count = 0, current = -1;
- const char ** names = 0;
- oyOptionChoicesGet( oyWIDGET_POLICY, &count, &names, ¤t );
- if(names && count && current >= 0)
- {
- selected_policy = names[current];
- // Set user selected policy as system default.
- currentPolicyLabel->setText(selected_policy); // Update default policy \
label.
- kDebug() << "actual policy:" << names[current];
- } else
- currentPolicyLabel->setText("----");
-}
-
-
-
-// This function controls whether or not the settings are read-only.
-void kmsettings::setEditableItems(bool itemStatus)
-{
- QComboBox * combobox;
- for (int i = 0; i < editableComboItems.size(); i++)
- {
- combobox = editableComboItems.value(i);
- combobox->setEnabled(itemStatus);
- }
-
- QCheckBox * checkbox;
- for (int i = 0; i < editableCheckBoxItems.size(); i++)
- {
- checkbox = editableCheckBoxItems.value(i);
- checkbox->setEnabled(itemStatus);
- }
-}
-
-/*
- When the user wants to add a custom policy,
- the program will prompt user for new policy name
- and add to the installed policies list. */
-
-void kmsettings::addNewPolicy()
-{
- bool ok;
-
- // New policy name dialog.
- xmlFileName = QInputDialog::getText(this, i18n("Add new policy"),
- i18n("Please enter a name for the new policy:"),
- QLineEdit::Normal, QDir::home().dirName(), &ok);
-
- if(ok)
- {
- int i;
- QListWidgetItem * temp_item;
-
- for(i = 0; i < policySettingsList->count(); i++)
- {
- temp_item = policySettingsList->item(i);
- if (xmlFileName == temp_item->text())
- {
- KMessageBox::error(this,
- i18n("The policy name '%1' already exists.", xmlFileName),
- i18n("Unable to add policy."));
-
- return;
- }
- }
-
- policySettingsList->addItem(xmlFileName); // Add policy name to list.
- }
- else
- return;
-
- savePolicy();
-
- // Create a "blank" XML file based on entered name.
- selected_policy = xmlFileName;
- saveCustomXmlFile();
- refreshPolicySettings();
-}
-
-void kmsettings::removeCustomPolicy()
-{
- // Remove policy from list file.
- QListWidgetItem * deleted_item = \
policySettingsList->takeItem(policySettingsList->currentRow());
- savePolicy();
-
- // Remove actual Xml file from directory.
- char * full_name = 0;
- std::string t = deleted_item->text().toStdString();
- oyPolicyFileNameGet( t.c_str(),&full_name,malloc);
- QFile file( full_name );
- file.remove();
- if(full_name) free( full_name );
-}
-
-void kmsettings::saveSettingsToXml()
-{
- saveCustomXmlFile();
- refreshPolicySettings();
-}
-
-
-void kmsettings::saveSettings()
-{
- std::string t;
- int behaviorSetting;
-
- t = combo_EDITING_RGB->currentText().toStdString();
- oySetDefaultProfile(oyEDITING_RGB, t.c_str()); t.clear();
-
- t = combo_EDITING_CMYK->currentText().toStdString();
- oySetDefaultProfile(oyEDITING_CMYK, t.c_str()); t.clear();
-
- t = combo_EDITING_XYZ->currentText().toStdString();
- oySetDefaultProfile(oyEDITING_XYZ, t.c_str()); t.clear();
-
- t = combo_EDITING_LAB->currentText().toStdString();
- oySetDefaultProfile(oyEDITING_LAB, t.c_str()); t.clear();
-
- t = combo_EDITING_GRAY->currentText().toStdString();
- oySetDefaultProfile(oyEDITING_GRAY, t.c_str()); t.clear();
-
- t = combo_ASSUMED_RGB->currentText().toStdString();
- oySetDefaultProfile(oyASSUMED_RGB, t.c_str()); t.clear();
-
- t = combo_ASSUMED_CMYK->currentText().toStdString();
- oySetDefaultProfile(oyASSUMED_CMYK, t.c_str()); t.clear();
-
- t = combo_ASSUMED_LAB->currentText().toStdString();
- oySetDefaultProfile(oyASSUMED_LAB, t.c_str()); t.clear();
-
- t = combo_ASSUMED_XYZ->currentText().toStdString();
- oySetDefaultProfile(oyASSUMED_XYZ, t.c_str()); t.clear();
-
- t = combo_ASSUMED_GRAY->currentText().toStdString();
- oySetDefaultProfile(oyASSUMED_GRAY, t.c_str()); t.clear();
-
- t = combo_PROFILE_PROOF->currentText().toStdString();
- oySetDefaultProfile(oyPROFILE_PROOF, t.c_str()); t.clear();
-
- //----------------------------------------------------------------
-
- behaviorSetting = combo_RENDERING_INTENT->currentIndex();
- oySetBehaviour ( oyBEHAVIOUR_RENDERING_INTENT, behaviorSetting ); t.clear();
-
- behaviorSetting = combo_ACTION_UNTAGGED_ASSIGN->currentIndex();
- oySetBehaviour ( oyBEHAVIOUR_ACTION_UNTAGGED_ASSIGN, behaviorSetting ); \
t.clear();
-
- behaviorSetting = combo_ACTION_OPEN_MISMATCH_RGB->currentIndex();
- oySetBehaviour ( oyBEHAVIOUR_ACTION_OPEN_MISMATCH_RGB , behaviorSetting ); \
t.clear();
-
- behaviorSetting = combo_ACTION_OPEN_MISMATCH_CMYK->currentIndex();
- oySetBehaviour ( oyBEHAVIOUR_ACTION_OPEN_MISMATCH_CMYK , behaviorSetting ); \
t.clear();
-
- behaviorSetting = combo_RENDERING_INTENT_PROOF->currentIndex();
- oySetBehaviour ( oyBEHAVIOUR_RENDERING_INTENT_PROOF , behaviorSetting ); \
t.clear();
-
- behaviorSetting = combo_MIXED_MOD_DOCUMENTS_SCREEN->currentIndex();
- oySetBehaviour ( oyBEHAVIOUR_MIXED_MOD_DOCUMENTS_SCREEN , behaviorSetting ); \
t.clear();
-
- behaviorSetting = combo_MIXED_MOD_DOCUMENTS_PRINT->currentIndex();
- oySetBehaviour ( oyBEHAVIOUR_MIXED_MOD_DOCUMENTS_PRINT , behaviorSetting ); \
t.clear();
-
- if (check_RENDERING_BPC->isChecked())
- oySetBehaviour ( oyBEHAVIOUR_RENDERING_BPC , 1 );
- else
- oySetBehaviour ( oyBEHAVIOUR_RENDERING_BPC , 0 );
-
- if (check_RENDERING_GAMUT_WARNING->isChecked())
- oySetBehaviour ( oyBEHAVIOUR_RENDERING_GAMUT_WARNING , 1 );
- else
- oySetBehaviour ( oyBEHAVIOUR_RENDERING_GAMUT_WARNING , 0 );
-
- if (check_PROOF_SOFT->isChecked())
- oySetBehaviour ( oyBEHAVIOUR_PROOF_SOFT , 1 );
- else
- oySetBehaviour ( oyBEHAVIOUR_PROOF_SOFT , 0 );
-
- if (check_PROOF_HARD->isChecked())
- oySetBehaviour( oyBEHAVIOUR_PROOF_HARD , 1 );
- else
- oySetBehaviour(oyBEHAVIOUR_PROOF_HARD , 0 );
-}
-
-// Create a new file that's currently stored in the customProfileDirectory QString.
-void kmsettings::saveCustomXmlFile()
-{
- saveSettings();
- std::string t = selected_policy.toStdString();
- oyPolicySaveActual(oyGROUP_ALL, t.c_str());
-}
-
-// Used to enable the "Apply" button.
-void kmsettings::emitChanged()
-{
- // Ungrey "Apply" button.
- settingsChanged = true;
- emit changed(true);
-
- saveSettings();
- refreshPolicySettings();
-}
-
-// Function to save/refresh installed policies in system.
-void kmsettings::savePolicy()
-{
- QString tempProfile;
- QStringList policyList;
-
- if ( policySettingsList->count() >= internalPolicyCount)
- {
- QListWidgetItem * temp_item;
-
- for (int i = internalPolicyCount; i < policySettingsList->count(); i++)
- {
- temp_item = policySettingsList->item(i);
- tempProfile = temp_item->text();
-
- policyList.insert(0, tempProfile);
- }
- }
-}
-
-// Function to load the installed policies in system.
-void kmsettings::loadPolicy()
-{
- const char ** names = NULL;
- int count = 0, i, current = -1;
-
- policySettingsList->clear();
-
- // NOTE Built-in policies are loaded first.
- oyOptionChoicesGet( oyWIDGET_POLICY, &count, &names, ¤t );
- for(i = 0; i < count; ++i)
- policySettingsList->addItem( names[i] );
+ QGridLayout *gridLayout;
+ gridLayout = new QGridLayout(this);
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+ gridLayout->addWidget(module, 0, 0, 0, 0);
}
kmsettings::~kmsettings()
{
-
+ delete module;
}
diff --git a/settings/kmsettings.h b/settings/kmsettings.h
index e4a017c..92476ca 100644
--- a/settings/kmsettings.h
+++ b/settings/kmsettings.h
@@ -28,25 +28,16 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef KMSETTINGS_H
#define KMSETTINGS_H
-#include <QtGui/QDialogButtonBox>
#include <KCModule>
-#include <KColorScheme>
-#include <KPushButton>
-
#include <oyranos.h>
-
-class QPushButton;
-class QListWidget;
-class QListWidgetItem;
-
-#include "ui_kmsettings.h" // Gui header.
+#include <sy_settings.h>
/*****************************************************************
Kolor Management Settings Class Definition *
******************************************************************/
-class kmsettings : public KCModule, Ui::kmsettings
+class kmsettings : public KCModule
{
Q_OBJECT
@@ -54,95 +45,8 @@ public:
kmsettings(QWidget *parent, const QVariantList &);
~kmsettings();
- // QString to const char * conversion.
- const char* qStringToChar(QString);
-
-public Q_SLOTS:
-
- // load the settings from the config
- virtual void load();
-
- // save the current settings
- virtual void save();
-
-// User-defined QT slots.
-private slots:
-
- // Refreshes which policy is currently highlighted/selected.
- void selectPolicy(int);
-
- // Function used when user clicks on "Add Custom Policy".
- void addNewPolicy();
-
- // Function to remove custom policy.
- void removeCustomPolicy();
-
- // Write changes to the custom Xml File.
- void saveCustomXmlFile();
-
- // Enables "Apply" button.
- void emitChanged();
-
- // Button is called to save custom default profile into XML file.
- void saveSettingsToXml();
-
private:
-
- // Used to fill in "Default Profiles" tab.
- void populateProfiles();
-
- // Used to fill in "Behavior Settings" tab.
- void populateBehaviorSettings();
-
- // Refresh profile list with changed policy settings.
- void refreshProfileSettings();
-
- // Refresh policy displaying
- void refreshPolicySettings();
-
- // Function that handles read-only instances.
- void setEditableItems(bool);
-
- // Function to 'create' a new xml file.
- void writeNewXmlFile(QString policyname, QString filename);
-
- // Filter default profiles.
- void fillProfileComboBoxes(oyPROFILE_e, QComboBox *);
-
- // Save policies
- void savePolicy();
-
- // Load policies
- void loadPolicy();
-
- // Set up all available widgets that are editable into lists.
- void loadEditableItems();
-
- // Store the settings in the Oyranos database
- void saveSettings();
-
- // Holds all available policy names on the list.
- QStringList installedCustomPolicies;
-
- // For items that are editable by the user, having them stored
- // in a list allows us to easily detect if "one" item has been changed.
- QList<QComboBox*> editableComboItems;
- QList<QCheckBox*> editableCheckBoxItems;
-
- // Strings to store policy names.
- QString selected_policy;
- QString default_policy;
-
- // String to hold new custom XML filename.
- QString xmlFileName;
-
- // String used to store the path of a recently installed custom policy.
- QString customProfileDirectory;
-
- // Variable to specify if current policy is a custom one.
- bool isCustom, settingsChanged;
-
- int icc_profile_flags; ///< profile selection flags from \
oyProfile_s.h + SySettingsModule * module;
};
#endif
diff --git a/settings/kmsettings.ui b/settings/kmsettings.ui
deleted file mode 100644
index edc6e87..0000000
--- a/settings/kmsettings.ui
+++ /dev/null
@@ -1,860 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>kmsettings</class>
- <widget class="QWidget" name="kmsettings">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>723</width>
- <height>538</height>
- </rect>
- </property>
- <layout class="QGridLayout" name="gridLayout_5">
- <item row="0" column="0" colspan="2">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QLabel" name="currentPolicyTitleLabel">
- <property name="text">
- <string>Active Policy:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="currentPolicyLabel">
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>----</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0" colspan="2">
- <widget class="QTabWidget" name="kmsettingsTab">
- <property name="currentIndex">
- <number>0</number>
- </property>
- <widget class="QWidget" name="policySettingsTab">
- <attribute name="title">
- <string>Policy Settings</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout_6">
- <item row="2" column="0">
- <widget class="QGroupBox" name="policySettingsBox">
- <property name="title">
- <string>Policy Settings</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_8">
- <item row="0" column="1">
- <widget class="QLabel" name="policyLabel">
- <property name="text">
- <string>Change the global color policy:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QListWidget" name="policySettingsList">
- <property name="whatsThis">
- <string><p>Select from a group of pre-set or user-defined policy \
settings that maintain all of the settings in Kolor \
Manager.</p>
-<p>The four "standard" settings are as follows:</p>
-<ul>
-<li><b>Graphic Design:</b> Useful for digital illustration and web \
imaging work.</li>
-<li><b>Home / Office:</b> Settings that are used for everyday \
occurrences.</li>
-<li><b>Photography:</b> Optimized for photo-related \
work.</li>
-<li><b>Printer:</b> Settings used mainly for printer/proofing \
images.</li>
-</ul></string>
- </property>
- <property name="iconSize">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="QPushButton" name="addNewPolicyButton">
- <property name="text">
- <string>Add Custom Policy</string>
- </property>
- </widget>
- </item>
- <item row="5" column="1">
- <widget class="QPushButton" name="removePolicyButton">
- <property name="text">
- <string>Remove Custom Policy</string>
- </property>
- </widget>
- </item>
- <item row="6" column="1">
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="3" column="1">
- <widget class="Line" name="line_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="defaultProfilesTab">
- <attribute name="title">
- <string>Default Profiles</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout_12">
- <item row="3" column="0">
- <widget class="QGroupBox" name="assumedSourceGBox">
- <property name="toolTip">
- <string><p>Select the default <em>assumed</em> profiles \
for each of the corresponding color spaces.</p></string>
- </property>
- <layout class="QGridLayout" name="gridLayout_17">
- <item row="0" column="0">
- <widget class="QLabel" name="label_ASSUMED_RGB">
- <property name="text">
- <string>Assumed RGB Source:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="combo_ASSUMED_RGB">
- <property name="enabled">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_ASSUMED_CMYK">
- <property name="text">
- <string>Assumed CMYK Source:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QComboBox" name="combo_ASSUMED_CMYK">
- <property name="enabled">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_ASSUMED_XYZ">
- <property name="text">
- <string>Assumed XYZ Source:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QComboBox" name="combo_ASSUMED_XYZ">
- <property name="enabled">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_ASSUMED_LAB">
- <property name="text">
- <string>Assumed Lab Source:</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QComboBox" name="combo_ASSUMED_LAB">
- <property name="enabled">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="label_ASSUMED_GRAY">
- <property name="text">
- <string>Assumed Gray Source:</string>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="QComboBox" name="combo_ASSUMED_GRAY"/>
- </item>
- <item row="5" column="0" colspan="2">
- <widget class="Line" name="line">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item row="6" column="0">
- <widget class="QLabel" name="label_ASSUMED_WEB">
- <property name="text">
- <string>Web Source:</string>
- </property>
- </widget>
- </item>
- <item row="6" column="1">
- <widget class="QComboBox" name="combo_ASSUMED_WEB">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <item>
- <property name="text">
- <string>sRGB.icc (default)</string>
- </property>
- </item>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QGroupBox" name="defaultProfilesBox">
- <property name="toolTip">
- <string><p>Select the default <em>editing</em> profiles \
for each of the corresponding color spaces.</p></string>
- </property>
- <layout class="QGridLayout" name="gridLayout_11">
- <item row="2" column="0">
- <widget class="QLabel" name="label_EDITING_RGB">
- <property name="text">
- <string>Editing RGB:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QComboBox" name="combo_EDITING_RGB">
- <property name="enabled">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_EDITING_CMYK">
- <property name="text">
- <string>Editing CMYK:</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QComboBox" name="combo_EDITING_CMYK">
- <property name="enabled">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="label_EDITING_XYZ">
- <property name="text">
- <string>Editing XYZ:</string>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="QComboBox" name="combo_EDITING_XYZ">
- <property name="enabled">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="5" column="0">
- <widget class="QLabel" name="label_EDITING_LAB">
- <property name="text">
- <string>Editing Lab:</string>
- </property>
- </widget>
- </item>
- <item row="5" column="1">
- <widget class="QComboBox" name="combo_EDITING_LAB">
- <property name="enabled">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="6" column="0">
- <widget class="QLabel" name="label_EDITING_GRAY">
- <property name="text">
- <string>Editing Gray:</string>
- </property>
- </widget>
- </item>
- <item row="6" column="1">
- <widget class="QComboBox" name="combo_EDITING_GRAY"/>
- </item>
- </layout>
- </widget>
- </item>
- <item row="4" column="0">
- <spacer name="verticalSpacer_3">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="behaviourTab">
- <attribute name="title">
- <string>Behavior Settings</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout_10">
- <item row="1" column="0">
- <layout class="QGridLayout" name="gridLayout_9">
- <property name="horizontalSpacing">
- <number>-1</number>
- </property>
- <property name="verticalSpacing">
- <number>16</number>
- </property>
- <property name="topMargin">
- <number>0</number>
- </property>
- <item row="2" column="0">
- <widget class="QGroupBox" name="box_GROUP_BEHAVIOUR_MISSMATCH">
- <property name="toolTip">
- <string><p><b>Mismatch Handling</b> settings lets you \
manage different handling situations for differing \
profiles.</p>
-</string>
- </property>
- <property name="title">
- <string>Mismatch Handling</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_14">
- <property name="leftMargin">
- <number>14</number>
- </property>
- <property name="topMargin">
- <number>9</number>
- </property>
- <property name="bottomMargin">
- <number>18</number>
- </property>
- <item row="0" column="0">
- <layout class="QGridLayout" name="gridLayout">
- <property name="verticalSpacing">
- <number>6</number>
- </property>
- <property name="leftMargin">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>0</number>
- </property>
- <property name="bottomMargin">
- <number>0</number>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="label_ACTION_UNTAGGED_ASSIGN">
- <property name="text">
- <string>For Non-existent Profile</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLabel" name="label_ACTION_OPEN_MISMATCH_RGB">
- <property name="text">
- <string>For RGB Mismatch</string>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QLabel" name="label_ACTION_OPEN_MISMATCH_CMYK">
- <property name="text">
- <string>For CMYK Mismatch</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QComboBox" name="combo_ACTION_UNTAGGED_ASSIGN">
- <property name="whatsThis">
- <string><ul>
-<li><b>Do Not Assign Profile:</b> Do nothing to the mismatched \
profile (leave as is).</li>
-<li><b>Assign Assumed Profile:</b> Assign a profile.</li>
-<li><b>Prompt User:</b> Let the user decide on whether to assign a \
profile or not.</li>
-</ul></string>
- </property>
- <item>
- <property name="text">
- <string>Do Not Assign Profile</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Assign Assumed Profile</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Prompt User</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QComboBox" name="combo_ACTION_OPEN_MISMATCH_RGB">
- <property name="whatsThis">
- <string><ul>
-<li><b>Preserve Numbers:</b> Allow the source RGB profile to be \
kept and unchanged from the destination.</li>
-<li><b>Automatically Convert:</b> Convert the source RGB profile \
to its destination.</li>
-<li><b>Prompt User:</b> Allow the user to choose which method to \
use.</li>
-</ul></string>
- </property>
- <item>
- <property name="text">
- <string>Preserve Numbers</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Automatically Convert</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Prompt User</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QComboBox" name="combo_ACTION_OPEN_MISMATCH_CMYK">
- <property name="whatsThis">
- <string><ul>
-<li><b>Preserve Numbers:</b> Allow the source CMYK profile to be \
kept and unchanged from the destination.</li>
-<li><b>Automatically Convert:</b> Convert the source CMYK profile \
to its destination.</li>
-<li><b>Prompt User:</b> Allow the user to choose which method to \
use.</li>
-</ul></string>
- </property>
- <item>
- <property name="text">
- <string>Preserve Numbers</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Automatically Convert</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Prompt User</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="0" column="1">
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QGroupBox" name="box_GROUP_BEHAVIOUR_MIXED_MODE_DOCUMENTS">
- <property name="toolTip">
- <string><p><b>Mixed Color Space Settings</b> lets you \
handle color space mismatch options for your monitor and \
printer.</p></string>
- </property>
- <property name="title">
- <string>Mixed Color Space Settings</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_16">
- <property name="leftMargin">
- <number>14</number>
- </property>
- <property name="topMargin">
- <number>9</number>
- </property>
- <property name="bottomMargin">
- <number>14</number>
- </property>
- <property name="verticalSpacing">
- <number>-1</number>
- </property>
- <item row="0" column="0">
- <layout class="QGridLayout" name="gridLayout_4">
- <property name="topMargin">
- <number>5</number>
- </property>
- <property name="bottomMargin">
- <number>3</number>
- </property>
- <property name="horizontalSpacing">
- <number>5</number>
- </property>
- <property name="verticalSpacing">
- <number>7</number>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="label_MIXED_MOD_DOCUMENTS_SCREEN">
- <property name="text">
- <string>For Screen</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="combo_MIXED_MOD_DOCUMENTS_SCREEN">
- <property name="whatsThis">
- <string><ul>
-<li><b>Preserve Numbers:</b> Leave the non-RGB color space as is \
(no conversion).</li>
-<li><b>Convert to Editing RGB Space:</b> Convert the non-RGB color \
space into the assigned editing color space.</li>
-<li><b>Convert to Web:</b> Convert the non-RGB color space into \
the web-appropriate sRGB color space.</li>
-<li><b>Prompt User:</b> Allow the user to select the appropriate \
color space conversion method.</li>
-</ul></string>
- </property>
- <item>
- <property name="text">
- <string>Preserve Numbers</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Convert to Editing RGB Space</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Convert to Web</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Prompt User</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_MIXED_MOD_DOCUMENTS_PRINT">
- <property name="text">
- <string>Printer</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QComboBox" name="combo_MIXED_MOD_DOCUMENTS_PRINT">
- <property name="whatsThis">
- <string><ul>
-<li><b>Preserve Numbers:</b> Leave the non-CMYK color space as is \
(no conversion).</li>
-<li><b>Convert to Editing CMYK:</b> Convert the non-CMYK color \
space into an assigned editing CMYK color space.</li>
-<li><b>Convert to Untagged CMYK:</b> Convert the color space into \
a non-CMYK color space.</li>
-<li><b>Prompt User:</b> Allow the user to select the appropriate \
color space conversion method.</li>
-</ul></string>
- </property>
- <item>
- <property name="text">
- <string>Preserve Numbers</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Convert to Editing CMYK</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Convert to Untagged CMYK</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Prompt User</string>
- </property>
- </item>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QGroupBox" name="box_GROUP_BEHAVIOUR_PROOF">
- <property name="toolTip">
- <string><p><b>Proofing</b> will allow you to modify \
color proofing options, including color space, rendering intent, and hard/soft \
proofing.</b></string>
- </property>
- <property name="title">
- <string>Proofing</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_15">
- <property name="leftMargin">
- <number>14</number>
- </property>
- <property name="topMargin">
- <number>8</number>
- </property>
- <property name="bottomMargin">
- <number>9</number>
- </property>
- <item row="0" column="0">
- <layout class="QGridLayout" name="gridLayout_3">
- <property name="topMargin">
- <number>2</number>
- </property>
- <property name="bottomMargin">
- <number>4</number>
- </property>
- <property name="horizontalSpacing">
- <number>-1</number>
- </property>
- <property name="verticalSpacing">
- <number>9</number>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="label_PROFILE_PROOF">
- <property name="text">
- <string>Color Space:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QComboBox" name="combo_PROFILE_PROOF">
- <property name="whatsThis">
- <string>Select from a list of profiles applicable for \
proofing.</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_RENDERING_INTENT_PROOF">
- <property name="text">
- <string>Rendering Intent:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QComboBox" name="combo_RENDERING_INTENT_PROOF">
- <property name="whatsThis">
- <string><ul>
-<li><b>Relative Colorimetric:</b> Scales the white point of the \
source gamut into the white point of the target.</li>
-<li><b>Absolute Colorimetric:</b> Preserves in-gamut colors, and \
clips out-of-gamut colors to the nearest hue.</li>
-</ul></string>
- </property>
- <item>
- <property name="text">
- <string>Relative Colorimetric</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Absolute Colorimetric</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="2" column="2">
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QCheckBox" name="check_PROOF_SOFT">
- <property name="whatsThis">
- <string><p>Select <b>Soft Proof</b> as a means \
to preview the printer's color output on your monitor. (Mostly to match transmissive \
media.)</p></string>
- </property>
- <property name="text">
- <string>Soft Proof</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="check_PROOF_HARD">
- <property name="whatsThis">
- <string><p>Check <b>Hard Proof</b> (or match \
print) to fully simulate colors that the printer will be using through a reflective \
surface.</p></string>
- </property>
- <property name="text">
- <string>Hard Proof</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QGroupBox" name="box_GROUP_BEHAVIOUR_RENDERING">
- <property name="toolTip">
- <string><p><b>Rendering Settings</b> allows you to \
change the global rendering intent.</p></string>
- </property>
- <property name="title">
- <string>Rendering Intent</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_3">
- <property name="spacing">
- <number>-1</number>
- </property>
- <property name="leftMargin">
- <number>14</number>
- </property>
- <property name="topMargin">
- <number>10</number>
- </property>
- <property name="bottomMargin">
- <number>17</number>
- </property>
- <item>
- <layout class="QGridLayout" name="gridLayout_19">
- <property name="topMargin">
- <number>3</number>
- </property>
- <item row="0" column="0">
- <widget class="QComboBox" name="combo_RENDERING_INTENT">
- <property name="whatsThis">
- <string><ul>
-<li><b>Perceptual:</b> Preserves relationship between out-of-gamut \
colors.</li>
-<li><b>Relative Colorimetric:</b> The white point of the \
colorspace source is changed to the destination.</li>
-<li><b>Saturation:</b> Preserves accurate saturation, while \
modifying color hues.</li>
-<li><b>Absolute Colorimetric:</b> The white point of the \
destination colorspace will become the white point of the \
source.</li>
-</ul>
-</string>
- </property>
- <item>
- <property name="text">
- <string>Perceptual</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Relative Colorimetric</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Saturation</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Absolute Colorimetric</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QCheckBox" name="check_RENDERING_BPC">
- <property name="text">
- <string>BlackPointCompensation</string>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QCheckBox" name="check_RENDERING_GAMUT_WARNING">
- <property name="text">
- <string>Gamut Warning</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </item>
- <item row="2" column="0">
- <spacer name="verticalSpacer_4">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="0">
- <spacer name="verticalSpacer_5">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>7</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- <item row="2" column="1">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>0</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic