Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37559136
en ru br
Репозитории ALT
S:0.3.20-alt2
5.1: 0.1.14-alt0.M51.1
3.0: 0.0.4-alt7
www.altlinux.org/Changes

Группа :: Система/Настройка/Пакеты
Пакет: apt-indicator

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: apt-indicator-0.0.4-add-url-handler.patch
Скачать


diff -uNrp apt-indicator1/src/help_browser.ui apt-indicator/src/help_browser.ui
--- apt-indicator1/src/help_browser.ui	2004-07-16 21:53:04 +0400
+++ apt-indicator/src/help_browser.ui	2004-07-16 21:39:28 +0400
@@ -161,7 +161,12 @@
     <include location="local" impldecl="in declaration">qtextbrowser.h</include>
     <include location="local" impldecl="in declaration">qpushbutton.h</include>
     <include location="local" impldecl="in implementation">local.h</include>
+    <include location="local" impldecl="in implementation">help_browser.ui.h</include>
 </includes>
+<slots>
+    <slot access="private" specifier="non virtual">init()</slot>
+    <slot specifier="non virtual">execLink( const QString &amp; link )</slot>
+</slots>
 <pixmapfunction>QPixmap</pixmapfunction>
 <layoutdefaults spacing="6" margin="11"/>
 </UI>
diff -uNrp apt-indicator1/src/help_browser.ui.h apt-indicator/src/help_browser.ui.h
--- apt-indicator1/src/help_browser.ui.h	1970-01-01 03:00:00 +0300
+++ apt-indicator/src/help_browser.ui.h	2004-07-16 21:50:47 +0400
@@ -0,0 +1,68 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you want to add, delete, or rename functions or slots, use
+** Qt Designer to update this file, preserving your code.
+**
+** You should not define a constructor or destructor in this file.
+** Instead, write your code in functions called init() and destroy().
+** These will automatically be called by the form's constructor and
+** destructor.
+*****************************************************************************/
+
+#include <qprocess.h>
+
+void HelpBrowser::init()
+{
+//    QObject::connect( this->helpText, SIGNAL( linkClicked(QString) ), this, SLOT( execLink(QString) ) );
+    connect( helpText, SIGNAL( linkClicked(const QString&) ), this, SLOT( execLink( const QString& ) ) );
+}
+
+
+void HelpBrowser::execLink( const QString& link )
+{
+    QString progname;
+    if( link.startsWith("http:") )
+    {
+	progname = getenv("HELP_BROWSER");
+	if( progname.isEmpty() )
+	{
+	    qWarning(tr("HELP_BROWSER environment variable is empty"));
+	    progname = getenv("BROWSER");
+	    if( progname.isEmpty() )
+		qWarning(tr("BROWSER environment variable is empty"));
+	}
+    }
+    else if( link.startsWith("mailto:") )
+    {
+	progname = getenv("MAILER");
+	if( progname.isEmpty() )
+	    qWarning(tr("MAILER environment variable is empty"));
+    }
+    else
+    {
+	return;
+    }
+    helpText->reload();
+    
+    if( progname.isEmpty() )
+    {
+	progname = "url_handler.sh";
+	qDebug(QString("Set progname to %1").arg(progname));
+    }
+    
+    QProcess prog;
+    QStringList proglist = QStringList::split(" ", progname);
+    QStringList::Iterator i = proglist.begin();
+    while ( i != proglist.end() )
+    {
+	prog.addArgument( *i );
+	qDebug(*i);
+	i++;
+    }
+    prog.addArgument(link);
+	
+    if ( !prog.start() ) {
+	qWarning(tr("Unable to execute %1 for %2").arg(progname).arg(link));
+    }
+}
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin