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/7ff2316bfef735d7226a692178222e3ffe95fd= 27 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. KolorMana= ger 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 SU= CH DAMAGE. = #include "kmdevices.h" = -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include // sleep -#include = -#include -#include -#include -#include -#include -#include +#include // oyMessageFuncSet() = -#include //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 QVariantLi= st &) : = setAboutData( about ); = - currentDevice =3D 0; - current_device_name =3D 0; - current_device_class =3D 0; - - listModified =3D false; // avoid action on signals - - /* select profiles matching actual capabilities */ - icc_profile_flags =3D oyICCProfileSelectionFlagsFromOptions( OY_CMM_ST= D, "//" 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 =3D 0; i < deviceList->columnCount(); i++) - deviceList->resizeColumnToContents(i); - - installProfileButton->setEnabled(false); - - // QT-related Signal/Slot calls (for button-press and item selection e= vents)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 =3D 0; - oyOptions_SetFromText( &options, - "//"OY_TYPE_STD"/config/icc_profile.x_color_region_targ= et", - "yes", OY_CREATE_NEW ); - int error =3D 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 =3D 0, i =3D 1, - * rank_list =3D 0; - char ** texts =3D 0; - int error =3D 0; - - // get all configuration filters - oyConfigDomainList( "//"OY_TYPE_STD"/config.device.icc_profile", - &texts, &count, &rank_list ,0 ); - - for (i =3D 0; i < count; ++i) - { - error =3D 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 =3D 0; - oyConfigs_s * device_list =3D 0; - oyOptions_s * options =3D oyOptions_New(0); - oyConfDomain_s * d =3D oyConfDomain_FromReg( device_type, 0 ); - const char * reg_app =3D strrchr(device_type,'/')+1; - const char * device_class =3D 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 =3D 0, - device_num =3D 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 =3D 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 =3D QString(":/resources/") + device_class + ".png"; - device_icon.addFile( icon.toLower(), icon_size , QIcon::Normal, QI= con::On); - - // Traverse through the available devices - for (j =3D 0; j < device_num; ++j) - { - QString deviceItemString, deviceProfileDescription; - - oyConfig_s * device =3D oyConfigs_Get(device_list, j); - error =3D oyDeviceBackendCall(device, options); - - const char * device_manufacturer =3D 0; - const char * device_model =3D 0; - const char * device_serial =3D 0; - char * device_designation =3D 0; - - const char * profile_filepath =3D 0; - const char * profile_filename =3D 0; - oyProfile_s * profile =3D 0; - - device_manufacturer =3D oyConfig_FindString( device,"manufactu= rer",0); - device_model =3D oyConfig_FindString( device, "model", 0); - device_serial =3D oyConfig_FindString( device, "serial", 0); + oyMessageFuncSet( oyGuiMessageFunc ); = - // Get device designation. - error =3D oyDeviceGetInfo(device, oyNAME_NICK, 0, &device_desi= gnation, malloc); + devicesModule =3D new SyDevicesModule(0); // "Synnefo Devices" = - // A printer will only take a "device model" - if (strcmp(device_class,"printer") !=3D 0) - { - deviceItemString.append(device_manufacturer); - deviceItemString.append(" "); - } - - deviceItemString.append(device_model); - deviceItemString.append(" "); - deviceItemString.append(device_serial); - - error =3D kmDeviceGetProfile(device, &profile); - profile_filepath =3D oyProfile_GetFileName(profile, 0); - - deviceListPointer =3D new QTreeWidgetItem(); - - if (profile_filepath =3D=3D NULL) - { - deviceProfileDescription =3D oyProfile_GetText( profile, o= yNAME_DESCRIPTION ); - if(!deviceProfileDescription.count()) - deviceProfileDescription =3D i18n("(No Profile Installed= )"); - profile_filename =3D "------"; - } - else - { - deviceProfileDescription =3D convertFilenameToDescription(= profile_filepath); - profile_filename =3D strrchr(profile_filepath, '/')+1; - } - - deviceListPointer->setIcon(0, device_icon); - deviceListPointer->setText(DEVICE_DESCRIPTION, deviceItemStrin= g); - deviceListPointer->setText(DEVICE_NAME, device_designation); - deviceListPointer->setText(PROFILE_DESCRIPTION, deviceProfileD= escription); - deviceListPointer->setText(PROFILE_FILENAME, profile_filename); - - parent_item->addChild(deviceListPointer); - - oyConfig_Release(&device); - } - - } - else - error =3D -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() =3D=3D deviceListPointer) - { - deviceProfileComboBox->setEnabled(false); - deviceProfileTaxiDBComboBox->setEnabled(false); - - return; - } - - // The user modifies the list, but clicks away from the selected devic= e item. - listModified =3D false; - - // If we click on a device item, the current device is stored and opti= ons are available. - deviceProfileComboBox->setEnabled(true); - deviceProfileTaxiDBComboBox->setEnabled(true); - - currentDevice =3D selected_device; - - // Convert QString to proper C string. - QByteArray raw_string; - raw_string =3D (currentDevice->text(DEVICE_NAME)).toLatin1(); - setCurrentDeviceName(raw_string.data()); - - char * device_class =3D 0; - if(selected_device && selected_device->parent()) - { - QVariant v =3D selected_device->parent()->data( 0, Qt::UserRole ); - QString qs_device_class =3D v.toString(); - QByteArray raw_string; - raw_string =3D qs_device_class.toLatin1(); - device_class =3D strdup(raw_string.data()); - } - - // Change "Available Device Profiles" combobox to device-related profi= les. - if ( device_class ) - { - oyConfDomain_s * d =3D oyConfDomain_FromReg( device_class, 0 ); - const char * icc_profile_class =3D oyConfDomain_GetText( d, - "icc_profile_class", oyNAME_N= ICK ); - setCurrentDeviceClass(device_class); - - if(icc_profile_class && strcmp(icc_profile_class,"display") =3D=3D 0) - populateLocalProfileComboBox(icSigDisplayClass, new_device); - else if(icc_profile_class && strcmp(icc_profile_class,"output") =3D= =3D 0) - populateLocalProfileComboBox(icSigOutputClass, new_device); - else if(icc_profile_class && strcmp(icc_profile_class,"input") =3D= =3D 0) - populateLocalProfileComboBox(icSigInputClass, new_device); - - oyConfDomain_Release( &d ); - free(device_class); device_class =3D 0; - } - - // Get the device that the user selected. - - // TODO - remove it because this code does nothing - oyConfig_s * device =3D 0; - device =3D 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 =3D 0; - oyOptions_s * options =3D 0; - char * id =3D (char*)calloc(sizeof(char), 1024); - - snprintf(id, 1024, "%s/0", deviceProfileTaxiDBComboBox->itemData(devic= eProfileTaxiDBComboBox->currentIndex()).toString().toStdString().c_str()); - - oyOptions_SetFromText(&options, "//" OY_TYPE_STD "/db/TAXI_id", - id, - OY_CREATE_NEW); - - ip =3D oyProfile_FromTaxiDB(options, NULL); - - oyOptions_Release(&options); - - oyOptions_SetFromText(&options, - "////device", "1", - OY_CREATE_NEW); - - int error =3D oyProfile_Install(ip, options); - - if(!ip) { - msgWidget->setMessageType(KMessageWidget::Information); - msgWidget->setText(i18n("No valid profile obtained")); - } - - if(error =3D=3D 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 =3D=3D oyERROR_DATA_WRITE) { - msgWidget->setMessageType(KMessageWidget::Error); - msgWidget->setText(i18n("User Path can not be written")); - } else if(error =3D=3D oyCORRUPTED) { - msgWidget->setMessageType(KMessageWidget::Error); - msgWidget->setText(i18n("Profile not useable")); - } else if(error > 0) { - QString text =3D 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 devic= eSignature, bool new_device) -{ - int size, i, current =3D -1, current_tmp =3D 0, pos =3D 0; - oyProfile_s * profile =3D 0, * temp_profile =3D 0; - oyProfiles_s * patterns =3D oyProfiles_New(0), - * iccs =3D 0; - oyConfig_s * device =3D getCurrentDevice(); - const char * profile_file_name =3D 0; - - profile =3D oyProfile_FromSignature( deviceSignature, oySIGNATURE_CLAS= S, 0 ); - oyProfiles_MoveIn( patterns, &profile, -1 ); - - iccs =3D oyProfiles_Create( patterns, icc_profile_flags, 0 ); - oyProfiles_Release( &patterns ); - - QString getProfileDescription; - - size =3D oyProfiles_Count(iccs); - int32_t * rank_list =3D (int32_t*) malloc( oyProfiles_Count(iccs) * - sizeof(int32_t) ); - oyProfiles_DeviceRank( iccs, device, rank_list ); - - size =3D oyProfiles_Count(iccs); - - deviceProfileComboBox->clear(); - - kmDeviceGetProfile( device, &profile ); /* reget profile */ - profile_file_name =3D oyProfile_GetFileName( profile, 0 ); - - Qt::CheckState show_only_device_related =3D - relatedDeviceCheckBox->checkSt= ate(); - int empty_added =3D -1; - - for( i =3D 0; i < size; ++i) - { - const char * temp_profile_file_name; - { - temp_profile =3D oyProfiles_Get( iccs, i ); - // show rank number - getProfileDescription =3D "[" + QString::number(rank_list[i]) + "= ] "; - - getProfileDescription +=3D oyProfile_GetText( temp_profile, oyNAM= E_DESCRIPTION ); - temp_profile_file_name =3D oyProfile_GetFileName( temp_profile, 0= ); - - current_tmp =3D -1; - - if(profile_file_name && temp_profile_file_name && - strcmp( profile_file_name, temp_profile_file_name ) =3D=3D 0) - current_tmp =3D pos; - - if(current =3D=3D -1 && current_tmp !=3D -1) - current =3D current_tmp; - - if(empty_added =3D=3D -1 && - rank_list[i] < 1) - { - deviceProfileComboBox->addItem(i18n("automatic")); - empty_added =3D pos; - if(current !=3D -1 && - current =3D=3D pos) - ++current; - ++pos; - } - - if(show_only_device_related =3D=3D Qt::Unchecked || - rank_list[i] > 0 || - current_tmp !=3D -1) - { - getProfileDescription.append("\t("); - getProfileDescription.append(temp_profile_file_name); - getProfileDescription.append(")"); - deviceProfileComboBox->addItem(getProfileDescription); - ++pos; - } - } - oyProfile_Release( &temp_profile ); - } - - if (empty_added =3D=3D -1) - { - deviceProfileComboBox->addItem(i18n("automatic")); - ++pos; - if(current =3D=3D -1 && current_tmp !=3D -1) - current =3D 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 =3D new TaxiLoad( oyConfig_Copy( device, oyObject_= New() ) ); - connect(loader, SIGNAL(finishedSignal( char *, oyConfigs_s * )), thi= s, 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 =3D oyConfigs_Count(taxi_devices); - - int32_t rank =3D 0; - oyConfig_s * taxi_device; - oyConfig_s * device =3D getCurrentDevice(); - - if(!oyConfig_FindString( device, "device_name", for_device) ) - { - QString text =3D i18n("wrong device") + " ... " + QString(for_device= ); - if(oy_debug) - msgWidget->setText(text); - goto clean_getTaxiSlot; - } - - for (int i =3D 0; i < count; i++) { - taxi_device =3D oyConfigs_Get( taxi_devices, i ); - - oyConfig_Compare(device, taxi_device, &rank); - - if (rank > 0) { - QString text =3D "[" + QString::number(rank) + "]"; - text +=3D " "; - text +=3D oyConfig_FindString(taxi_device, "TAXI_profile_description"= , 0); - deviceProfileTaxiDBComboBox->addItem(text, oyConfig_FindString(taxi_d= evice, "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 =3D deviceProfileComboBox->currentText(); - int parenthesis_index =3D 0, base_filename_index =3D 0, str_size =3D 0; - - if(QString::localeAwareCompare( baseFileName, i18n("automatic"))) - { - parenthesis_index =3D baseFileName.indexOf("\t("); - - // Clean-up full text in the deviceComboBox (we will only use the fi= le name to - // add to the profiles list= ). - str_size =3D baseFileName.size(); - baseFileName.remove(0, parenthesis_index + 2); - baseFileName.remove(str_size - 2, 1); - parenthesis_index =3D baseFileName.indexOf(")"); - baseFileName.remove(parenthesis_index, parenthesis_index + 1); - base_filename_index =3D 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 =3D true; - - assignProfile( baseFileName ); - - // Convert QString to proper C string. - QByteArray raw_string; - raw_string =3D (currentDevice->text(DEVICE_NAME)).toLatin1(); - setCurrentDeviceName(raw_string.data()); - - // Update column width of device list. - for(int i =3D 0; i < deviceList->columnCount(); i++) - deviceList->resizeColumnToContents(i); - - // Get the device that the user selected. - oyConfig_s * device =3D 0; - device =3D getCurrentDevice(); - - oyConfig_Release(&device); -} - -oyConfig_s * kmdevices::getCurrentDevice( void ) -{ - oyConfig_s * device =3D 0; - int error =3D 0; - - oyOptions_s * options =3D 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_targ= et", - "yes", OY_CREATE_NEW ); - if(current_device_class && current_device_name) - error =3D oyDeviceGet( OY_TYPE_STD, current_device_class, current_devi= ce_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 =3D NULL; - QString description; - - // If current device pointer points to a MONITOR item, save default p= rofile to Oyranos. - - { - int error=3D 0; - oyConfig_s * device =3D getCurrentDevice(); - std::string t =3D profile_name.toStdString(); - const char * profilename =3D t.c_str(); - char * pn =3D strdup(profilename); - - - /* store a existing profile in DB */ - if(strlen(pn) && QString::localeAwareCompare( QString(pn), i18n("= automatic"))) - error =3D oyDeviceSetProfile ( device, pn ); - error =3D oyDeviceUnset( device ); /* unset the device */ - /* completely unset the actual profile from DB */ - if(!strlen(pn) || !QString::localeAwareCompare(QString(pn), i18n(= "automatic"))) - { - error =3D oyConfig_EraseFromDB( device ); - oyConfig_Release( &device ); - /* reopen the device to forget about the "profile_name" key */ - device =3D getCurrentDevice(); - } - error =3D 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 =3D kmDeviceGetProfile( device, &profile ); /* reget profil= e */ - Q_UNUSED(error); - /* clear */ - oyConfig_Release( &device ); - if(pn) free(pn); pn =3D 0; - } - - // Convert profile into description name... - description =3D oyProfile_GetText( profile, oyNAME_DESCRIPTION); - - if(!description.count()) - description =3D 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 =3D "------"; - currentDevice->setText(PROFILE_FILENAME, profile_name); + QGridLayout *gridLayout; + gridLayout =3D 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 =3D NULL; - - std::string t =3D profileFilename.toStdString(); - profile_name =3D oyProfile_FromFile( t.c_str(), 0, 0); - profileDescriptionName =3D oyProfile_GetText( profile_name, oyNAME_DES= CRIPTION ); - - 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 SU= CH DAMAGE. #ifndef KMDEVICES_H #define KMDEVICES_H = -#include #include -#include -#include -#include - -class QPushButton; -class QListWidget; -class QListWidgetItem; -class QTreeWidget; -class QTreeWidgetItem; - -#include "ui_kmdevices.h" // Gui header. -#include +#include = /***************************************************************** 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 deviceSignat= ure, 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 ne= w_device); - - // Function to refresh device list and node with the new default profi= le. - 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 monito= r. - void saveMonitorLocationInfo (QString device_name, const char * displa= y); - 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 wid= get. - QTreeWidgetItem * currentDevice; - - bool listModified; // Was the list changed by the user? - - int icc_profile_flags; // profile selection flags from oyPr= ofile_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 =3D strdup(name); } - void setCurrentDeviceClass(const char * name) - { if(current_device_name) free(current_device_class); - current_device_class =3D strdup(name); } -}; - -class TaxiLoad : public QThread -{ - Q_OBJECT - - oyConfig_s * d_; - - TaxiLoad( ) { d_ =3D 0; } - public: - TaxiLoad( oyConfig_s * device ) { d_ =3D device; } - ~TaxiLoad( ) { } - = - signals: - void finishedSignal( char * device_name, oyConfigs_s * taxi_device= s ); - = - protected: - void run() { - oyConfigs_s * taxi_devices =3D 0; - char * device_name =3D 0; - if(d_) - { - oyDevicesFromTaxiDB( d_, 0, &taxi_devices, 0); - device_name =3D 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 @@ - - - kmdevices - - - - 0 - 0 - 892 - 624 - - - - - - - - 0 - 0 - - - - Available Device Profiles from Taxi DB - - - false - - - - - - - - - 0 - 0 - - - - - 0 - 27 - - - - - - - - Install selected profile - - - false - - - - - - - - - - - - - - - - 0 - 0 - - - - Qt::ActionsContextMenu - - - - - - Detected Devices - - - true - - - - - - List of installed input/output devices and their default = profiles. - - - - 32 - 32 - - - - false - - - false - - - false - - - - Device Name - - - - - Designation - - - - - Profile Description - - - - - Profile Filename - - - - - - - - - - - - 0 - 0 - - - - Available Device Profiles - - - false - - - - - - - - - 0 - 0 - - - - - 0 - 27 - - - - - - - - Show only device related ICC profiles - - - true - - - false - - - - - - - - - - - - - - - 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_C= URRENT_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 SU= CH DAMAGE. #include "kminfo.h" = #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include = #include -#include -#include -#include +#include = // 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 =3D QChar::fromLatin1(';'); - const QString iccExamin =3D QString::fromLocal8Bit("iccexamin.exe"); -#elif defined (__APPLE__) - QChar pathSep =3D QChar::fromLatin1(':'); - const QString iccExamin =3D QString::fromLocal8Bit("iccexamin.app/Con= tents/MacOS/ICC Examin"); -# else - QChar pathSep =3D QChar::fromLatin1(':'); - const QString iccExamin =3D QString::fromLocal8Bit("iccexamin"); -# endif /* __WIN32__ */ - - QString Path =3D QString::fromLocal8Bit(qgetenv("PATH")); - QFileInfo fileinfo; - - bool done =3D false; - bool found =3D false; - - while (!done) - { - if (!Path.length() > 0) // still more paths to look at - done=3Dtrue; - else - { - // get next path - iccExaminPath =3D Path.left(Path.indexOf(pathSep, 0, Qt::Cas= eSensitive)) + - QString::fromLocal8Bit("/") + iccExamin ; - // remove the path we are about to check from path - Path =3D 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 =3D true; - found =3D true; - - } - // check to see if this was last path - if (Path.length() <=3D iccExaminPath.length()) - done =3D 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 =3D 0; - - /* select profiles matching actual capabilities */ - icc_profile_flags =3D oyICCProfileSelectionFlagsFromOptions( OY_CMM_ST= D, "//" 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 =3D installedProfilesTree->topLevelItem(0); - const char * g_name =3D NULL; - QString name; - editingCsTree =3D installedProfilesTree->topLevelItem(1); - oyWidgetTitleGet( oyWIDGET_GROUP_DEFAULT_PROFILES_EDIT, NULL, &g_name, - NULL, NULL ); - editingCsTree->setText(0, name.fromUtf8(g_name)); - assumedCsTree =3D installedProfilesTree->topLevelItem(2); - oyWidgetTitleGet( oyWIDGET_GROUP_DEFAULT_PROFILES_ASSUMED, NULL, &g_na= me, - 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 =3D 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 ch= anges. - connect( installedProfilesTree, SIGNAL(itemClicked(QTreeWidgetItem*,in= t)), - this, SLOT(changeProfileTreeItem(QTreeWidgetItem*))); - connect( launchICCExaminButton, SIGNAL(clicked()), this, SLOT(launchIC= CExamin())); -} - -void kminfo::launchICCExamin() -{ - QString exec; - - if(!directoryListingTag->text().isNull()) - exec =3D iccExaminCommand + " -g \"" + directoryListingTag->text() += "\"&"; - else - { - // Write to a temporary file. - size_t size =3D 0; - oyPointer data =3D oyProfile_GetMem( current_profile, &size, 0, mall= oc ); - if(data) - { - // The disadvantage is, any previous ICC Examin session for the sa= me - // 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 =3D 0; - exec =3D iccExaminCommand + " -g /tmp/icc_examin_temp.icc&"; - } else - return; - } - std::string t =3D exec.toStdString(); - system(t.c_str()); -} - -// Populate the tree with detected profile items. -void kminfo::populateInstalledProfileList() -{ - devicesParentTree =3D installedProfilesTree->topLevelItem(0); - editingCsTree =3D installedProfilesTree->topLevelItem(1); - assumedCsTree =3D installedProfilesTree->topLevelItem(2); - - - populateDeviceProfiles( devicesParentTree ); - installedProfilesTree->expandAll(); - - const char * g_name =3D NULL; - QString name; - - // Populate colorspace items. - oyWidgetTitleGet( (oyWIDGET_e)oyEDITING_RGB, NULL, &g_name, NULL, NUL= L ); - if (strlen(g_name) > 0) - addProfileTreeItem( oyEDITING_RGB, name.fromUtf8(g_name), editing= CsTree); - oyWidgetTitleGet( (oyWIDGET_e)oyEDITING_CMYK, NULL, &g_name, NULL,NUL= L ); - if (strlen(g_name) > 0) - addProfileTreeItem( oyEDITING_CMYK, name.fromUtf8(g_name), editing= CsTree); - oyWidgetTitleGet( (oyWIDGET_e)oyEDITING_XYZ, NULL, &g_name, NULL, NUL= L ); - if (strlen(g_name) > 0) - addProfileTreeItem( oyEDITING_XYZ, name.fromUtf8(g_name), editing= CsTree ); - oyWidgetTitleGet( (oyWIDGET_e)oyEDITING_LAB, NULL, &g_name, NULL, NUL= L ); - if (strlen(g_name) > 0) - addProfileTreeItem( oyEDITING_LAB, name.fromUtf8(g_name), editing= CsTree ); - oyWidgetTitleGet( (oyWIDGET_e)oyEDITING_GRAY, NULL, &g_name, NULL, NU= LL ); - if (strlen(g_name) > 0) - addProfileTreeItem( oyEDITING_GRAY, name.fromUtf8(g_name), editin= gCsTree ); - oyWidgetTitleGet( (oyWIDGET_e)oyASSUMED_RGB, NULL, &g_name, NULL, NUL= L ); - if (strlen(g_name) > 0) - addProfileTreeItem( oyASSUMED_RGB, name.fromUtf8(g_name), assumedC= sTree ); - oyWidgetTitleGet( (oyWIDGET_e)oyASSUMED_CMYK, NULL, &g_name, NULL,NUL= L ); - if (strlen(g_name) > 0) - addProfileTreeItem( oyASSUMED_CMYK, name.fromUtf8(g_name), assume= dCsTree ); - oyWidgetTitleGet( (oyWIDGET_e)oyASSUMED_XYZ, NULL, &g_name, NULL, NUL= L ); - if (strlen(g_name) > 0) - addProfileTreeItem( oyASSUMED_XYZ, name.fromUtf8(g_name), assumedC= sTree ); - oyWidgetTitleGet( (oyWIDGET_e)oyASSUMED_LAB, NULL, &g_name, NULL, NUL= L ); - if (strlen(g_name) > 0) - addProfileTreeItem( oyASSUMED_LAB, name.fromUtf8(g_name), assumedC= sTree ); - oyWidgetTitleGet( (oyWIDGET_e)oyASSUMED_GRAY, NULL, &g_name, NULL, NU= LL ); - if (strlen(g_name) > 0) - addProfileTreeItem( oyASSUMED_GRAY, name.fromUtf8(g_name), assumed= CsTree ); -} - -void kminfo::populateDeviceProfiles( QTreeWidgetItem * deviceListTree ) -{ - int n =3D 0; - QIcon device_icon(""); - - uint32_t count =3D 0, i,j, - * rank_list =3D 0; - char ** texts =3D 0; - const char * device_class =3D 0; - oyConfDomain_s * d =3D 0; - int error =3D 0; - - // get all configuration filters - oyConfigDomainList( "//"OY_TYPE_STD"/config.device.icc_profile", - &texts, &count, &rank_list ,0 ); - - for (i =3D 0; i < count; ++i) - { - oyConfigs_s * devices =3D 0; - const char * reg_app =3D strrchr(texts[i],'/')+1; - error =3D oyDevicesGet( OY_TYPE_STD, reg_app, 0, &devices ); - Q_UNUSED(error); - n =3D oyConfigs_Count( devices ); - d =3D oyConfDomain_FromReg( texts[i], 0 ); - - // Setup icons for devices parent item. - if(strstr(reg_app,"monitor")) - device_icon =3D QIcon(":/resources/monitor.png"); - else if(strstr(reg_app,"printer")) - device_icon =3D QIcon(":/resources/printer.png"); - else if(strstr(reg_app,"scanner")) - device_icon =3D QIcon(":/resources/scanner.png"); - - // pick the modules device class nick name - device_class =3D oyConfDomain_GetText( d, "device_class", oyNAME_NAM= E ); - - QTreeWidgetItem * device_list_sub_tree =3D new QTreeWidgetItem; - device_list_sub_tree->setText(0, device_class); - deviceListTree->addChild(device_list_sub_tree); - - for(j =3D 0; j < (uint32_t)n; ++j) - { - oyConfig_s * device =3D oyConfigs_Get( devices, j ); - char * device_info =3D 0; - - // get expensive information to see the "model" option - error =3D oyDeviceGetInfo( device, oyNAME_DESCRIPTION, 0, - &device_info, malloc ); - error =3D oyDeviceGetInfo( device, oyNAME_NAME, 0, - &device_info, malloc ); - - QTreeWidgetItem * device_child =3D new QTreeWidgetItem; - QString device_item_string; - const char * device_manufacturer =3D 0; - const char * device_model =3D 0; - const char * device_serial =3D 0; - - device_manufacturer =3D oyConfig_FindString( device, "manufacturer= ", 0); - device_model =3D oyConfig_FindString( device, "model", 0); - device_serial =3D 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 =3D strdup(device_item_string.toUtf8()); - if(!model) - { - const char * m =3D oyConfig_FindString( device, "device_name", 0= ); - if(m) - model =3D 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 =3D 0; - device_child->setIcon(0, device_icon); - device_list_sub_tree->addChild(device_child); - - oyProfile_s * p =3D 0; - oyOptions_s * options =3D 0; - error =3D oyOptions_SetFromText( &options, - "//"OY_TYPE_STD"/config/icc_profile= .x_color_region_target", - "yes", OY_CREATE_NEW ); - oyOptions_SetFromInt( &options, "///icc_profile_flags", icc_profil= e_flags, 0, OY_CREATE_NEW ); - oyDeviceGetProfile( device, options, &p ); - oyOptions_Release( &options ); - - if(p) - { - QTreeWidgetItem * profile_child =3D new QTreeWidgetItem; - const char* profile_name =3D oyProfile_GetText( p, oyNAME_DESCRI= PTION ); - const char* file_path =3D oyProfile_GetFileName( p, -1 ); - if(file_path) - { - const char* file_name =3D 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 descrip= tion, - QTreeWidgetItem * parent_item ) -{ - oyProfile_s * profile =3D oyProfile_FromStd( profile_type, icc_profi= le_flags, 0 ); - const char * text =3D oyProfile_GetText( profile, oyNAME_DESCRIPTION= ); - - // Add new item. - QTreeWidgetItem * new_child =3D 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 inform= ation" -// window is updated. -void kminfo::changeProfileTreeItem(QTreeWidgetItem* currentProfileItem) -{ - // get the profile from the widget - QVariant v =3D currentProfileItem->data( 0, Qt::UserRole ); - oyProfile_s * p =3D (oyProfile_s *) v.toULongLong(); - - if(p && p->type_ =3D=3D 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, descriptionTagLab= el); - - setDateTag(profile, dateTagLabel); - - setCSpaceTag(profile, colorspaceTagLabel); - - setIccsTag(profile, iccVerTagLabel); - - setPcsTag(profile, pcsTagLabel); - - setDeviceClassTag(profile, deviceClassTagLabel); - - QString profilePathName =3D oyProfile_GetFileName( profile, -1 ); - directoryListingTag->setText(profilePathName); - - oyProfile_Release( ¤t_profile ); - current_profile =3D oyProfile_Copy( profile, 0 ); - - setProfileInfoPanelHiding(false); - - m_tempFile.open(); - - KProcess * process =3D new KProcess(); - connect(process, SIGNAL(finished(int)), SLOT(loadProfileGraph())); - - QString program =3D 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 =3D oyValueUInt32( oyProfile_GetSignature(profile, oySI= GNATURE_VERSION) ); - char * v =3D (char*)&vs; - - field1 =3D (((int)v[0])); - field2 =3D ((int)v[1]/16); - field3 =3D ((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 * devClassLab= el) -{ - QString string; - string =3D oyICCDeviceClassDescription( (icProfileClassSignature) - oyProfile_GetSignature(profile, oySIGNATURE_CLASS= ) ); - devClassLabel->setText(string); -} - -void kminfo::setPcsTag(oyProfile_s * profile, QLabel * pcsLabel) -{ - QString tagString; - tagString =3D oyICCColorSpaceGetName( (icColorSpaceSignature) - oyProfile_GetSignature(profile, oySIGNATURE_PCS) = ); - pcsLabel->setText("CIE" + tagString); -} - -void kminfo::setCSpaceTag(oyProfile_s * profile, QLabel * cSpaceLabel) -{ - QString tagString; - tagString =3D 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 =3D oyProfile_GetSignature(profile, oySIGNATURE_DATETIME_YEAR); - month =3D oyProfile_GetSignature(profile, oySIGNATURE_DATETIME_MONTH); - day =3D oyProfile_GetSignature(profile, oySIGNATURE_DATETIME_DAY); + oyMessageFuncSet( oyGuiMessageFunc ); = - // NOTE (If we need hours/minutes/seconds, uncomment) - //hours =3D oyProfile_GetSignature(profile, oySIGNATURE_DATETIME_HOU= RS); - //minutes =3D oyProfile_GetSignature(profile, oySIGNATURE_DATETIME_M= INUTES); - //seconds =3D oyProfile_GetSignature(profile, oySIGNATURE_DATETIME_S= ECONDS); + module =3D new SyInfoModule(0); // "Synnefo Info" = - QString date =3D QString("%1-%2-%3").arg( year ).arg( month ).arg( da= y ); - dateLabel->setText( date ); + QGridLayout *gridLayout; + gridLayout =3D 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 La= bel. -void kminfo::setTagDescriptions(oyProfile_s * profile_name, icTagSignature= tagType, QLabel * tagLabel ) -{ - int text_n; - bool error; - - //oyObject_s object; - char** tagText =3D 0; - oyProfileTag_s * tagID; - - tagID =3D oyProfile_GetTagById( profile_name, tagType ); - - error =3D !tagID; - - if(!error) - tagText =3D 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 SUC= H DAMAGE. #ifndef KMINFO_H #define KMINFO_H = -#include #include -#include -#include -#include - -#include -#include - -class QPushButton; -class QListWidget; -class QListWidgetItem; - -#include "ui_kminfo.h" // Gui header. +#include = /****************************************************************** 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, QTreeWidge= tItem * parent_item ); - - // Populate tree list items relating to device-specific profiles (pri= nters, monitors, etc.) - void populateDeviceProfiles( /*QStringList listOfDevices,*/ QTreeWidg= etItem * deviceListSubTree /*, QIcon device_icon*/); - - // Populate tag descriptions for device-specific profiles. - void populateDeviceProfileDescriptions(oyProfile_s * profile, bool va= lid); - - // 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, A= ssumed 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 @@ - - - kminfo - - - - 0 - 0 - 949 - 684 - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - true - - - false - - - - - 0 - 0 - - - - - 200 - 0 - - - - false - - - false - - - QAbstractItemView::SingleSelection - - - Qt::ElideRight - - - false - - - false - - - false - - - false - - - false - - - - Installed Profiles - - - - - Description - - - - - Devices - - - - - - - - Editing Space - - - - - - - - Assumed Space - - - - - - - - - - 0 - 0 - - - - - 340 - 0 - - - - false - - - - 0 - - - - - - 0 - 0 - - - - QFrame::NoFrame - - - Qt::ScrollBarAlwaysOff - - - true - - - - - 0 - 0 - 510 - 666 - - - - - - - - - - 98 - 99 - - - - - 150 - 300 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - 3 - - - 3 - - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 13 - 75 - true - - - - ICCDescriptionLabel - - - Qt::AlignHCenter|Qt::AlignTop - - - true - - - - - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 0 - 30 - - - - QFrame::Plain - - - 1 - - - (Copyright not available) - - - false - - - Qt::AlignHCenter|Qt::AlignTop - - - true - - - 0 - - - - - - - - - - - - 0 - 0 - - - - - 116 - 0 - - - - - 75 - false - true - false - - - - Date Created: - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - ---- - - - - - - - - 0 - 0 - - - - - 113 - 0 - - - - - 75 - true - - - - Device Class: - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - ---- - - - - - - - - 0 - 0 - - - - - 118 - 0 - - - - - 75 - true - - - - Manufacturer: - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - ---- - - - Qt::AlignJustify|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 55 - 0 - - - - - 75 - true - - - - Model: - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - ---- - - - Qt::AlignJustify|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 101 - 0 - - - - - 75 - true - - - - ICC Version: - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - ---- - - - - - - - - 0 - 0 - - - - - 104 - 0 - - - - - 75 - true - - - - Color Space: - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - ---- - - - - - - - - 0 - 0 - - - - - 84 - 0 - - - - - 75 - true - - - - PCS Type: - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - ---- - - - - - - - - - 0 - - - 3 - - - 3 - - - - - - 0 - 0 - - - - - 102 - 0 - - - - - 75 - true - false - - - - Profile Path: - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 16777215 - 16777215 - - - - - 50 - false - false - - - - QFrame::NoFrame - - - QFrame::Plain - - - 1 - - - 0 - - - --- - - - Qt::AutoText - - - false - - - Qt::AlignJustify|Qt::AlignVCenter - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByM= ouse - - - - - - - - - - 0 - 0 - - - - - 0 - 200 - - - - - - - - 200 - 200 - - - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - - - - - - - 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 SUC= H DAMAGE. = #include "kmsettings.h" = -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -// The number of policies that are available in KM by default. -// NOTE These are listed *before* the user-defined policies. -const int internalPolicyCount =3D 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 =3D 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 QVariant= List &) : = setAboutData( about ); = - /* select profiles matching actual capabilities */ - icc_profile_flags =3D oyICCProfileSelectionFlagsFromOptions( OY_CMM_ST= D, "//" OY_TYPE_STD "/icc_color", NULL, 0 ); - - setupUi(this); // Load Gui. - - removePolicyButton->setEnabled(false); - - loadEditableItems(); // Store all setting widgets into a conveni= ent list structure. - - populateProfiles(); // Load all Oyranos-specified profiles - // into each combobox in the "Default Profi= les" tab. - - - settingsChanged =3D false; - - /* i18n */ - QString qs; - int i; - int count =3D 0, - current =3D 0, - flags =3D 0; - const char * tooltip =3D NULL; - const char ** names =3D NULL; - const char * label =3D NULL; - oyWIDGET_TYPE_e type =3D oyWIDGETTYPE_START; - - // Get widget strings. - type =3D oyWidgetTitleGet( oyWIDGET_POLICY, NULL, &label, &tooltip, &fla= gs ); - qs =3D QString::fromLocal8Bit(label); - policySettingsBox->setTitle(qs); - kmsettingsTab->setTabText(0,qs); - qs =3D QString::fromLocal8Bit( tooltip ); - policyLabel->setText(qs); - - type =3D oyWidgetTitleGet( oyWIDGET_GROUP_DEFAULT_PROFILES, NULL, &label= , &tooltip, &flags ); - Q_UNUSED(type); - qs =3D QString::fromLocal8Bit(label); - kmsettingsTab->setTabText(1,qs); - - type =3D oyWidgetTitleGet( oyWIDGET_GROUP_BEHAVIOUR, NULL, &label, &tool= tip, &flags ); - Q_UNUSED(type); - qs =3D QString::fromLocal8Bit(label,-1); - kmsettingsTab->setTabText(2,qs); - -#define SET_OY_PROFILE_WIDGET( widget ) \ - oyWidgetTitleGet( oyWIDGET_##widget, NULL, &label, &tooltip, &flags ); \ - qs =3D QString::fromLocal8Bit(label); \ - label_##widget->setText( qs ); \ - qs =3D 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 =3D QString::fromLocal8Bit(label); \ - box_##widget->setTitle( qs ); \ - qs =3D 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 =3D QString::fromLocal8Bit( tooltip ); \ - combo_##widget->setToolTip( qs ); \ - combo_##widget->clear(); \ - for(i =3D 0; i < count; ++i) \ - { \ - qs =3D QString::fromLocal8Bit( names[i] ); \ - combo_##widget->addItem( qs ); \ - } - -#define SET_OY_CHECK_WIDGET( widget ) \ - oyWidgetTitleGet( oyWIDGET_##widget, NULL, &label, &tooltip, &flags ); \ - qs =3D QString::fromLocal8Bit( label ); \ - check_##widget->setText( qs ); \ - qs =3D QString::fromLocal8Bit( tooltip ); \ - check_##widget->setToolTip( qs ); - -#define SET_OY_LABEL_WIDGET( widget ) \ - oyWidgetTitleGet( oyWIDGET_##widget, NULL, &label, &tooltip, &flags ); \ - qs =3D QString::fromLocal8Bit(label); \ - label_##widget->setText( qs ); \ - qs =3D 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 Pro= files" - 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(removeCustomP= olicy())); - - int k =3D 0, n =3D editableComboItems.size(); - // When a user clicks on any combo box, the "Apply" button will be enab= led. - for(k =3D 0; k < n; ++k) - connect(editableComboItems.value(k), SIGNAL(activated(int)), this, SLO= T(emitChanged())); - - n =3D editableCheckBoxItems.size(); - // When a user clicks on a radio box, the "Apply" button will be enable= d. - for(k =3D 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-instal= led 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 =3D 0, size, i, - sizeofProfilename, - indexofProfilename; - oyProfile_s * temp_prof =3D 0; - oyProfiles_s * iccs; - - QString profile_text, profile_filename; - - iccs =3D oyProfiles_ForStd( profile_type, icc_profile_flags, ¤t,= 0 ); - - size =3D oyProfiles_Count(iccs); - for( i =3D 0; i < size; ++i) - { - temp_prof =3D oyProfiles_Get( iccs, i ); - profile_text =3D oyProfile_GetText( temp_prof, oyNAME_DESCRIPTION ); - profile_filename =3D oyProfile_GetFileName(temp_prof, 0); + oyMessageFuncSet( oyGuiMessageFunc ); = - sizeofProfilename =3D profile_filename.size(); - indexofProfilename =3D profile_filename.lastIndexOf( "/", sizeofPro= filename - 1); - profile_filename.remove(0, indexofProfilename + 1); + module =3D 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 =3D oyGetBehaviour(oyBEHAVIOUR_RENDERING_INTENT); - combo_RENDERING_INTENT->setCurrentIndex(behavior_setting); - -// Populate Mismatch Handling Settings - - behavior_setting =3D oyGetBehaviour(oyBEHAVIOUR_ACTION_UNTAGGED_ASSIG= N); - combo_ACTION_UNTAGGED_ASSIGN->setCurrentIndex(behavior_setting); - - behavior_setting =3D oyGetBehaviour(oyBEHAVIOUR_ACTION_OPEN_MISMATCH_= RGB); - combo_ACTION_OPEN_MISMATCH_RGB->setCurrentIndex(behavior_setting); - - behavior_setting =3D oyGetBehaviour(oyBEHAVIOUR_ACTION_OPEN_MISMATCH_= CMYK); - combo_ACTION_OPEN_MISMATCH_CMYK->setCurrentIndex(behavior_setting); - -// Set up Proofing Settings - - behavior_setting =3D oyGetBehaviour(oyBEHAVIOUR_RENDERING_INTENT_PROO= F); - combo_RENDERING_INTENT_PROOF->setCurrentIndex(behavior_setting); - - behavior_setting =3D oyGetBehaviour(oyBEHAVIOUR_RENDERING_BPC); - if(behavior_setting =3D=3D 1) - check_RENDERING_BPC->setChecked(true); - else - check_RENDERING_BPC->setChecked(false); - - behavior_setting =3D oyGetBehaviour(oyBEHAVIOUR_RENDERING_GAMUT_WARNI= NG); - if(behavior_setting =3D=3D 1) - check_RENDERING_GAMUT_WARNING->setChecked(true); - else - check_RENDERING_GAMUT_WARNING->setChecked(false); - - behavior_setting =3D oyGetBehaviour(oyBEHAVIOUR_PROOF_SOFT); - if(behavior_setting =3D=3D 1) - check_PROOF_SOFT->setChecked(true); - else - check_PROOF_SOFT->setChecked(false); - - behavior_setting =3D oyGetBehaviour(oyBEHAVIOUR_PROOF_HARD); - - if(behavior_setting =3D=3D 1) - check_PROOF_HARD->setChecked(true); - else - check_PROOF_HARD->setChecked(false); - -// Set up Mixed Color Settings - - behavior_setting =3D oyGetBehaviour(oyBEHAVIOUR_MIXED_MOD_DOCUMENTS_S= CREEN); - combo_MIXED_MOD_DOCUMENTS_SCREEN->setCurrentIndex(behavior_setting); - - behavior_setting =3D oyGetBehaviour(oyBEHAVIOUR_MIXED_MOD_DOCUMENTS_P= RINT); - combo_MIXED_MOD_DOCUMENTS_PRINT->setCurrentIndex(behavior_setting); -} - -// Last "clicked on" policy by the user. -void kmsettings::selectPolicy(int rowIndex) -{ - QListWidgetItem * selectedPolicyItem =3D policySettingsList->item(rowI= ndex); - - // If user makes a settings change, and then clicks on a different pol= icy... - if (settingsChanged =3D=3D true && isCustom =3D=3D true) - { - if(KMessageBox::questionYesNo(this, - i18n("The policy settings for '%1' have changed.\nDo you wish to s= ave them?", selected_policy), - i18n("Policy settings have been modified.")) =3D=3D KMessageBox::Y= es) - - save(); - - settingsChanged =3D false; - changed(false); - } - - if(!selectedPolicyItem) - return; - - selected_policy =3D selectedPolicyItem->text(); - - char * full_name =3D 0; - std::string t =3D selected_policy.toStdString(); - oyPolicyFileNameGet( t.c_str(), &full_name, malloc ); - t.clear(); - QFile file( full_name ); - if(file.permissions() & QFile::WriteOwner) - { - isCustom =3D true; // This is a custom policy. - - removePolicyButton->setEnabled(true); - t =3D 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 Se= ttings" - refreshProfileSettings(); // Refresh comboboxes in "Default P= rofiles" - 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 combob= ox. - - QString xmlToString; // String used to grab each default colorspa= ce - // profile from Oyranos. - - /* Each item will grab the default profile, and match it with an avai= lable profile - under each combo box in "Default Profiles". The combobox will the= n display - the default profile. = */ - xmlToString =3D oyGetDefaultProfileName (oyEDITING_RGB, 0); - profileSearchIndex =3D combo_EDITING_RGB->findText( xmlToString, Qt::= MatchExactly); - combo_EDITING_RGB->setCurrentIndex(profileSearchIndex); - - xmlToString =3D oyGetDefaultProfileName (oyEDITING_CMYK, 0); - profileSearchIndex =3D combo_EDITING_CMYK->findText( xmlToString, Qt:= :MatchExactly); - combo_EDITING_CMYK->setCurrentIndex(profileSearchIndex); - - xmlToString =3D oyGetDefaultProfileName (oyEDITING_XYZ, 0); - profileSearchIndex =3D combo_EDITING_XYZ->findText( xmlToString, Qt::= MatchExactly); - combo_EDITING_XYZ->setCurrentIndex(profileSearchIndex); - - xmlToString =3D oyGetDefaultProfileName (oyEDITING_LAB, 0); - profileSearchIndex =3D combo_EDITING_LAB->findText( xmlToString, Qt::= MatchExactly); - combo_EDITING_LAB->setCurrentIndex(profileSearchIndex); - - xmlToString =3D oyGetDefaultProfileName (oyEDITING_GRAY, 0); - profileSearchIndex =3D combo_EDITING_GRAY->findText( xmlToString, Qt:= :MatchExactly); - combo_EDITING_GRAY->setCurrentIndex(profileSearchIndex); - - xmlToString =3D oyGetDefaultProfileName (oyASSUMED_RGB, 0); - profileSearchIndex =3D combo_ASSUMED_RGB->findText( xmlToString, Qt::= MatchExactly); - combo_ASSUMED_RGB->setCurrentIndex(profileSearchIndex); - - xmlToString =3D oyGetDefaultProfileName (oyASSUMED_CMYK, 0); - profileSearchIndex =3D combo_EDITING_CMYK->findText( xmlToString, Qt:= :MatchExactly); - combo_ASSUMED_CMYK->setCurrentIndex(profileSearchIndex); - - xmlToString =3D oyGetDefaultProfileName (oyASSUMED_XYZ, 0); - profileSearchIndex =3D combo_EDITING_XYZ->findText( xmlToString, Qt::= MatchExactly); - combo_ASSUMED_XYZ->setCurrentIndex(profileSearchIndex); - - xmlToString =3D oyGetDefaultProfileName (oyASSUMED_LAB, 0); - profileSearchIndex =3D combo_ASSUMED_LAB->findText( xmlToString, Qt::= MatchExactly); - combo_ASSUMED_LAB->setCurrentIndex(profileSearchIndex); - - xmlToString =3D oyGetDefaultProfileName (oyASSUMED_GRAY, 0); - profileSearchIndex =3D combo_ASSUMED_GRAY->findText( xmlToString, Qt:= :MatchExactly); - combo_ASSUMED_GRAY->setCurrentIndex(profileSearchIndex); - - xmlToString =3D oyGetDefaultProfileName (oyPROFILE_PROOF, 0); - profileSearchIndex =3D 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 =3D 0, current =3D -1; - const char ** names =3D 0; - oyOptionChoicesGet( oyWIDGET_POLICY, &count, &names, ¤t ); - if(names && count && current >=3D 0) - { - selected_policy =3D 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 =3D 0; i < editableComboItems.size(); i++) - { - combobox =3D editableComboItems.value(i); - combobox->setEnabled(itemStatus); - } - - QCheckBox * checkbox; - for (int i =3D 0; i < editableCheckBoxItems.size(); i++) - { - checkbox =3D 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 =3D 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 =3D 0; i < policySettingsList->count(); i++) - { - temp_item =3D policySettingsList->item(i); - if (xmlFileName =3D=3D 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 =3D xmlFileName; - saveCustomXmlFile(); - refreshPolicySettings(); -} - -void kmsettings::removeCustomPolicy() -{ - // Remove policy from list file. - QListWidgetItem * deleted_item =3D policySettingsList->takeItem(polic= ySettingsList->currentRow()); - savePolicy(); - - // Remove actual Xml file from directory. - char * full_name =3D 0; - std::string t =3D 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 =3D combo_EDITING_RGB->currentText().toStdString(); - oySetDefaultProfile(oyEDITING_RGB, t.c_str()); t.clear(); - - t =3D combo_EDITING_CMYK->currentText().toStdString(); - oySetDefaultProfile(oyEDITING_CMYK, t.c_str()); t.clear(); - - t =3D combo_EDITING_XYZ->currentText().toStdString(); - oySetDefaultProfile(oyEDITING_XYZ, t.c_str()); t.clear(); - - t =3D combo_EDITING_LAB->currentText().toStdString(); - oySetDefaultProfile(oyEDITING_LAB, t.c_str()); t.clear(); - - t =3D combo_EDITING_GRAY->currentText().toStdString(); - oySetDefaultProfile(oyEDITING_GRAY, t.c_str()); t.clear(); - - t =3D combo_ASSUMED_RGB->currentText().toStdString(); - oySetDefaultProfile(oyASSUMED_RGB, t.c_str()); t.clear(); - - t =3D combo_ASSUMED_CMYK->currentText().toStdString(); - oySetDefaultProfile(oyASSUMED_CMYK, t.c_str()); t.clear(); - - t =3D combo_ASSUMED_LAB->currentText().toStdString(); - oySetDefaultProfile(oyASSUMED_LAB, t.c_str()); t.clear(); - - t =3D combo_ASSUMED_XYZ->currentText().toStdString(); - oySetDefaultProfile(oyASSUMED_XYZ, t.c_str()); t.clear(); - - t =3D combo_ASSUMED_GRAY->currentText().toStdString(); - oySetDefaultProfile(oyASSUMED_GRAY, t.c_str()); t.clear(); - - t =3D combo_PROFILE_PROOF->currentText().toStdString(); - oySetDefaultProfile(oyPROFILE_PROOF, t.c_str()); t.clear(); - - //---------------------------------------------------------------- - - behaviorSetting =3D combo_RENDERING_INTENT->currentIndex(); - oySetBehaviour ( oyBEHAVIOUR_RENDERING_INTENT, behaviorSetting ); t.cl= ear(); - - behaviorSetting =3D combo_ACTION_UNTAGGED_ASSIGN->currentIndex(); - oySetBehaviour ( oyBEHAVIOUR_ACTION_UNTAGGED_ASSIGN, behaviorSetting )= ; t.clear(); - - behaviorSetting =3D combo_ACTION_OPEN_MISMATCH_RGB->currentIndex(); - oySetBehaviour ( oyBEHAVIOUR_ACTION_OPEN_MISMATCH_RGB , behaviorSettin= g ); t.clear(); - - behaviorSetting =3D combo_ACTION_OPEN_MISMATCH_CMYK->currentIndex(); - oySetBehaviour ( oyBEHAVIOUR_ACTION_OPEN_MISMATCH_CMYK , behaviorSetti= ng ); t.clear(); - - behaviorSetting =3D combo_RENDERING_INTENT_PROOF->currentIndex(); - oySetBehaviour ( oyBEHAVIOUR_RENDERING_INTENT_PROOF , behaviorSetting = ); t.clear(); - - behaviorSetting =3D combo_MIXED_MOD_DOCUMENTS_SCREEN->currentIndex(); - oySetBehaviour ( oyBEHAVIOUR_MIXED_MOD_DOCUMENTS_SCREEN , behaviorSett= ing ); t.clear(); - - behaviorSetting =3D combo_MIXED_MOD_DOCUMENTS_PRINT->currentIndex(); - oySetBehaviour ( oyBEHAVIOUR_MIXED_MOD_DOCUMENTS_PRINT , behaviorSetti= ng ); 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 =3D selected_policy.toStdString(); - oyPolicySaveActual(oyGROUP_ALL, t.c_str()); -} - -// Used to enable the "Apply" button. -void kmsettings::emitChanged() -{ - // Ungrey "Apply" button. - settingsChanged =3D true; - emit changed(true); - - saveSettings(); - refreshPolicySettings(); -} - -// Function to save/refresh installed policies in system. -void kmsettings::savePolicy() -{ - QString tempProfile; - QStringList policyList; - - if ( policySettingsList->count() >=3D internalPolicyCount) - { - QListWidgetItem * temp_item; - - for (int i =3D internalPolicyCount; i < policySettingsList->count= (); i++) - { - temp_item =3D policySettingsList->item(i); - tempProfile =3D temp_item->text(); - - policyList.insert(0, tempProfile); - } - } -} - -// Function to load the installed policies in system. -void kmsettings::loadPolicy() -{ - const char ** names =3D NULL; - int count =3D 0, i, current =3D -1; - - policySettingsList->clear(); - - // NOTE Built-in policies are loaded first. - oyOptionChoicesGet( oyWIDGET_POLICY, &count, &names, ¤t ); - for(i =3D 0; i < count; ++i) - policySettingsList->addItem( names[i] ); + QGridLayout *gridLayout; + gridLayout =3D 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 SU= CH DAMAGE. #ifndef KMSETTINGS_H #define KMSETTINGS_H = -#include #include -#include -#include - #include - -class QPushButton; -class QListWidget; -class QListWidgetItem; - -#include "ui_kmsettings.h" // Gui header. +#include = = /***************************************************************** 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 editableComboItems; - QList 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 @@ - - - kmsettings - - - - 0 - 0 - 723 - 538 - - - - - - - - - Active Policy: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 75 - true - - - - ---- - - - - - - - - - 0 - - - - Policy Settings - - - - - - Policy Settings - - - - - - Change the global color policy: - - - - - - - <p>Select from a group of pre-set or user-defin= ed 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 illustrati= on and web imaging work.</li> -<li><b>Home / Office:</b> Settings that are used for eve= ryday occurrences.</li> -<li><b>Photography:</b> Optimized for photo-related work= .</li> -<li><b>Printer:</b> Settings used mainly for printer/pro= ofing images.</li> -</ul> - - - - 16 - 16 - - - - - - - - Add Custom Policy - - - - - - - Remove Custom Policy - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Horizontal - - - - - - - - - - - Default Profiles - - - - - - <p>Select the default <em>assumed</em>= profiles for each of the corresponding color spaces.</p> - - - - - - Assumed RGB Source: - - - - - - - true - - - - - - - Assumed CMYK Source: - - - - - - - true - - - - - - - Assumed XYZ Source: - - - - - - - true - - - - - - - Assumed Lab Source: - - - - - - - true - - - - - - - Assumed Gray Source: - - - - - - - - - - Qt::Horizontal - - - - - - - Web Source: - - - - - - - false - - - - sRGB.icc (default) - - - - - - - - - - - <p>Select the default <em>editing</em>= profiles for each of the corresponding color spaces.</p> - - - - - - Editing RGB: - - - - - - - true - - - - - - - Editing CMYK: - - - - - - - true - - - - - - - Editing XYZ: - - - - - - - true - - - - - - - Editing Lab: - - - - - - - true - - - - - - - Editing Gray: - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Behavior Settings - - - - - - -1 - - - 16 - - - 0 - - - - - <p><b>Mismatch Handling</b> settings= lets you manage different handling situations for differing profiles.</= p> - - - - Mismatch Handling - - - - 14 - - - 9 - - - 18 - - - - - 6 - - - 0 - - - 0 - - - 0 - - - - - For Non-existent Profile - - - - - - - For RGB Mismatch - - - - - - - For CMYK Mismatch - - - - - - - <ul> -<li><b>Do Not Assign Profile:</b> Do nothing to the mism= atched 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 t= o assign a profile or not.</li> -</ul> - - - - Do Not Assign Profile - - - - - Assign Assumed Profile - - - - - Prompt User - - - - - - - - <ul> -<li><b>Preserve Numbers:</b> Allow the source RGB profil= e 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 m= ethod to use.</li> -</ul> - - - - Preserve Numbers - - - - - Automatically Convert - - - - - Prompt User - - - - - - - - <ul> -<li><b>Preserve Numbers:</b> Allow the source CMYK profi= le to be kept and unchanged from the destination.</li> -<li><b>Automatically Convert:</b> Convert the source CMY= K profile to its destination.</li> -<li><b>Prompt User:</b> Allow the user to choose which m= ethod to use.</li> -</ul> - - - - Preserve Numbers - - - - - Automatically Convert - - - - - Prompt User - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - <p><b>Mixed Color Space Settings</b>= lets you handle color space mismatch options for your monitor and printer.= </p> - - - Mixed Color Space Settings - - - - 14 - - - 9 - - - 14 - - - -1 - - - - - 5 - - - 3 - - - 5 - - - 7 - - - - - For Screen - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - <ul> -<li><b>Preserve Numbers:</b> Leave the non-RGB color spa= ce 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 spa= ce into the web-appropriate sRGB color space.</li> -<li><b>Prompt User:</b> Allow the user to select the app= ropriate color space conversion method.</li> -</ul> - - - - Preserve Numbers - - - - - Convert to Editing RGB Space - - - - - Convert to Web - - - - - Prompt User - - - - - - - - Printer - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - <ul> -<li><b>Preserve Numbers:</b> Leave the non-CMYK color sp= ace 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 s= pace into a non-CMYK color space.</li> -<li><b>Prompt User:</b> Allow the user to select the app= ropriate color space conversion method.</li> -</ul> - - - - Preserve Numbers - - - - - Convert to Editing CMYK - - - - - Convert to Untagged CMYK - - - - - Prompt User - - - - - - - - - - - - - <p><b>Proofing</b> will allow you to= modify color proofing options, including color space, rendering intent, an= d hard/soft proofing.</b> - - - Proofing - - - - 14 - - - 8 - - - 9 - - - - - 2 - - - 4 - - - -1 - - - 9 - - - - - Color Space: - - - - - - - Select from a list of profiles applicable for pro= ofing. - - - - - - - Rendering Intent: - - - - - - - <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 col= ors, and clips out-of-gamut colors to the nearest hue.</li> -</ul> - - - - Relative Colorimetric - - - - - Absolute Colorimetric - - - - - - - - - - <p>Select <b>Soft Proof</b> a= s a means to preview the printer's color output on your monitor. (Mostly to= match transmissive media.)</p> - - - Soft Proof - - - - - - - <p>Check <b>Hard Proof</b> (o= r match print) to fully simulate colors that the printer will be using thro= ugh a reflective surface.</p> - - - Hard Proof - - - - - - - - - - - - - - <p><b>Rendering Settings</b> allows = you to change the global rendering intent.</p> - - - Rendering Intent - - - - -1 - - - 14 - - - 10 - - - 17 - - - - - 3 - - - - - <ul> -<li><b>Perceptual:</b> Preserves relationship between ou= t-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, wh= ile 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&g= t; -</ul> - - - - - Perceptual - - - - - Relative Colorimetric - - - - - Saturation - - - - - Absolute Colorimetric - - - - - - - - BlackPointCompensation - - - - - - - Gamut Warning - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 7 - - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 0 - - - - - - - - -