[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bkcm-grub2=5D_/=3A_Set_an_initial_resolution_when_cr?=
From:       Konstantinos Smanis <konstantinos.smanis () gmail ! com>
Date:       2011-04-18 9:19:24
Message-ID: 20110418091924.7E099A609B () git ! kde ! org
[Download RAW message or body]

Git commit a52bc25fec6523cd3380713baaab7b09710ad4a1 by Konstantinos Smanis.
Committed on 18/04/2011 at 11:17.
Pushed by ksmanis into branch 'master'.

Set an initial resolution when creating a splash image.

Splash images in GRUB are best shown when they are the same resolution
with the one that GRUB runs. So suggest this resolution (user may always
change it).

M  +7    -0    src/convertDlg.cpp     
M  +1    -0    src/convertDlg.h     
M  +2    -0    src/kcm_grub2.cpp     
M  +1    -1    ui/convertDlg.ui     

http://commits.kde.org/kcm-grub2/a52bc25fec6523cd3380713baaab7b09710ad4a1

diff --git a/src/convertDlg.cpp b/src/convertDlg.cpp
index d6a1a00..8d43588 100644
--- a/src/convertDlg.cpp
+++ b/src/convertDlg.cpp
@@ -37,6 +37,13 @@ ConvertDialog::ConvertDialog(QWidget *parent, Qt::WFlags flags) : \
                KDialog(parent
     ui.kurlrequester_converted->fileDialog()->setOperationMode(KFileDialog::Saving);
     ui.kurlrequester_converted->fileDialog()->setFilter(QString("*%1|PNG %5 \
(%1)\n*%2|TGA %5 (%2)\n*%3 *%4|JPEG %5 (%3 %4)").arg(".png", ".tga", ".jpg", ".jpeg", \
i18nc("@item:inlistbox", "Image")));  }
+void ConvertDialog::setResolution(int width, int height)
+{
+    if (width > 0 && height > 0) {
+        ui.spinBox_width->setValue(width);
+        ui.spinBox_height->setValue(height);
+    }
+}
 void ConvertDialog::slotButtonClicked(int button)
 {
     if (button == KDialog::Ok) {
diff --git a/src/convertDlg.h b/src/convertDlg.h
index f77e050..09f47d3 100644
--- a/src/convertDlg.h
+++ b/src/convertDlg.h
@@ -26,6 +26,7 @@ class ConvertDialog : public KDialog
     Q_OBJECT
 public:
     explicit ConvertDialog(QWidget *parent = 0, Qt::WFlags flags = 0);
+    void setResolution(int width, int height);
 protected Q_SLOTS:
     virtual void slotButtonClicked(int button);
 Q_SIGNALS:
diff --git a/src/kcm_grub2.cpp b/src/kcm_grub2.cpp
index 998bd02..7b0f3da 100644
--- a/src/kcm_grub2.cpp
+++ b/src/kcm_grub2.cpp
@@ -469,6 +469,8 @@ void KCMGRUB2::createGrubBackground()
 {
 #ifdef HAVE_IMAGEMAGICK
     ConvertDialog convertDlg(this);
+    QString resolution = \
ui.comboBox_gfxmode->itemData(ui.comboBox_gfxmode->currentIndex()).toString(); +    \
convertDlg.setResolution(resolution.section('x', 0, 0).toInt(), \
                resolution.section('x', 1, 1).toInt());
     connect(&convertDlg, SIGNAL(splashImageCreated(QString)), \
ui.kurlrequester_background, SLOT(setText(QString)));  convertDlg.exec();
 #endif
diff --git a/ui/convertDlg.ui b/ui/convertDlg.ui
index 14880fc..e267c2f 100644
--- a/ui/convertDlg.ui
+++ b/ui/convertDlg.ui
@@ -82,7 +82,7 @@
       <item row="3" column="0">
        <widget class="QLabel" name="label_6">
         <property name="text">
-         <string comment="@option:check">Set As Wallpaper:</string>
+         <string comment="@option:check">Set As GRUB Wallpaper:</string>
         </property>
        </widget>
       </item>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic