diff --git a/localization/rssguard_cs.ts b/localization/rssguard_cs.ts index 38fc11b1c..e0ac2c5a8 100644 --- a/localization/rssguard_cs.ts +++ b/localization/rssguard_cs.ts @@ -48,6 +48,38 @@ Context menu for feeds Kontextové menu pro přehled kanálů + + Cannot add standard category + + + + You cannot add new standard category now because feed update is ongoing. + + + + Cannot add standard feed + + + + You cannot add new standard feed now because feed update is ongoing. + + + + Cannot edit item + + + + Selected item cannot be edited because feed update is ongoing. + + + + Cannot delete item + + + + Selected item cannot be deleted because feed update is ongoing. + + FormAbout @@ -258,10 +290,6 @@ Delete selected messages. Smazat vybrané zprávy. - - Add new &feed - Přidat k&anál - Add new feed. Přidat nový kanál. @@ -378,6 +406,10 @@ Add new standard category. + + Add new standard &feed + + FormSettings @@ -746,17 +778,13 @@ Authors of this application are NOT responsible for lost data. FormStandardCategoryDetails - - Dialog - - Parent category Title - + Nadpis Description @@ -767,19 +795,194 @@ Authors of this application are NOT responsible for lost data. - Add new category + Select parent item for your category. - Edit existing category + Select icon for your category. - This category name is ok. + Add new standard category - This category name is too short. + Edit existing standard category + + + + Category name is ok. + + + + Category name is too short. + + + + Description is empty. + + + + The description os ok. + + + + Select icon file for the category + + + + Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga) + + + + Select icon + + + + Cancel + + + + Look in: + + + + Icon name: + + + + Icon type: + + + + Category title + + + + Set title for your category. + + + + Category description + + + + Set description for your category. + + + + Icon selection + + + + Load icon from file... + + + + Do not use icon + + + + Use default icon + + + + + FormStandardFeedDetails + + Dialog + + + + Parent category + + + + Select parent item for your feed. + + + + Type + Typ + + + Select type of the standard feed. + + + + Title + Nadpis + + + Description + + + + URL + + + + Encoding + + + + Select encoding of the standard feed. If you are unsure about the encoding, then select "UTF-8" encoding. + + + + Icon + + + + Select icon for your feed. + + + + Add new standard feed + + + + Edit existing standard feed + + + + Feed name is ok. + + + + Feed name is too short. + + + + Description is empty. + + + + The description os ok. + + + + Feed title + + + + Set title for your feed. + + + + Feed description + + + + Set description for your feed. + + + + Feed url + + + + Set url for your feed. @@ -988,13 +1191,8 @@ Tato kategorie neobsahuje žádné podřízené položky. %1 (%2) %3 -Encoding: %4 -Language: %5 - %1 (%2) -%3 - -Kódování: %4 -Jazyk: %5 +Encoding: %4 + diff --git a/localization/rssguard_en.ts b/localization/rssguard_en.ts index b5f5e9a8c..1f50abb81 100644 --- a/localization/rssguard_en.ts +++ b/localization/rssguard_en.ts @@ -48,6 +48,38 @@ Context menu for feeds + + Cannot add standard category + + + + You cannot add new standard category now because feed update is ongoing. + + + + Cannot add standard feed + + + + You cannot add new standard feed now because feed update is ongoing. + + + + Cannot edit item + + + + Selected item cannot be edited because feed update is ongoing. + + + + Cannot delete item + + + + Selected item cannot be deleted because feed update is ongoing. + + FormAbout @@ -258,10 +290,6 @@ Delete selected messages. - - Add new &feed - - Add new feed. @@ -378,6 +406,10 @@ Add new standard category. + + Add new standard &feed + + FormSettings @@ -738,10 +770,6 @@ Authors of this application are NOT responsible for lost data. FormStandardCategoryDetails - - Dialog - - Parent category @@ -759,19 +787,194 @@ Authors of this application are NOT responsible for lost data. - Add new category + Select parent item for your category. - Edit existing category + Select icon for your category. - This category name is ok. + Add new standard category - This category name is too short. + Edit existing standard category + + + + Category name is ok. + + + + Category name is too short. + + + + Description is empty. + + + + The description os ok. + + + + Select icon file for the category + + + + Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga) + + + + Select icon + + + + Cancel + + + + Look in: + + + + Icon name: + + + + Icon type: + + + + Category title + + + + Set title for your category. + + + + Category description + + + + Set description for your category. + + + + Icon selection + + + + Load icon from file... + + + + Do not use icon + + + + Use default icon + + + + + FormStandardFeedDetails + + Dialog + + + + Parent category + + + + Select parent item for your feed. + + + + Type + + + + Select type of the standard feed. + + + + Title + + + + Description + + + + URL + + + + Encoding + + + + Select encoding of the standard feed. If you are unsure about the encoding, then select "UTF-8" encoding. + + + + Icon + + + + Select icon for your feed. + + + + Add new standard feed + + + + Edit existing standard feed + + + + Feed name is ok. + + + + Feed name is too short. + + + + Description is empty. + + + + The description os ok. + + + + Feed title + + + + Set title for your feed. + + + + Feed description + + + + Set description for your feed. + + + + Feed url + + + + Set url for your feed. @@ -976,8 +1179,7 @@ This category does not contain any nested items. %1 (%2) %3 -Encoding: %4 -Language: %5 +Encoding: %4 diff --git a/localization/rssguard_nl.ts b/localization/rssguard_nl.ts index 1aa5a6ef1..676ee2078 100644 --- a/localization/rssguard_nl.ts +++ b/localization/rssguard_nl.ts @@ -48,6 +48,38 @@ Context menu for feeds Contextmenu voor feeds + + Cannot add standard category + + + + You cannot add new standard category now because feed update is ongoing. + + + + Cannot add standard feed + + + + You cannot add new standard feed now because feed update is ongoing. + + + + Cannot edit item + + + + Selected item cannot be edited because feed update is ongoing. + + + + Cannot delete item + + + + Selected item cannot be deleted because feed update is ongoing. + + FormAbout @@ -258,10 +290,6 @@ Delete selected messages. Verwijder geselecteerde berichten. - - Add new &feed - Voeg nieuwe &feed toe - Add new feed. Voeg nieuwe feed toe. @@ -378,6 +406,10 @@ Add new standard category. + + Add new standard &feed + + FormSettings @@ -746,10 +778,6 @@ Authors of this application are NOT responsible for lost data. FormStandardCategoryDetails - - Dialog - - Parent category Oudere categorie @@ -767,19 +795,194 @@ Authors of this application are NOT responsible for lost data. Pictogram - Add new category - Voeg nieuwe categorie toe - - - Edit existing category + Select parent item for your category. - This category name is ok. + Select icon for your category. - This category name is too short. + Add new standard category + + + + Edit existing standard category + + + + Category name is ok. + + + + Category name is too short. + + + + Description is empty. + + + + The description os ok. + + + + Select icon file for the category + + + + Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga) + + + + Select icon + + + + Cancel + + + + Look in: + + + + Icon name: + + + + Icon type: + + + + Category title + + + + Set title for your category. + + + + Category description + + + + Set description for your category. + + + + Icon selection + + + + Load icon from file... + + + + Do not use icon + + + + Use default icon + + + + + FormStandardFeedDetails + + Dialog + + + + Parent category + Oudere categorie + + + Select parent item for your feed. + + + + Type + Type + + + Select type of the standard feed. + + + + Title + Titel + + + Description + Omschrijving + + + URL + + + + Encoding + + + + Select encoding of the standard feed. If you are unsure about the encoding, then select "UTF-8" encoding. + + + + Icon + Pictogram + + + Select icon for your feed. + + + + Add new standard feed + + + + Edit existing standard feed + + + + Feed name is ok. + + + + Feed name is too short. + + + + Description is empty. + + + + The description os ok. + + + + Feed title + + + + Set title for your feed. + + + + Feed description + + + + Set description for your feed. + + + + Feed url + + + + Set url for your feed. @@ -987,13 +1190,8 @@ Deze categorie bevat geen nested items. %1 (%2) %3 -Encoding: %4 -Language: %5 - %1 (%2) -%3 - -Codering: %4 -Taal: %5 +Encoding: %4 + diff --git a/resources/misc/db_init.sql b/resources/misc/db_init.sql index f1fc1ef42..991e99d12 100644 --- a/resources/misc/db_init.sql +++ b/resources/misc/db_init.sql @@ -32,7 +32,6 @@ CREATE TABLE IF NOT EXISTS Feeds ( category INTEGER NOT NULL CHECK (category >= -1), encoding TEXT NOT NULL CHECK (encoding != ''), url TEXT NOT NULL UNIQUE CHECK (url != ''), - language TEXT, type INTEGER NOT NULL CHECK (type >= 0) ); -- ! diff --git a/resources/misc/db_init_memory.sql b/resources/misc/db_init_memory.sql index b15fead49..718de887c 100644 --- a/resources/misc/db_init_memory.sql +++ b/resources/misc/db_init_memory.sql @@ -30,7 +30,6 @@ CREATE TABLE IF NOT EXISTS Feeds ( category INTEGER NOT NULL CHECK (category >= -1), encoding TEXT NOT NULL CHECK (encoding != ''), url TEXT NOT NULL UNIQUE CHECK (url != ''), - language TEXT, type INTEGER NOT NULL CHECK (type >= 0) ); -- ! diff --git a/src/gui/formstandardcategorydetails.cpp b/src/gui/formstandardcategorydetails.cpp index e41865906..4a5b0ae63 100644 --- a/src/gui/formstandardcategorydetails.cpp +++ b/src/gui/formstandardcategorydetails.cpp @@ -118,7 +118,7 @@ void FormStandardCategoryDetails::apply() { } void FormStandardCategoryDetails::onTitleChanged(const QString &new_title){ - if (new_title.size() >= MIN_CATEGORY_NAME_LENGTH) { + if (new_title.simplified().size() >= MIN_CATEGORY_NAME_LENGTH) { m_ui->m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); m_ui->m_txtTitle->setStatus(LineEditWithStatus::Ok, tr("Category name is ok.")); } diff --git a/src/gui/formstandardcategorydetails.h b/src/gui/formstandardcategorydetails.h index 39d0d312f..e335394c9 100644 --- a/src/gui/formstandardcategorydetails.h +++ b/src/gui/formstandardcategorydetails.h @@ -29,18 +29,7 @@ class FormStandardCategoryDetails : public QDialog { // Destructor. virtual ~FormStandardCategoryDetails(); - // Creates needed connections. - void createConnections(); - public slots: - // Start dialog execution. If result is QDialog::Accepted, - // then output_item contains added or edited category - // and parent_item contains parent item of newly - // created or edited category. - // NOTE: Newly ADDED category is NOT added to the model NOR - // to the database. - // NOTE: Newly EDITED category IS COPY of its original. - // SO NO ORIGINAL MODEL DATA ARE EDITED OR CHANGED. int exec(FeedsModelStandardCategory *input_category); protected slots: @@ -57,6 +46,9 @@ class FormStandardCategoryDetails : public QDialog { void onUseDefaultIcon(); protected: + // Creates needed connections. + void createConnections(); + // Sets the category which will be edited. // NOTE: This is used for editing categories. void setEditableCategory(FeedsModelStandardCategory *editable_category); diff --git a/src/gui/formstandardfeeddetails.cpp b/src/gui/formstandardfeeddetails.cpp index 0ed90c413..ecc49a0a8 100644 --- a/src/gui/formstandardfeeddetails.cpp +++ b/src/gui/formstandardfeeddetails.cpp @@ -22,6 +22,11 @@ FormStandardFeedDetails::FormStandardFeedDetails(FeedsModel *model, QWidget *par m_editableFeed(NULL), m_feedsModel(model) { initialize(); + createConnections(); + + // Initialize that shit. + onTitleChanged(QString()); + onDescriptionChanged(QString()); } FormStandardFeedDetails::~FormStandardFeedDetails() { @@ -48,6 +53,36 @@ int FormStandardFeedDetails::exec(FeedsModelStandardFeed *input_feed) { return QDialog::exec(); } +void FormStandardFeedDetails::onTitleChanged(const QString &new_title){ + if (new_title.simplified().size() >= MIN_CATEGORY_NAME_LENGTH) { + m_ui->m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); + m_ui->m_txtTitle->setStatus(LineEditWithStatus::Ok, tr("Feed name is ok.")); + } + else { + m_ui->m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); + m_ui->m_txtTitle->setStatus(LineEditWithStatus::Error, tr("Feed name is too short.")); + } +} + +void FormStandardFeedDetails::onDescriptionChanged(const QString &new_description) { + if (new_description.simplified().isEmpty()) { + m_ui->m_txtDescription->setStatus(LineEditWithStatus::Warning, tr("Description is empty.")); + } + else { + m_ui->m_txtDescription->setStatus(LineEditWithStatus::Ok, tr("The description os ok.")); + } +} + +void FormStandardFeedDetails::createConnections() { + // General connections. + connect(m_ui->m_txtTitle->lineEdit(), SIGNAL(textChanged(QString)), + this, SLOT(onTitleChanged(QString))); + connect(m_ui->m_txtDescription->lineEdit(), SIGNAL(textChanged(QString)), + this, SLOT(onDescriptionChanged(QString))); + + // Icon connections. +} + void FormStandardFeedDetails::setEditableFeed(FeedsModelStandardFeed *editable_feed) { m_editableFeed = editable_feed; @@ -71,6 +106,16 @@ void FormStandardFeedDetails::initialize() { // Setup button box. m_ui->m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); + // Set text boxes. + m_ui->m_txtTitle->lineEdit()->setPlaceholderText(tr("Feed title")); + m_ui->m_txtTitle->lineEdit()->setToolTip(tr("Set title for your feed.")); + + m_ui->m_txtDescription->lineEdit()->setPlaceholderText(tr("Feed description")); + m_ui->m_txtDescription->lineEdit()->setToolTip(tr("Set description for your feed.")); + + m_ui->m_txtUrl->lineEdit()->setPlaceholderText(tr("Feed url")); + m_ui->m_txtUrl->lineEdit()->setToolTip(tr("Set url for your feed.")); + #if !defined(Q_OS_WIN) MessageBox::iconify(m_ui->m_buttonBox); #endif diff --git a/src/gui/formstandardfeeddetails.h b/src/gui/formstandardfeeddetails.h index db0c3607d..7d0fbc266 100644 --- a/src/gui/formstandardfeeddetails.h +++ b/src/gui/formstandardfeeddetails.h @@ -26,7 +26,13 @@ class FormStandardFeedDetails : public QDialog { public slots: int exec(FeedsModelStandardFeed *input_feed); + protected slots: + // Trigerred when title/description changes. + void onTitleChanged(const QString &new_title); + void onDescriptionChanged(const QString &new_description); + protected: + void createConnections(); void setEditableFeed(FeedsModelStandardFeed *editable_feed); void initialize(); diff --git a/src/gui/formstandardfeeddetails.ui b/src/gui/formstandardfeeddetails.ui index c690d00bd..512cb3deb 100644 --- a/src/gui/formstandardfeeddetails.ui +++ b/src/gui/formstandardfeeddetails.ui @@ -32,7 +32,7 @@ - Select parent item for your category. + Select parent item for your feed. @@ -125,7 +125,7 @@ - Select icon for your category. + Select icon for your feed.